Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)
parse.c
1/* A Bison parser, made by GNU Bison 3.8.2. */
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
68
69/* First part of user prologue. */
70#line 14 "parse.y"
71
72
73#if !YYPURE
74# error needs pure parser
75#endif
76#define YYDEBUG 1
77#define YYERROR_VERBOSE 1
78#define YYSTACK_USE_ALLOCA 0
79#define YYLTYPE rb_code_location_t
80#define YYLTYPE_IS_DECLARED 1
81
82#include "ruby/internal/config.h"
83
84#include <ctype.h>
85#include <errno.h>
86#include <stdio.h>
87
88struct lex_context;
89
90#include "internal.h"
91#include "internal/compile.h"
92#include "internal/compilers.h"
93#include "internal/complex.h"
94#include "internal/encoding.h"
95#include "internal/error.h"
96#include "internal/hash.h"
97#include "internal/imemo.h"
98#include "internal/io.h"
99#include "internal/numeric.h"
100#include "internal/parse.h"
101#include "internal/rational.h"
102#include "internal/re.h"
103#include "internal/symbol.h"
104#include "internal/thread.h"
105#include "internal/variable.h"
106#include "node.h"
107#include "probes.h"
108#include "regenc.h"
109#include "ruby/encoding.h"
110#include "ruby/regex.h"
111#include "ruby/ruby.h"
112#include "ruby/st.h"
113#include "ruby/util.h"
114#include "ruby/ractor.h"
115#include "symbol.h"
116
117enum shareability {
118 shareable_none,
119 shareable_literal,
120 shareable_copy,
121 shareable_everything,
122};
123
125 unsigned int in_defined: 1;
126 unsigned int in_kwarg: 1;
127 unsigned int in_argdef: 1;
128 unsigned int in_def: 1;
129 unsigned int in_class: 1;
130 BITFIELD(enum shareability, shareable_constant_value, 2);
131};
132
133#if defined(__GNUC__) && !defined(__clang__)
134// Suppress "parameter passing for argument of type 'struct
135// lex_context' changed" notes. `struct lex_context` is file scope,
136// and has no ABI compatibility issue.
140// Not sure why effective even after popped.
141#endif
142
143#include "parse.h"
144
145#define NO_LEX_CTXT (struct lex_context){0}
146
147#define AREF(ary, i) RARRAY_AREF(ary, i)
148
149#ifndef WARN_PAST_SCOPE
150# define WARN_PAST_SCOPE 0
151#endif
152
153#define TAB_WIDTH 8
154
155#define yydebug (p->debug) /* disable the global variable definition */
156
157#define YYMALLOC(size) rb_parser_malloc(p, (size))
158#define YYREALLOC(ptr, size) rb_parser_realloc(p, (ptr), (size))
159#define YYCALLOC(nelem, size) rb_parser_calloc(p, (nelem), (size))
160#define YYFREE(ptr) rb_parser_free(p, (ptr))
161#define YYFPRINTF rb_parser_printf
162#define YY_LOCATION_PRINT(File, loc) \
163 rb_parser_printf(p, "%d.%d-%d.%d", \
164 (loc).beg_pos.lineno, (loc).beg_pos.column,\
165 (loc).end_pos.lineno, (loc).end_pos.column)
166#define YYLLOC_DEFAULT(Current, Rhs, N) \
167 do \
168 if (N) \
169 { \
170 (Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
171 (Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
172 } \
173 else \
174 { \
175 (Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
176 (Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
177 } \
178 while (0)
179#define YY_(Msgid) \
180 (((Msgid)[0] == 'm') && (strcmp((Msgid), "memory exhausted") == 0) ? \
181 "nesting too deep" : (Msgid))
182
183#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
184 rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
185#define RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(Current) \
186 rb_parser_set_location_of_delayed_token(p, &(Current))
187#define RUBY_SET_YYLLOC_OF_HEREDOC_END(Current) \
188 rb_parser_set_location_of_heredoc_end(p, &(Current))
189#define RUBY_SET_YYLLOC_OF_DUMMY_END(Current) \
190 rb_parser_set_location_of_dummy_end(p, &(Current))
191#define RUBY_SET_YYLLOC_OF_NONE(Current) \
192 rb_parser_set_location_of_none(p, &(Current))
193#define RUBY_SET_YYLLOC(Current) \
194 rb_parser_set_location(p, &(Current))
195#define RUBY_INIT_YYLLOC() \
196 { \
197 {p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
198 {p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
199 }
200
201enum lex_state_bits {
202 EXPR_BEG_bit, /* ignore newline, +/- is a sign. */
203 EXPR_END_bit, /* newline significant, +/- is an operator. */
204 EXPR_ENDARG_bit, /* ditto, and unbound braces. */
205 EXPR_ENDFN_bit, /* ditto, and unbound braces. */
206 EXPR_ARG_bit, /* newline significant, +/- is an operator. */
207 EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */
208 EXPR_MID_bit, /* newline significant, +/- is an operator. */
209 EXPR_FNAME_bit, /* ignore newline, no reserved words. */
210 EXPR_DOT_bit, /* right after `.' or `::', no reserved words. */
211 EXPR_CLASS_bit, /* immediate after `class', no here document. */
212 EXPR_LABEL_bit, /* flag bit, label is allowed. */
213 EXPR_LABELED_bit, /* flag bit, just after a label. */
214 EXPR_FITEM_bit, /* symbol literal as FNAME. */
215 EXPR_MAX_STATE
216};
217/* examine combinations */
218enum lex_state_e {
219#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit)
220 DEF_EXPR(BEG),
221 DEF_EXPR(END),
222 DEF_EXPR(ENDARG),
223 DEF_EXPR(ENDFN),
224 DEF_EXPR(ARG),
225 DEF_EXPR(CMDARG),
226 DEF_EXPR(MID),
227 DEF_EXPR(FNAME),
228 DEF_EXPR(DOT),
229 DEF_EXPR(CLASS),
230 DEF_EXPR(LABEL),
231 DEF_EXPR(LABELED),
232 DEF_EXPR(FITEM),
233 EXPR_VALUE = EXPR_BEG,
234 EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS),
235 EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG),
236 EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN),
237 EXPR_NONE = 0
238};
239#define IS_lex_state_for(x, ls) ((x) & (ls))
240#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
241#define IS_lex_state(ls) IS_lex_state_for(p->lex.state, (ls))
242#define IS_lex_state_all(ls) IS_lex_state_all_for(p->lex.state, (ls))
243
244# define SET_LEX_STATE(ls) \
245 parser_set_lex_state(p, ls, __LINE__)
246static inline enum lex_state_e parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line);
247
248typedef VALUE stack_type;
249
250static const rb_code_location_t NULL_LOC = { {0, -1}, {0, -1} };
251
252# define SHOW_BITSTACK(stack, name) (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
253# define BITSTACK_PUSH(stack, n) (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
254# define BITSTACK_POP(stack) (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
255# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
256# define BITSTACK_SET(stack, n) ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
257
258/* A flag to identify keyword_do_cond, "do" keyword after condition expression.
259 Examples: `while ... do`, `until ... do`, and `for ... in ... do` */
260#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
261#define COND_POP() BITSTACK_POP(cond_stack)
262#define COND_P() BITSTACK_SET_P(cond_stack)
263#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
264
265/* A flag to identify keyword_do_block; "do" keyword after command_call.
266 Example: `foo 1, 2 do`. */
267#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
268#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
269#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
270#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
271
272struct vtable {
273 ID *tbl;
274 int pos;
275 int capa;
276 struct vtable *prev;
277};
278
280 struct vtable *args;
281 struct vtable *vars;
282 struct vtable *used;
283# if WARN_PAST_SCOPE
284 struct vtable *past;
285# endif
286 struct local_vars *prev;
287# ifndef RIPPER
288 struct {
289 NODE *outer, *inner, *current;
290 } numparam;
291# endif
292};
293
294enum {
295 ORDINAL_PARAM = -1,
296 NO_PARAM = 0,
297 NUMPARAM_MAX = 9,
298};
299
300#define NUMPARAM_ID_P(id) numparam_id_p(id)
301#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - (tNUMPARAM_1 - 1))
302#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 - 1 + (idx)))
303static int
304numparam_id_p(ID id)
305{
306 if (!is_local_id(id) || id < (tNUMPARAM_1 << ID_SCOPE_SHIFT)) return 0;
307 unsigned int idx = NUMPARAM_ID_TO_IDX(id);
308 return idx > 0 && idx <= NUMPARAM_MAX;
309}
310static void numparam_name(struct parser_params *p, ID id);
311
312#define DVARS_INHERIT ((void*)1)
313#define DVARS_TOPSCOPE NULL
314#define DVARS_TERMINAL_P(tbl) ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
315
316typedef struct token_info {
317 const char *token;
319 int indent;
320 int nonspc;
321 struct token_info *next;
322} token_info;
323
324typedef struct rb_strterm_struct rb_strterm_t;
325
326/*
327 Structure of Lexer Buffer:
328
329 lex.pbeg lex.ptok lex.pcur lex.pend
330 | | | |
331 |------------+------------+------------|
332 |<---------->|
333 token
334*/
336 rb_imemo_tmpbuf_t *heap;
337
338 YYSTYPE *lval;
339 YYLTYPE *yylloc;
340
341 struct {
342 rb_strterm_t *strterm;
343 VALUE (*gets)(struct parser_params*,VALUE);
344 VALUE input;
345 VALUE lastline;
346 VALUE nextline;
347 const char *pbeg;
348 const char *pcur;
349 const char *pend;
350 const char *ptok;
351 union {
352 long ptr;
353 VALUE (*call)(VALUE, int);
354 } gets_;
355 enum lex_state_e state;
356 /* track the nest level of any parens "()[]{}" */
357 int paren_nest;
358 /* keep p->lex.paren_nest at the beginning of lambda "->" to detect tLAMBEG and keyword_do_LAMBDA */
359 int lpar_beg;
360 /* track the nest level of only braces "{}" */
361 int brace_nest;
362 } lex;
363 stack_type cond_stack;
364 stack_type cmdarg_stack;
365 int tokidx;
366 int toksiz;
367 int tokline;
368 int heredoc_end;
369 int heredoc_indent;
370 int heredoc_line_indent;
371 char *tokenbuf;
372 struct local_vars *lvtbl;
373 st_table *pvtbl;
374 st_table *pktbl;
375 int line_count;
376 int ruby_sourceline; /* current line no. */
377 const char *ruby_sourcefile; /* current source file */
378 VALUE ruby_sourcefile_string;
379 rb_encoding *enc;
381 VALUE case_labels;
382 VALUE compile_option;
383
384 VALUE debug_buffer;
385 VALUE debug_output;
386
387 struct {
388 VALUE token;
389 int beg_line;
390 int beg_col;
391 int end_line;
392 int end_col;
393 } delayed;
394
395 ID cur_arg;
396
397 rb_ast_t *ast;
398 int node_id;
399
400 int max_numparam;
401
402 struct lex_context ctxt;
403
404 unsigned int command_start:1;
405 unsigned int eofp: 1;
406 unsigned int ruby__end__seen: 1;
407 unsigned int debug: 1;
408 unsigned int has_shebang: 1;
409 unsigned int token_seen: 1;
410 unsigned int token_info_enabled: 1;
411# if WARN_PAST_SCOPE
412 unsigned int past_scope_enabled: 1;
413# endif
414 unsigned int error_p: 1;
415 unsigned int cr_seen: 1;
416
417#ifndef RIPPER
418 /* Ruby core only */
419
420 unsigned int do_print: 1;
421 unsigned int do_loop: 1;
422 unsigned int do_chomp: 1;
423 unsigned int do_split: 1;
424 unsigned int keep_script_lines: 1;
425 unsigned int error_tolerant: 1;
426 unsigned int keep_tokens: 1;
427
428 NODE *eval_tree_begin;
429 NODE *eval_tree;
430 VALUE error_buffer;
431 VALUE debug_lines;
432 const struct rb_iseq_struct *parent_iseq;
433 /* store specific keyword locations to generate dummy end token */
434 VALUE end_expect_token_locations;
435 /* id for terms */
436 int token_id;
437 /* Array for term tokens */
438 VALUE tokens;
439#else
440 /* Ripper only */
441
442 VALUE value;
443 VALUE result;
444 VALUE parsing_thread;
445#endif
446};
447
448#define intern_cstr(n,l,en) rb_intern3(n,l,en)
449
450#define STR_NEW(ptr,len) rb_enc_str_new((ptr),(len),p->enc)
451#define STR_NEW0() rb_enc_str_new(0,0,p->enc)
452#define STR_NEW2(ptr) rb_enc_str_new((ptr),strlen(ptr),p->enc)
453#define STR_NEW3(ptr,len,e,func) parser_str_new((ptr),(len),(e),(func),p->enc)
454#define TOK_INTERN() intern_cstr(tok(p), toklen(p), p->enc)
455
456static st_table *
457push_pvtbl(struct parser_params *p)
458{
459 st_table *tbl = p->pvtbl;
460 p->pvtbl = st_init_numtable();
461 return tbl;
462}
463
464static void
465pop_pvtbl(struct parser_params *p, st_table *tbl)
466{
467 st_free_table(p->pvtbl);
468 p->pvtbl = tbl;
469}
470
471static st_table *
472push_pktbl(struct parser_params *p)
473{
474 st_table *tbl = p->pktbl;
475 p->pktbl = 0;
476 return tbl;
477}
478
479static void
480pop_pktbl(struct parser_params *p, st_table *tbl)
481{
482 if (p->pktbl) st_free_table(p->pktbl);
483 p->pktbl = tbl;
484}
485
486#ifndef RIPPER
487static void flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str);
488
489static void
490debug_end_expect_token_locations(struct parser_params *p, const char *name)
491{
492 if(p->debug) {
493 VALUE mesg = rb_sprintf("%s: ", name);
494 rb_str_catf(mesg, " %"PRIsVALUE"\n", p->end_expect_token_locations);
495 flush_debug_buffer(p, p->debug_output, mesg);
496 }
497}
498
499static void
500push_end_expect_token_locations(struct parser_params *p, const rb_code_position_t *pos)
501{
502 if(NIL_P(p->end_expect_token_locations)) return;
503 rb_ary_push(p->end_expect_token_locations, rb_ary_new_from_args(2, INT2NUM(pos->lineno), INT2NUM(pos->column)));
504 debug_end_expect_token_locations(p, "push_end_expect_token_locations");
505}
506
507static void
508pop_end_expect_token_locations(struct parser_params *p)
509{
510 if(NIL_P(p->end_expect_token_locations)) return;
511 rb_ary_pop(p->end_expect_token_locations);
512 debug_end_expect_token_locations(p, "pop_end_expect_token_locations");
513}
514
515static VALUE
516peek_end_expect_token_locations(struct parser_params *p)
517{
518 if(NIL_P(p->end_expect_token_locations)) return Qnil;
519 return rb_ary_last(0, 0, p->end_expect_token_locations);
520}
521
522static ID
523parser_token2id(enum yytokentype tok)
524{
525 switch ((int) tok) {
526#define TOKEN2ID(tok) case tok: return rb_intern(#tok);
527#define TOKEN2ID2(tok, name) case tok: return rb_intern(name);
528 TOKEN2ID2(' ', "words_sep")
529 TOKEN2ID2('!', "!")
530 TOKEN2ID2('%', "%");
531 TOKEN2ID2('&', "&");
532 TOKEN2ID2('*', "*");
533 TOKEN2ID2('+', "+");
534 TOKEN2ID2('-', "-");
535 TOKEN2ID2('/', "/");
536 TOKEN2ID2('<', "<");
537 TOKEN2ID2('=', "=");
538 TOKEN2ID2('>', ">");
539 TOKEN2ID2('?', "?");
540 TOKEN2ID2('^', "^");
541 TOKEN2ID2('|', "|");
542 TOKEN2ID2('~', "~");
543 TOKEN2ID2(':', ":");
544 TOKEN2ID2(',', ",");
545 TOKEN2ID2('.', ".");
546 TOKEN2ID2(';', ";");
547 TOKEN2ID2('`', "`");
548 TOKEN2ID2('\n', "nl");
549 TOKEN2ID2('{', "{");
550 TOKEN2ID2('}', "}");
551 TOKEN2ID2('[', "[");
552 TOKEN2ID2(']', "]");
553 TOKEN2ID2('(', "(");
554 TOKEN2ID2(')', ")");
555 TOKEN2ID(keyword_class);
556 TOKEN2ID(keyword_module);
557 TOKEN2ID(keyword_def);
558 TOKEN2ID(keyword_undef);
559 TOKEN2ID(keyword_begin);
560 TOKEN2ID(keyword_rescue);
561 TOKEN2ID(keyword_ensure);
562 TOKEN2ID(keyword_end);
563 TOKEN2ID(keyword_if);
564 TOKEN2ID(keyword_unless);
565 TOKEN2ID(keyword_then);
566 TOKEN2ID(keyword_elsif);
567 TOKEN2ID(keyword_else);
568 TOKEN2ID(keyword_case);
569 TOKEN2ID(keyword_when);
570 TOKEN2ID(keyword_while);
571 TOKEN2ID(keyword_until);
572 TOKEN2ID(keyword_for);
573 TOKEN2ID(keyword_break);
574 TOKEN2ID(keyword_next);
575 TOKEN2ID(keyword_redo);
576 TOKEN2ID(keyword_retry);
577 TOKEN2ID(keyword_in);
578 TOKEN2ID(keyword_do);
579 TOKEN2ID(keyword_do_cond);
580 TOKEN2ID(keyword_do_block);
581 TOKEN2ID(keyword_do_LAMBDA);
582 TOKEN2ID(keyword_return);
583 TOKEN2ID(keyword_yield);
584 TOKEN2ID(keyword_super);
585 TOKEN2ID(keyword_self);
586 TOKEN2ID(keyword_nil);
587 TOKEN2ID(keyword_true);
588 TOKEN2ID(keyword_false);
589 TOKEN2ID(keyword_and);
590 TOKEN2ID(keyword_or);
591 TOKEN2ID(keyword_not);
592 TOKEN2ID(modifier_if);
593 TOKEN2ID(modifier_unless);
594 TOKEN2ID(modifier_while);
595 TOKEN2ID(modifier_until);
596 TOKEN2ID(modifier_rescue);
597 TOKEN2ID(keyword_alias);
598 TOKEN2ID(keyword_defined);
599 TOKEN2ID(keyword_BEGIN);
600 TOKEN2ID(keyword_END);
601 TOKEN2ID(keyword__LINE__);
602 TOKEN2ID(keyword__FILE__);
603 TOKEN2ID(keyword__ENCODING__);
604 TOKEN2ID(tIDENTIFIER);
605 TOKEN2ID(tFID);
606 TOKEN2ID(tGVAR);
607 TOKEN2ID(tIVAR);
608 TOKEN2ID(tCONSTANT);
609 TOKEN2ID(tCVAR);
610 TOKEN2ID(tLABEL);
611 TOKEN2ID(tINTEGER);
612 TOKEN2ID(tFLOAT);
613 TOKEN2ID(tRATIONAL);
614 TOKEN2ID(tIMAGINARY);
615 TOKEN2ID(tCHAR);
616 TOKEN2ID(tNTH_REF);
617 TOKEN2ID(tBACK_REF);
618 TOKEN2ID(tSTRING_CONTENT);
619 TOKEN2ID(tREGEXP_END);
620 TOKEN2ID(tDUMNY_END);
621 TOKEN2ID(tSP);
622 TOKEN2ID(tUPLUS);
623 TOKEN2ID(tUMINUS);
624 TOKEN2ID(tPOW);
625 TOKEN2ID(tCMP);
626 TOKEN2ID(tEQ);
627 TOKEN2ID(tEQQ);
628 TOKEN2ID(tNEQ);
629 TOKEN2ID(tGEQ);
630 TOKEN2ID(tLEQ);
631 TOKEN2ID(tANDOP);
632 TOKEN2ID(tOROP);
633 TOKEN2ID(tMATCH);
634 TOKEN2ID(tNMATCH);
635 TOKEN2ID(tDOT2);
636 TOKEN2ID(tDOT3);
637 TOKEN2ID(tBDOT2);
638 TOKEN2ID(tBDOT3);
639 TOKEN2ID(tAREF);
640 TOKEN2ID(tASET);
641 TOKEN2ID(tLSHFT);
642 TOKEN2ID(tRSHFT);
643 TOKEN2ID(tANDDOT);
644 TOKEN2ID(tCOLON2);
645 TOKEN2ID(tCOLON3);
646 TOKEN2ID(tOP_ASGN);
647 TOKEN2ID(tASSOC);
648 TOKEN2ID(tLPAREN);
649 TOKEN2ID(tLPAREN_ARG);
650 TOKEN2ID(tRPAREN);
651 TOKEN2ID(tLBRACK);
652 TOKEN2ID(tLBRACE);
653 TOKEN2ID(tLBRACE_ARG);
654 TOKEN2ID(tSTAR);
655 TOKEN2ID(tDSTAR);
656 TOKEN2ID(tAMPER);
657 TOKEN2ID(tLAMBDA);
658 TOKEN2ID(tSYMBEG);
659 TOKEN2ID(tSTRING_BEG);
660 TOKEN2ID(tXSTRING_BEG);
661 TOKEN2ID(tREGEXP_BEG);
662 TOKEN2ID(tWORDS_BEG);
663 TOKEN2ID(tQWORDS_BEG);
664 TOKEN2ID(tSYMBOLS_BEG);
665 TOKEN2ID(tQSYMBOLS_BEG);
666 TOKEN2ID(tSTRING_END);
667 TOKEN2ID(tSTRING_DEND);
668 TOKEN2ID(tSTRING_DBEG);
669 TOKEN2ID(tSTRING_DVAR);
670 TOKEN2ID(tLAMBEG);
671 TOKEN2ID(tLABEL_END);
672 TOKEN2ID(tIGNORED_NL);
673 TOKEN2ID(tCOMMENT);
674 TOKEN2ID(tEMBDOC_BEG);
675 TOKEN2ID(tEMBDOC);
676 TOKEN2ID(tEMBDOC_END);
677 TOKEN2ID(tHEREDOC_BEG);
678 TOKEN2ID(tHEREDOC_END);
679 TOKEN2ID(k__END__);
680 TOKEN2ID(tLOWEST);
681 TOKEN2ID(tUMINUS_NUM);
682 TOKEN2ID(tLAST_TOKEN);
683#undef TOKEN2ID
684#undef TOKEN2ID2
685 }
686
687 rb_bug("parser_token2id: unknown token %d", tok);
688
689 UNREACHABLE_RETURN(0);
690}
691
692#endif
693
694RBIMPL_ATTR_NONNULL((1, 2, 3))
695static int parser_yyerror(struct parser_params*, const YYLTYPE *yylloc, const char*);
696RBIMPL_ATTR_NONNULL((1, 2))
697static int parser_yyerror0(struct parser_params*, const char*);
698#define yyerror0(msg) parser_yyerror0(p, (msg))
699#define yyerror1(loc, msg) parser_yyerror(p, (loc), (msg))
700#define yyerror(yylloc, p, msg) parser_yyerror(p, yylloc, msg)
701#define token_flush(ptr) ((ptr)->lex.ptok = (ptr)->lex.pcur)
702#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
703#define lex_eol_p(p) ((p)->lex.pcur >= (p)->lex.pend)
704#define lex_eol_n_p(p,n) ((p)->lex.pcur+(n) >= (p)->lex.pend)
705
706static void token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc);
707static void token_info_push(struct parser_params*, const char *token, const rb_code_location_t *loc);
708static void token_info_pop(struct parser_params*, const char *token, const rb_code_location_t *loc);
709static void token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc);
710static void token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos);
711
712#ifdef RIPPER
713#define compile_for_eval (0)
714#else
715#define compile_for_eval (p->parent_iseq != 0)
716#endif
717
718#define token_column ((int)(p->lex.ptok - p->lex.pbeg))
719
720#define CALL_Q_P(q) ((q) == TOKEN2VAL(tANDDOT))
721#define NODE_CALL_Q(q) (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
722#define NEW_QCALL(q,r,m,a,loc) NEW_NODE(NODE_CALL_Q(q),r,m,a,loc)
723
724#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
725
726static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
727
728#ifndef RIPPER
729static inline void
730rb_discard_node(struct parser_params *p, NODE *n)
731{
732 rb_ast_delete_node(p->ast, n);
733}
734#endif
735
736#ifdef RIPPER
737static inline VALUE
738add_mark_object(struct parser_params *p, VALUE obj)
739{
740 if (!SPECIAL_CONST_P(obj)
741 && !RB_TYPE_P(obj, T_NODE) /* Ripper jumbles NODE objects and other objects... */
742 ) {
743 rb_ast_add_mark_object(p->ast, obj);
744 }
745 return obj;
746}
747#else
748static NODE* node_newnode_with_locals(struct parser_params *, enum node_type, VALUE, VALUE, const rb_code_location_t*);
749#endif
750
751static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE, const rb_code_location_t*);
752#define rb_node_newnode(type, a1, a2, a3, loc) node_newnode(p, (type), (a1), (a2), (a3), (loc))
753
754/* Make a new temporal node, which should not be appeared in the
755 * result AST and does not have node_id and location. */
756static NODE* node_new_temporal(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2);
757#define NODE_NEW_TEMPORAL(t,a0,a1,a2) node_new_temporal(p, (t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
758
759static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
760
761static int
762parser_get_node_id(struct parser_params *p)
763{
764 int node_id = p->node_id;
765 p->node_id++;
766 return node_id;
767}
768
769#ifndef RIPPER
770static inline void
771set_line_body(NODE *body, int line)
772{
773 if (!body) return;
774 switch (nd_type(body)) {
775 case NODE_RESCUE:
776 case NODE_ENSURE:
777 nd_set_line(body, line);
778 }
779}
780
781#define yyparse ruby_yyparse
782
783static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
784static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
785#define new_nil(loc) NEW_NIL(loc)
786static NODE *new_nil_at(struct parser_params *p, const rb_code_position_t *pos);
787static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
788static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
789static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
790
791static NODE *newline_node(NODE*);
792static void fixpos(NODE*,NODE*);
793
794static int value_expr_gen(struct parser_params*,NODE*);
795static void void_expr(struct parser_params*,NODE*);
796static NODE *remove_begin(NODE*);
797static NODE *remove_begin_all(NODE*);
798#define value_expr(node) value_expr_gen(p, (node))
799static NODE *void_stmts(struct parser_params*,NODE*);
800static void reduce_nodes(struct parser_params*,NODE**);
801static void block_dup_check(struct parser_params*,NODE*,NODE*);
802
803static NODE *block_append(struct parser_params*,NODE*,NODE*);
804static NODE *list_append(struct parser_params*,NODE*,NODE*);
805static NODE *list_concat(NODE*,NODE*);
806static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
807static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
808static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
809static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
810static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
811static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
812static NODE *evstr2dstr(struct parser_params*,NODE*);
813static NODE *splat_array(NODE*);
814static void mark_lvar_used(struct parser_params *p, NODE *rhs);
815
816static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
817static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
818static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
819static 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);
820static NODE *method_add_block(struct parser_params*p, NODE *m, NODE *b, const YYLTYPE *loc) {b->nd_iter = m; b->nd_loc = *loc; return b;}
821
822static bool args_info_empty_p(struct rb_args_info *args);
823static NODE *new_args(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*,const YYLTYPE*);
824static NODE *new_args_tail(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
825static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
826static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc);
827static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
828static NODE *new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc);
829static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
830static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
831
832static NODE *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
833static NODE *args_with_numbered(struct parser_params*,NODE*,int);
834
835static VALUE negate_lit(struct parser_params*, VALUE);
836static NODE *ret_args(struct parser_params*,NODE*);
837static NODE *arg_blk_pass(NODE*,NODE*);
838static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
839static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
840
841static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
842static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
843
844static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
845static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
846
847static void rb_backref_error(struct parser_params*,NODE*);
848static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
849
850static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
851static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
852static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
853static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
854static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
855
856static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
857
858static NODE *opt_arg_append(NODE*, NODE*);
859static NODE *kwd_append(NODE*, NODE*);
860
861static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
862static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
863
864static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
865
866static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
867
868#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
869
870static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
871
872static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
873
874static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
875
876static rb_ast_id_table_t *local_tbl(struct parser_params*);
877
878static VALUE reg_compile(struct parser_params*, VALUE, int);
879static void reg_fragment_setenc(struct parser_params*, VALUE, int);
880static int reg_fragment_check(struct parser_params*, VALUE, int);
881static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
882
883static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
884static NODE *heredoc_dedent(struct parser_params*,NODE*);
885
886static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
887
888#define get_id(id) (id)
889#define get_value(val) (val)
890#define get_num(num) (num)
891#else /* RIPPER */
892#define NODE_RIPPER NODE_CDECL
893#define NEW_RIPPER(a,b,c,loc) (VALUE)NEW_CDECL(a,b,c,loc)
894
895static inline int ripper_is_node_yylval(VALUE n);
896
897static inline VALUE
898ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
899{
900 if (ripper_is_node_yylval(c)) c = RNODE(c)->nd_cval;
901 add_mark_object(p, b);
902 add_mark_object(p, c);
903 return NEW_RIPPER(a, b, c, &NULL_LOC);
904}
905
906static inline int
907ripper_is_node_yylval(VALUE n)
908{
909 return RB_TYPE_P(n, T_NODE) && nd_type_p(RNODE(n), NODE_RIPPER);
910}
911
912#define value_expr(node) ((void)(node))
913#define remove_begin(node) (node)
914#define void_stmts(p,x) (x)
915#define rb_dvar_defined(id, base) 0
916#define rb_local_defined(id, base) 0
917static ID ripper_get_id(VALUE);
918#define get_id(id) ripper_get_id(id)
919static VALUE ripper_get_value(VALUE);
920#define get_value(val) ripper_get_value(val)
921#define get_num(num) (int)get_id(num)
922static VALUE assignable(struct parser_params*,VALUE);
923static int id_is_var(struct parser_params *p, ID id);
924
925#define method_cond(p,node,loc) (node)
926#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
927#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
928#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
929#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
930
931#define new_nil(loc) Qnil
932
933static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
934
935static VALUE const_decl(struct parser_params *p, VALUE path);
936
937static VALUE var_field(struct parser_params *p, VALUE a);
938static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
939
940static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
941
942static VALUE backref_error(struct parser_params*, NODE *, VALUE);
943#endif /* !RIPPER */
944
945/* forward declaration */
946typedef struct rb_strterm_heredoc_struct rb_strterm_heredoc_t;
947
948RUBY_SYMBOL_EXPORT_BEGIN
949VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
950int rb_reg_fragment_setenc(struct parser_params*, VALUE, int);
951enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
952VALUE rb_parser_lex_state_name(enum lex_state_e state);
953void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
954PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
955YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
956YYLTYPE *rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc);
957YYLTYPE *rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc);
958YYLTYPE *rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc);
959YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
960YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
961RUBY_SYMBOL_EXPORT_END
962
963static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
964static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
965#ifndef RIPPER
966static ID formal_argument(struct parser_params*, ID);
967#else
968static ID formal_argument(struct parser_params*, VALUE);
969#endif
970static ID shadowing_lvar(struct parser_params*,ID);
971static void new_bv(struct parser_params*,ID);
972
973static void local_push(struct parser_params*,int);
974static void local_pop(struct parser_params*);
975static void local_var(struct parser_params*, ID);
976static void arg_var(struct parser_params*, ID);
977static int local_id(struct parser_params *p, ID id);
978static int local_id_ref(struct parser_params*, ID, ID **);
979#ifndef RIPPER
980static ID internal_id(struct parser_params*);
981static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
982#endif
983static int check_forwarding_args(struct parser_params*);
984static void add_forwarding_args(struct parser_params *p);
985
986static const struct vtable *dyna_push(struct parser_params *);
987static void dyna_pop(struct parser_params*, const struct vtable *);
988static int dyna_in_block(struct parser_params*);
989#define dyna_var(p, id) local_var(p, id)
990static int dvar_defined(struct parser_params*, ID);
991static int dvar_defined_ref(struct parser_params*, ID, ID**);
992static int dvar_curr(struct parser_params*,ID);
993
994static int lvar_defined(struct parser_params*, ID);
995
996static NODE *numparam_push(struct parser_params *p);
997static void numparam_pop(struct parser_params *p, NODE *prev_inner);
998
999#ifdef RIPPER
1000# define METHOD_NOT idNOT
1001#else
1002# define METHOD_NOT '!'
1003#endif
1004
1005#define idFWD_REST '*'
1006#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
1007#define idFWD_BLOCK '&'
1008#define idFWD_ALL idDot3
1009#define FORWARD_ARGS_WITH_RUBY2_KEYWORDS
1010
1011#define RE_OPTION_ONCE (1<<16)
1012#define RE_OPTION_ENCODING_SHIFT 8
1013#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
1014#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
1015#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
1016#define RE_OPTION_MASK 0xff
1017#define RE_OPTION_ARG_ENCODING_NONE 32
1018
1019/* structs for managing terminator of string literal and heredocment */
1020typedef struct rb_strterm_literal_struct {
1021 union {
1022 VALUE dummy;
1023 long nest;
1024 } u0;
1025 union {
1026 VALUE dummy;
1027 long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
1028 } u1;
1029 union {
1030 VALUE dummy;
1031 long paren; /* '(' of `%q(...)` */
1032 } u2;
1033 union {
1034 VALUE dummy;
1035 long term; /* ')' of `%q(...)` */
1036 } u3;
1037} rb_strterm_literal_t;
1038
1039#define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
1040
1041struct rb_strterm_heredoc_struct {
1042 VALUE lastline; /* the string of line that contains `<<"END"` */
1043 long offset; /* the column of END in `<<"END"` */
1044 int sourceline; /* lineno of the line that contains `<<"END"` */
1045 unsigned length /* the length of END in `<<"END"` */
1046#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
1047 : HERETERM_LENGTH_BITS
1048# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
1049#else
1050# define HERETERM_LENGTH_MAX UINT_MAX
1051#endif
1052 ;
1053#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
1054 unsigned quote: 1;
1055 unsigned func: 8;
1056#else
1057 uint8_t quote;
1058 uint8_t func;
1059#endif
1060};
1061STATIC_ASSERT(rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t) <= 4 * SIZEOF_VALUE);
1062
1063#define STRTERM_HEREDOC IMEMO_FL_USER0
1064
1065struct rb_strterm_struct {
1066 VALUE flags;
1067 union {
1068 rb_strterm_literal_t literal;
1069 rb_strterm_heredoc_t heredoc;
1070 } u;
1071};
1072
1073#ifndef RIPPER
1074void
1075rb_strterm_mark(VALUE obj)
1076{
1077 rb_strterm_t *strterm = (rb_strterm_t*)obj;
1078 if (RBASIC(obj)->flags & STRTERM_HEREDOC) {
1079 rb_strterm_heredoc_t *heredoc = &strterm->u.heredoc;
1080 rb_gc_mark(heredoc->lastline);
1081 }
1082}
1083#endif
1084
1085#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
1086size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
1087
1088#define TOKEN2ID(tok) ( \
1089 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
1090 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
1091 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
1092 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
1093 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
1094 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
1095 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
1096
1097/****** Ripper *******/
1098
1099#ifdef RIPPER
1100#define RIPPER_VERSION "0.1.0"
1101
1102static inline VALUE intern_sym(const char *name);
1103
1104#include "eventids1.c"
1105#include "eventids2.c"
1106
1107static VALUE ripper_dispatch0(struct parser_params*,ID);
1108static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
1109static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
1110static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
1111static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
1112static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
1113static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
1114static void ripper_error(struct parser_params *p);
1115
1116#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
1117#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
1118#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
1119#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
1120#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
1121#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
1122#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))
1123
1124#define yyparse ripper_yyparse
1125
1126#define ID2VAL(id) STATIC_ID2SYM(id)
1127#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
1128#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
1129
1130#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
1131 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
1132
1133#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
1134
1135static inline VALUE
1136new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
1137{
1138 NODE *t = (NODE *)tail;
1139 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value, block = t->u3.value;
1140 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, escape_Qundef(block));
1141}
1142
1143static inline VALUE
1144new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
1145{
1146 NODE *t = rb_node_newnode(NODE_ARGS_AUX, kw_args, kw_rest_arg, block, &NULL_LOC);
1147 add_mark_object(p, kw_args);
1148 add_mark_object(p, kw_rest_arg);
1149 add_mark_object(p, block);
1150 return (VALUE)t;
1151}
1152
1153static inline VALUE
1154args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
1155{
1156 return args;
1157}
1158
1159static VALUE
1160new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
1161{
1162 NODE *t = (NODE *)aryptn;
1163 VALUE pre_args = t->u1.value, rest_arg = t->u2.value, post_args = t->u3.value;
1164
1165 if (!NIL_P(pre_arg)) {
1166 if (!NIL_P(pre_args)) {
1167 rb_ary_unshift(pre_args, pre_arg);
1168 }
1169 else {
1170 pre_args = rb_ary_new_from_args(1, pre_arg);
1171 }
1172 }
1173 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
1174}
1175
1176static VALUE
1177new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
1178{
1179 NODE *t;
1180
1181 if (has_rest) {
1182 rest_arg = dispatch1(var_field, rest_arg ? rest_arg : Qnil);
1183 }
1184 else {
1185 rest_arg = Qnil;
1186 }
1187
1188 t = rb_node_newnode(NODE_ARYPTN, pre_args, rest_arg, post_args, &NULL_LOC);
1189 add_mark_object(p, pre_args);
1190 add_mark_object(p, rest_arg);
1191 add_mark_object(p, post_args);
1192 return (VALUE)t;
1193}
1194
1195static VALUE
1196new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YYLTYPE *loc)
1197{
1198 NODE *t = (NODE *)fndptn;
1199 VALUE pre_rest_arg = t->u1.value, args = t->u2.value, post_rest_arg = t->u3.value;
1200
1201 return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg);
1202}
1203
1204static VALUE
1205new_find_pattern_tail(struct parser_params *p, VALUE pre_rest_arg, VALUE args, VALUE post_rest_arg, const YYLTYPE *loc)
1206{
1207 NODE *t;
1208
1209 pre_rest_arg = dispatch1(var_field, pre_rest_arg ? pre_rest_arg : Qnil);
1210 post_rest_arg = dispatch1(var_field, post_rest_arg ? post_rest_arg : Qnil);
1211
1212 t = rb_node_newnode(NODE_FNDPTN, pre_rest_arg, args, post_rest_arg, &NULL_LOC);
1213 add_mark_object(p, pre_rest_arg);
1214 add_mark_object(p, args);
1215 add_mark_object(p, post_rest_arg);
1216 return (VALUE)t;
1217}
1218
1219#define new_hash(p,h,l) rb_ary_new_from_args(0)
1220
1221static VALUE
1222new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
1223{
1224 return ary;
1225}
1226
1227static VALUE
1228new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
1229{
1230 NODE *t = (NODE *)hshptn;
1231 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value;
1232 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
1233}
1234
1235static VALUE
1236new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
1237{
1238 NODE *t;
1239 if (kw_rest_arg) {
1240 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
1241 }
1242 else {
1243 kw_rest_arg = Qnil;
1244 }
1245 t = rb_node_newnode(NODE_HSHPTN, kw_args, kw_rest_arg, 0, &NULL_LOC);
1246
1247 add_mark_object(p, kw_args);
1248 add_mark_object(p, kw_rest_arg);
1249 return (VALUE)t;
1250}
1251
1252#define new_defined(p,expr,loc) dispatch1(defined, (expr))
1253
1254static VALUE heredoc_dedent(struct parser_params*,VALUE);
1255
1256#else
1257#define ID2VAL(id) (id)
1258#define TOKEN2VAL(t) ID2VAL(t)
1259#define KWD2EID(t, v) keyword_##t
1260
1261static NODE *
1262set_defun_body(struct parser_params *p, NODE *n, NODE *args, NODE *body, const YYLTYPE *loc)
1263{
1264 body = remove_begin(body);
1265 reduce_nodes(p, &body);
1266 n->nd_defn = NEW_SCOPE(args, body, loc);
1267 n->nd_loc = *loc;
1268 nd_set_line(n->nd_defn, loc->end_pos.lineno);
1269 set_line_body(body, loc->beg_pos.lineno);
1270 return n;
1271}
1272
1273static NODE *
1274rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1275 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1276{
1277 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1278 rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1279 loc.beg_pos = arg_loc->beg_pos;
1280 return NEW_RESCUE(arg, rescue, 0, &loc);
1281}
1282
1283#endif /* RIPPER */
1284
1285static void
1286restore_defun(struct parser_params *p, NODE *name)
1287{
1288 NODE *save = name->nd_next;
1289 YYSTYPE c = {.val = save->nd_cval};
1290 p->cur_arg = name->nd_vid;
1291 p->ctxt.in_def = c.ctxt.in_def;
1292 p->ctxt.shareable_constant_value = c.ctxt.shareable_constant_value;
1293 p->max_numparam = (int)save->nd_nth;
1294 numparam_pop(p, save->nd_head);
1295}
1296
1297static void
1298endless_method_name(struct parser_params *p, NODE *defn, const YYLTYPE *loc)
1299{
1300#ifdef RIPPER
1301 defn = defn->nd_defn;
1302#endif
1303 ID mid = defn->nd_mid;
1304 if (is_attrset_id(mid)) {
1305 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1306 }
1307 token_info_drop(p, "def", loc->beg_pos);
1308}
1309
1310#define debug_token_line(p, name, line) if (p->debug) rb_parser_printf(p, name ":%d (%d: %ld|%ld|%ld)\n", line, p->ruby_sourceline, p->lex.ptok - p->lex.pbeg, p->lex.pcur - p->lex.ptok, p->lex.pend - p->lex.pcur)
1311
1312#ifndef RIPPER
1313# define Qnone 0
1314# define Qnull 0
1315# define ifndef_ripper(x) (x)
1316#else
1317# define Qnone Qnil
1318# define Qnull Qundef
1319# define ifndef_ripper(x)
1320#endif
1321
1322# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1323# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1324# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1325# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1326# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1327# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1328# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1329# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1330# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1331# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1332# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1333# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1334# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1335# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1336# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1337# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1338# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1339# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1340# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1341# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1342#ifdef RIPPER
1343static ID id_warn, id_warning, id_gets, id_assoc;
1344# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1345# define WARN_S_L(s,l) STR_NEW(s,l)
1346# define WARN_S(s) STR_NEW2(s)
1347# define WARN_I(i) INT2NUM(i)
1348# define WARN_ID(i) rb_id2str(i)
1349# define WARN_IVAL(i) i
1350# define PRIsWARN "s"
1351# define rb_warn0L_experimental(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1352# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1353# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1354# ifdef HAVE_VA_ARGS_MACRO
1355# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1356# else
1357# define WARN_CALL rb_funcall
1358# endif
1359# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1360# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1361# ifdef HAVE_VA_ARGS_MACRO
1362# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1363# else
1364# define WARNING_CALL rb_funcall
1365# endif
1366PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1367# define compile_error ripper_compile_error
1368#else
1369# define WARN_S_L(s,l) s
1370# define WARN_S(s) s
1371# define WARN_I(i) i
1372# define WARN_ID(i) rb_id2name(i)
1373# define WARN_IVAL(i) NUM2INT(i)
1374# define PRIsWARN PRIsVALUE
1375# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1376# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1377# define WARN_CALL rb_compile_warn
1378# define rb_warn0L_experimental(l,fmt) rb_category_compile_warn(RB_WARN_CATEGORY_EXPERIMENTAL, WARN_ARGS_L(l, fmt, 1))
1379# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1380# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1381# define WARNING_CALL rb_compile_warning
1382PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1383# define compile_error parser_compile_error
1384#endif
1385
1386#define WARN_EOL(tok) \
1387 (looking_at_eol_p(p) ? \
1388 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1389 (void)0)
1390static int looking_at_eol_p(struct parser_params *p);
1391
1392#line 1393 "parse.c"
1393
1394# ifndef YY_CAST
1395# ifdef __cplusplus
1396# define YY_CAST(Type, Val) static_cast<Type> (Val)
1397# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1398# else
1399# define YY_CAST(Type, Val) ((Type) (Val))
1400# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1401# endif
1402# endif
1403# ifndef YY_NULLPTR
1404# if defined __cplusplus
1405# if 201103L <= __cplusplus
1406# define YY_NULLPTR nullptr
1407# else
1408# define YY_NULLPTR 0
1409# endif
1410# else
1411# define YY_NULLPTR ((void*)0)
1412# endif
1413# endif
1414
1415/* Use api.header.include to #include this header
1416 instead of duplicating it here. */
1417#ifndef YY_YY_Y_TAB_H_INCLUDED
1418# define YY_YY_Y_TAB_H_INCLUDED
1419/* Debug traces. */
1420#ifndef YYDEBUG
1421# define YYDEBUG 0
1422#endif
1423#if YYDEBUG
1424#ifndef yydebug
1425extern int yydebug;
1426#endif
1427#endif
1428
1429/* Token kinds. */
1430#ifndef YYTOKENTYPE
1431# define YYTOKENTYPE
1432 enum yytokentype
1433 {
1434 YYEMPTY = -2,
1435 END_OF_INPUT = 0, /* "end-of-input" */
1436 YYerror = 256, /* error */
1437 YYUNDEF = 257, /* "invalid token" */
1438 keyword_class = 258, /* "`class'" */
1439 keyword_module = 259, /* "`module'" */
1440 keyword_def = 260, /* "`def'" */
1441 keyword_undef = 261, /* "`undef'" */
1442 keyword_begin = 262, /* "`begin'" */
1443 keyword_rescue = 263, /* "`rescue'" */
1444 keyword_ensure = 264, /* "`ensure'" */
1445 keyword_end = 265, /* "`end'" */
1446 keyword_if = 266, /* "`if'" */
1447 keyword_unless = 267, /* "`unless'" */
1448 keyword_then = 268, /* "`then'" */
1449 keyword_elsif = 269, /* "`elsif'" */
1450 keyword_else = 270, /* "`else'" */
1451 keyword_case = 271, /* "`case'" */
1452 keyword_when = 272, /* "`when'" */
1453 keyword_while = 273, /* "`while'" */
1454 keyword_until = 274, /* "`until'" */
1455 keyword_for = 275, /* "`for'" */
1456 keyword_break = 276, /* "`break'" */
1457 keyword_next = 277, /* "`next'" */
1458 keyword_redo = 278, /* "`redo'" */
1459 keyword_retry = 279, /* "`retry'" */
1460 keyword_in = 280, /* "`in'" */
1461 keyword_do = 281, /* "`do'" */
1462 keyword_do_cond = 282, /* "`do' for condition" */
1463 keyword_do_block = 283, /* "`do' for block" */
1464 keyword_do_LAMBDA = 284, /* "`do' for lambda" */
1465 keyword_return = 285, /* "`return'" */
1466 keyword_yield = 286, /* "`yield'" */
1467 keyword_super = 287, /* "`super'" */
1468 keyword_self = 288, /* "`self'" */
1469 keyword_nil = 289, /* "`nil'" */
1470 keyword_true = 290, /* "`true'" */
1471 keyword_false = 291, /* "`false'" */
1472 keyword_and = 292, /* "`and'" */
1473 keyword_or = 293, /* "`or'" */
1474 keyword_not = 294, /* "`not'" */
1475 modifier_if = 295, /* "`if' modifier" */
1476 modifier_unless = 296, /* "`unless' modifier" */
1477 modifier_while = 297, /* "`while' modifier" */
1478 modifier_until = 298, /* "`until' modifier" */
1479 modifier_rescue = 299, /* "`rescue' modifier" */
1480 keyword_alias = 300, /* "`alias'" */
1481 keyword_defined = 301, /* "`defined?'" */
1482 keyword_BEGIN = 302, /* "`BEGIN'" */
1483 keyword_END = 303, /* "`END'" */
1484 keyword__LINE__ = 304, /* "`__LINE__'" */
1485 keyword__FILE__ = 305, /* "`__FILE__'" */
1486 keyword__ENCODING__ = 306, /* "`__ENCODING__'" */
1487 tIDENTIFIER = 307, /* "local variable or method" */
1488 tFID = 308, /* "method" */
1489 tGVAR = 309, /* "global variable" */
1490 tIVAR = 310, /* "instance variable" */
1491 tCONSTANT = 311, /* "constant" */
1492 tCVAR = 312, /* "class variable" */
1493 tLABEL = 313, /* "label" */
1494 tINTEGER = 314, /* "integer literal" */
1495 tFLOAT = 315, /* "float literal" */
1496 tRATIONAL = 316, /* "rational literal" */
1497 tIMAGINARY = 317, /* "imaginary literal" */
1498 tCHAR = 318, /* "char literal" */
1499 tNTH_REF = 319, /* "numbered reference" */
1500 tBACK_REF = 320, /* "back reference" */
1501 tSTRING_CONTENT = 321, /* "literal content" */
1502 tREGEXP_END = 322, /* tREGEXP_END */
1503 tDUMNY_END = 323, /* "dummy end" */
1504 tSP = 324, /* "escaped space" */
1505 tUPLUS = 132, /* "unary+" */
1506 tUMINUS = 133, /* "unary-" */
1507 tPOW = 134, /* "**" */
1508 tCMP = 135, /* "<=>" */
1509 tEQ = 140, /* "==" */
1510 tEQQ = 141, /* "===" */
1511 tNEQ = 142, /* "!=" */
1512 tGEQ = 139, /* ">=" */
1513 tLEQ = 138, /* "<=" */
1514 tANDOP = 148, /* "&&" */
1515 tOROP = 149, /* "||" */
1516 tMATCH = 143, /* "=~" */
1517 tNMATCH = 144, /* "!~" */
1518 tDOT2 = 128, /* ".." */
1519 tDOT3 = 129, /* "..." */
1520 tBDOT2 = 130, /* "(.." */
1521 tBDOT3 = 131, /* "(..." */
1522 tAREF = 145, /* "[]" */
1523 tASET = 146, /* "[]=" */
1524 tLSHFT = 136, /* "<<" */
1525 tRSHFT = 137, /* ">>" */
1526 tANDDOT = 150, /* "&." */
1527 tCOLON2 = 147, /* "::" */
1528 tCOLON3 = 325, /* ":: at EXPR_BEG" */
1529 tOP_ASGN = 326, /* "operator-assignment" */
1530 tASSOC = 327, /* "=>" */
1531 tLPAREN = 328, /* "(" */
1532 tLPAREN_ARG = 329, /* "( arg" */
1533 tRPAREN = 330, /* ")" */
1534 tLBRACK = 331, /* "[" */
1535 tLBRACE = 332, /* "{" */
1536 tLBRACE_ARG = 333, /* "{ arg" */
1537 tSTAR = 334, /* "*" */
1538 tDSTAR = 335, /* "**arg" */
1539 tAMPER = 336, /* "&" */
1540 tLAMBDA = 337, /* "->" */
1541 tSYMBEG = 338, /* "symbol literal" */
1542 tSTRING_BEG = 339, /* "string literal" */
1543 tXSTRING_BEG = 340, /* "backtick literal" */
1544 tREGEXP_BEG = 341, /* "regexp literal" */
1545 tWORDS_BEG = 342, /* "word list" */
1546 tQWORDS_BEG = 343, /* "verbatim word list" */
1547 tSYMBOLS_BEG = 344, /* "symbol list" */
1548 tQSYMBOLS_BEG = 345, /* "verbatim symbol list" */
1549 tSTRING_END = 346, /* "terminator" */
1550 tSTRING_DEND = 347, /* "'}'" */
1551 tSTRING_DBEG = 348, /* tSTRING_DBEG */
1552 tSTRING_DVAR = 349, /* tSTRING_DVAR */
1553 tLAMBEG = 350, /* tLAMBEG */
1554 tLABEL_END = 351, /* tLABEL_END */
1555 tIGNORED_NL = 352, /* tIGNORED_NL */
1556 tCOMMENT = 353, /* tCOMMENT */
1557 tEMBDOC_BEG = 354, /* tEMBDOC_BEG */
1558 tEMBDOC = 355, /* tEMBDOC */
1559 tEMBDOC_END = 356, /* tEMBDOC_END */
1560 tHEREDOC_BEG = 357, /* tHEREDOC_BEG */
1561 tHEREDOC_END = 358, /* tHEREDOC_END */
1562 k__END__ = 359, /* k__END__ */
1563 tLOWEST = 360, /* tLOWEST */
1564 tUMINUS_NUM = 361, /* tUMINUS_NUM */
1565 tLAST_TOKEN = 362 /* tLAST_TOKEN */
1566 };
1567 typedef enum yytokentype yytoken_kind_t;
1568#endif
1569
1570/* Value type. */
1571#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1572union YYSTYPE
1573{
1574#line 1383 "parse.y"
1575
1576 VALUE val;
1577 NODE *node;
1578 ID id;
1579 int num;
1580 st_table *tbl;
1581 const struct vtable *vars;
1582 struct rb_strterm_struct *strterm;
1583 struct lex_context ctxt;
1584
1585#line 1584 "parse.c"
1586
1587};
1588typedef union YYSTYPE YYSTYPE;
1589# define YYSTYPE_IS_TRIVIAL 1
1590# define YYSTYPE_IS_DECLARED 1
1591#endif
1592
1593/* Location type. */
1594#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
1595typedef struct YYLTYPE YYLTYPE;
1596struct YYLTYPE
1597{
1598 int first_line;
1599 int first_column;
1600 int last_line;
1601 int last_column;
1602};
1603# define YYLTYPE_IS_DECLARED 1
1604# define YYLTYPE_IS_TRIVIAL 1
1605#endif
1606
1607
1608
1609
1610int yyparse (struct parser_params *p);
1611
1612
1613#endif /* !YY_YY_Y_TAB_H_INCLUDED */
1614/* Symbol kind. */
1615enum yysymbol_kind_t
1616{
1617 YYSYMBOL_YYEMPTY = -2,
1618 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1619 YYSYMBOL_YYerror = 1, /* error */
1620 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1621 YYSYMBOL_keyword_class = 3, /* "`class'" */
1622 YYSYMBOL_keyword_module = 4, /* "`module'" */
1623 YYSYMBOL_keyword_def = 5, /* "`def'" */
1624 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
1625 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
1626 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
1627 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
1628 YYSYMBOL_keyword_end = 10, /* "`end'" */
1629 YYSYMBOL_keyword_if = 11, /* "`if'" */
1630 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
1631 YYSYMBOL_keyword_then = 13, /* "`then'" */
1632 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
1633 YYSYMBOL_keyword_else = 15, /* "`else'" */
1634 YYSYMBOL_keyword_case = 16, /* "`case'" */
1635 YYSYMBOL_keyword_when = 17, /* "`when'" */
1636 YYSYMBOL_keyword_while = 18, /* "`while'" */
1637 YYSYMBOL_keyword_until = 19, /* "`until'" */
1638 YYSYMBOL_keyword_for = 20, /* "`for'" */
1639 YYSYMBOL_keyword_break = 21, /* "`break'" */
1640 YYSYMBOL_keyword_next = 22, /* "`next'" */
1641 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
1642 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
1643 YYSYMBOL_keyword_in = 25, /* "`in'" */
1644 YYSYMBOL_keyword_do = 26, /* "`do'" */
1645 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
1646 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
1647 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
1648 YYSYMBOL_keyword_return = 30, /* "`return'" */
1649 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
1650 YYSYMBOL_keyword_super = 32, /* "`super'" */
1651 YYSYMBOL_keyword_self = 33, /* "`self'" */
1652 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
1653 YYSYMBOL_keyword_true = 35, /* "`true'" */
1654 YYSYMBOL_keyword_false = 36, /* "`false'" */
1655 YYSYMBOL_keyword_and = 37, /* "`and'" */
1656 YYSYMBOL_keyword_or = 38, /* "`or'" */
1657 YYSYMBOL_keyword_not = 39, /* "`not'" */
1658 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
1659 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
1660 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
1661 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
1662 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
1663 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
1664 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
1665 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
1666 YYSYMBOL_keyword_END = 48, /* "`END'" */
1667 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
1668 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
1669 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
1670 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
1671 YYSYMBOL_tFID = 53, /* "method" */
1672 YYSYMBOL_tGVAR = 54, /* "global variable" */
1673 YYSYMBOL_tIVAR = 55, /* "instance variable" */
1674 YYSYMBOL_tCONSTANT = 56, /* "constant" */
1675 YYSYMBOL_tCVAR = 57, /* "class variable" */
1676 YYSYMBOL_tLABEL = 58, /* "label" */
1677 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
1678 YYSYMBOL_tFLOAT = 60, /* "float literal" */
1679 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
1680 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
1681 YYSYMBOL_tCHAR = 63, /* "char literal" */
1682 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
1683 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
1684 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
1685 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
1686 YYSYMBOL_tDUMNY_END = 68, /* "dummy end" */
1687 YYSYMBOL_69_ = 69, /* '.' */
1688 YYSYMBOL_70_backslash_ = 70, /* "backslash" */
1689 YYSYMBOL_tSP = 71, /* "escaped space" */
1690 YYSYMBOL_72_escaped_horizontal_tab_ = 72, /* "escaped horizontal tab" */
1691 YYSYMBOL_73_escaped_form_feed_ = 73, /* "escaped form feed" */
1692 YYSYMBOL_74_escaped_carriage_return_ = 74, /* "escaped carriage return" */
1693 YYSYMBOL_75_escaped_vertical_tab_ = 75, /* "escaped vertical tab" */
1694 YYSYMBOL_tUPLUS = 76, /* "unary+" */
1695 YYSYMBOL_tUMINUS = 77, /* "unary-" */
1696 YYSYMBOL_tPOW = 78, /* "**" */
1697 YYSYMBOL_tCMP = 79, /* "<=>" */
1698 YYSYMBOL_tEQ = 80, /* "==" */
1699 YYSYMBOL_tEQQ = 81, /* "===" */
1700 YYSYMBOL_tNEQ = 82, /* "!=" */
1701 YYSYMBOL_tGEQ = 83, /* ">=" */
1702 YYSYMBOL_tLEQ = 84, /* "<=" */
1703 YYSYMBOL_tANDOP = 85, /* "&&" */
1704 YYSYMBOL_tOROP = 86, /* "||" */
1705 YYSYMBOL_tMATCH = 87, /* "=~" */
1706 YYSYMBOL_tNMATCH = 88, /* "!~" */
1707 YYSYMBOL_tDOT2 = 89, /* ".." */
1708 YYSYMBOL_tDOT3 = 90, /* "..." */
1709 YYSYMBOL_tBDOT2 = 91, /* "(.." */
1710 YYSYMBOL_tBDOT3 = 92, /* "(..." */
1711 YYSYMBOL_tAREF = 93, /* "[]" */
1712 YYSYMBOL_tASET = 94, /* "[]=" */
1713 YYSYMBOL_tLSHFT = 95, /* "<<" */
1714 YYSYMBOL_tRSHFT = 96, /* ">>" */
1715 YYSYMBOL_tANDDOT = 97, /* "&." */
1716 YYSYMBOL_tCOLON2 = 98, /* "::" */
1717 YYSYMBOL_tCOLON3 = 99, /* ":: at EXPR_BEG" */
1718 YYSYMBOL_tOP_ASGN = 100, /* "operator-assignment" */
1719 YYSYMBOL_tASSOC = 101, /* "=>" */
1720 YYSYMBOL_tLPAREN = 102, /* "(" */
1721 YYSYMBOL_tLPAREN_ARG = 103, /* "( arg" */
1722 YYSYMBOL_tRPAREN = 104, /* ")" */
1723 YYSYMBOL_tLBRACK = 105, /* "[" */
1724 YYSYMBOL_tLBRACE = 106, /* "{" */
1725 YYSYMBOL_tLBRACE_ARG = 107, /* "{ arg" */
1726 YYSYMBOL_tSTAR = 108, /* "*" */
1727 YYSYMBOL_tDSTAR = 109, /* "**arg" */
1728 YYSYMBOL_tAMPER = 110, /* "&" */
1729 YYSYMBOL_tLAMBDA = 111, /* "->" */
1730 YYSYMBOL_tSYMBEG = 112, /* "symbol literal" */
1731 YYSYMBOL_tSTRING_BEG = 113, /* "string literal" */
1732 YYSYMBOL_tXSTRING_BEG = 114, /* "backtick literal" */
1733 YYSYMBOL_tREGEXP_BEG = 115, /* "regexp literal" */
1734 YYSYMBOL_tWORDS_BEG = 116, /* "word list" */
1735 YYSYMBOL_tQWORDS_BEG = 117, /* "verbatim word list" */
1736 YYSYMBOL_tSYMBOLS_BEG = 118, /* "symbol list" */
1737 YYSYMBOL_tQSYMBOLS_BEG = 119, /* "verbatim symbol list" */
1738 YYSYMBOL_tSTRING_END = 120, /* "terminator" */
1739 YYSYMBOL_tSTRING_DEND = 121, /* "'}'" */
1740 YYSYMBOL_tSTRING_DBEG = 122, /* tSTRING_DBEG */
1741 YYSYMBOL_tSTRING_DVAR = 123, /* tSTRING_DVAR */
1742 YYSYMBOL_tLAMBEG = 124, /* tLAMBEG */
1743 YYSYMBOL_tLABEL_END = 125, /* tLABEL_END */
1744 YYSYMBOL_tIGNORED_NL = 126, /* tIGNORED_NL */
1745 YYSYMBOL_tCOMMENT = 127, /* tCOMMENT */
1746 YYSYMBOL_tEMBDOC_BEG = 128, /* tEMBDOC_BEG */
1747 YYSYMBOL_tEMBDOC = 129, /* tEMBDOC */
1748 YYSYMBOL_tEMBDOC_END = 130, /* tEMBDOC_END */
1749 YYSYMBOL_tHEREDOC_BEG = 131, /* tHEREDOC_BEG */
1750 YYSYMBOL_tHEREDOC_END = 132, /* tHEREDOC_END */
1751 YYSYMBOL_k__END__ = 133, /* k__END__ */
1752 YYSYMBOL_tLOWEST = 134, /* tLOWEST */
1753 YYSYMBOL_135_ = 135, /* '=' */
1754 YYSYMBOL_136_ = 136, /* '?' */
1755 YYSYMBOL_137_ = 137, /* ':' */
1756 YYSYMBOL_138_ = 138, /* '>' */
1757 YYSYMBOL_139_ = 139, /* '<' */
1758 YYSYMBOL_140_ = 140, /* '|' */
1759 YYSYMBOL_141_ = 141, /* '^' */
1760 YYSYMBOL_142_ = 142, /* '&' */
1761 YYSYMBOL_143_ = 143, /* '+' */
1762 YYSYMBOL_144_ = 144, /* '-' */
1763 YYSYMBOL_145_ = 145, /* '*' */
1764 YYSYMBOL_146_ = 146, /* '/' */
1765 YYSYMBOL_147_ = 147, /* '%' */
1766 YYSYMBOL_tUMINUS_NUM = 148, /* tUMINUS_NUM */
1767 YYSYMBOL_149_ = 149, /* '!' */
1768 YYSYMBOL_150_ = 150, /* '~' */
1769 YYSYMBOL_tLAST_TOKEN = 151, /* tLAST_TOKEN */
1770 YYSYMBOL_152_ = 152, /* '{' */
1771 YYSYMBOL_153_ = 153, /* '}' */
1772 YYSYMBOL_154_ = 154, /* '[' */
1773 YYSYMBOL_155_ = 155, /* ',' */
1774 YYSYMBOL_156_ = 156, /* '`' */
1775 YYSYMBOL_157_ = 157, /* '(' */
1776 YYSYMBOL_158_ = 158, /* ')' */
1777 YYSYMBOL_159_ = 159, /* ']' */
1778 YYSYMBOL_160_ = 160, /* ';' */
1779 YYSYMBOL_161_ = 161, /* ' ' */
1780 YYSYMBOL_162_n_ = 162, /* '\n' */
1781 YYSYMBOL_YYACCEPT = 163, /* $accept */
1782 YYSYMBOL_program = 164, /* program */
1783 YYSYMBOL_165_1 = 165, /* $@1 */
1784 YYSYMBOL_top_compstmt = 166, /* top_compstmt */
1785 YYSYMBOL_top_stmts = 167, /* top_stmts */
1786 YYSYMBOL_top_stmt = 168, /* top_stmt */
1787 YYSYMBOL_begin_block = 169, /* begin_block */
1788 YYSYMBOL_bodystmt = 170, /* bodystmt */
1789 YYSYMBOL_171_2 = 171, /* $@2 */
1790 YYSYMBOL_compstmt = 172, /* compstmt */
1791 YYSYMBOL_stmts = 173, /* stmts */
1792 YYSYMBOL_stmt_or_begin = 174, /* stmt_or_begin */
1793 YYSYMBOL_175_3 = 175, /* $@3 */
1794 YYSYMBOL_stmt = 176, /* stmt */
1795 YYSYMBOL_177_4 = 177, /* $@4 */
1796 YYSYMBOL_command_asgn = 178, /* command_asgn */
1797 YYSYMBOL_command_rhs = 179, /* command_rhs */
1798 YYSYMBOL_expr = 180, /* expr */
1799 YYSYMBOL_181_5 = 181, /* @5 */
1800 YYSYMBOL_182_6 = 182, /* @6 */
1801 YYSYMBOL_183_7 = 183, /* @7 */
1802 YYSYMBOL_184_8 = 184, /* @8 */
1803 YYSYMBOL_def_name = 185, /* def_name */
1804 YYSYMBOL_defn_head = 186, /* defn_head */
1805 YYSYMBOL_defs_head = 187, /* defs_head */
1806 YYSYMBOL_188_9 = 188, /* $@9 */
1807 YYSYMBOL_expr_value = 189, /* expr_value */
1808 YYSYMBOL_expr_value_do = 190, /* expr_value_do */
1809 YYSYMBOL_191_10 = 191, /* $@10 */
1810 YYSYMBOL_192_11 = 192, /* $@11 */
1811 YYSYMBOL_command_call = 193, /* command_call */
1812 YYSYMBOL_block_command = 194, /* block_command */
1813 YYSYMBOL_cmd_brace_block = 195, /* cmd_brace_block */
1814 YYSYMBOL_fcall = 196, /* fcall */
1815 YYSYMBOL_command = 197, /* command */
1816 YYSYMBOL_mlhs = 198, /* mlhs */
1817 YYSYMBOL_mlhs_inner = 199, /* mlhs_inner */
1818 YYSYMBOL_mlhs_basic = 200, /* mlhs_basic */
1819 YYSYMBOL_mlhs_item = 201, /* mlhs_item */
1820 YYSYMBOL_mlhs_head = 202, /* mlhs_head */
1821 YYSYMBOL_mlhs_post = 203, /* mlhs_post */
1822 YYSYMBOL_mlhs_node = 204, /* mlhs_node */
1823 YYSYMBOL_lhs = 205, /* lhs */
1824 YYSYMBOL_cname = 206, /* cname */
1825 YYSYMBOL_cpath = 207, /* cpath */
1826 YYSYMBOL_fname = 208, /* fname */
1827 YYSYMBOL_fitem = 209, /* fitem */
1828 YYSYMBOL_undef_list = 210, /* undef_list */
1829 YYSYMBOL_211_12 = 211, /* $@12 */
1830 YYSYMBOL_op = 212, /* op */
1831 YYSYMBOL_reswords = 213, /* reswords */
1832 YYSYMBOL_arg = 214, /* arg */
1833 YYSYMBOL_215_13 = 215, /* $@13 */
1834 YYSYMBOL_relop = 216, /* relop */
1835 YYSYMBOL_rel_expr = 217, /* rel_expr */
1836 YYSYMBOL_lex_ctxt = 218, /* lex_ctxt */
1837 YYSYMBOL_arg_value = 219, /* arg_value */
1838 YYSYMBOL_aref_args = 220, /* aref_args */
1839 YYSYMBOL_arg_rhs = 221, /* arg_rhs */
1840 YYSYMBOL_paren_args = 222, /* paren_args */
1841 YYSYMBOL_opt_paren_args = 223, /* opt_paren_args */
1842 YYSYMBOL_opt_call_args = 224, /* opt_call_args */
1843 YYSYMBOL_call_args = 225, /* call_args */
1844 YYSYMBOL_command_args = 226, /* command_args */
1845 YYSYMBOL_227_14 = 227, /* $@14 */
1846 YYSYMBOL_block_arg = 228, /* block_arg */
1847 YYSYMBOL_opt_block_arg = 229, /* opt_block_arg */
1848 YYSYMBOL_args = 230, /* args */
1849 YYSYMBOL_mrhs_arg = 231, /* mrhs_arg */
1850 YYSYMBOL_mrhs = 232, /* mrhs */
1851 YYSYMBOL_primary = 233, /* primary */
1852 YYSYMBOL_234_15 = 234, /* $@15 */
1853 YYSYMBOL_235_16 = 235, /* $@16 */
1854 YYSYMBOL_236_17 = 236, /* $@17 */
1855 YYSYMBOL_237_18 = 237, /* $@18 */
1856 YYSYMBOL_238_19 = 238, /* @19 */
1857 YYSYMBOL_239_20 = 239, /* @20 */
1858 YYSYMBOL_240_21 = 240, /* $@21 */
1859 YYSYMBOL_241_22 = 241, /* $@22 */
1860 YYSYMBOL_242_23 = 242, /* $@23 */
1861 YYSYMBOL_243_24 = 243, /* $@24 */
1862 YYSYMBOL_244_25 = 244, /* $@25 */
1863 YYSYMBOL_primary_value = 245, /* primary_value */
1864 YYSYMBOL_k_begin = 246, /* k_begin */
1865 YYSYMBOL_k_if = 247, /* k_if */
1866 YYSYMBOL_k_unless = 248, /* k_unless */
1867 YYSYMBOL_k_while = 249, /* k_while */
1868 YYSYMBOL_k_until = 250, /* k_until */
1869 YYSYMBOL_k_case = 251, /* k_case */
1870 YYSYMBOL_k_for = 252, /* k_for */
1871 YYSYMBOL_k_class = 253, /* k_class */
1872 YYSYMBOL_k_module = 254, /* k_module */
1873 YYSYMBOL_k_def = 255, /* k_def */
1874 YYSYMBOL_k_do = 256, /* k_do */
1875 YYSYMBOL_k_do_block = 257, /* k_do_block */
1876 YYSYMBOL_k_rescue = 258, /* k_rescue */
1877 YYSYMBOL_k_ensure = 259, /* k_ensure */
1878 YYSYMBOL_k_when = 260, /* k_when */
1879 YYSYMBOL_k_else = 261, /* k_else */
1880 YYSYMBOL_k_elsif = 262, /* k_elsif */
1881 YYSYMBOL_k_end = 263, /* k_end */
1882 YYSYMBOL_k_return = 264, /* k_return */
1883 YYSYMBOL_then = 265, /* then */
1884 YYSYMBOL_do = 266, /* do */
1885 YYSYMBOL_if_tail = 267, /* if_tail */
1886 YYSYMBOL_opt_else = 268, /* opt_else */
1887 YYSYMBOL_for_var = 269, /* for_var */
1888 YYSYMBOL_f_marg = 270, /* f_marg */
1889 YYSYMBOL_f_marg_list = 271, /* f_marg_list */
1890 YYSYMBOL_f_margs = 272, /* f_margs */
1891 YYSYMBOL_f_rest_marg = 273, /* f_rest_marg */
1892 YYSYMBOL_f_any_kwrest = 274, /* f_any_kwrest */
1893 YYSYMBOL_f_eq = 275, /* f_eq */
1894 YYSYMBOL_276_26 = 276, /* $@26 */
1895 YYSYMBOL_block_args_tail = 277, /* block_args_tail */
1896 YYSYMBOL_opt_block_args_tail = 278, /* opt_block_args_tail */
1897 YYSYMBOL_excessed_comma = 279, /* excessed_comma */
1898 YYSYMBOL_block_param = 280, /* block_param */
1899 YYSYMBOL_opt_block_param = 281, /* opt_block_param */
1900 YYSYMBOL_block_param_def = 282, /* block_param_def */
1901 YYSYMBOL_opt_bv_decl = 283, /* opt_bv_decl */
1902 YYSYMBOL_bv_decls = 284, /* bv_decls */
1903 YYSYMBOL_bvar = 285, /* bvar */
1904 YYSYMBOL_lambda = 286, /* lambda */
1905 YYSYMBOL_287_27 = 287, /* @27 */
1906 YYSYMBOL_288_28 = 288, /* @28 */
1907 YYSYMBOL_289_29 = 289, /* @29 */
1908 YYSYMBOL_290_30 = 290, /* $@30 */
1909 YYSYMBOL_f_larglist = 291, /* f_larglist */
1910 YYSYMBOL_lambda_body = 292, /* lambda_body */
1911 YYSYMBOL_293_31 = 293, /* $@31 */
1912 YYSYMBOL_do_block = 294, /* do_block */
1913 YYSYMBOL_block_call = 295, /* block_call */
1914 YYSYMBOL_method_call = 296, /* method_call */
1915 YYSYMBOL_brace_block = 297, /* brace_block */
1916 YYSYMBOL_brace_body = 298, /* brace_body */
1917 YYSYMBOL_299_32 = 299, /* @32 */
1918 YYSYMBOL_300_33 = 300, /* @33 */
1919 YYSYMBOL_301_34 = 301, /* @34 */
1920 YYSYMBOL_do_body = 302, /* do_body */
1921 YYSYMBOL_303_35 = 303, /* @35 */
1922 YYSYMBOL_304_36 = 304, /* @36 */
1923 YYSYMBOL_305_37 = 305, /* @37 */
1924 YYSYMBOL_case_args = 306, /* case_args */
1925 YYSYMBOL_case_body = 307, /* case_body */
1926 YYSYMBOL_cases = 308, /* cases */
1927 YYSYMBOL_p_case_body = 309, /* p_case_body */
1928 YYSYMBOL_310_38 = 310, /* @38 */
1929 YYSYMBOL_311_39 = 311, /* @39 */
1930 YYSYMBOL_312_40 = 312, /* $@40 */
1931 YYSYMBOL_p_cases = 313, /* p_cases */
1932 YYSYMBOL_p_top_expr = 314, /* p_top_expr */
1933 YYSYMBOL_p_top_expr_body = 315, /* p_top_expr_body */
1934 YYSYMBOL_p_expr = 316, /* p_expr */
1935 YYSYMBOL_p_as = 317, /* p_as */
1936 YYSYMBOL_p_alt = 318, /* p_alt */
1937 YYSYMBOL_p_lparen = 319, /* p_lparen */
1938 YYSYMBOL_p_lbracket = 320, /* p_lbracket */
1939 YYSYMBOL_p_expr_basic = 321, /* p_expr_basic */
1940 YYSYMBOL_322_41 = 322, /* @41 */
1941 YYSYMBOL_323_42 = 323, /* @42 */
1942 YYSYMBOL_p_args = 324, /* p_args */
1943 YYSYMBOL_p_args_head = 325, /* p_args_head */
1944 YYSYMBOL_p_args_tail = 326, /* p_args_tail */
1945 YYSYMBOL_p_find = 327, /* p_find */
1946 YYSYMBOL_p_rest = 328, /* p_rest */
1947 YYSYMBOL_p_args_post = 329, /* p_args_post */
1948 YYSYMBOL_p_arg = 330, /* p_arg */
1949 YYSYMBOL_p_kwargs = 331, /* p_kwargs */
1950 YYSYMBOL_p_kwarg = 332, /* p_kwarg */
1951 YYSYMBOL_p_kw = 333, /* p_kw */
1952 YYSYMBOL_p_kw_label = 334, /* p_kw_label */
1953 YYSYMBOL_p_kwrest = 335, /* p_kwrest */
1954 YYSYMBOL_p_kwnorest = 336, /* p_kwnorest */
1955 YYSYMBOL_p_any_kwrest = 337, /* p_any_kwrest */
1956 YYSYMBOL_p_value = 338, /* p_value */
1957 YYSYMBOL_p_primitive = 339, /* p_primitive */
1958 YYSYMBOL_p_variable = 340, /* p_variable */
1959 YYSYMBOL_p_var_ref = 341, /* p_var_ref */
1960 YYSYMBOL_p_expr_ref = 342, /* p_expr_ref */
1961 YYSYMBOL_p_const = 343, /* p_const */
1962 YYSYMBOL_opt_rescue = 344, /* opt_rescue */
1963 YYSYMBOL_exc_list = 345, /* exc_list */
1964 YYSYMBOL_exc_var = 346, /* exc_var */
1965 YYSYMBOL_opt_ensure = 347, /* opt_ensure */
1966 YYSYMBOL_literal = 348, /* literal */
1967 YYSYMBOL_strings = 349, /* strings */
1968 YYSYMBOL_string = 350, /* string */
1969 YYSYMBOL_string1 = 351, /* string1 */
1970 YYSYMBOL_xstring = 352, /* xstring */
1971 YYSYMBOL_regexp = 353, /* regexp */
1972 YYSYMBOL_words = 354, /* words */
1973 YYSYMBOL_word_list = 355, /* word_list */
1974 YYSYMBOL_word = 356, /* word */
1975 YYSYMBOL_symbols = 357, /* symbols */
1976 YYSYMBOL_symbol_list = 358, /* symbol_list */
1977 YYSYMBOL_qwords = 359, /* qwords */
1978 YYSYMBOL_qsymbols = 360, /* qsymbols */
1979 YYSYMBOL_qword_list = 361, /* qword_list */
1980 YYSYMBOL_qsym_list = 362, /* qsym_list */
1981 YYSYMBOL_string_contents = 363, /* string_contents */
1982 YYSYMBOL_xstring_contents = 364, /* xstring_contents */
1983 YYSYMBOL_regexp_contents = 365, /* regexp_contents */
1984 YYSYMBOL_string_content = 366, /* string_content */
1985 YYSYMBOL_367_43 = 367, /* @43 */
1986 YYSYMBOL_368_44 = 368, /* $@44 */
1987 YYSYMBOL_369_45 = 369, /* @45 */
1988 YYSYMBOL_370_46 = 370, /* @46 */
1989 YYSYMBOL_371_47 = 371, /* @47 */
1990 YYSYMBOL_372_48 = 372, /* @48 */
1991 YYSYMBOL_string_dvar = 373, /* string_dvar */
1992 YYSYMBOL_symbol = 374, /* symbol */
1993 YYSYMBOL_ssym = 375, /* ssym */
1994 YYSYMBOL_sym = 376, /* sym */
1995 YYSYMBOL_dsym = 377, /* dsym */
1996 YYSYMBOL_numeric = 378, /* numeric */
1997 YYSYMBOL_simple_numeric = 379, /* simple_numeric */
1998 YYSYMBOL_nonlocal_var = 380, /* nonlocal_var */
1999 YYSYMBOL_user_variable = 381, /* user_variable */
2000 YYSYMBOL_keyword_variable = 382, /* keyword_variable */
2001 YYSYMBOL_var_ref = 383, /* var_ref */
2002 YYSYMBOL_var_lhs = 384, /* var_lhs */
2003 YYSYMBOL_backref = 385, /* backref */
2004 YYSYMBOL_superclass = 386, /* superclass */
2005 YYSYMBOL_387_49 = 387, /* $@49 */
2006 YYSYMBOL_f_opt_paren_args = 388, /* f_opt_paren_args */
2007 YYSYMBOL_f_paren_args = 389, /* f_paren_args */
2008 YYSYMBOL_f_arglist = 390, /* f_arglist */
2009 YYSYMBOL_391_50 = 391, /* @50 */
2010 YYSYMBOL_args_tail = 392, /* args_tail */
2011 YYSYMBOL_opt_args_tail = 393, /* opt_args_tail */
2012 YYSYMBOL_f_args = 394, /* f_args */
2013 YYSYMBOL_args_forward = 395, /* args_forward */
2014 YYSYMBOL_f_bad_arg = 396, /* f_bad_arg */
2015 YYSYMBOL_f_norm_arg = 397, /* f_norm_arg */
2016 YYSYMBOL_f_arg_asgn = 398, /* f_arg_asgn */
2017 YYSYMBOL_f_arg_item = 399, /* f_arg_item */
2018 YYSYMBOL_f_arg = 400, /* f_arg */
2019 YYSYMBOL_f_label = 401, /* f_label */
2020 YYSYMBOL_f_kw = 402, /* f_kw */
2021 YYSYMBOL_f_block_kw = 403, /* f_block_kw */
2022 YYSYMBOL_f_block_kwarg = 404, /* f_block_kwarg */
2023 YYSYMBOL_f_kwarg = 405, /* f_kwarg */
2024 YYSYMBOL_kwrest_mark = 406, /* kwrest_mark */
2025 YYSYMBOL_f_no_kwarg = 407, /* f_no_kwarg */
2026 YYSYMBOL_f_kwrest = 408, /* f_kwrest */
2027 YYSYMBOL_f_opt = 409, /* f_opt */
2028 YYSYMBOL_f_block_opt = 410, /* f_block_opt */
2029 YYSYMBOL_f_block_optarg = 411, /* f_block_optarg */
2030 YYSYMBOL_f_optarg = 412, /* f_optarg */
2031 YYSYMBOL_restarg_mark = 413, /* restarg_mark */
2032 YYSYMBOL_f_rest_arg = 414, /* f_rest_arg */
2033 YYSYMBOL_blkarg_mark = 415, /* blkarg_mark */
2034 YYSYMBOL_f_block_arg = 416, /* f_block_arg */
2035 YYSYMBOL_opt_f_block_arg = 417, /* opt_f_block_arg */
2036 YYSYMBOL_singleton = 418, /* singleton */
2037 YYSYMBOL_419_51 = 419, /* $@51 */
2038 YYSYMBOL_assoc_list = 420, /* assoc_list */
2039 YYSYMBOL_assocs = 421, /* assocs */
2040 YYSYMBOL_assoc = 422, /* assoc */
2041 YYSYMBOL_operation = 423, /* operation */
2042 YYSYMBOL_operation2 = 424, /* operation2 */
2043 YYSYMBOL_operation3 = 425, /* operation3 */
2044 YYSYMBOL_dot_or_colon = 426, /* dot_or_colon */
2045 YYSYMBOL_call_op = 427, /* call_op */
2046 YYSYMBOL_call_op2 = 428, /* call_op2 */
2047 YYSYMBOL_opt_terms = 429, /* opt_terms */
2048 YYSYMBOL_opt_nl = 430, /* opt_nl */
2049 YYSYMBOL_rparen = 431, /* rparen */
2050 YYSYMBOL_rbracket = 432, /* rbracket */
2051 YYSYMBOL_rbrace = 433, /* rbrace */
2052 YYSYMBOL_trailer = 434, /* trailer */
2053 YYSYMBOL_term = 435, /* term */
2054 YYSYMBOL_terms = 436, /* terms */
2055 YYSYMBOL_none = 437 /* none */
2056};
2057typedef enum yysymbol_kind_t yysymbol_kind_t;
2058
2059
2060
2061
2062#ifdef short
2063# undef short
2064#endif
2065
2066/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
2067 <limits.h> and (if available) <stdint.h> are included
2068 so that the code can choose integer types of a good width. */
2069
2070#ifndef __PTRDIFF_MAX__
2071# include <limits.h> /* INFRINGES ON USER NAME SPACE */
2072# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2073# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
2074# define YY_STDINT_H
2075# endif
2076#endif
2077
2078/* Narrow types that promote to a signed type and that can represent a
2079 signed or unsigned integer of at least N bits. In tables they can
2080 save space and decrease cache pressure. Promoting to a signed type
2081 helps avoid bugs in integer arithmetic. */
2082
2083#ifdef __INT_LEAST8_MAX__
2084typedef __INT_LEAST8_TYPE__ yytype_int8;
2085#elif defined YY_STDINT_H
2086typedef int_least8_t yytype_int8;
2087#else
2088typedef signed char yytype_int8;
2089#endif
2090
2091#ifdef __INT_LEAST16_MAX__
2092typedef __INT_LEAST16_TYPE__ yytype_int16;
2093#elif defined YY_STDINT_H
2094typedef int_least16_t yytype_int16;
2095#else
2096typedef short yytype_int16;
2097#endif
2098
2099/* Work around bug in HP-UX 11.23, which defines these macros
2100 incorrectly for preprocessor constants. This workaround can likely
2101 be removed in 2023, as HPE has promised support for HP-UX 11.23
2102 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
2103 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
2104#ifdef __hpux
2105# undef UINT_LEAST8_MAX
2106# undef UINT_LEAST16_MAX
2107# define UINT_LEAST8_MAX 255
2108# define UINT_LEAST16_MAX 65535
2109#endif
2110
2111#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
2112typedef __UINT_LEAST8_TYPE__ yytype_uint8;
2113#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
2114 && UINT_LEAST8_MAX <= INT_MAX)
2115typedef uint_least8_t yytype_uint8;
2116#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
2117typedef unsigned char yytype_uint8;
2118#else
2119typedef short yytype_uint8;
2120#endif
2121
2122#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
2123typedef __UINT_LEAST16_TYPE__ yytype_uint16;
2124#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
2125 && UINT_LEAST16_MAX <= INT_MAX)
2126typedef uint_least16_t yytype_uint16;
2127#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
2128typedef unsigned short yytype_uint16;
2129#else
2130typedef int yytype_uint16;
2131#endif
2132
2133#ifndef YYPTRDIFF_T
2134# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
2135# define YYPTRDIFF_T __PTRDIFF_TYPE__
2136# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
2137# elif defined PTRDIFF_MAX
2138# ifndef ptrdiff_t
2139# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2140# endif
2141# define YYPTRDIFF_T ptrdiff_t
2142# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
2143# else
2144# define YYPTRDIFF_T long
2145# define YYPTRDIFF_MAXIMUM LONG_MAX
2146# endif
2147#endif
2148
2149#ifndef YYSIZE_T
2150# ifdef __SIZE_TYPE__
2151# define YYSIZE_T __SIZE_TYPE__
2152# elif defined size_t
2153# define YYSIZE_T size_t
2154# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2155# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2156# define YYSIZE_T size_t
2157# else
2158# define YYSIZE_T unsigned
2159# endif
2160#endif
2161
2162#define YYSIZE_MAXIMUM \
2163 YY_CAST (YYPTRDIFF_T, \
2164 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
2165 ? YYPTRDIFF_MAXIMUM \
2166 : YY_CAST (YYSIZE_T, -1)))
2167
2168#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
2169
2170
2171/* Stored state numbers (used for stacks). */
2172typedef yytype_int16 yy_state_t;
2173
2174/* State numbers in computations. */
2175typedef int yy_state_fast_t;
2176
2177#ifndef YY_
2178# if defined YYENABLE_NLS && YYENABLE_NLS
2179# if ENABLE_NLS
2180# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2181# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
2182# endif
2183# endif
2184# ifndef YY_
2185# define YY_(Msgid) Msgid
2186# endif
2187#endif
2188
2189
2190#ifndef YY_ATTRIBUTE_PURE
2191# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
2192# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
2193# else
2194# define YY_ATTRIBUTE_PURE
2195# endif
2196#endif
2197
2198#ifndef YY_ATTRIBUTE_UNUSED
2199# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
2200# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
2201# else
2202# define YY_ATTRIBUTE_UNUSED
2203# endif
2204#endif
2205
2206/* Suppress unused-variable warnings by "using" E. */
2207#if ! defined lint || defined __GNUC__
2208# define YY_USE(E) ((void) (E))
2209#else
2210# define YY_USE(E) /* empty */
2211#endif
2212
2213/* Suppress an incorrect diagnostic about yylval being uninitialized. */
2214#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
2215# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
2216# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2217 _Pragma ("GCC diagnostic push") \
2218 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
2219# else
2220# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2221 _Pragma ("GCC diagnostic push") \
2222 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
2223 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
2224# endif
2225# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
2226 _Pragma ("GCC diagnostic pop")
2227#else
2228# define YY_INITIAL_VALUE(Value) Value
2229#endif
2230#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2231# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2232# define YY_IGNORE_MAYBE_UNINITIALIZED_END
2233#endif
2234#ifndef YY_INITIAL_VALUE
2235# define YY_INITIAL_VALUE(Value) /* Nothing. */
2236#endif
2237
2238#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
2239# define YY_IGNORE_USELESS_CAST_BEGIN \
2240 _Pragma ("GCC diagnostic push") \
2241 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
2242# define YY_IGNORE_USELESS_CAST_END \
2243 _Pragma ("GCC diagnostic pop")
2244#endif
2245#ifndef YY_IGNORE_USELESS_CAST_BEGIN
2246# define YY_IGNORE_USELESS_CAST_BEGIN
2247# define YY_IGNORE_USELESS_CAST_END
2248#endif
2249
2250
2251#define YY_ASSERT(E) ((void) (0 && (E)))
2252
2253#if 1
2254
2255/* The parser invokes alloca or malloc; define the necessary symbols. */
2256
2257# ifdef YYSTACK_USE_ALLOCA
2258# if YYSTACK_USE_ALLOCA
2259# ifdef __GNUC__
2260# define YYSTACK_ALLOC __builtin_alloca
2261# elif defined __BUILTIN_VA_ARG_INCR
2262# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2263# elif defined _AIX
2264# define YYSTACK_ALLOC __alloca
2265# elif defined _MSC_VER
2266# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2267# define alloca _alloca
2268# else
2269# define YYSTACK_ALLOC alloca
2270# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
2271# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2272 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
2273# ifndef EXIT_SUCCESS
2274# define EXIT_SUCCESS 0
2275# endif
2276# endif
2277# endif
2278# endif
2279# endif
2280
2281# ifdef YYSTACK_ALLOC
2282 /* Pacify GCC's 'empty if-body' warning. */
2283# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
2284# ifndef YYSTACK_ALLOC_MAXIMUM
2285 /* The OS might guarantee only one guard page at the bottom of the stack,
2286 and a page size can be as small as 4096 bytes. So we cannot safely
2287 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2288 to allow for a few compiler-allocated temporary stack slots. */
2289# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2290# endif
2291# else
2292# define YYSTACK_ALLOC YYMALLOC
2293# define YYSTACK_FREE YYFREE
2294# ifndef YYSTACK_ALLOC_MAXIMUM
2295# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2296# endif
2297# if (defined __cplusplus && ! defined EXIT_SUCCESS \
2298 && ! ((defined YYMALLOC || defined malloc) \
2299 && (defined YYFREE || defined free)))
2300# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2301# ifndef EXIT_SUCCESS
2302# define EXIT_SUCCESS 0
2303# endif
2304# endif
2305# ifndef YYMALLOC
2306# define YYMALLOC malloc
2307# if ! defined malloc && ! defined EXIT_SUCCESS
2308void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2309# endif
2310# endif
2311# ifndef YYFREE
2312# define YYFREE free
2313# if ! defined free && ! defined EXIT_SUCCESS
2314void free (void *); /* INFRINGES ON USER NAME SPACE */
2315# endif
2316# endif
2317# endif
2318#endif /* 1 */
2319
2320#if (! defined yyoverflow \
2321 && (! defined __cplusplus \
2322 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
2323 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2324
2325/* A type that is properly aligned for any stack member. */
2326union yyalloc
2327{
2328 yy_state_t yyss_alloc;
2329 YYSTYPE yyvs_alloc;
2330 YYLTYPE yyls_alloc;
2331};
2332
2333/* The size of the maximum gap between one aligned stack and the next. */
2334# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
2335
2336/* The size of an array large to enough to hold all stacks, each with
2337 N elements. */
2338# define YYSTACK_BYTES(N) \
2339 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
2340 + YYSIZEOF (YYLTYPE)) \
2341 + 2 * YYSTACK_GAP_MAXIMUM)
2342
2343# define YYCOPY_NEEDED 1
2344
2345/* Relocate STACK from its old location to the new one. The
2346 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2347 elements in the stack, and YYPTR gives the new location of the
2348 stack. Advance YYPTR to a properly aligned location for the next
2349 stack. */
2350# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2351 do \
2352 { \
2353 YYPTRDIFF_T yynewbytes; \
2354 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2355 Stack = &yyptr->Stack_alloc; \
2356 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
2357 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
2358 } \
2359 while (0)
2360
2361#endif
2362
2363#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
2364/* Copy COUNT objects from SRC to DST. The source and destination do
2365 not overlap. */
2366# ifndef YYCOPY
2367# if defined __GNUC__ && 1 < __GNUC__
2368# define YYCOPY(Dst, Src, Count) \
2369 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
2370# else
2371# define YYCOPY(Dst, Src, Count) \
2372 do \
2373 { \
2374 YYPTRDIFF_T yyi; \
2375 for (yyi = 0; yyi < (Count); yyi++) \
2376 (Dst)[yyi] = (Src)[yyi]; \
2377 } \
2378 while (0)
2379# endif
2380# endif
2381#endif /* !YYCOPY_NEEDED */
2382
2383/* YYFINAL -- State number of the termination state. */
2384#define YYFINAL 3
2385/* YYLAST -- Last index in YYTABLE. */
2386#define YYLAST 15194
2387
2388/* YYNTOKENS -- Number of terminals. */
2389#define YYNTOKENS 163
2390/* YYNNTS -- Number of nonterminals. */
2391#define YYNNTS 275
2392/* YYNRULES -- Number of rules. */
2393#define YYNRULES 782
2394/* YYNSTATES -- Number of states. */
2395#define YYNSTATES 1304
2396
2397/* YYMAXUTOK -- Last valid token kind. */
2398#define YYMAXUTOK 362
2399
2400
2401/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2402 as returned by yylex, with out-of-bounds checking. */
2403#define YYTRANSLATE(YYX) \
2404 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2405 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2406 : YYSYMBOL_YYUNDEF)
2407
2408/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2409 as returned by yylex. */
2410static const yytype_uint8 yytranslate[] =
2411{
2412 0, 2, 2, 2, 2, 2, 2, 2, 2, 72,
2413 162, 75, 73, 74, 2, 2, 2, 2, 2, 2,
2414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2415 2, 2, 161, 149, 2, 2, 2, 147, 142, 2,
2416 157, 158, 145, 143, 155, 144, 69, 146, 2, 2,
2417 2, 2, 2, 2, 2, 2, 2, 2, 137, 160,
2418 139, 135, 138, 136, 2, 2, 2, 2, 2, 2,
2419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2421 2, 154, 70, 159, 141, 2, 156, 2, 2, 2,
2422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2424 2, 2, 2, 152, 140, 153, 150, 2, 89, 90,
2425 91, 92, 76, 77, 78, 79, 95, 96, 84, 83,
2426 80, 81, 82, 87, 88, 93, 94, 98, 85, 86,
2427 97, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2437 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2438 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2439 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2440 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2441 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2442 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2443 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2444 65, 66, 67, 68, 71, 99, 100, 101, 102, 103,
2445 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2446 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2447 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2448 134, 148, 151
2449};
2450
2451#if YYDEBUG
2452/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2453static const yytype_int16 yyrline[] =
2454{
2455 0, 1588, 1588, 1588, 1614, 1620, 1627, 1634, 1643, 1644,
2456 1650, 1663, 1661, 1672, 1683, 1689, 1696, 1703, 1712, 1717,
2457 1716, 1726, 1726, 1733, 1740, 1750, 1759, 1766, 1774, 1782,
2458 1794, 1806, 1816, 1830, 1831, 1839, 1846, 1854, 1861, 1862,
2459 1870, 1877, 1884, 1892, 1899, 1906, 1914, 1921, 1932, 1944,
2460 1957, 1971, 1981, 1986, 1995, 1998, 1999, 2003, 2007, 2011,
2461 2016, 2024, 2015, 2038, 2046, 2037, 2059, 2062, 2084, 2094,
2462 2093, 2112, 2117, 2125, 2125, 2125, 2131, 2132, 2135, 2136,
2463 2145, 2155, 2165, 2174, 2185, 2192, 2199, 2206, 2213, 2221,
2464 2229, 2236, 2243, 2252, 2253, 2262, 2263, 2272, 2279, 2286,
2465 2293, 2300, 2307, 2314, 2321, 2328, 2335, 2344, 2345, 2354,
2466 2361, 2370, 2377, 2386, 2393, 2400, 2407, 2417, 2424, 2434,
2467 2441, 2448, 2458, 2465, 2472, 2479, 2486, 2493, 2500, 2507,
2468 2514, 2524, 2532, 2535, 2542, 2549, 2558, 2559, 2560, 2561,
2469 2566, 2569, 2576, 2579, 2586, 2586, 2596, 2597, 2598, 2599,
2470 2600, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609,
2471 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619,
2472 2620, 2621, 2622, 2623, 2624, 2625, 2628, 2628, 2628, 2629,
2473 2629, 2630, 2630, 2630, 2631, 2631, 2631, 2631, 2632, 2632,
2474 2632, 2632, 2633, 2633, 2633, 2634, 2634, 2634, 2634, 2635,
2475 2635, 2635, 2635, 2636, 2636, 2636, 2636, 2637, 2637, 2637,
2476 2637, 2638, 2638, 2638, 2638, 2639, 2639, 2642, 2649, 2656,
2477 2663, 2670, 2677, 2684, 2692, 2700, 2708, 2717, 2726, 2734,
2478 2742, 2750, 2758, 2762, 2766, 2770, 2774, 2778, 2782, 2786,
2479 2790, 2794, 2798, 2802, 2806, 2810, 2811, 2815, 2819, 2823,
2480 2827, 2831, 2835, 2839, 2843, 2847, 2851, 2855, 2855, 2860,
2481 2869, 2880, 2892, 2905, 2919, 2925, 2926, 2927, 2928, 2931,
2482 2935, 2942, 2948, 2955, 2956, 2960, 2967, 2976, 2981, 2991,
2483 2998, 3010, 3024, 3025, 3028, 3029, 3030, 3034, 3041, 3050,
2484 3058, 3065, 3073, 3081, 3085, 3085, 3122, 3129, 3141, 3145,
2485 3152, 3159, 3166, 3177, 3184, 3191, 3205, 3206, 3210, 3217,
2486 3224, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241,
2487 3242, 3243, 3251, 3250, 3265, 3265, 3272, 3272, 3280, 3288,
2488 3295, 3302, 3309, 3317, 3324, 3331, 3338, 3345, 3345, 3350,
2489 3354, 3358, 3365, 3366, 3374, 3375, 3386, 3397, 3407, 3418,
2490 3417, 3434, 3433, 3448, 3457, 3500, 3499, 3523, 3522, 3545,
2491 3544, 3569, 3567, 3586, 3584, 3603, 3610, 3617, 3624, 3633,
2492 3640, 3649, 3669, 3678, 3687, 3696, 3705, 3714, 3724, 3734,
2493 3741, 3751, 3760, 3766, 3772, 3778, 3793, 3800, 3807, 3813,
2494 3820, 3821, 3822, 3825, 3826, 3829, 3830, 3842, 3843, 3852,
2495 3853, 3856, 3864, 3873, 3880, 3889, 3896, 3903, 3910, 3917,
2496 3926, 3934, 3943, 3944, 3947, 3947, 3949, 3953, 3957, 3961,
2497 3967, 3972, 3977, 3987, 3991, 3995, 3999, 4003, 4007, 4012,
2498 4016, 4020, 4024, 4028, 4032, 4036, 4040, 4044, 4050, 4051,
2499 4057, 4067, 4080, 4084, 4093, 4095, 4099, 4104, 4111, 4117,
2500 4121, 4125, 4110, 4150, 4159, 4170, 4176, 4175, 4187, 4197,
2501 4211, 4218, 4225, 4234, 4243, 4251, 4259, 4266, 4274, 4282,
2502 4289, 4296, 4309, 4317, 4327, 4328, 4332, 4327, 4349, 4350,
2503 4354, 4349, 4373, 4381, 4388, 4396, 4405, 4417, 4418, 4422,
2504 4429, 4433, 4421, 4448, 4449, 4452, 4453, 4461, 4471, 4472,
2505 4477, 4485, 4489, 4493, 4499, 4502, 4511, 4514, 4521, 4524,
2506 4525, 4527, 4528, 4529, 4538, 4547, 4556, 4561, 4570, 4579,
2507 4588, 4593, 4597, 4601, 4607, 4606, 4618, 4623, 4623, 4630,
2508 4639, 4643, 4652, 4656, 4660, 4663, 4667, 4676, 4680, 4686,
2509 4693, 4697, 4703, 4704, 4713, 4722, 4726, 4730, 4734, 4740,
2510 4742, 4751, 4759, 4773, 4774, 4797, 4801, 4807, 4813, 4814,
2511 4817, 4818, 4827, 4836, 4844, 4852, 4853, 4854, 4855, 4863,
2512 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4888,
2513 4891, 4901, 4912, 4921, 4930, 4937, 4944, 4953, 4974, 4977,
2514 4984, 4991, 4994, 4998, 5001, 5008, 5011, 5012, 5015, 5032,
2515 5033, 5034, 5043, 5053, 5062, 5068, 5078, 5084, 5093, 5095,
2516 5104, 5114, 5120, 5129, 5138, 5148, 5154, 5164, 5170, 5180,
2517 5190, 5209, 5215, 5225, 5235, 5276, 5279, 5278, 5295, 5299,
2518 5304, 5308, 5312, 5294, 5333, 5340, 5347, 5354, 5357, 5358,
2519 5361, 5371, 5372, 5375, 5385, 5386, 5396, 5397, 5398, 5399,
2520 5402, 5403, 5404, 5407, 5408, 5409, 5412, 5413, 5414, 5415,
2521 5416, 5417, 5418, 5421, 5434, 5443, 5450, 5459, 5460, 5464,
2522 5463, 5473, 5481, 5482, 5490, 5502, 5503, 5503, 5519, 5523,
2523 5527, 5531, 5535, 5545, 5550, 5555, 5559, 5563, 5567, 5571,
2524 5575, 5579, 5583, 5587, 5591, 5595, 5599, 5603, 5607, 5612,
2525 5618, 5631, 5640, 5649, 5658, 5669, 5670, 5678, 5687, 5695,
2526 5716, 5718, 5731, 5741, 5750, 5761, 5769, 5779, 5786, 5796,
2527 5803, 5812, 5813, 5816, 5824, 5832, 5842, 5853, 5864, 5871,
2528 5880, 5887, 5896, 5897, 5900, 5908, 5918, 5919, 5922, 5930,
2529 5940, 5944, 5950, 5955, 5955, 5979, 5980, 5989, 5991, 6014,
2530 6025, 6032, 6041, 6049, 6066, 6080, 6081, 6082, 6085, 6086,
2531 6089, 6090, 6091, 6094, 6095, 6098, 6099, 6102, 6103, 6106,
2532 6107, 6110, 6111, 6114, 6117, 6120, 6123, 6124, 6127, 6128,
2533 6135, 6136, 6140
2534};
2535#endif
2536
2538#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2539
2540#if 1
2541/* The user-facing name of the symbol whose (internal) number is
2542 YYSYMBOL. No bounds checking. */
2543static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2544
2545/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2546 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2547static const char *const yytname[] =
2548{
2549 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2550 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2551 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2552 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2553 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2554 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2555 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2556 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2557 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2558 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2559 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2560 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2561 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2562 "\"method\"", "\"global variable\"", "\"instance variable\"",
2563 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
2564 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2565 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2566 "\"literal content\"", "tREGEXP_END", "\"dummy end\"", "'.'",
2567 "\"backslash\"", "\"escaped space\"", "\"escaped horizontal tab\"",
2568 "\"escaped form feed\"", "\"escaped carriage return\"",
2569 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2570 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2571 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2572 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2573 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2574 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2575 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2576 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2577 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2578 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2579 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tIGNORED_NL", "tCOMMENT",
2580 "tEMBDOC_BEG", "tEMBDOC", "tEMBDOC_END", "tHEREDOC_BEG", "tHEREDOC_END",
2581 "k__END__", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", "'^'",
2582 "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", "'~'",
2583 "tLAST_TOKEN", "'{'", "'}'", "'['", "','", "'`'", "'('", "')'", "']'",
2584 "';'", "' '", "'\\n'", "$accept", "program", "$@1", "top_compstmt",
2585 "top_stmts", "top_stmt", "begin_block", "bodystmt", "$@2", "compstmt",
2586 "stmts", "stmt_or_begin", "$@3", "stmt", "$@4", "command_asgn",
2587 "command_rhs", "expr", "@5", "@6", "@7", "@8", "def_name", "defn_head",
2588 "defs_head", "$@9", "expr_value", "expr_value_do", "$@10", "$@11",
2589 "command_call", "block_command", "cmd_brace_block", "fcall", "command",
2590 "mlhs", "mlhs_inner", "mlhs_basic", "mlhs_item", "mlhs_head",
2591 "mlhs_post", "mlhs_node", "lhs", "cname", "cpath", "fname", "fitem",
2592 "undef_list", "$@12", "op", "reswords", "arg", "$@13", "relop",
2593 "rel_expr", "lex_ctxt", "arg_value", "aref_args", "arg_rhs",
2594 "paren_args", "opt_paren_args", "opt_call_args", "call_args",
2595 "command_args", "$@14", "block_arg", "opt_block_arg", "args", "mrhs_arg",
2596 "mrhs", "primary", "$@15", "$@16", "$@17", "$@18", "@19", "@20", "$@21",
2597 "$@22", "$@23", "$@24", "$@25", "primary_value", "k_begin", "k_if",
2598 "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
2599 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
2600 "k_when", "k_else", "k_elsif", "k_end", "k_return", "then", "do",
2601 "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list", "f_margs",
2602 "f_rest_marg", "f_any_kwrest", "f_eq", "$@26", "block_args_tail",
2603 "opt_block_args_tail", "excessed_comma", "block_param",
2604 "opt_block_param", "block_param_def", "opt_bv_decl", "bv_decls", "bvar",
2605 "lambda", "@27", "@28", "@29", "$@30", "f_larglist", "lambda_body",
2606 "$@31", "do_block", "block_call", "method_call", "brace_block",
2607 "brace_body", "@32", "@33", "@34", "do_body", "@35", "@36", "@37",
2608 "case_args", "case_body", "cases", "p_case_body", "@38", "@39", "$@40",
2609 "p_cases", "p_top_expr", "p_top_expr_body", "p_expr", "p_as", "p_alt",
2610 "p_lparen", "p_lbracket", "p_expr_basic", "@41", "@42", "p_args",
2611 "p_args_head", "p_args_tail", "p_find", "p_rest", "p_args_post", "p_arg",
2612 "p_kwargs", "p_kwarg", "p_kw", "p_kw_label", "p_kwrest", "p_kwnorest",
2613 "p_any_kwrest", "p_value", "p_primitive", "p_variable", "p_var_ref",
2614 "p_expr_ref", "p_const", "opt_rescue", "exc_list", "exc_var",
2615 "opt_ensure", "literal", "strings", "string", "string1", "xstring",
2616 "regexp", "words", "word_list", "word", "symbols", "symbol_list",
2617 "qwords", "qsymbols", "qword_list", "qsym_list", "string_contents",
2618 "xstring_contents", "regexp_contents", "string_content", "@43", "$@44",
2619 "@45", "@46", "@47", "@48", "string_dvar", "symbol", "ssym", "sym",
2620 "dsym", "numeric", "simple_numeric", "nonlocal_var", "user_variable",
2621 "keyword_variable", "var_ref", "var_lhs", "backref", "superclass",
2622 "$@49", "f_opt_paren_args", "f_paren_args", "f_arglist", "@50",
2623 "args_tail", "opt_args_tail", "f_args", "args_forward", "f_bad_arg",
2624 "f_norm_arg", "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw",
2625 "f_block_kw", "f_block_kwarg", "f_kwarg", "kwrest_mark", "f_no_kwarg",
2626 "f_kwrest", "f_opt", "f_block_opt", "f_block_optarg", "f_optarg",
2627 "restarg_mark", "f_rest_arg", "blkarg_mark", "f_block_arg",
2628 "opt_f_block_arg", "singleton", "$@51", "assoc_list", "assocs", "assoc",
2629 "operation", "operation2", "operation3", "dot_or_colon", "call_op",
2630 "call_op2", "opt_terms", "opt_nl", "rparen", "rbracket", "rbrace",
2631 "trailer", "term", "terms", "none", YY_NULLPTR
2632};
2633
2634static const char *
2635yysymbol_name (yysymbol_kind_t yysymbol)
2636{
2637 return yytname[yysymbol];
2638}
2639#endif
2640
2641#define YYPACT_NINF (-1065)
2642
2643#define yypact_value_is_default(Yyn) \
2644 ((Yyn) == YYPACT_NINF)
2645
2646#define YYTABLE_NINF (-783)
2647
2648#define yytable_value_is_error(Yyn) \
2649 ((Yyn) == YYTABLE_NINF)
2650
2651/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2652 STATE-NUM. */
2653static const yytype_int16 yypact[] =
2654{
2655 -1065, 144, 4385, -1065, -1065, -1065, -1065, -1065, 9742, -1065,
2656 -1065, -1065, -1065, -1065, -1065, -1065, 10562, 10562, -1065, -1065,
2657 -1065, 6084, 5616, -1065, -1065, -1065, -1065, 32, 9588, 11,
2658 92, 197, -1065, -1065, -1065, 4824, 5772, -1065, -1065, 4992,
2659 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, 12135, 12135,
2660 12135, 12135, 351, 7722, 8484, 11046, 11409, 10044, -1065, 9434,
2661 -1065, -1065, -1065, 272, 284, 359, 362, 1229, 12256, 12135,
2662 -1065, 340, -1065, 1436, -1065, 551, 20, 20, -1065, -1065,
2663 194, 432, 406, -1065, 308, 12498, -1065, 442, 2224, 819,
2664 622, 676, -1065, 10441, 10441, -1065, -1065, 8605, 12617, 12736,
2665 12855, 9279, 10562, -1065, 582, 249, -1065, -1065, 373, -1065,
2666 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2667 -1065, -1065, 37, 299, -1065, 509, 342, -1065, -1065, -1065,
2668 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2669 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2670 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2671 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2672 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2673 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2674 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2675 -1065, -1065, -1065, -1065, -1065, 507, -1065, -1065, -1065, 528,
2676 12135, 637, 7882, 12135, 12135, 12135, -1065, 12135, 20, 20,
2677 -1065, 563, 4625, 603, -1065, -1065, 552, 754, 80, 302,
2678 615, 306, 569, -1065, -1065, 9037, -1065, 10562, 10683, -1065,
2679 -1065, 9158, -1065, 12377, 751, -1065, 575, 8042, -1065, 8202,
2680 -1065, -1065, 589, 602, 194, -1065, 758, -1065, 687, 4962,
2681 4962, 389, -1065, 7722, 612, 340, -1065, 1436, 11, 643,
2682 -1065, 1436, 11, 639, 601, 609, -1065, 603, 638, 609,
2683 -1065, 11, 744, 1229, 12974, 646, 646, 664, -1065, 774,
2684 858, 866, 871, -1065, -1065, 855, -1065, -1065, 1196, 1209,
2685 450, -1065, -1065, -1065, -1065, 753, -1065, -1065, -1065, -1065,
2686 -1065, -1065, -1065, 8727, 10441, 10441, 10441, 10441, 10320, 12377,
2687 12377, 2298, 705, 713, -1065, 2298, -1065, 718, -1065, -1065,
2688 -1065, -1065, 715, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2689 7722, 10182, 706, -1065, -1065, 12135, 12135, 12135, 12135, 12135,
2690 -1065, -1065, 12135, 12135, 12135, 12135, 12135, 12135, 12135, 12135,
2691 -1065, 12135, -1065, -1065, 12135, 12135, 12135, 12135, 12135, 12135,
2692 12135, 12135, 12135, 12135, -1065, -1065, 13553, 10562, 13652, 6868,
2693 -1065, 551, 185, 185, 7600, 10441, 7600, 340, -1065, 703,
2694 814, -1065, -1065, 935, 874, 77, 128, 132, 851, 883,
2695 12377, 119, -1065, 741, 1039, -1065, -1065, -1065, -1065, 83,
2696 325, 529, 534, 561, 568, 632, 633, 670, -1065, -1065,
2697 -1065, -1065, 679, -1065, -1065, -1065, 15038, -1065, -1065, -1065,
2698 -1065, -1065, -1065, 390, -1065, -1065, -1065, 1072, 748, 761,
2699 -1065, 12135, 10804, -1065, -1065, 13751, 10562, 13850, -1065, -1065,
2700 11167, -1065, 11, 733, -1065, -1065, 12135, 11, -1065, 750,
2701 11, 776, -1065, 352, -1065, -1065, -1065, -1065, -1065, 9742,
2702 -1065, 12135, 757, 786, 13751, 13850, -1065, 92, 11, -1065,
2703 -1065, 8885, 789, 11, -1065, -1065, 11288, -1065, -1065, 11409,
2704 -1065, -1065, -1065, 575, 1071, -1065, -1065, 805, -1065, 12974,
2705 13949, 10562, 14048, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2706 -1065, -1065, -1065, -1065, 1215, 85, 1233, 88, 12135, -1065,
2707 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2708 -1065, -1065, -1065, -1065, -1065, -1065, 1404, -1065, -1065, -1065,
2709 -1065, -1065, 817, -1065, -1065, 11, -1065, -1065, -1065, 806,
2710 -1065, 831, 12135, -1065, 833, 134, -1065, -1065, -1065, 834,
2711 938, 838, 942, -1065, 12256, 6868, 340, 12256, 6868, 843,
2712 -1065, -1065, -1065, 138, -1065, 138, 11530, -1065, 11, 12974,
2713 844, -1065, 11530, -1065, 687, 3311, 3311, 3311, 3311, 3382,
2714 2366, 3311, 3311, 4962, 4962, 771, 771, -1065, 4036, 1358,
2715 1358, 1227, 266, 266, 687, 687, 687, 1300, 1300, 6240,
2716 5148, 6552, 5304, -1065, -1065, 602, -1065, 11, 852, 412,
2717 -1065, 539, -1065, -1065, 5928, 138, 990, -1065, 6990, 993,
2718 7356, 138, 109, 138, 984, 1004, 175, 14147, 10562, 14246,
2719 -1065, 551, -1065, 1071, -1065, -1065, -1065, 14345, 10562, 14444,
2720 6868, 12377, -1065, -1065, -1065, -1065, -1065, 3687, 12256, 12256,
2721 9742, 12135, 12135, 12135, 12135, -1065, 12135, 603, -1065, 569,
2722 4540, 5460, 11, 451, 456, 12135, 12135, -1065, -1065, -1065,
2723 -1065, 10925, -1065, 11167, -1065, -1065, 12377, 4625, -1065, -1065,
2724 602, 602, 12135, -1065, 315, -1065, -1065, 609, 12974, 805,
2725 76, 660, 11, 300, 391, 2980, -1065, 1189, -1065, 526,
2726 -1065, 862, -1065, -1065, 535, 863, -1065, 687, 1404, 1062,
2727 -1065, 875, 11, 881, -1065, 40, -1065, -1065, -1065, 12135,
2728 878, 2298, -1065, -1065, 339, -1065, -1065, -1065, 2298, -1065,
2729 -1065, 1709, -1065, -1065, 982, 3514, 138, -1065, 994, 3654,
2730 138, -1065, -1065, 888, -1065, -1065, -1065, -1065, -1065, 12135,
2731 -1065, 889, 892, 999, -1065, -1065, 805, 12974, -1065, -1065,
2732 1005, 913, 3176, -1065, -1065, -1065, 1075, 461, 13379, 13379,
2733 914, -1065, -1065, -1065, 715, 896, 599, 10804, -1065, -1065,
2734 -1065, -1065, 715, -1065, -1065, -1065, 11651, 662, -1065, 723,
2735 -1065, 1047, -1065, -1065, -1065, -1065, -1065, -1065, 1004, 138,
2736 -1065, 11772, 138, 99, 139, 11, 179, 204, 7600, 340,
2737 10441, 6868, 996, 660, -1065, 11, 138, 352, 9896, 249,
2738 432, -1065, 3731, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2739 -1065, -1065, 480, -1065, -1065, 11, 911, 352, -1065, -1065,
2740 -1065, 471, 2298, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2741 -1065, -1065, -1065, -1065, -1065, -1065, 11, -1065, 1404, -1065,
2742 1333, -1065, -1065, -1065, -1065, -1065, 912, 919, -1065, 1016,
2743 817, 924, -1065, 932, -1065, 924, 12135, 12135, -1065, 12135,
2744 12135, -1065, 951, -1065, 951, 937, 11893, 10320, 805, 10320,
2745 -1065, 12135, 14543, 10562, 14642, -1065, -1065, -1065, 1928, 1928,
2746 565, -1065, 13286, 314, 1043, -1065, 1002, -1065, -1065, 28,
2747 -1065, 960, -1065, -1065, -1065, 969, -1065, 970, -1065, 13565,
2748 -1065, -1065, -1065, -1065, 756, -1065, -1065, -1065, 328, -1065,
2749 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, 136, -1065,
2750 12135, 12256, 12256, -1065, -1065, -1065, 12256, 12256, -1065, 889,
2751 -1065, 1026, -1065, -1065, -1065, 7600, -1065, -1065, -1065, -1065,
2752 7600, 10441, 138, -1065, -1065, 138, -1065, -1065, 138, -1065,
2753 12135, -1065, 146, -1065, 214, 138, 6868, 340, 138, -1065,
2754 -1065, -1065, -1065, -1065, -1065, 12135, 12135, -1065, 12135, 12135,
2755 -1065, 11167, -1065, 11, 75, -1065, -1065, -1065, 973, 975,
2756 2298, -1065, 1709, -1065, -1065, 1709, -1065, 1709, -1065, -1065,
2757 4625, 4625, 4625, 4625, 2064, 8202, -1065, -1065, 6868, 12135,
2758 977, -1065, -1065, 12256, 4625, 6396, 6708, 11, 485, 490,
2759 -1065, -1065, -1065, -1065, 13565, 41, 11, 13472, -1065, 11,
2760 978, -1065, 394, 953, -1065, -1065, 1162, -1065, 10441, -1065,
2761 1082, 13472, 13565, 13565, 394, 1038, 1928, 1928, 565, 60,
2762 696, 13379, 13379, -1065, 4625, -1065, -1065, -1065, -1065, 12256,
2763 -1065, -1065, -1065, -1065, 13093, 185, -1065, -1065, 7478, -1065,
2764 185, -1065, -1065, 13379, -1065, -1065, 12014, 7112, -1065, 138,
2765 -1065, -1065, 12135, 983, 986, -1065, 8202, -1065, -1065, 1333,
2766 1333, 924, 987, 924, 924, 817, -1065, 11, 1007, 806,
2767 1008, 13212, -1065, 1010, -1065, 1012, 1020, -1065, -1065, -1065,
2768 1022, 499, 29, -1065, 1038, 1023, 1024, -1065, -1065, -1065,
2769 11, -1065, -1065, 11, -1065, -1065, 1028, -1065, 1033, -1065,
2770 -1065, -1065, -1065, -1065, -1065, -1065, -1065, 11, 11, 11,
2771 11, 11, 11, -1065, -1065, 1093, -1065, 1102, 210, 224,
2772 259, 6868, 1142, 6990, 185, 884, 12135, -1065, 768, -1065,
2773 -1065, 1325, 6868, 1006, 8362, 975, -1065, 1709, -1065, -1065,
2774 -1065, -1065, 1017, -1065, 13212, 1252, -1065, -1065, 1125, 1117,
2775 339, -1065, 1252, -1065, 755, -1065, -1065, 13565, -1065, 472,
2776 -1065, -1065, 13565, 13472, -1065, -1065, -1065, -1065, -1065, -1065,
2777 291, 14741, 10562, 14840, 990, -1065, 723, -1065, 10441, 10441,
2778 -1065, -1065, -1065, -1065, -1065, 627, -1065, -1065, 138, -1065,
2779 1069, 924, -1065, 1117, -1065, 1052, 1054, -1065, 14939, -1065,
2780 817, 1055, -1065, 1056, 1055, 1058, 1058, -1065, -1065, 105,
2781 166, 11, 318, 367, -1065, -1065, 7234, -1065, -1065, 1325,
2782 -1065, -1065, -1065, -1065, 1252, -1065, 755, -1065, 1059, 1060,
2783 -1065, 755, -1065, 755, -1065, -1065, 13565, 374, 725, -1065,
2784 1055, 1063, 1055, 1055, -1065, -1065, -1065, -1065, 755, -1065,
2785 -1065, -1065, 1055, -1065
2786};
2787
2788/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2789 Performed when YYTABLE does not specify something else to do. Zero
2790 means the default is an error. */
2791static const yytype_int16 yydefact[] =
2792{
2793 2, 0, 0, 1, 39, 377, 378, 379, 0, 370,
2794 371, 372, 375, 373, 374, 376, 365, 366, 367, 368,
2795 389, 294, 294, 657, 656, 658, 659, 771, 0, 771,
2796 0, 0, 661, 660, 662, 755, 757, 651, 650, 756,
2797 652, 646, 647, 648, 649, 599, 667, 668, 0, 0,
2798 0, 0, 0, 0, 0, 782, 782, 105, 448, 619,
2799 619, 621, 623, 0, 0, 0, 0, 0, 0, 0,
2800 3, 769, 6, 8, 33, 38, 676, 676, 55, 77,
2801 294, 76, 0, 93, 0, 97, 107, 0, 66, 245,
2802 264, 0, 322, 0, 0, 73, 73, 0, 0, 0,
2803 0, 0, 333, 344, 78, 342, 311, 312, 598, 600,
2804 313, 314, 315, 317, 316, 318, 597, 638, 639, 596,
2805 644, 655, 663, 664, 319, 0, 320, 81, 5, 186,
2806 197, 187, 210, 183, 203, 193, 192, 213, 214, 208,
2807 191, 190, 185, 211, 215, 216, 195, 184, 198, 202,
2808 204, 196, 189, 205, 212, 207, 206, 199, 209, 194,
2809 182, 201, 200, 181, 188, 179, 180, 176, 177, 178,
2810 136, 138, 137, 171, 172, 167, 149, 150, 151, 158,
2811 155, 157, 152, 153, 173, 174, 159, 160, 164, 168,
2812 154, 156, 146, 147, 148, 161, 162, 163, 165, 166,
2813 169, 170, 175, 141, 143, 26, 139, 140, 142, 0,
2814 751, 0, 0, 302, 754, 297, 619, 0, 676, 676,
2815 289, 0, 272, 300, 91, 293, 782, 0, 663, 664,
2816 0, 320, 782, 747, 92, 771, 89, 0, 782, 469,
2817 88, 771, 772, 0, 0, 21, 257, 0, 9, 0,
2818 365, 366, 336, 470, 0, 239, 0, 333, 240, 230,
2819 231, 330, 19, 0, 0, 769, 16, 18, 771, 95,
2820 15, 326, 771, 0, 771, 771, 273, 0, 0, 771,
2821 745, 771, 0, 0, 0, 676, 676, 103, 369, 0,
2822 113, 114, 121, 449, 641, 0, 640, 642, 0, 0,
2823 0, 606, 615, 611, 617, 645, 59, 251, 252, 778,
2824 779, 4, 780, 0, 0, 0, 0, 0, 0, 0,
2825 0, 699, 0, 675, 361, 699, 673, 0, 363, 380,
2826 474, 463, 82, 478, 341, 381, 478, 459, 782, 109,
2827 0, 101, 98, 782, 63, 0, 0, 0, 0, 0,
2828 267, 268, 0, 0, 0, 0, 228, 229, 0, 0,
2829 60, 0, 265, 266, 0, 0, 0, 0, 0, 0,
2830 0, 0, 0, 0, 765, 766, 0, 782, 0, 0,
2831 72, 71, 0, 0, 0, 0, 0, 769, 351, 770,
2832 0, 400, 399, 0, 0, 663, 664, 320, 131, 132,
2833 0, 0, 134, 671, 0, 663, 664, 320, 359, 206,
2834 199, 209, 194, 176, 177, 178, 136, 137, 743, 68,
2835 67, 742, 0, 90, 768, 767, 0, 343, 601, 782,
2836 782, 144, 750, 330, 301, 753, 296, 0, 0, 0,
2837 782, 0, 0, 290, 299, 0, 782, 0, 782, 782,
2838 0, 291, 771, 0, 335, 295, 700, 771, 285, 782,
2839 771, 782, 284, 771, 340, 58, 23, 25, 24, 0,
2840 337, 0, 0, 0, 0, 0, 782, 0, 771, 328,
2841 14, 0, 94, 771, 325, 331, 777, 776, 274, 777,
2842 276, 332, 746, 0, 120, 645, 111, 106, 675, 0,
2843 0, 782, 0, 450, 625, 643, 628, 626, 620, 602,
2844 603, 622, 604, 624, 0, 0, 0, 0, 0, 781,
2845 7, 27, 28, 29, 30, 31, 56, 57, 706, 703,
2846 702, 701, 704, 712, 721, 700, 0, 733, 722, 737,
2847 736, 732, 782, 723, 698, 771, 682, 705, 707, 708,
2848 710, 684, 714, 719, 782, 725, 413, 412, 730, 684,
2849 735, 684, 739, 681, 0, 0, 0, 0, 0, 0,
2850 475, 474, 83, 0, 479, 0, 0, 271, 771, 0,
2851 99, 110, 0, 64, 237, 244, 246, 247, 248, 255,
2852 256, 249, 250, 226, 227, 253, 254, 61, 771, 241,
2853 242, 243, 232, 233, 234, 235, 236, 269, 270, 755,
2854 757, 756, 759, 468, 758, 294, 466, 771, 782, 755,
2855 757, 756, 759, 467, 294, 0, 782, 391, 0, 390,
2856 0, 0, 0, 0, 349, 0, 330, 0, 782, 0,
2857 73, 357, 131, 132, 133, 669, 355, 0, 782, 0,
2858 0, 0, 763, 764, 69, 755, 756, 294, 0, 0,
2859 0, 0, 0, 0, 0, 749, 305, 303, 298, 782,
2860 755, 756, 771, 755, 756, 0, 0, 748, 334, 773,
2861 279, 286, 281, 288, 339, 22, 0, 258, 10, 32,
2862 0, 782, 0, 20, 96, 17, 327, 771, 0, 104,
2863 760, 119, 771, 755, 756, 699, 629, 0, 605, 0,
2864 608, 0, 613, 610, 0, 0, 614, 238, 0, 411,
2865 403, 405, 771, 408, 401, 0, 680, 741, 674, 0,
2866 0, 0, 691, 713, 0, 679, 557, 724, 0, 694,
2867 734, 0, 696, 738, 47, 260, 0, 677, 49, 262,
2868 0, 472, 476, 0, 387, 388, 473, 480, 458, 302,
2869 34, 307, 0, 37, 306, 108, 102, 0, 54, 40,
2870 52, 0, 277, 300, 217, 35, 0, 320, 0, 0,
2871 0, 782, 782, 465, 86, 0, 471, 286, 782, 782,
2872 283, 464, 84, 282, 323, 382, 782, 782, 588, 782,
2873 392, 782, 347, 394, 74, 393, 348, 489, 0, 0,
2874 384, 0, 0, 760, 329, 771, 755, 756, 0, 0,
2875 0, 0, 131, 132, 135, 771, 0, 771, 0, 460,
2876 79, 41, 277, 218, 51, 225, 145, 752, 304, 292,
2877 782, 782, 471, 782, 782, 771, 782, 771, 224, 275,
2878 112, 471, 699, 451, 454, 630, 634, 635, 636, 627,
2879 637, 607, 609, 616, 612, 618, 771, 410, 0, 709,
2880 0, 740, 726, 415, 683, 711, 684, 684, 720, 725,
2881 782, 684, 731, 684, 708, 684, 0, 0, 362, 0,
2882 0, 364, 782, 80, 782, 310, 0, 0, 100, 0,
2883 782, 0, 0, 782, 0, 580, 586, 553, 0, 0,
2884 0, 527, 771, 524, 541, 619, 0, 579, 65, 498,
2885 504, 506, 508, 502, 501, 537, 503, 546, 549, 552,
2886 558, 559, 548, 511, 560, 512, 565, 566, 567, 570,
2887 571, 572, 573, 574, 576, 575, 577, 578, 556, 62,
2888 0, 0, 0, 87, 774, 782, 0, 0, 85, 589,
2889 590, 782, 591, 383, 385, 0, 11, 13, 595, 386,
2890 0, 0, 0, 395, 397, 0, 75, 490, 0, 353,
2891 0, 482, 0, 352, 471, 0, 0, 0, 0, 471,
2892 360, 744, 70, 461, 462, 0, 0, 782, 0, 0,
2893 280, 287, 338, 771, 0, 631, 402, 404, 406, 409,
2894 0, 687, 0, 689, 678, 0, 695, 0, 692, 697,
2895 48, 261, 50, 263, 771, 0, 439, 438, 0, 305,
2896 308, 36, 53, 0, 278, 755, 756, 771, 755, 756,
2897 568, 569, 132, 584, 0, 529, 771, 530, 534, 771,
2898 0, 523, 0, 0, 526, 540, 0, 581, 0, 582,
2899 0, 499, 0, 0, 547, 551, 563, 564, 0, 510,
2900 509, 0, 0, 555, 259, 46, 222, 45, 223, 0,
2901 43, 220, 44, 221, 0, 0, 593, 594, 0, 398,
2902 0, 345, 346, 0, 350, 483, 0, 0, 354, 0,
2903 670, 356, 0, 0, 442, 456, 0, 452, 632, 0,
2904 0, 684, 684, 684, 684, 782, 437, 771, 0, 708,
2905 421, 716, 717, 782, 728, 421, 421, 419, 477, 481,
2906 309, 471, 771, 521, 544, 532, 531, 522, 535, 619,
2907 771, 775, 554, 771, 505, 500, 537, 507, 538, 542,
2908 550, 545, 561, 562, 585, 520, 516, 771, 771, 771,
2909 771, 771, 771, 42, 219, 0, 592, 0, 663, 664,
2910 320, 0, 782, 0, 0, 495, 0, 484, 782, 358,
2911 453, 0, 0, 0, 0, 407, 688, 0, 685, 690,
2912 693, 418, 0, 440, 0, 422, 430, 428, 0, 715,
2913 0, 417, 0, 433, 0, 435, 528, 0, 536, 0,
2914 525, 583, 0, 0, 513, 514, 515, 517, 518, 519,
2915 330, 0, 782, 0, 782, 12, 782, 491, 0, 0,
2916 485, 487, 488, 486, 446, 771, 444, 447, 0, 455,
2917 0, 684, 441, 727, 420, 421, 421, 330, 0, 718,
2918 782, 421, 729, 421, 421, 533, 538, 539, 543, 760,
2919 329, 771, 755, 756, 587, 396, 0, 496, 497, 0,
2920 443, 457, 633, 686, 0, 425, 0, 427, 760, 329,
2921 416, 0, 434, 0, 431, 436, 0, 471, 782, 445,
2922 421, 421, 421, 421, 493, 494, 492, 426, 0, 423,
2923 429, 432, 421, 424
2924};
2925
2926/* YYPGOTO[NTERM-NUM]. */
2927static const yytype_int16 yypgoto[] =
2928{
2929 -1065, -1065, -1065, 976, -1065, 926, 763, -522, -1065, -28,
2930 -1065, 769, -1065, 39, -1065, -229, -542, -67, -1065, -1065,
2931 -1065, -1065, 414, 2325, 2587, -1065, -24, -77, -1065, -1065,
2932 -6, -1065, -424, 1029, -10, 1153, -153, 10, -75, -1065,
2933 -401, 7, 2986, -392, 1155, -56, -13, -1065, -1065, -4,
2934 -1065, 3847, -1065, 1171, -1065, 623, 2014, -1065, 675, 26,
2935 604, -360, 65, 16, -1065, -319, -203, 5, -1065, -457,
2936 -20, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2937 -1065, -1065, 917, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2938 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, 466, -1065,
2939 -430, 1837, -372, -1065, 42, -783, -1065, -799, -785, 547,
2940 401, -92, 154, -1065, 250, -417, -1065, -1065, 383, -1065,
2941 -905, -1065, 43, 519, -1065, -1065, -1065, -1065, -1065, -1065,
2942 -1065, 449, -1065, -1065, -104, 712, -1065, -1065, -1065, 959,
2943 -1065, -1065, -1065, -1065, -773, -1065, 23, -1065, -1065, -1065,
2944 -1065, -1065, -722, -43, -1065, -1065, -1065, -1065, 253, -1065,
2945 -1065, -177, -1065, -702, -812, -939, -966, -898, -909, -1065,
2946 256, -1065, -1065, -632, 257, -1065, -782, 264, -1065, -1065,
2947 -1065, 101, -1065, -1065, 156, 562, 631, -1065, 1218, 736,
2948 1173, 1370, -1065, 836, 1486, -1065, 1719, 1813, -1065, -1065,
2949 -55, -1065, -1065, -179, -1065, -1065, -1065, -1065, -1065, -1065,
2950 -1065, 24, -1065, -1065, -1065, -1065, 27, -57, 2864, 14,
2951 1256, 3061, 1912, -1065, -1065, 63, 697, 57, -1065, -274,
2952 -500, -302, -194, -1012, -505, -313, -673, 235, -514, 624,
2953 164, -1065, -1065, -246, -1065, -706, -672, -1064, 170, 635,
2954 -1065, -541, -1065, -532, -540, -1065, -1065, -1065, 33, -394,
2955 -342, -336, -1065, -1065, -71, -1065, -14, 290, 243, -294,
2956 228, -188, -58, 1, -2
2957};
2958
2959/* YYDEFGOTO[NTERM-NUM]. */
2960static const yytype_int16 yydefgoto[] =
2961{
2962 0, 1, 2, 70, 71, 72, 248, 625, 1088, 626,
2963 265, 266, 477, 267, 469, 74, 769, 75, 597, 779,
2964 583, 778, 419, 218, 219, 828, 382, 384, 385, 976,
2965 78, 79, 572, 254, 81, 82, 268, 83, 84, 85,
2966 497, 86, 221, 402, 403, 203, 204, 205, 660, 612,
2967 207, 88, 471, 372, 89, 576, 223, 273, 774, 613,
2968 791, 457, 458, 236, 237, 225, 443, 618, 763, 764,
2969 90, 379, 272, 483, 686, 808, 635, 821, 819, 650,
2970 565, 568, 256, 92, 93, 94, 95, 96, 97, 98,
2971 99, 100, 101, 333, 336, 796, 965, 811, 970, 971,
2972 756, 257, 628, 804, 972, 973, 394, 720, 721, 722,
2973 723, 542, 729, 730, 1244, 1196, 1197, 1117, 1025, 1026,
2974 1103, 1235, 1236, 103, 293, 503, 705, 1004, 853, 1107,
2975 1182, 337, 104, 105, 334, 569, 570, 752, 892, 573,
2976 574, 757, 894, 982, 812, 1233, 809, 977, 1093, 1266,
2977 1296, 1174, 918, 1134, 920, 921, 1071, 1072, 922, 1052,
2978 1044, 1046, 1047, 1048, 924, 925, 1148, 1050, 926, 927,
2979 928, 929, 930, 543, 932, 933, 934, 935, 936, 937,
2980 938, 797, 961, 1085, 967, 106, 107, 108, 109, 110,
2981 111, 112, 514, 709, 113, 516, 114, 115, 515, 517,
2982 295, 299, 300, 508, 707, 706, 855, 1005, 1108, 1184,
2983 859, 116, 117, 296, 118, 119, 120, 121, 228, 229,
2984 124, 230, 231, 646, 820, 322, 323, 324, 325, 874,
2985 732, 545, 546, 547, 548, 884, 550, 551, 552, 553,
2986 1122, 1123, 554, 555, 556, 557, 558, 1124, 1125, 559,
2987 560, 561, 562, 563, 726, 422, 651, 278, 461, 233,
2988 127, 690, 616, 654, 649, 426, 311, 453, 454, 786,
2989 1054, 488, 629, 389, 270
2990};
2991
2992/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2993 positive, shift that token. If negative, reduce the rule whose
2994 number is the opposite. If YYTABLE_NINF, syntax error. */
2995static const yytype_int16 yytable[] =
2996{
2997 128, 427, 297, 294, 206, 298, 220, 220, 549, 644,
2998 342, 630, 549, 312, 735, 245, 123, 617, 975, 386,
2999 378, 226, 226, 566, 206, 264, 381, 381, 880, 451,
3000 381, 724, 208, 425, 614, 978, 614, 288, 240, 312,
3001 615, 73, 624, 746, 460, 420, 750, 544, 239, 232,
3002 232, 544, 208, 276, 280, 206, 677, 949, 875, 739,
3003 274, 742, 306, 269, 287, 288, 882, 123, 123, 1007,
3004 383, 291, 313, 387, 326, 326, 923, 923, 288, 288,
3005 288, 224, 234, 388, 614, 1009, 672, 490, 275, 279,
3006 657, 492, 220, 271, 305, 677, 332, 206, 699, 291,
3007 1049, -117, -122, 614, 1105, 614, 331, 226, 1135, 615,
3008 478, 624, 396, 406, 406, 406, 831, 834, -126, 1118,
3009 511, 513, 1146, 668, -126, 775, 1040, 1041, 826, 1060,
3010 1060, 668, 614, 614, 328, 232, 803, -665, 1252, 691,
3011 327, 702, 1060, 1140, 3, 758, 931, 931, 754, 1136,
3012 539, 711, -657, -123, 715, -782, 447, -130, 614, 627,
3013 614, 437, 1159, 1162, -128, 1149, 691, 423, 736, 1237,
3014 736, 642, -122, 242, 463, 643, 465, 321, 766, -128,
3015 -665, -657, 540, 1061, 264, 475, 737, 578, 1073, 241,
3016 877, 242, -113, 871, 242, 794, -544, 883, 627, 1106,
3017 -129, 802, 871, 806, -125, 712, 755, 312, 716, 496,
3018 1252, -117, 1192, 724, 867, -122, 326, 326, 502, -771,
3019 329, 473, 242, -122, 444, 220, 123, 220, 220, -127,
3020 444, -117, -113, -755, -117, 264, 462, -123, -117, -124,
3021 226, 1255, 226, 459, 247, 128, 1256, 381, 381, 381,
3022 381, 480, 526, 527, -117, 824, -755, 1237, 451, 1158,
3023 1161, 123, -755, 123, 288, -126, 481, -126, 232, 309,
3024 232, 310, -130, 269, 1257, 329, 328, 123, 815, 239,
3025 331, 438, 439, -114, 1152, 1153, 73, -121, 825, 677,
3026 521, 522, 523, 524, -119, 614, -756, 614, 291, 988,
3027 452, 1096, 455, 691, -129, 614, 309, 614, 310, 1149,
3028 495, 1007, 264, 691, 1149, 1258, 888, 243, 381, 246,
3029 891, 288, 639, -756, 1185, -116, -128, 123, -128, 312,
3030 -120, -125, 123, 641, -116, 710, 577, 710, 882, 960,
3031 1014, 577, 875, 328, 345, 309, 330, 310, 580, 249,
3032 269, 238, 73, 768, 123, 291, 631, 525, 633, -118,
3033 953, 632, 668, 724, 668, 724, 898, 220, 958, -115,
3034 -122, 1175, -122, 634, 622, 462, 1011, 1013, 842, 979,
3035 -127, 1016, 983, 1018, -123, 1019, -123, -124, 1258, 319,
3036 320, 923, 549, 123, -656, 1231, 990, 533, 123, -666,
3037 123, 330, -666, 854, 623, 1232, 449, 261, 851, 1075,
3038 1077, 369, 370, 371, 1080, 1082, -118, 534, 549, -130,
3039 931, -130, 622, -656, 496, 549, 1068, 577, 577, 768,
3040 768, 544, 931, 301, -123, -116, 220, -123, 577, 931,
3041 931, -130, 430, 622, 462, 302, 577, 577, 538, 539,
3042 -94, -129, 907, -129, -114, -116, 685, 444, -116, 444,
3043 335, 931, -116, 339, 1099, 206, 839, -771, 668, 1112,
3044 -108, 622, 534, 623, 577, 669, 242, -130, -125, 288,
3045 -125, 540, 1069, 1126, 464, 1070, 60, 845, 879, 476,
3046 476, 220, 1127, 208, 1250, 123, -115, -121, 622, 462,
3047 309, 623, 310, 538, 496, 1294, 1129, 1139, 747, 849,
3048 1121, 482, 788, 291, 242, 484, 504, 512, 1043, 697,
3049 303, 984, 875, 304, -129, -129, -118, -127, 623, -127,
3050 862, 989, 948, 948, -124, 862, -124, 1163, 504, 549,
3051 727, 338, 1091, 1037, -120, 1092, -118, -125, 1094, -118,
3052 1003, 843, 727, -118, 744, 1098, 844, 748, 1101, 288,
3053 614, 430, 614, 818, 487, 487, 615, -116, 624, 487,
3054 760, 493, 506, 507, 805, 1191, 770, 343, 544, 123,
3055 997, 762, 123, 1201, 827, 788, -125, 762, 319, 320,
3056 789, -127, 504, 291, 506, 507, -130, 1142, -658, 955,
3057 799, 504, 801, -659, 724, 724, -115, 677, 875, 429,
3058 1097, 1186, 1188, 1189, 1190, -124, 444, 642, 1051, 847,
3059 -125, 1042, 793, 850, 798, -127, -115, -658, 220, -115,
3060 -661, 784, -659, -115, -124, 622, 462, -660, 220, 789,
3061 792, 783, 123, 839, 123, 622, 462, 836, 506, 507,
3062 790, 374, 770, 770, 1246, 793, 206, 506, 507, -661,
3063 1238, 1253, 431, 1127, 123, 623, -660, 444, 871, 1179,
3064 1127, 963, 1127, 830, -127, 623, 1154, 964, 288, 375,
3065 424, 1121, 668, 790, 208, 241, 1121, 861, 1121, 793,
3066 1121, -369, 496, 433, -118, 678, 864, 549, 440, 955,
3067 680, -662, -653, 682, 441, 904, 684, 442, 1203, 1205,
3068 1280, 1119, 291, 1171, 846, 448, 783, 790, 1173, -369,
3069 -369, 694, 768, 768, 450, 993, 696, 768, 768, -329,
3070 -662, -653, 470, 1291, -124, 919, 919, 969, 964, -654,
3071 964, 1273, 1127, 1131, 1127, 374, 235, 288, 652, 1127,
3072 807, 1127, 1133, 381, -115, 1137, 486, -329, -329, 238,
3073 1121, 986, 1121, 242, 489, 345, 1127, 1121, -654, 1121,
3074 479, 242, 420, 375, 376, 1155, -369, 653, -93, 577,
3075 577, 291, 1269, 964, 1121, 810, 577, 577, 728, 242,
3076 985, 491, 947, 947, 962, 968, 987, 974, 485, 974,
3077 494, 762, 1227, 321, 768, 466, 948, 528, 1271, 529,
3078 530, 531, 532, 533, -329, 467, 468, -756, 948, 499,
3079 846, 765, 571, 374, 206, 948, 948, 374, 1275, 1277,
3080 377, 518, 123, 534, 1282, 123, 1284, 1285, 577, 577,
3081 564, 577, 577, 374, 444, 1066, 1067, 948, -672, 345,
3082 768, 375, 445, 567, -771, 375, 474, 536, 242, 1059,
3083 1056, 581, 1261, 519, 538, 539, 1217, 1218, 1219, 1045,
3084 636, 375, 500, 1297, 1299, 1300, 1301, -755, 727, 614,
3085 645, 614, 1119, 662, 1145, 1303, 1065, 691, 780, 1119,
3086 1027, 679, 1027, 220, 1157, 1160, 663, 540, 577, 640,
3087 622, 462, 350, 351, 381, 681, 614, 785, 446, -756,
3088 688, 123, 446, 123, 367, 368, 369, 370, 371, 91,
3089 -653, 504, 947, 947, 1228, 1229, 947, -663, 501, 1100,
3090 623, 683, 1115, 227, 227, -664, 1031, 1087, 1032, 689,
3091 -320, -414, 1089, 947, -108, 770, 770, 1090, -653, -653,
3092 770, 770, -654, 577, 879, -663, -663, 362, 363, 1086,
3093 698, 1119, 785, -664, -664, 869, 582, 1287, -320, -320,
3094 91, 91, 725, 881, 289, 505, 885, 506, 507, 123,
3095 -654, -654, 498, 498, 123, 227, 731, 487, 734, 738,
3096 740, 381, 785, 741, 743, 577, 751, 1128, 795, 767,
3097 123, 1132, 289, -755, 374, -653, 800, 787, -755, 807,
3098 227, 227, -663, 873, 227, 393, 404, 404, 1045, 227,
3099 -664, 810, -760, 863, 865, -320, 886, 770, 1045, 1045,
3100 868, 80, 375, 637, 1143, -756, 870, -654, 889, 123,
3101 -756, 893, 123, 897, -300, 80, 80, 896, 900, 899,
3102 919, 950, 658, 659, 1057, 954, 37, 38, 947, 40,
3103 1172, 947, 964, 664, 288, -760, 1001, 1010, 737, 1178,
3104 991, 675, 676, 770, 1012, 947, 947, 947, 1183, 1015,
3105 947, 947, 80, 80, 1209, 947, 947, 1017, 1000, 638,
3106 1002, 1024, -301, -760, -760, 1055, 1223, 80, 1169, 692,
3107 1062, 288, 123, 1115, 1058, 785, 1141, 947, 374, 1006,
3108 1115, 123, 1115, 727, 528, 785, 529, 530, 531, 532,
3109 123, 727, 80, 80, 1063, 1064, 80, 1084, 1109, 91,
3110 1110, 80, -303, 1138, 905, 406, 375, 647, 504, 1060,
3111 -330, 1180, 1187, 1224, 374, 1226, 1181, 1193, -760, 1220,
3112 -760, 963, 227, -755, 227, 227, 1240, 1242, 227, 1239,
3113 227, 381, 381, 1195, 91, 1200, 91, 1202, -330, -330,
3114 968, 374, 375, 902, 288, 1204, 974, -304, 1207, 1208,
3115 91, 1247, 1115, 1212, 1115, 123, 374, 123, 1213, 1115,
3116 1272, 1115, 509, 648, 506, 507, 123, 661, 123, 375,
3117 1221, 289, 785, 1053, 1267, 1268, 1115, 1274, 406, 1276,
3118 1281, 1283, 220, 1286, 375, 1248, -755, -756, 1298, 622,
3119 462, 947, 798, 472, 974, -330, 947, 947, 504, 903,
3120 91, 227, 227, 227, 227, 91, 227, 227, 1288, 520,
3121 693, 80, 992, 856, 857, 1111, 858, 1113, 727, 623,
3122 695, 391, 1114, 46, 47, 408, 1222, 91, 289, 1120,
3123 373, 829, 504, 966, 80, 866, 80, 80, 1265, 1008,
3124 80, 648, 80, 1194, 1116, 504, 80, 1028, 80, 994,
3125 123, 504, 509, 753, 506, 507, 974, 1142, 41, 42,
3126 43, 44, 80, 1104, 227, 575, 91, 917, 917, 504,
3127 947, 91, 227, 91, 528, 345, 529, 530, 531, 532,
3128 533, 1295, 1289, 1156, 1104, 1147, 509, 227, 506, 507,
3129 1150, 1151, 358, 359, 1144, 1264, 428, 785, 1225, 510,
3130 534, 506, 507, 833, 835, 708, 785, 506, 507, 785,
3131 939, 939, 80, 80, 80, 80, 80, 80, 80, 80,
3132 833, 835, 714, 713, 536, 506, 507, 421, 878, 785,
3133 537, 538, 539, 227, 1249, 1245, 876, 848, 1210, 80,
3134 367, 368, 369, 370, 371, 1206, 0, 1234, 345, 529,
3135 530, 531, 532, 0, 0, 528, 1211, 529, 530, 531,
3136 532, 0, 0, 0, 540, 358, 359, 541, 91, 0,
3137 1214, 1215, 1216, 0, 951, 952, 80, 1104, 80, 940,
3138 940, 956, 957, 80, 80, 80, 289, 0, 227, 0,
3139 0, 0, 1241, 0, 0, 0, 0, 917, 917, 80,
3140 1053, 917, 0, 0, 0, 718, 345, 1251, 0, 1254,
3141 364, 365, 366, 367, 368, 369, 370, 371, 917, 0,
3142 785, 785, 785, 358, 359, 0, 528, 0, 529, 530,
3143 531, 532, 0, 995, 996, 0, 998, 999, 0, 0,
3144 939, 939, 0, 0, 939, 80, 314, 315, 316, 317,
3145 318, 227, 91, 0, 227, 91, 0, 0, 0, 0,
3146 0, 939, 0, 227, 0, 0, 289, 0, 0, 776,
3147 366, 367, 368, 369, 370, 371, 718, 0, 0, 1290,
3148 80, 1292, 719, 0, 941, 941, 0, 0, 1293, 0,
3149 0, 0, 0, 1033, 0, 1270, 0, 0, 0, 0,
3150 80, 0, 0, 1302, 0, 0, 0, 0, 0, 940,
3151 940, 0, 0, 940, 0, 91, 0, 91, 0, 0,
3152 0, 785, 0, 0, 0, 227, 0, 0, 0, 0,
3153 940, 0, 0, 917, 0, 227, 917, 91, 227, 0,
3154 0, 0, 0, 0, 0, 776, 776, 0, 1079, 0,
3155 917, 917, 917, 0, 0, 917, 917, 0, 0, 0,
3156 917, 917, 0, 80, 80, 0, 80, 80, 0, 0,
3157 0, 0, 0, 227, 0, 80, 939, 0, 0, 939,
3158 0, 80, 917, 0, 0, 289, 0, 0, 0, 0,
3159 1102, 0, 0, 939, 939, 939, 1076, 1078, 939, 939,
3160 0, 1081, 1083, 939, 939, 0, 0, 0, 0, 0,
3161 0, 0, 0, 0, 941, 941, 0, 0, 941, 0,
3162 0, 0, 0, 0, 0, 939, 0, 80, 0, 80,
3163 0, 0, 0, 0, 0, 941, 0, 80, 0, 0,
3164 1076, 1078, 0, 1081, 1083, 940, 0, 80, 940, 80,
3165 80, 0, 0, 0, 289, 0, 0, 80, 80, 0,
3166 0, 0, 940, 940, 940, 0, 0, 940, 940, 0,
3167 0, 0, 940, 940, 0, 0, 0, 0, 0, 0,
3168 0, 0, 0, 0, 0, 80, 0, 0, 0, 0,
3169 0, 0, 0, 0, 940, 0, 917, 0, 0, 0,
3170 0, 917, 917, 0, 0, 91, 0, 227, 91, 0,
3171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3172 0, 0, 0, 0, 1164, 0, 0, 0, 0, 0,
3173 0, 528, 0, 529, 530, 531, 532, 533, 0, 939,
3174 0, 0, 0, 0, 939, 939, 0, 1164, 0, 0,
3175 941, 0, 0, 941, 0, 0, 0, 534, 0, 0,
3176 0, 0, 0, 0, 0, 0, 0, 941, 941, 941,
3177 0, 535, 941, 941, 0, 917, 0, 941, 941, 0,
3178 0, 536, 0, 0, 91, 0, 91, 0, 538, 539,
3179 227, 0, 0, 0, 0, 0, 0, 0, 0, 941,
3180 0, 0, 0, 0, 0, 0, 0, 0, 940, 102,
3181 0, 0, 0, 940, 940, 0, 0, 80, 939, 80,
3182 80, 540, 0, 102, 102, 0, 0, 0, 0, 0,
3183 0, 0, 0, 0, 0, 0, 0, 0, 776, 776,
3184 0, 0, 0, 776, 776, 0, 0, 0, 0, 0,
3185 0, 0, 91, 0, 0, 0, 0, 91, 227, 0,
3186 102, 102, 0, 0, 0, 0, 0, 0, 0, 0,
3187 0, 0, 0, 91, 0, 102, 0, 0, 0, 0,
3188 0, 0, 0, 0, 126, 0, 0, 940, 0, 0,
3189 0, 0, 0, 0, 0, 0, 80, 0, 80, 0,
3190 102, 102, 80, 0, 102, 0, 0, 0, 0, 102,
3191 0, 0, 91, 941, 0, 91, 0, 0, 941, 941,
3192 776, 942, 942, 0, 0, 0, 0, 0, 0, 0,
3193 0, 23, 24, 25, 26, 126, 126, 0, 0, 292,
3194 0, 0, 0, 0, 0, 227, 0, 32, 33, 34,
3195 80, 80, 0, 0, 0, 80, 80, 41, 42, 43,
3196 44, 45, 0, 0, 80, 0, 776, 292, 0, 80,
3197 80, 1167, 0, 0, 0, 91, 0, 0, 0, 0,
3198 397, 407, 407, 0, 91, 80, 0, 0, 0, 0,
3199 0, 0, 941, 91, 0, 0, 0, 0, 0, 0,
3200 0, 0, 0, 0, 0, 0, 0, 0, 1199, 58,
3201 59, 60, 61, 62, 63, 64, 65, 66, 0, 102,
3202 0, 0, 0, 0, 80, 0, 0, 80, 0, 0,
3203 0, 0, 80, 0, 0, 0, 0, 0, 0, 0,
3204 277, 0, 102, 0, 102, 102, 283, 0, 102, 0,
3205 102, 942, 942, 0, 102, 942, 102, 80, 91, 0,
3206 91, 0, 0, 0, 0, 0, 0, 0, 0, 91,
3207 102, 91, 942, 0, 0, 0, 0, 0, 80, 0,
3208 0, 1243, 0, 0, 0, 0, 528, 80, 529, 530,
3209 531, 532, 533, 0, 126, 0, 80, 0, 0, 0,
3210 0, 0, 0, 0, 0, 80, 0, 0, 0, 227,
3211 0, 0, 534, 0, 0, 227, 227, 0, 943, 943,
3212 102, 102, 102, 102, 102, 102, 102, 102, 0, 126,
3213 0, 126, 0, 0, 0, 0, 536, 0, 0, 0,
3214 0, 0, 537, 538, 539, 126, 0, 102, 0, 0,
3215 0, 0, 0, 91, 0, 0, 0, 0, 0, 0,
3216 0, 0, 0, 0, 0, 0, 292, 0, 0, 0,
3217 80, 0, 80, 0, 0, 0, 540, 0, 0, 541,
3218 0, 80, 0, 80, 102, 0, 102, 942, 0, 0,
3219 942, 102, 102, 102, 432, 126, 242, 434, 435, 436,
3220 126, 0, 0, 0, 942, 942, 942, 102, 0, 942,
3221 942, 0, 0, 0, 942, 942, 0, 0, 0, 344,
3222 0, 80, 126, 292, 0, 0, 0, 80, 80, 0,
3223 0, 0, 0, 0, 944, 944, 942, 0, 0, 0,
3224 0, 0, 0, 0, 0, 0, 0, 0, 943, 943,
3225 0, 0, 943, 102, 0, 0, 0, 0, 0, 0,
3226 0, 126, 0, 0, 0, 80, 126, 0, 126, 943,
3227 0, 0, 345, 346, 347, 348, 349, 350, 351, 352,
3228 353, 354, 355, 356, 357, 0, 0, 0, 102, 358,
3229 359, 0, 0, 0, 0, 360, 0, 76, 0, 0,
3230 0, 0, 0, 0, 0, 0, 0, 0, 102, 0,
3231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3232 528, 0, 529, 530, 531, 532, 533, 0, 0, 0,
3233 361, 0, 362, 363, 364, 365, 366, 367, 368, 369,
3234 370, 371, 0, 0, 0, 0, 534, 0, 76, 76,
3235 942, 0, 285, 0, 0, 942, 942, 0, 0, 0,
3236 535, 0, 0, 126, 944, 944, 0, 0, 944, 0,
3237 536, 102, 102, 0, 102, 102, 537, 538, 539, 0,
3238 285, 292, 0, 102, 943, 944, 0, 943, 0, 102,
3239 0, 0, 0, 285, 285, 285, 0, 0, 0, 0,
3240 0, 943, 943, 943, 0, 0, 943, 943, 0, 0,
3241 540, 943, 943, 541, 345, 346, 347, 348, 349, 350,
3242 351, 352, 0, 354, 355, 665, 667, 0, 0, 942,
3243 0, 358, 359, 943, 277, 102, 0, 102, 0, 0,
3244 0, 0, 0, 0, 0, 102, 0, 126, 0, 0,
3245 126, 0, 0, 0, 0, 102, 0, 102, 102, 0,
3246 0, 292, 0, 0, 777, 102, 102, 945, 945, 0,
3247 667, 0, 0, 277, 362, 363, 364, 365, 366, 367,
3248 368, 369, 370, 371, 0, 0, 0, 0, 0, 0,
3249 0, 0, 0, 102, 0, 0, 0, 0, 0, 0,
3250 944, 0, 0, 944, 0, 0, 0, 76, 0, 0,
3251 126, 0, 126, 0, 0, 0, 0, 944, 944, 944,
3252 0, 0, 944, 944, 0, 0, 0, 944, 944, 0,
3253 0, 0, 126, 0, 0, 0, 733, 0, 0, 0,
3254 777, 777, 76, 0, 76, 0, 0, 943, 0, 944,
3255 0, 0, 943, 943, 0, 0, 0, 0, 76, 77,
3256 761, 946, 946, 0, 0, 0, 773, 0, 0, 0,
3257 0, 0, 0, 0, 0, 0, 0, 0, 0, 285,
3258 292, 0, 0, 0, 0, 0, 0, 0, 0, 860,
3259 0, 0, 0, 0, 0, 0, 0, 945, 945, 0,
3260 0, 945, 0, 0, 0, 0, 0, 0, 76, 0,
3261 77, 77, 0, 76, 286, 0, 0, 0, 945, 0,
3262 0, 0, 0, 0, 0, 102, 943, 102, 102, 0,
3263 0, 0, 0, 0, 0, 76, 285, 0, 0, 0,
3264 0, 0, 286, 0, 0, 837, 0, 0, 0, 292,
3265 838, 0, 0, 0, 0, 286, 286, 286, 0, 0,
3266 0, 0, 0, 944, 0, 667, 0, 277, 944, 944,
3267 0, 0, 0, 0, 76, 0, 0, 0, 0, 76,
3268 0, 76, 0, 0, 0, 0, 0, 0, 0, 0,
3269 0, 946, 946, 0, 0, 946, 0, 0, 0, 0,
3270 126, 0, 0, 126, 102, 0, 102, 0, 0, 0,
3271 102, 0, 946, 872, 0, 0, 0, 0, 0, 0,
3272 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3273 0, 0, 0, 945, 0, 0, 945, 0, 0, 0,
3274 0, 0, 944, 895, 0, 0, 0, 0, 0, 0,
3275 945, 945, 945, 0, 0, 945, 945, 0, 102, 102,
3276 945, 945, 0, 102, 102, 0, 0, 0, 0, 77,
3277 0, 667, 102, 0, 0, 0, 76, 102, 102, 126,
3278 959, 126, 945, 0, 0, 0, 0, 0, 0, 0,
3279 0, 0, 0, 102, 285, 981, 0, 0, 0, 0,
3280 0, 0, 0, 0, 77, 0, 77, 0, 0, 0,
3281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3282 77, 0, 0, 0, 0, 0, 0, 946, 0, 0,
3283 946, 0, 102, 777, 777, 102, 122, 0, 777, 777,
3284 102, 286, 0, 0, 946, 946, 946, 126, 0, 946,
3285 946, 0, 126, 0, 946, 946, 0, 0, 0, 0,
3286 76, 0, 0, 76, 0, 102, 0, 0, 126, 0,
3287 77, 0, 0, 0, 285, 77, 946, 76, 0, 0,
3288 1030, 0, 0, 0, 0, 0, 102, 122, 122, 0,
3289 0, 290, 0, 0, 0, 102, 945, 77, 286, 0,
3290 0, 945, 945, 0, 102, 0, 0, 126, 0, 0,
3291 126, 0, 0, 102, 0, 777, 0, 0, 0, 290,
3292 0, 0, 0, 76, 0, 76, 0, 0, 0, 0,
3293 0, 0, 395, 405, 405, 405, 77, 0, 0, 0,
3294 0, 77, 0, 77, 0, 76, 0, 0, 0, 0,
3295 0, 0, 0, 76, 76, 0, 0, 0, 87, 0,
3296 0, 777, 0, 0, 1095, 0, 1170, 0, 0, 0,
3297 126, 0, 0, 0, 0, 945, 0, 0, 102, 126,
3298 102, 0, 0, 0, 0, 277, 0, 0, 126, 102,
3299 946, 102, 0, 285, 0, 946, 946, 0, 0, 0,
3300 0, 0, 528, 407, 529, 530, 531, 532, 533, 87,
3301 87, 0, 0, 1130, 0, 0, 0, 0, 0, 0,
3302 0, 0, 0, 0, 0, 0, 0, 0, 534, 102,
3303 0, 0, 0, 125, 0, 102, 102, 0, 77, 0,
3304 0, 0, 535, 0, 0, 0, 122, 0, 0, 0,
3305 0, 0, 536, 126, 392, 126, 286, 0, 537, 538,
3306 539, 0, 285, 0, 126, 0, 126, 0, 0, 946,
3307 0, 0, 0, 102, 0, 0, 407, 0, 0, 0,
3308 1177, 122, 0, 122, 125, 125, 0, 0, 0, 0,
3309 0, 0, 540, 0, 0, 541, 0, 122, 0, 0,
3310 0, 0, 0, 0, 0, 0, 0, 852, 0, 0,
3311 0, 0, 0, 76, 0, 0, 76, 0, 290, 0,
3312 0, 0, 77, 0, 0, 77, 0, 0, 0, 0,
3313 0, 0, 0, 0, 0, 0, 286, 0, 0, 77,
3314 0, 0, 0, 0, 0, 0, 0, 122, 126, 0,
3315 0, 0, 122, 0, 0, 0, 0, 0, 0, 0,
3316 1230, 0, 0, 0, 0, 0, 0, 0, 87, 0,
3317 0, 0, 0, 0, 122, 290, 0, 0, 0, 0,
3318 0, 0, 0, 0, 0, 77, 0, 77, 0, 0,
3319 901, 0, 76, 0, 76, 0, 0, 0, 0, 0,
3320 0, 0, 0, 87, 0, 87, 0, 77, 0, 0,
3321 0, 0, 0, 122, 0, 77, 77, 0, 122, 87,
3322 122, 0, 0, 0, 345, 346, 347, 348, 349, 350,
3323 351, 352, 353, 354, 355, 356, 357, 0, 0, 0,
3324 0, 358, 359, 125, 0, 0, 76, 76, 0, 0,
3325 0, 76, 76, 0, 0, 286, 0, 0, 0, 0,
3326 76, 0, 0, 0, 0, 76, 0, 0, 0, 87,
3327 0, 0, 0, 0, 87, 0, 0, 0, 125, 0,
3328 125, 76, 361, 0, 362, 363, 364, 365, 366, 367,
3329 368, 369, 370, 371, 125, 0, 87, 0, 0, 0,
3330 0, -272, 0, 0, 0, 0, 0, 0, 0, 0,
3331 0, 0, 0, 0, 0, 122, 0, 0, 0, 0,
3332 76, 0, 0, 76, 286, 0, 0, 0, 76, 0,
3333 0, 0, 0, 290, 0, 87, 0, 0, 0, 0,
3334 87, 0, 87, 0, 125, 0, 0, 0, 0, 125,
3335 0, 0, 0, 0, 0, 0, 0, 0, 0, 345,
3336 -783, -783, -783, -783, 350, 351, 0, 0, -783, -783,
3337 0, 125, 0, 0, 76, 77, 358, 359, 77, 285,
3338 0, 0, 0, 76, 0, 0, 0, 0, 0, 0,
3339 0, 0, 76, 0, 0, 0, 0, 0, 0, 122,
3340 0, 76, 122, 0, 0, 0, 0, 0, 0, 0,
3341 125, 0, 0, 290, 0, 125, 285, 125, 0, 362,
3342 363, 364, 365, 366, 367, 368, 369, 370, 371, 0,
3343 345, 346, 347, 348, 349, 350, 351, 87, 0, 354,
3344 355, 0, 0, 0, 0, 0, 0, 358, 359, 0,
3345 0, 0, 0, 0, 77, 0, 77, 0, 0, 0,
3346 0, 0, 122, 0, 122, 0, 76, 0, 76, 0,
3347 0, 0, 0, 0, 0, 0, 0, 76, 0, 76,
3348 0, 0, 0, 0, 122, 0, 0, 0, 0, 285,
3349 362, 363, 364, 365, 366, 367, 368, 369, 370, 371,
3350 0, 0, 0, 0, 0, 0, 0, 0, 77, 77,
3351 0, 0, 125, 77, 77, 0, 0, 0, 0, 0,
3352 0, 87, 77, 0, 87, 0, 0, 77, 887, 0,
3353 0, 0, 290, 0, 0, 0, 0, 0, 771, 0,
3354 0, 0, 0, 77, 0, 0, 0, 0, 0, 0,
3355 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3356 0, 76, 345, 346, 347, 348, 349, 350, 351, 352,
3357 353, 354, 355, 356, 357, 0, 0, 0, 0, 358,
3358 359, 0, 77, 0, 87, 77, 87, 0, 0, 0,
3359 77, 0, 0, 0, 0, 0, 125, 0, 0, 125,
3360 0, 290, 0, 0, 0, 0, 87, 0, 0, 0,
3361 0, 0, 0, 125, 771, 771, 0, 0, 0, 0,
3362 361, 0, 362, 363, 364, 365, 366, 367, 368, 369,
3363 370, 371, 0, 0, 0, 0, 77, 0, 0, 0,
3364 0, 286, 0, 0, 0, 77, 0, 0, 0, 0,
3365 0, 0, 122, 0, 77, 122, 0, -782, 0, 125,
3366 0, 125, 0, 77, 0, -782, -782, -782, 890, 0,
3367 -782, -782, -782, 0, -782, 0, 0, 0, 286, 0,
3368 0, 125, -782, -782, -782, 0, 0, 0, 0, 125,
3369 125, 0, 0, 0, -782, -782, 0, -782, -782, -782,
3370 -782, -782, 345, 346, 347, 348, 349, 350, 351, 352,
3371 353, 354, 355, 356, 357, 0, 0, 0, 0, 358,
3372 359, 0, 0, 0, 0, -782, -782, 0, 77, 0,
3373 77, 122, 0, 122, 0, 0, 0, 0, 0, 77,
3374 0, 77, 0, 0, 0, 901, 0, 0, 0, 0,
3375 0, 286, 0, 0, -782, -782, 0, 0, 0, 0,
3376 361, 0, 362, 363, 364, 365, 366, 367, 368, 369,
3377 370, 371, 0, 0, 87, 0, 0, 87, -782, 345,
3378 346, 347, 348, 349, 350, 351, 352, 353, 354, 355,
3379 356, 357, 0, 0, 0, 0, 358, 359, 0, 122,
3380 0, 0, 0, 0, 122, 0, 0, 0, 0, -782,
3381 -782, 0, 0, 0, 238, -782, 0, -782, 0, -782,
3382 122, 0, 0, 77, 0, 0, 0, 0, 0, 0,
3383 0, 0, 0, 222, 222, 0, 0, 361, 0, 362,
3384 363, 364, 365, 366, 367, 368, 369, 370, 371, 125,
3385 0, 0, 125, 87, 0, 87, 0, 0, 0, 122,
3386 0, 0, 122, 0, 0, 255, 258, 259, 260, 0,
3387 0, 0, 222, 222, 0, 0, 0, 0, 0, 0,
3388 0, 0, 0, 0, 0, 307, 308, 0, 0, 0,
3389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3390 0, 0, 0, 0, 0, 0, 0, 771, 771, 0,
3391 0, 0, 771, 771, 0, 0, 0, 0, 1168, 222,
3392 0, 87, 122, 0, 0, 0, 87, 0, 125, 0,
3393 125, 122, 0, 0, 0, 0, 0, 0, 0, 0,
3394 122, 0, 87, 0, 0, 0, 0, 0, 0, 0,
3395 0, 0, 0, 0, 0, 405, 0, 0, 0, 0,
3396 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3398 0, 87, 125, 125, 87, 0, 0, 125, 125, 771,
3399 0, 0, 0, 0, 0, 0, 125, 0, 0, 0,
3400 0, 125, 0, 0, 0, 122, 0, 122, 0, 0,
3401 0, 0, 0, 0, 0, 0, 122, 125, 122, 0,
3402 0, 0, 0, 0, 0, 0, 0, 222, 405, 0,
3403 222, 222, 222, 0, 307, 771, 0, 0, 0, 0,
3404 1166, 0, 0, 0, 87, 0, 0, 0, 0, 0,
3405 0, 0, 222, 87, 222, 222, 125, 0, 0, 125,
3406 0, 0, 87, 0, 125, 0, 0, 0, 0, 0,
3407 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3408 0, 0, 0, 0, 345, 346, 347, 348, 349, 350,
3409 351, 352, 353, 354, 355, 356, 357, 0, 0, 0,
3410 122, 358, 359, 0, 0, 0, 0, 0, 0, 0,
3411 125, 0, 0, 0, 0, 0, 0, 0, 0, 125,
3412 0, 0, 0, 0, 0, 0, 0, 87, 125, 87,
3413 0, 0, 0, 0, 0, 0, 0, 125, 87, 0,
3414 87, 0, 361, 0, 362, 363, 364, 365, 366, 367,
3415 368, 369, 370, 371, 0, 0, 0, 0, 0, 0,
3416 0, 0, 584, 585, 586, 587, 588, 0, 242, 589,
3417 590, 591, 592, 593, 594, 595, 596, 0, 598, 0,
3418 0, 599, 600, 601, 602, 603, 604, 605, 606, 607,
3419 608, 0, 0, 0, 222, 0, 0, 0, 0, 0,
3420 0, 0, 125, 0, 125, 0, 0, 0, 0, 0,
3421 0, 0, 0, 125, 0, 125, 0, 0, 0, 0,
3422 0, 0, 87, 0, 0, 0, 0, 0, 0, 0,
3423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3425 0, 0, 0, 0, 0, 0, 0, 0, 222, 222,
3426 0, 0, 0, 222, 0, 0, 0, 222, 0, 0,
3427 0, 0, 0, 260, 0, 0, 0, 0, 0, 0,
3428 0, 0, 0, 0, 0, 0, 0, 0, 687, 0,
3429 0, 0, 0, 0, 0, 0, 0, 125, 0, 0,
3430 0, 0, 0, 222, 0, 0, 222, 0, 0, 0,
3431 0, 0, 0, 0, 0, 0, 0, 0, 222, 0,
3432 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3433 0, 0, 0, 0, 0, 717, 0, 0, 0, 0,
3434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3435 0, 0, 0, 0, 0, -782, 4, 0, 5, 6,
3436 7, 8, 9, 0, 0, 0, 10, 11, 0, 222,
3437 0, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3438 0, 745, 0, 0, 749, 20, 21, 22, 23, 24,
3439 25, 26, 0, 222, 27, 0, 0, 0, 0, 772,
3440 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
3441 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3442 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3443 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3444 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3445 0, 0, 0, 0, 52, 222, 0, 53, 54, 0,
3446 55, 56, 0, 57, 0, 222, 58, 59, 60, 61,
3447 62, 63, 64, 65, 66, 832, 832, 0, 222, 745,
3448 749, 832, 0, 222, 0, 0, 0, 0, 0, 0,
3449 0, 0, 832, 832, 0, 0, 0, 0, 222, 0,
3450 222, 0, 0, 67, 68, 69, 0, 0, 0, 832,
3451 -760, 0, 0, 0, 0, -782, 0, -782, -760, -760,
3452 -760, 0, 0, -760, -760, -760, 0, -760, 0, 0,
3453 0, 0, 0, 0, 0, -760, -760, -760, -760, -760,
3454 0, 0, 0, 0, 0, 0, 222, -760, -760, 0,
3455 -760, -760, -760, -760, -760, 0, 0, 0, 0, 0,
3456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3457 0, 0, 0, 0, 0, 0, 222, 0, -760, -760,
3458 0, 0, 0, 0, 0, 0, 0, 0, -760, -760,
3459 -760, -760, -760, -760, -760, -760, -760, -760, -760, -760,
3460 -760, 0, 0, 0, 222, -760, -760, -760, -760, 0,
3461 840, -760, 0, 222, 0, 0, 0, -760, 0, 0,
3462 0, 0, 0, 0, 0, 0, 0, 0, 222, 0,
3463 0, -760, 0, 0, -760, 0, 0, 0, 0, 0,
3464 0, 0, 0, 0, 0, -126, -760, -760, -760, -760,
3465 -760, -760, -760, -760, -760, -760, -760, -760, 0, 0,
3466 0, 0, -760, -760, -760, -760, 0, 0, -760, -760,
3467 -760, 0, -760, 345, 346, 347, 348, 349, 350, 351,
3468 352, 353, 354, 355, 356, 357, 0, 0, 0, 0,
3469 358, 359, 0, 0, 0, 0, 0, 0, 0, 0,
3470 0, 0, 0, 1020, 1021, 0, 1022, 1023, 0, 0,
3471 0, 0, 0, 222, 0, 0, 0, 0, 1034, 0,
3472 222, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3473 0, 361, 0, 362, 363, 364, 365, 366, 367, 368,
3474 369, 370, 371, 0, 0, 0, 0, 0, 0, 0,
3475 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3476 0, 0, 0, 0, 0, 0, 0, 1074, 832, 832,
3477 0, 0, 0, 832, 832, 0, 0, 0, 0, 0,
3478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3479 0, 0, 0, 0, -653, 0, 0, 222, 0, 0,
3480 0, 0, -653, -653, -653, 0, 0, -653, -653, -653,
3481 0, -653, 832, 832, 0, 832, 832, 0, 222, -653,
3482 0, -653, -653, -653, 0, 0, 0, 0, 0, 0,
3483 0, -653, -653, 0, -653, -653, -653, -653, -653, 0,
3484 0, 0, 0, 0, 0, 0, 222, 0, 0, 0,
3485 832, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3486 0, 0, -653, -653, 0, 0, 0, 0, 0, 0,
3487 0, 0, -653, -653, -653, -653, -653, -653, -653, -653,
3488 -653, -653, -653, -653, -653, 0, 0, 0, 0, -653,
3489 -653, -653, -653, 0, -653, -653, 832, 0, 0, 0,
3490 0, -653, 0, 0, 0, 0, 0, 0, 0, 0,
3491 0, 0, 0, 222, 0, -653, 0, 0, -653, 832,
3492 0, 0, 0, 0, 0, 0, 0, 0, 0, -653,
3493 -653, -653, -653, -653, -653, -653, -653, -653, -653, -653,
3494 -653, -653, 0, 0, 0, 0, 0, -653, -653, -653,
3495 0, 0, -653, -653, -653, 0, -653, 0, 0, 0,
3496 0, 0, -654, 0, 0, 0, 0, 0, 0, 0,
3497 -654, -654, -654, 0, 0, -654, -654, -654, 0, -654,
3498 0, 0, 0, 0, 0, 0, 0, -654, 0, -654,
3499 -654, -654, 0, 222, 0, 0, 0, 0, 0, -654,
3500 -654, 0, -654, -654, -654, -654, -654, 0, 0, 0,
3501 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
3502 355, -783, -783, 0, 0, 0, 0, 358, 359, 0,
3503 -654, -654, 0, 0, 0, 0, 0, 0, 0, 222,
3504 -654, -654, -654, -654, -654, -654, -654, -654, -654, -654,
3505 -654, -654, -654, 0, 0, 0, 0, -654, -654, -654,
3506 -654, 0, -654, -654, 0, 0, 0, 0, 0, -654,
3507 362, 363, 364, 365, 366, 367, 368, 369, 370, 371,
3508 0, 0, 0, -654, 0, 0, -654, 0, 0, 0,
3509 0, 0, 0, 0, 0, 0, 0, -654, -654, -654,
3510 -654, -654, -654, -654, -654, -654, -654, -654, -654, -654,
3511 0, 0, 0, 0, 0, -654, -654, -654, -761, 0,
3512 -654, -654, -654, 0, -654, 0, -761, -761, -761, 0,
3513 0, -761, -761, -761, 0, -761, 0, 0, 0, 0,
3514 0, 0, 0, -761, -761, -761, -761, -761, 0, 0,
3515 0, 0, 0, 0, 0, -761, -761, 0, -761, -761,
3516 -761, -761, -761, 0, 0, 0, 0, 0, 0, 0,
3517 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3518 0, 0, 0, 0, 0, 0, -761, -761, 0, 0,
3519 0, 0, 0, 0, 0, 0, -761, -761, -761, -761,
3520 -761, -761, -761, -761, -761, -761, -761, -761, -761, 0,
3521 0, 0, 0, -761, -761, -761, -761, 0, 0, -761,
3522 0, 0, 0, 0, 0, -761, 0, 0, 0, 0,
3523 0, 0, 0, 0, 0, 0, 0, 0, 0, -761,
3524 0, 0, -761, 0, 0, 0, 0, 0, 0, 0,
3525 0, 0, 0, 0, -761, -761, -761, -761, -761, -761,
3526 -761, -761, -761, -761, -761, -761, 0, 0, 0, 0,
3527 -761, -761, -761, -761, -762, 0, -761, -761, -761, 0,
3528 -761, 0, -762, -762, -762, 0, 0, -762, -762, -762,
3529 0, -762, 0, 0, 0, 0, 0, 0, 0, -762,
3530 -762, -762, -762, -762, 0, 0, 0, 0, 0, 0,
3531 0, -762, -762, 0, -762, -762, -762, -762, -762, 0,
3532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3534 0, 0, -762, -762, 0, 0, 0, 0, 0, 0,
3535 0, 0, -762, -762, -762, -762, -762, -762, -762, -762,
3536 -762, -762, -762, -762, -762, 0, 0, 0, 0, -762,
3537 -762, -762, -762, 0, 0, -762, 0, 0, 0, 0,
3538 0, -762, 0, 0, 0, 0, 0, 0, 0, 0,
3539 0, 0, 0, 0, 0, -762, 0, 0, -762, 0,
3540 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3541 -762, -762, -762, -762, -762, -762, -762, -762, -762, -762,
3542 -762, -762, 0, 0, 0, 0, -762, -762, -762, -762,
3543 -329, 0, -762, -762, -762, 0, -762, 0, -329, -329,
3544 -329, 0, 0, -329, -329, -329, 0, -329, 0, 0,
3545 0, 0, 0, 0, 0, -329, 0, -329, -329, -329,
3546 0, 0, 0, 0, 0, 0, 0, -329, -329, 0,
3547 -329, -329, -329, -329, -329, 0, 0, 0, 0, 0,
3548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3549 0, 0, 0, 0, 0, 0, 0, 0, -329, -329,
3550 0, 0, 0, 0, 0, 0, 0, 0, -329, -329,
3551 -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
3552 -329, 0, 0, 0, 0, -329, -329, -329, -329, 0,
3553 841, -329, 0, 0, 0, 0, 0, -329, 0, 0,
3554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3555 0, -329, 0, 0, -329, 0, 0, 0, 0, 0,
3556 0, 0, 0, 0, 0, -128, -329, -329, -329, -329,
3557 -329, -329, -329, -329, -329, -329, -329, -329, 0, 0,
3558 0, 0, 0, -329, -329, -329, -470, 0, -329, -329,
3559 -329, 0, -329, 0, -470, -470, -470, 0, 0, -470,
3560 -470, -470, 0, -470, 0, 0, 0, 0, 0, 0,
3561 0, -470, -470, -470, -470, 0, 0, 0, 0, 0,
3562 0, 0, 0, -470, -470, 0, -470, -470, -470, -470,
3563 -470, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3564 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3565 0, 0, 0, 0, -470, -470, 0, 0, 0, 0,
3566 0, 0, 0, 0, -470, -470, -470, -470, -470, -470,
3567 -470, -470, -470, -470, -470, -470, -470, 0, 0, 0,
3568 0, -470, -470, -470, -470, 0, 0, -470, 0, 0,
3569 0, 0, 0, -470, 0, 0, 0, 0, 0, 0,
3570 0, 0, 0, 0, 0, 0, 0, -470, 0, 0,
3571 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3572 0, 0, -470, 0, -470, -470, -470, -470, -470, -470,
3573 -470, -470, -470, -470, 0, 0, 0, 0, -470, -470,
3574 -470, -470, -321, 238, -470, -470, -470, 0, -470, 0,
3575 -321, -321, -321, 0, 0, -321, -321, -321, 0, -321,
3576 0, 0, 0, 0, 0, 0, 0, -321, 0, -321,
3577 -321, -321, 0, 0, 0, 0, 0, 0, 0, -321,
3578 -321, 0, -321, -321, -321, -321, -321, 0, 0, 0,
3579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3580 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3581 -321, -321, 0, 0, 0, 0, 0, 0, 0, 0,
3582 -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
3583 -321, -321, -321, 0, 0, 0, 0, -321, -321, -321,
3584 -321, 0, 0, -321, 0, 0, 0, 0, 0, -321,
3585 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3586 0, 0, 0, -321, 0, 0, -321, 0, 0, 0,
3587 0, 0, 0, 0, 0, 0, 0, 0, -321, -321,
3588 -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
3589 0, 0, 0, 0, 0, -321, -321, -321, -782, 0,
3590 -321, -321, -321, 0, -321, 0, -782, -782, -782, 0,
3591 0, -782, -782, -782, 0, -782, 0, 0, 0, 0,
3592 0, 0, 0, -782, -782, -782, -782, 0, 0, 0,
3593 0, 0, 0, 0, 0, -782, -782, 0, -782, -782,
3594 -782, -782, -782, 0, 0, 0, 0, 0, 0, 0,
3595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3596 0, 0, 0, 0, 0, 0, -782, -782, 0, 0,
3597 0, 0, 0, 0, 0, 0, -782, -782, -782, -782,
3598 -782, -782, -782, -782, -782, -782, -782, -782, -782, 0,
3599 0, 0, 0, -782, -782, -782, -782, 0, 0, -782,
3600 0, 0, 0, 0, 0, -782, 0, 0, 0, 0,
3601 0, 0, 0, 0, 0, 0, 0, 0, 0, -782,
3602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3603 0, 0, 0, 0, -782, 0, -782, -782, -782, -782,
3604 -782, -782, -782, -782, -782, -782, 0, 0, 0, 0,
3605 -782, -782, -782, -782, -336, 238, -782, -782, -782, 0,
3606 -782, 0, -336, -336, -336, 0, 0, -336, -336, -336,
3607 0, -336, 0, 0, 0, 0, 0, 0, 0, -336,
3608 0, -336, -336, 0, 0, 0, 0, 0, 0, 0,
3609 0, -336, -336, 0, -336, -336, -336, -336, -336, 0,
3610 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3612 0, 0, -336, -336, 0, 0, 0, 0, 0, 0,
3613 0, 0, -336, -336, -336, -336, -336, -336, -336, -336,
3614 -336, -336, -336, -336, -336, 0, 0, 0, 0, -336,
3615 -336, -336, -336, 0, 0, -336, 0, 0, 0, 0,
3616 0, -336, 0, 0, 0, 0, 0, 0, 0, 0,
3617 0, 0, 0, 0, 0, -336, 0, 0, 0, 0,
3618 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3619 -336, 0, -336, -336, -336, -336, -336, -336, -336, -336,
3620 -336, -336, 0, 0, 0, 0, 0, -336, -336, -336,
3621 -760, 235, -336, -336, -336, 0, -336, 0, -760, -760,
3622 -760, 0, 0, 0, -760, -760, 0, -760, 0, 0,
3623 0, 0, 0, 0, 0, -760, -760, 0, 0, 0,
3624 0, 0, 0, 0, 0, 0, 0, -760, -760, 0,
3625 -760, -760, -760, -760, -760, 0, 0, 0, 0, 0,
3626 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3627 0, 0, 0, 0, 0, 0, 0, 0, -760, -760,
3628 0, 0, 0, 0, 0, 0, 0, 0, -760, -760,
3629 -760, -760, -760, -760, -760, -760, -760, -760, -760, -760,
3630 -760, 0, 0, 0, 0, -760, -760, -760, -760, 0,
3631 781, -760, 0, 0, 0, 0, 0, 0, 0, 0,
3632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3633 0, -760, 0, 0, 0, 0, 0, 0, 0, 0,
3634 0, 0, 0, 0, 0, -126, -760, 0, -760, -760,
3635 -760, -760, -760, -760, -760, -760, -760, -760, 0, 0,
3636 0, 0, -760, -760, -760, -117, -760, 0, -760, 0,
3637 -760, 0, -760, 0, -760, -760, -760, 0, 0, 0,
3638 -760, -760, 0, -760, 0, 0, 0, 0, 0, 0,
3639 0, -760, -760, 0, 0, 0, 0, 0, 0, 0,
3640 0, 0, 0, -760, -760, 0, -760, -760, -760, -760,
3641 -760, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3643 0, 0, 0, 0, -760, -760, 0, 0, 0, 0,
3644 0, 0, 0, 0, -760, -760, -760, -760, -760, -760,
3645 -760, -760, -760, -760, -760, -760, -760, 0, 0, 0,
3646 0, -760, -760, -760, -760, 0, 781, -760, 0, 0,
3647 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3648 0, 0, 0, 0, 0, 0, 0, -760, 0, 0,
3649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3650 0, -126, -760, 0, -760, -760, -760, -760, -760, -760,
3651 -760, -760, -760, -760, 0, 0, 0, 0, -760, -760,
3652 -760, -760, -329, 0, -760, 0, -760, 0, -760, 0,
3653 -329, -329, -329, 0, 0, 0, -329, -329, 0, -329,
3654 0, 0, 0, 0, 0, 0, 0, -329, 0, 0,
3655 0, 0, 0, 0, 0, 0, 0, 0, 0, -329,
3656 -329, 0, -329, -329, -329, -329, -329, 0, 0, 0,
3657 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3658 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3659 -329, -329, 0, 0, 0, 0, 0, 0, 0, 0,
3660 -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
3661 -329, -329, -329, 0, 0, 0, 0, -329, -329, -329,
3662 -329, 0, 782, -329, 0, 0, 0, 0, 0, 0,
3663 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3664 0, 0, 0, -329, 0, 0, 0, 0, 0, 0,
3665 0, 0, 0, 0, 0, 0, 0, -128, -329, 0,
3666 -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
3667 0, 0, 0, 0, 0, -329, -329, -119, -329, 0,
3668 -329, 0, -329, 0, -329, 0, -329, -329, -329, 0,
3669 0, 0, -329, -329, 0, -329, 0, 0, 0, 0,
3670 0, 0, 0, -329, 0, 0, 0, 0, 0, 0,
3671 0, 0, 0, 0, 0, -329, -329, 0, -329, -329,
3672 -329, -329, -329, 0, 0, 0, 0, 0, 0, 0,
3673 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3674 0, 0, 0, 0, 0, 0, -329, -329, 0, 0,
3675 0, 0, 0, 0, 0, 0, -329, -329, -329, -329,
3676 -329, -329, -329, -329, -329, -329, -329, -329, -329, 0,
3677 0, 0, 0, -329, -329, -329, -329, 0, 782, -329,
3678 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3679 0, 0, 0, 0, 0, 0, 0, 0, 0, -329,
3680 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3681 0, 0, 0, -128, -329, 0, -329, -329, -329, -329,
3682 -329, -329, -329, -329, -329, -329, 0, 0, 0, 0,
3683 0, -329, -329, -329, 0, 0, -329, 0, -329, 4,
3684 -329, 5, 6, 7, 8, 9, -782, -782, -782, 10,
3685 11, 0, 0, -782, 12, 0, 13, 14, 15, 16,
3686 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
3687 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3688 0, 0, 0, 28, 29, 262, 31, 32, 33, 34,
3689 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3690 44, 45, 46, 47, 0, 0, -782, 0, 0, 0,
3691 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3692 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3693 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3694 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3695 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3696 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
3697 -782, 10, 11, 0, -782, -782, 12, 0, 13, 14,
3698 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
3699 20, 21, 22, 23, 24, 25, 26, 0, -782, 27,
3700 -782, 0, 0, 0, 0, 28, 29, 262, 31, 32,
3701 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3702 42, 43, 44, 45, 46, 47, 0, 0, -782, 0,
3703 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3704 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3705 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3706 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3707 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3708 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
3709 0, 0, -782, 10, 11, 0, 0, -782, 12, -782,
3710 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
3711 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3712 -782, 27, -782, 0, 0, 0, 0, 28, 29, 262,
3713 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3714 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3715 -782, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3716 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3717 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3718 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3719 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3720 65, 66, 0, 0, 0, 4, 0, 5, 6, 7,
3721 8, 9, 0, 0, -782, 10, 11, 0, 0, -782,
3722 12, 0, 13, 14, 15, 16, 17, 18, 19, -782,
3723 67, 68, 69, 0, 20, 21, 22, 23, 24, 25,
3724 26, 0, -782, 27, -782, 0, 0, 0, 0, 28,
3725 29, 262, 31, 32, 33, 34, 35, 36, 37, 38,
3726 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3727 0, 0, -782, 0, 0, 0, 0, 0, 0, 0,
3728 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3729 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3730 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3731 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3732 63, 64, 65, 66, 0, 0, 0, 4, 0, 5,
3733 6, 7, 8, 9, 0, 0, -782, 10, 11, 0,
3734 0, -782, 12, 0, 13, 14, 15, 16, 17, 18,
3735 19, 0, 67, 68, 69, 0, 20, 21, 22, 23,
3736 24, 25, 26, 0, -782, 27, -782, 0, 0, 0,
3737 0, 28, 29, 262, 31, 32, 33, 34, 35, 36,
3738 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3739 46, 47, 0, 0, -782, 0, 0, 0, 0, 0,
3740 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3741 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3742 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
3743 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3744 61, 62, 63, 64, 65, 66, 0, 0, 0, 4,
3745 0, 5, 6, 7, 8, 9, 0, -782, -782, 10,
3746 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
3747 17, 18, 19, 0, 67, 68, 69, 0, 20, 21,
3748 22, 23, 24, 25, 26, 0, -782, 27, -782, 0,
3749 0, 0, 0, 28, 29, 262, 31, 32, 33, 34,
3750 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3751 44, 45, 46, 47, 0, 0, -782, 0, 0, 0,
3752 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3753 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3754 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3755 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3756 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3757 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
3758 -782, 10, 11, 0, 0, 0, 12, 0, 13, 14,
3759 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
3760 20, 21, 22, 23, 24, 25, 26, 0, -782, 27,
3761 -782, 0, 0, 0, 0, 28, 29, 262, 31, 32,
3762 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3763 42, 43, 44, 45, 46, 47, 0, 0, -782, 0,
3764 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3766 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3767 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3768 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3769 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
3770 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3771 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
3772 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3773 -782, 27, -782, 0, 0, 0, 0, 28, 29, 262,
3774 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3775 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3776 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3777 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3778 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3779 0, 52, 0, 0, 263, 54, 0, 55, 56, 0,
3780 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3781 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3782 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3783 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3784 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
3785 -782, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3786 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3787 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3788 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3789 0, 27, 0, 0, 0, 0, 0, 28, 29, 262,
3790 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3791 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3792 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3794 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3795 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3796 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3797 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3798 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3799 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3800 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
3801 -782, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3802 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3803 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3804 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3805 0, 27, 0, 0, 0, 0, 0, 28, 29, 30,
3806 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3807 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3808 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3810 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3811 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3812 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3813 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3814 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3815 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3816 67, 68, 69, 0, 0, -782, 0, 0, 0, 0,
3817 0, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3818 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3819 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3820 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3821 0, 27, 0, 0, 0, 0, 0, 28, 29, 262,
3822 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3823 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3824 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3825 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3826 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3827 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3828 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3829 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3832 67, 68, 69, 0, 0, -782, 0, 0, 0, 0,
3833 0, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3834 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3835 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3836 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3837 0, 27, 0, 0, 0, 0, 0, 28, 29, 262,
3838 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3839 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3840 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3842 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3843 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3844 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3845 65, 66, 0, -782, 0, 4, 0, 5, 6, 7,
3846 8, 9, 0, 0, 0, 10, 11, 0, 0, 0,
3847 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3848 67, 68, 69, 0, 20, 21, 22, 23, 24, 25,
3849 26, 0, -782, 27, -782, 0, 0, 0, 0, 28,
3850 29, 0, 31, 32, 33, 34, 35, 36, 37, 38,
3851 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3852 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3853 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3854 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3855 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3856 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3857 63, 64, 65, 66, 0, 0, 380, 0, 5, 6,
3858 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
3859 0, 12, -769, 13, 14, 15, 16, 17, 18, 19,
3860 0, 0, 67, 68, 69, 20, 21, 22, 23, 24,
3861 25, 26, -324, 0, 27, 0, -324, 0, 0, 0,
3862 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3863 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3864 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3865 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3866 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3867 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
3868 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
3869 62, 63, 64, 65, 66, 0, 0, -770, 4, 0,
3870 5, 6, 7, 8, 9, 0, 0, 0, 10, 11,
3871 0, 0, 0, 12, 0, 13, 14, 15, 16, 17,
3872 18, 19, 0, 67, 68, 69, 0, 20, 21, 22,
3873 23, 24, 25, 26, 0, 309, 27, 310, 0, 0,
3874 0, 0, 28, 29, 30, 31, 32, 33, 34, 35,
3875 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3876 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3877 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3878 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3879 0, 0, 0, 0, 0, 0, 52, 0, 0, 53,
3880 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3881 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3883 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3884 0, 0, 0, 0, 0, 67, 68, 69, 0, 0,
3885 -770, 0, 0, 0, 0, 0, 4, 519, 5, 6,
3886 7, 8, 9, -770, -770, -770, 10, 11, 0, -770,
3887 -770, 12, -770, 13, 14, 15, 16, 17, 18, 19,
3888 -770, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3889 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
3890 28, 29, 262, 31, 32, 33, 34, 35, 36, 37,
3891 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3892 47, 0, 0, -770, 0, 0, 0, 0, 0, 0,
3893 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3894 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3895 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3896 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3897 62, 63, 64, 65, 66, 0, -770, 0, 0, 0,
3898 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3899 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3900 0, 0, 0, 67, 68, 69, 0, 0, -770, 0,
3901 5, 6, 7, -770, 9, 519, 0, 0, 10, 11,
3902 0, 0, 0, 12, 0, 13, 14, 15, 16, 17,
3903 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3904 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3905 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3906 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
3907 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3908 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3909 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3910 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
3911 54, 0, 55, 56, 0, 213, 214, 215, 58, 59,
3912 216, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3913 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
3914 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
3915 17, 18, 19, 0, 0, 67, 217, 69, 20, 21,
3916 22, 23, 24, 25, 26, 0, 0, 27, 0, 242,
3917 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
3918 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3919 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3920 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3921 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3922 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3923 212, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3924 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3925 0, 0, 129, 130, 131, 132, 133, 134, 135, 136,
3926 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
3927 147, 148, 149, 150, 151, 152, 67, 68, 69, 153,
3928 154, 155, 409, 410, 411, 412, 160, 161, 162, 0,
3929 242, 0, 0, 0, 163, 164, 165, 166, 413, 414,
3930 415, 416, 171, 37, 38, 417, 40, 0, 0, 0,
3931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3932 0, 0, 0, 0, 0, 173, 174, 175, 176, 177,
3933 178, 179, 180, 181, 0, 0, 182, 183, 0, 0,
3934 0, 0, 184, 185, 186, 187, 0, 0, 0, 0,
3935 0, 0, 0, 0, 0, 0, 0, 188, 189, 0,
3936 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3937 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3938 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
3939 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
3940 0, 0, 0, 0, 0, 202, 418, 129, 130, 131,
3941 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
3942 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
3943 152, 0, 0, 0, 153, 154, 155, 156, 157, 158,
3944 159, 160, 161, 162, 0, 0, 0, 0, 0, 163,
3945 164, 165, 166, 167, 168, 169, 170, 171, 37, 38,
3946 172, 40, 0, 0, 0, 0, 0, 0, 0, 0,
3947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3948 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
3949 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
3950 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3951 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
3952 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3953 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3954 0, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3955 198, 199, 0, 200, 201, 0, 0, 0, 0, 0,
3956 202, 129, 130, 131, 132, 133, 134, 135, 136, 137,
3957 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
3958 148, 149, 150, 151, 152, 0, 0, 0, 153, 154,
3959 155, 156, 157, 158, 159, 160, 161, 162, 0, 0,
3960 0, 0, 0, 163, 164, 165, 166, 167, 168, 169,
3961 170, 171, 244, 0, 172, 0, 0, 0, 0, 0,
3962 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3963 0, 0, 0, 0, 173, 174, 175, 176, 177, 178,
3964 179, 180, 181, 0, 0, 182, 183, 0, 0, 0,
3965 0, 184, 185, 186, 187, 0, 0, 0, 0, 0,
3966 0, 0, 0, 0, 0, 0, 188, 189, 0, 0,
3967 59, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3968 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3969 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
3970 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
3971 0, 0, 0, 0, 202, 129, 130, 131, 132, 133,
3972 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
3973 144, 145, 146, 147, 148, 149, 150, 151, 152, 0,
3974 0, 0, 153, 154, 155, 156, 157, 158, 159, 160,
3975 161, 162, 0, 0, 0, 0, 0, 163, 164, 165,
3976 166, 167, 168, 169, 170, 171, 0, 0, 172, 0,
3977 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3978 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
3979 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
3980 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
3981 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3982 188, 189, 0, 0, 59, 0, 0, 0, 0, 0,
3983 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3984 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3985 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3986 0, 200, 201, 0, 0, 0, 0, 0, 202, 129,
3987 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
3988 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
3989 150, 151, 152, 0, 0, 0, 153, 154, 155, 156,
3990 157, 158, 159, 160, 161, 162, 0, 0, 0, 0,
3991 0, 163, 164, 165, 166, 167, 168, 169, 170, 171,
3992 0, 0, 172, 0, 0, 0, 0, 0, 0, 0,
3993 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3994 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
3995 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
3996 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
3997 0, 0, 0, 0, 188, 189, 0, 0, 0, 0,
3998 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3999 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4000 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4001 196, 197, 198, 199, 0, 200, 201, 5, 6, 7,
4002 0, 9, 202, 0, 0, 10, 11, 0, 0, 0,
4003 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4004 0, 0, 0, 0, 20, 252, 253, 23, 24, 25,
4005 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4006 281, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4007 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4009 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4010 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4011 0, 0, 0, 282, 0, 0, 212, 54, 0, 55,
4012 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4013 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
4014 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4015 0, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4016 0, 0, 283, 10, 11, 0, 0, 0, 12, 284,
4017 13, 14, 15, 250, 251, 18, 19, 0, 0, 0,
4018 0, 0, 20, 252, 253, 23, 24, 25, 26, 0,
4019 0, 209, 0, 0, 0, 0, 0, 0, 281, 0,
4020 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4021 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4022 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4023 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4025 0, 282, 0, 0, 212, 54, 0, 55, 56, 0,
4026 0, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4027 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4028 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4029 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
4030 283, 10, 11, 0, 0, 0, 12, 579, 13, 14,
4031 15, 16, 17, 18, 19, 0, 0, 0, 0, 0,
4032 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
4033 0, 0, 0, 0, 0, 28, 29, 0, 31, 32,
4034 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4035 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4036 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4037 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4038 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
4039 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
4040 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4041 0, 0, 380, 0, 5, 6, 7, 0, 9, 0,
4042 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4043 14, 15, 16, 17, 18, 19, 0, 0, 67, 68,
4044 69, 20, 21, 22, 23, 24, 25, 26, 0, 0,
4045 27, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4046 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4047 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4048 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4050 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4051 211, 0, 0, 212, 54, 0, 55, 56, 0, 0,
4052 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4053 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4054 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4055 13, 14, 15, 16, 17, 18, 19, 0, 0, 67,
4056 68, 69, 20, 21, 22, 23, 24, 25, 26, 0,
4057 0, 209, 0, 0, 0, 0, 0, 0, 29, 0,
4058 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4059 210, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4060 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4061 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4062 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4063 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
4064 213, 214, 215, 58, 59, 216, 61, 62, 63, 64,
4065 65, 66, 0, 0, 0, 0, 5, 6, 7, 0,
4066 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4067 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
4068 67, 217, 69, 20, 21, 22, 23, 24, 25, 26,
4069 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
4070 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4071 40, 210, 41, 42, 43, 44, 45, 46, 47, 0,
4072 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4073 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4074 0, 0, 0, 0, 50, 456, 0, 0, 0, 0,
4075 0, 0, 211, 0, 0, 212, 54, 0, 55, 56,
4076 0, 213, 214, 215, 58, 59, 216, 61, 62, 63,
4077 64, 65, 66, 0, 0, 0, 0, 5, 6, 7,
4078 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4079 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4080 0, 67, 217, 69, 20, 252, 253, 23, 24, 25,
4081 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4082 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4083 39, 40, 210, 41, 42, 43, 44, 45, 46, 47,
4084 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4085 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4086 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4087 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
4088 56, 0, 666, 214, 215, 58, 59, 216, 61, 62,
4089 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4090 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4091 0, 12, 0, 13, 14, 15, 250, 251, 18, 19,
4092 0, 0, 67, 217, 69, 20, 252, 253, 23, 24,
4093 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4094 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4095 38, 39, 40, 210, 41, 42, 43, 44, 45, 46,
4096 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4097 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4098 0, 0, 0, 0, 0, 0, 50, 456, 0, 0,
4099 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
4100 55, 56, 0, 666, 214, 215, 58, 59, 216, 61,
4101 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4102 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4103 0, 0, 12, 0, 13, 14, 15, 250, 251, 18,
4104 19, 0, 0, 67, 217, 69, 20, 252, 253, 23,
4105 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
4106 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4107 37, 38, 39, 40, 210, 41, 42, 43, 44, 45,
4108 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4109 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4110 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4111 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
4112 0, 55, 56, 0, 213, 214, 0, 58, 59, 216,
4113 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4114 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4115 0, 0, 0, 12, 0, 13, 14, 15, 250, 251,
4116 18, 19, 0, 0, 67, 217, 69, 20, 252, 253,
4117 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
4118 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4119 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
4120 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4121 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4122 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4123 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
4124 54, 0, 55, 56, 0, 0, 214, 215, 58, 59,
4125 216, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4126 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4127 11, 0, 0, 0, 12, 0, 13, 14, 15, 250,
4128 251, 18, 19, 0, 0, 67, 217, 69, 20, 252,
4129 253, 23, 24, 25, 26, 0, 0, 209, 0, 0,
4130 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
4131 35, 36, 37, 38, 39, 40, 210, 41, 42, 43,
4132 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4133 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4134 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4135 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
4136 212, 54, 0, 55, 56, 0, 666, 214, 0, 58,
4137 59, 216, 61, 62, 63, 64, 65, 66, 0, 0,
4138 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4139 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4140 250, 251, 18, 19, 0, 0, 67, 217, 69, 20,
4141 252, 253, 23, 24, 25, 26, 0, 0, 209, 0,
4142 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
4143 34, 35, 36, 37, 38, 39, 40, 210, 41, 42,
4144 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4145 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4147 50, 51, 0, 0, 0, 0, 0, 0, 211, 0,
4148 0, 212, 54, 0, 55, 56, 0, 0, 214, 0,
4149 58, 59, 216, 61, 62, 63, 64, 65, 66, 0,
4150 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4151 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4152 15, 16, 17, 18, 19, 0, 0, 67, 217, 69,
4153 20, 21, 22, 23, 24, 25, 26, 0, 0, 209,
4154 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4155 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4156 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4157 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4158 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4159 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
4160 0, 0, 212, 54, 0, 55, 56, 0, 759, 0,
4161 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4162 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4163 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4164 14, 15, 250, 251, 18, 19, 0, 0, 67, 217,
4165 69, 20, 252, 253, 23, 24, 25, 26, 0, 0,
4166 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4167 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4168 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4169 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4170 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4171 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4172 211, 0, 0, 212, 54, 0, 55, 56, 0, 759,
4173 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4174 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4175 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4176 13, 14, 15, 250, 251, 18, 19, 0, 0, 67,
4177 217, 69, 20, 252, 253, 23, 24, 25, 26, 0,
4178 0, 209, 0, 0, 0, 0, 0, 0, 29, 0,
4179 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4180 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4181 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4183 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4184 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
4185 980, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4186 65, 66, 0, 0, 0, 0, 5, 6, 7, 0,
4187 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4188 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
4189 67, 217, 69, 20, 252, 253, 23, 24, 25, 26,
4190 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
4191 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4192 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4193 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4194 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4195 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
4196 0, 0, 211, 0, 0, 212, 54, 0, 55, 56,
4197 0, 1029, 0, 0, 58, 59, 60, 61, 62, 63,
4198 64, 65, 66, 0, 0, 0, 0, 5, 6, 7,
4199 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4200 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4201 0, 67, 217, 69, 20, 252, 253, 23, 24, 25,
4202 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4203 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4204 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4206 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4207 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4208 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
4209 56, 0, 1176, 0, 0, 58, 59, 60, 61, 62,
4210 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4211 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4212 0, 12, 0, 13, 14, 15, 250, 251, 18, 19,
4213 0, 0, 67, 217, 69, 20, 252, 253, 23, 24,
4214 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4215 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4216 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4217 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4218 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4219 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
4220 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
4221 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
4222 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4223 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4224 0, 0, 12, 0, 13, 14, 15, 16, 17, 18,
4225 19, 0, 0, 67, 217, 69, 20, 21, 22, 23,
4226 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
4227 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4228 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4229 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4230 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4231 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4232 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
4233 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4234 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4235 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4236 0, 0, 0, 12, 0, 13, 14, 15, 16, 17,
4237 18, 19, 0, 0, 67, 217, 69, 20, 21, 22,
4238 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
4239 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4240 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4241 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4242 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4243 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4244 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
4245 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4246 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4247 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4248 11, 0, 0, 0, 12, 0, 13, 14, 15, 250,
4249 251, 18, 19, 0, 0, 67, 68, 69, 20, 252,
4250 253, 23, 24, 25, 26, 0, 0, 209, 0, 0,
4251 0, 0, 0, 0, 281, 0, 0, 32, 33, 34,
4252 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4253 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4256 0, 0, 0, 0, 0, 0, 0, 282, 0, 0,
4257 340, 54, 0, 55, 56, 0, 341, 0, 0, 58,
4258 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4259 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4260 0, 0, 0, 12, 0, 13, 14, 15, 250, 251,
4261 18, 19, 0, 0, 0, 0, 283, 20, 252, 253,
4262 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
4263 0, 0, 0, 281, 0, 0, 32, 33, 34, 35,
4264 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4265 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4266 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4267 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4268 0, 0, 0, 0, 0, 0, 390, 0, 0, 53,
4269 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
4270 60, 61, 62, 63, 64, 65, 66, 0, 0, 5,
4271 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4272 0, 0, 12, 0, 13, 14, 15, 250, 251, 18,
4273 19, 0, 0, 0, 0, 283, 20, 252, 253, 23,
4274 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
4275 0, 0, 281, 0, 0, 32, 33, 34, 398, 36,
4276 37, 38, 399, 40, 0, 41, 42, 43, 44, 45,
4277 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4279 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4280 0, 400, 0, 0, 0, 401, 0, 0, 212, 54,
4281 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4282 61, 62, 63, 64, 65, 66, 0, 0, 5, 6,
4283 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4284 0, 12, 0, 13, 14, 15, 250, 251, 18, 19,
4285 0, 0, 0, 0, 283, 20, 252, 253, 23, 24,
4286 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4287 0, 281, 0, 0, 32, 33, 34, 398, 36, 37,
4288 38, 399, 40, 0, 41, 42, 43, 44, 45, 46,
4289 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4291 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4292 0, 0, 0, 0, 401, 0, 0, 212, 54, 0,
4293 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
4294 62, 63, 64, 65, 66, 0, 0, 5, 6, 7,
4295 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4296 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4297 0, 0, 0, 283, 20, 252, 253, 23, 24, 25,
4298 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4299 281, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4300 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4301 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4302 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4303 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4304 0, 0, 0, 282, 0, 0, 340, 54, 0, 55,
4305 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4306 63, 64, 65, 66, 0, 0, 5, 6, 7, 0,
4307 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4308 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
4309 0, 0, 283, 20, 252, 253, 23, 24, 25, 26,
4310 0, 0, 209, 0, 0, 0, 0, 0, 0, 281,
4311 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4312 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4313 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4314 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4316 0, 0, 1165, 0, 0, 212, 54, 0, 55, 56,
4317 0, 0, 0, 0, 58, 59, 60, 61, 62, 63,
4318 64, 65, 66, 0, 0, 5, 6, 7, 0, 9,
4319 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4320 13, 14, 15, 250, 251, 18, 19, 0, 0, 0,
4321 0, 283, 20, 252, 253, 23, 24, 25, 26, 0,
4322 0, 209, 0, 0, 0, 0, 0, 0, 281, 0,
4323 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4324 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4325 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4326 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4327 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4328 0, 1198, 0, 0, 212, 54, 0, 55, 56, 23,
4329 24, 25, 26, 58, 59, 60, 61, 62, 63, 64,
4330 65, 66, 0, 0, 0, 32, 33, 34, 905, 0,
4331 0, 0, 906, 0, 0, 41, 42, 43, 44, 45,
4332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4333 283, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4334 0, 0, 0, 0, 0, 0, 0, 908, 909, 0,
4335 0, 0, 0, 0, 0, 910, 0, 0, 911, 0,
4336 0, 912, 913, 0, 914, 0, 0, 58, 59, 60,
4337 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4338 0, 0, 23, 24, 25, 26, 0, 0, 0, 0,
4339 0, 0, 0, 0, 0, 0, 0, 916, 32, 33,
4340 34, 905, 0, 0, 283, 906, 0, 907, 41, 42,
4341 43, 44, 45, 0, 0, 0, 0, 0, 242, 0,
4342 0, 0, 0, 0, 0, 0, 0, 534, 0, 0,
4343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4344 908, 909, 0, 0, 0, 0, 0, 0, 910, 0,
4345 0, 911, 0, 0, 912, 913, 0, 914, 538, 0,
4346 58, 59, 915, 61, 62, 63, 64, 65, 66, 0,
4347 0, 0, 0, 0, 0, 23, 24, 25, 26, 0,
4348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4349 916, 32, 33, 34, 905, 0, 0, 283, 906, 0,
4350 0, 41, 42, 43, 44, 45, 0, 0, 0, 0,
4351 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4352 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4353 0, 0, 0, 908, 909, 0, 0, 0, 0, 0,
4354 0, 910, 0, 0, 911, 0, 0, 912, 913, 0,
4355 914, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4356 65, 66, 0, 0, 0, 0, 0, 0, 23, 24,
4357 25, 26, 0, 0, 0, 609, 610, 0, 0, 611,
4358 0, 0, 0, 916, 32, 33, 34, 905, 0, 0,
4359 283, 906, 0, 0, 41, 42, 43, 44, 45, 173,
4360 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4361 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4362 0, 0, 0, 0, 0, 0, 908, 909, 0, 0,
4363 0, 188, 189, 0, 910, 0, 0, 911, 0, 0,
4364 912, 913, 0, 0, 0, 0, 58, 59, 60, 61,
4365 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
4366 0, 190, 191, 192, 193, 194, 195, 196, 197, 198,
4367 199, 0, 200, 201, 619, 620, 916, 0, 621, 202,
4368 238, 0, 0, 283, 0, 0, 0, 0, 0, 0,
4369 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
4370 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
4371 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
4372 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4373 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4375 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4376 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
4377 0, 200, 201, 670, 610, 0, 0, 671, 202, 238,
4378 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4379 0, 0, 0, 0, 0, 0, 0, 173, 174, 175,
4380 176, 177, 178, 179, 180, 181, 0, 0, 182, 183,
4381 0, 0, 0, 0, 184, 185, 186, 187, 0, 0,
4382 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
4383 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4384 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4385 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4386 191, 192, 193, 194, 195, 196, 197, 198, 199, 0,
4387 200, 201, 673, 620, 0, 0, 674, 202, 238, 0,
4388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4389 0, 0, 0, 0, 0, 0, 173, 174, 175, 176,
4390 177, 178, 179, 180, 181, 0, 0, 182, 183, 0,
4391 0, 0, 0, 184, 185, 186, 187, 0, 0, 0,
4392 0, 0, 0, 0, 0, 0, 0, 0, 188, 189,
4393 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4394 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4395 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4396 192, 193, 194, 195, 196, 197, 198, 199, 0, 200,
4397 201, 700, 610, 0, 0, 701, 202, 238, 0, 0,
4398 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4399 0, 0, 0, 0, 0, 173, 174, 175, 176, 177,
4400 178, 179, 180, 181, 0, 0, 182, 183, 0, 0,
4401 0, 0, 184, 185, 186, 187, 0, 0, 0, 0,
4402 0, 0, 0, 0, 0, 0, 0, 188, 189, 0,
4403 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4405 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
4406 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
4407 703, 620, 0, 0, 704, 202, 238, 0, 0, 0,
4408 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4409 0, 0, 0, 0, 173, 174, 175, 176, 177, 178,
4410 179, 180, 181, 0, 0, 182, 183, 0, 0, 0,
4411 0, 184, 185, 186, 187, 0, 0, 0, 0, 0,
4412 0, 0, 0, 0, 0, 0, 188, 189, 0, 0,
4413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4414 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4415 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
4416 194, 195, 196, 197, 198, 199, 0, 200, 201, 813,
4417 610, 0, 0, 814, 202, 238, 0, 0, 0, 0,
4418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4419 0, 0, 0, 173, 174, 175, 176, 177, 178, 179,
4420 180, 181, 0, 0, 182, 183, 0, 0, 0, 0,
4421 184, 185, 186, 187, 0, 0, 0, 0, 0, 0,
4422 0, 0, 0, 0, 0, 188, 189, 0, 0, 0,
4423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4425 0, 0, 0, 0, 0, 190, 191, 192, 193, 194,
4426 195, 196, 197, 198, 199, 0, 200, 201, 816, 620,
4427 0, 0, 817, 202, 238, 0, 0, 0, 0, 0,
4428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4429 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
4430 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
4431 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
4432 0, 0, 0, 0, 188, 189, 0, 0, 0, 0,
4433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4435 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4436 196, 197, 198, 199, 0, 200, 201, 822, 610, 0,
4437 0, 823, 202, 238, 0, 0, 0, 0, 0, 0,
4438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4439 0, 173, 174, 175, 176, 177, 178, 179, 180, 181,
4440 0, 0, 182, 183, 0, 0, 0, 0, 184, 185,
4441 186, 187, 0, 0, 0, 0, 0, 0, 0, 0,
4442 0, 0, 0, 188, 189, 0, 0, 0, 0, 0,
4443 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4444 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4445 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4446 197, 198, 199, 0, 200, 201, 655, 620, 0, 0,
4447 656, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4448 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4449 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4450 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4451 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4452 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4454 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4455 0, 0, 190, 191, 192, 193, 194, 195, 196, 197,
4456 198, 199, 0, 200, 201, 1035, 610, 0, 0, 1036,
4457 202, 238, 0, 0, 0, 0, 0, 0, 0, 0,
4458 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4459 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4460 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4461 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4462 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4463 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4464 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4465 0, 190, 191, 192, 193, 194, 195, 196, 197, 198,
4466 199, 0, 200, 201, 1038, 620, 0, 0, 1039, 202,
4467 238, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4468 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
4469 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
4470 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
4471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4472 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4475 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
4476 0, 200, 201, 1259, 610, 0, 0, 1260, 202, 238,
4477 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4478 0, 0, 0, 0, 0, 0, 0, 173, 174, 175,
4479 176, 177, 178, 179, 180, 181, 0, 0, 182, 183,
4480 0, 0, 0, 0, 184, 185, 186, 187, 0, 0,
4481 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
4482 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4484 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4485 191, 192, 193, 194, 195, 196, 197, 198, 199, 0,
4486 200, 201, 1262, 620, 0, 0, 1263, 202, 238, 0,
4487 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4488 0, 0, 0, 0, 0, 0, 173, 174, 175, 176,
4489 177, 178, 179, 180, 181, 0, 0, 182, 183, 0,
4490 0, 0, 0, 184, 185, 186, 187, 0, 0, 0,
4491 0, 0, 0, 0, 0, 0, 0, 0, 188, 189,
4492 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4493 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4494 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4495 192, 193, 194, 195, 196, 197, 198, 199, 0, 200,
4496 201, 1278, 610, 0, 0, 1279, 202, 238, 0, 0,
4497 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4498 0, 0, 0, 0, 0, 173, 174, 175, 176, 177,
4499 178, 179, 180, 181, 0, 0, 182, 183, 0, 0,
4500 0, 0, 184, 185, 186, 187, 0, 0, 0, 0,
4501 0, 0, 0, 0, 0, 0, 0, 188, 189, 0,
4502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4503 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4504 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
4505 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
4506 655, 620, 0, 0, 656, 202, 238, 0, 0, 0,
4507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4508 0, 0, 0, 0, 173, 174, 175, 176, 177, 178,
4509 179, 180, 181, 0, 0, 182, 183, 0, 0, 0,
4510 0, 184, 185, 186, 187, 0, 0, 0, 0, 0,
4511 0, 0, 0, 0, 0, 0, 188, 189, 0, 0,
4512 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4513 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4514 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
4515 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
4516 0, 0, 0, 0, 202
4517};
4518
4519static const yytype_int16 yycheck[] =
4520{
4521 2, 105, 59, 59, 8, 60, 16, 17, 321, 401,
4522 85, 383, 325, 71, 554, 28, 2, 377, 801, 96,
4523 91, 16, 17, 325, 28, 53, 93, 94, 734, 232,
4524 97, 536, 8, 104, 376, 808, 378, 57, 22, 97,
4525 376, 2, 378, 565, 238, 101, 568, 321, 22, 16,
4526 17, 325, 28, 55, 56, 59, 450, 779, 731, 559,
4527 55, 561, 68, 53, 57, 85, 738, 53, 54, 868,
4528 94, 57, 71, 97, 76, 77, 778, 779, 98, 99,
4529 100, 16, 17, 97, 426, 870, 446, 275, 55, 56,
4530 426, 279, 102, 54, 67, 489, 80, 101, 499, 85,
4531 912, 25, 25, 445, 29, 447, 80, 102, 1047, 445,
4532 263, 447, 98, 99, 100, 101, 658, 659, 13, 1024,
4533 299, 300, 1061, 442, 25, 582, 908, 909, 650, 101,
4534 101, 450, 474, 475, 77, 102, 27, 100, 1202, 475,
4535 77, 501, 101, 1052, 0, 575, 778, 779, 10, 1047,
4536 110, 66, 69, 25, 66, 135, 227, 25, 500, 13,
4537 502, 216, 1071, 1072, 25, 1063, 502, 102, 34, 1181,
4538 34, 52, 135, 162, 241, 56, 243, 157, 579, 13,
4539 100, 98, 142, 155, 212, 256, 52, 340, 52, 157,
4540 731, 162, 155, 725, 162, 625, 155, 738, 13, 124,
4541 25, 631, 734, 633, 25, 120, 68, 265, 120, 284,
4542 1274, 135, 1117, 718, 719, 135, 218, 219, 289, 159,
4543 26, 249, 162, 13, 226, 235, 212, 237, 238, 25,
4544 232, 155, 155, 157, 158, 263, 238, 13, 162, 25,
4545 235, 1207, 237, 238, 152, 247, 1212, 314, 315, 316,
4546 317, 265, 319, 320, 155, 647, 157, 1269, 461, 1071,
4547 1072, 247, 157, 249, 284, 160, 265, 162, 235, 160,
4548 237, 162, 13, 263, 1213, 26, 219, 263, 638, 253,
4549 254, 218, 219, 155, 1066, 1067, 247, 155, 648, 683,
4550 314, 315, 316, 317, 155, 637, 157, 639, 284, 821,
4551 235, 155, 237, 639, 13, 647, 160, 649, 162, 1207,
4552 283, 1110, 340, 649, 1212, 1213, 746, 27, 385, 29,
4553 750, 341, 393, 157, 1109, 25, 160, 313, 162, 387,
4554 155, 13, 318, 400, 155, 514, 338, 516, 1010, 796,
4555 880, 343, 1015, 286, 78, 160, 152, 162, 341, 152,
4556 340, 157, 313, 582, 340, 341, 384, 318, 386, 155,
4557 784, 385, 681, 868, 683, 870, 767, 377, 792, 155,
4558 160, 1093, 162, 387, 378, 377, 876, 877, 672, 809,
4559 13, 881, 812, 883, 160, 885, 162, 13, 1286, 37,
4560 38, 1093, 705, 379, 69, 1178, 826, 58, 384, 100,
4561 386, 152, 100, 705, 378, 1178, 100, 56, 702, 951,
4562 952, 145, 146, 147, 956, 957, 25, 78, 731, 160,
4563 1052, 162, 426, 98, 499, 738, 98, 429, 430, 658,
4564 659, 705, 1064, 161, 135, 135, 446, 135, 440, 1071,
4565 1072, 135, 100, 447, 446, 161, 448, 449, 109, 110,
4566 135, 160, 58, 162, 155, 155, 469, 459, 158, 461,
4567 28, 1093, 162, 155, 986, 469, 669, 153, 787, 1010,
4568 155, 475, 78, 447, 476, 442, 162, 135, 160, 499,
4569 162, 142, 154, 1024, 241, 157, 113, 681, 734, 100,
4570 100, 501, 1024, 469, 1200, 481, 25, 155, 502, 501,
4571 160, 475, 162, 109, 579, 1288, 1028, 113, 566, 697,
4572 1024, 268, 100, 499, 162, 272, 66, 67, 910, 486,
4573 161, 815, 1195, 161, 135, 135, 135, 160, 502, 162,
4574 709, 825, 778, 779, 160, 714, 162, 1079, 66, 852,
4575 542, 135, 972, 903, 155, 975, 155, 135, 978, 158,
4576 852, 100, 554, 162, 564, 985, 100, 567, 988, 579,
4577 902, 100, 904, 640, 274, 275, 902, 155, 904, 279,
4578 576, 281, 122, 123, 632, 1115, 582, 135, 852, 565,
4579 100, 576, 568, 1123, 651, 100, 135, 582, 37, 38,
4580 100, 135, 66, 579, 122, 123, 135, 125, 69, 100,
4581 628, 66, 630, 69, 1109, 1110, 135, 1001, 1281, 100,
4582 982, 1111, 1112, 1113, 1114, 135, 618, 52, 912, 686,
4583 135, 56, 624, 698, 626, 135, 155, 98, 638, 158,
4584 69, 615, 98, 162, 135, 639, 638, 69, 648, 100,
4585 624, 615, 628, 846, 630, 649, 648, 660, 122, 123,
4586 624, 69, 658, 659, 1195, 657, 660, 122, 123, 98,
4587 1182, 1202, 155, 1195, 650, 639, 98, 669, 1200, 1099,
4588 1202, 9, 1204, 657, 135, 649, 1068, 15, 698, 97,
4589 98, 1195, 1001, 657, 660, 157, 1200, 161, 1202, 691,
4590 1204, 69, 767, 56, 155, 452, 161, 1010, 135, 100,
4591 457, 69, 69, 460, 101, 776, 463, 155, 1125, 1126,
4592 1250, 1024, 698, 1085, 681, 100, 690, 691, 1090, 97,
4593 98, 478, 951, 952, 155, 829, 483, 956, 957, 69,
4594 98, 98, 157, 1274, 135, 778, 779, 14, 15, 69,
4595 15, 1241, 1274, 1037, 1276, 69, 157, 767, 69, 1281,
4596 25, 1283, 1046, 820, 155, 1049, 155, 97, 98, 157,
4597 1274, 819, 1276, 162, 155, 78, 1298, 1281, 98, 1283,
4598 158, 162, 828, 97, 98, 1069, 154, 98, 135, 781,
4599 782, 767, 155, 15, 1298, 17, 788, 789, 545, 162,
4600 818, 153, 778, 779, 796, 797, 820, 799, 159, 801,
4601 56, 796, 1174, 157, 1033, 54, 1052, 52, 1238, 54,
4602 55, 56, 57, 58, 154, 64, 65, 157, 1064, 155,
4603 787, 578, 107, 69, 828, 1071, 1072, 69, 1245, 1246,
4604 154, 78, 818, 78, 1251, 821, 1253, 1254, 840, 841,
4605 135, 843, 844, 69, 846, 89, 90, 1093, 135, 78,
4606 1079, 97, 98, 135, 158, 97, 98, 102, 162, 916,
4607 915, 155, 1222, 160, 109, 110, 1160, 1161, 1162, 912,
4608 56, 97, 98, 1290, 1291, 1292, 1293, 26, 880, 1221,
4609 139, 1223, 1195, 135, 1061, 1302, 929, 1223, 598, 1202,
4610 892, 158, 894, 903, 1071, 1072, 135, 142, 900, 25,
4611 904, 903, 83, 84, 971, 155, 1248, 617, 154, 26,
4612 153, 897, 154, 899, 143, 144, 145, 146, 147, 2,
4613 69, 66, 908, 909, 40, 41, 912, 69, 154, 987,
4614 904, 155, 1024, 16, 17, 69, 897, 965, 899, 153,
4615 69, 135, 970, 929, 155, 951, 952, 971, 97, 98,
4616 956, 957, 69, 955, 1200, 97, 98, 138, 139, 961,
4617 155, 1274, 672, 97, 98, 722, 343, 1261, 97, 98,
4618 53, 54, 155, 738, 57, 120, 741, 122, 123, 965,
4619 97, 98, 285, 286, 970, 68, 155, 697, 155, 155,
4620 52, 1058, 702, 155, 52, 997, 153, 1025, 8, 155,
4621 986, 1044, 85, 152, 69, 154, 13, 155, 157, 25,
4622 93, 94, 154, 135, 97, 98, 99, 100, 1061, 102,
4623 154, 17, 26, 161, 161, 154, 44, 1033, 1071, 1072,
4624 155, 2, 97, 98, 1058, 152, 155, 154, 44, 1025,
4625 157, 153, 1028, 44, 155, 16, 17, 155, 135, 44,
4626 1093, 137, 429, 430, 52, 159, 54, 55, 1044, 57,
4627 1088, 1047, 15, 440, 1084, 69, 155, 155, 52, 1097,
4628 827, 448, 449, 1079, 155, 1061, 1062, 1063, 1106, 155,
4629 1066, 1067, 53, 54, 1139, 1071, 1072, 155, 845, 154,
4630 847, 140, 155, 97, 98, 52, 1167, 68, 1084, 476,
4631 140, 1121, 1088, 1195, 102, 815, 153, 1093, 69, 866,
4632 1202, 1097, 1204, 1115, 52, 825, 54, 55, 56, 57,
4633 1106, 1123, 93, 94, 155, 155, 97, 101, 155, 212,
4634 155, 102, 155, 155, 52, 1121, 97, 98, 66, 101,
4635 69, 158, 155, 1171, 69, 1173, 160, 140, 152, 56,
4636 154, 9, 235, 157, 237, 238, 1184, 140, 241, 153,
4637 243, 1228, 1229, 155, 247, 155, 249, 155, 97, 98,
4638 1172, 69, 97, 98, 1194, 155, 1178, 155, 155, 155,
4639 263, 56, 1274, 155, 1276, 1171, 69, 1173, 155, 1281,
4640 121, 1283, 120, 154, 122, 123, 1182, 125, 1184, 97,
4641 98, 284, 912, 913, 1228, 1229, 1298, 155, 1194, 155,
4642 155, 155, 1222, 155, 97, 98, 157, 157, 155, 1223,
4643 1222, 1207, 1224, 247, 1226, 154, 1212, 1213, 66, 154,
4644 313, 314, 315, 316, 317, 318, 319, 320, 1266, 313,
4645 477, 212, 828, 54, 55, 1010, 57, 1012, 1250, 1223,
4646 481, 98, 1017, 64, 65, 100, 154, 340, 341, 1024,
4647 89, 657, 66, 797, 235, 718, 237, 238, 1226, 868,
4648 241, 154, 243, 1119, 1024, 66, 247, 894, 249, 830,
4649 1266, 66, 120, 571, 122, 123, 1288, 125, 59, 60,
4650 61, 62, 263, 1003, 377, 336, 379, 778, 779, 66,
4651 1286, 384, 385, 386, 52, 78, 54, 55, 56, 57,
4652 58, 1288, 1269, 1070, 1024, 1062, 120, 400, 122, 123,
4653 1064, 1064, 95, 96, 1060, 1224, 108, 1037, 1172, 120,
4654 78, 122, 123, 658, 659, 120, 1046, 122, 123, 1049,
4655 778, 779, 313, 314, 315, 316, 317, 318, 319, 320,
4656 675, 676, 516, 120, 102, 122, 123, 101, 734, 1069,
4657 108, 109, 110, 446, 1200, 1195, 731, 692, 1140, 340,
4658 143, 144, 145, 146, 147, 1132, -1, 52, 78, 54,
4659 55, 56, 57, -1, -1, 52, 1143, 54, 55, 56,
4660 57, -1, -1, -1, 142, 95, 96, 145, 481, -1,
4661 1157, 1158, 1159, -1, 781, 782, 377, 1117, 379, 778,
4662 779, 788, 789, 384, 385, 386, 499, -1, 501, -1,
4663 -1, -1, 1187, -1, -1, -1, -1, 908, 909, 400,
4664 1140, 912, -1, -1, -1, 102, 78, 1202, -1, 1204,
4665 140, 141, 142, 143, 144, 145, 146, 147, 929, -1,
4666 1160, 1161, 1162, 95, 96, -1, 52, -1, 54, 55,
4667 56, 57, -1, 840, 841, -1, 843, 844, -1, -1,
4668 908, 909, -1, -1, 912, 446, 40, 41, 42, 43,
4669 44, 564, 565, -1, 567, 568, -1, -1, -1, -1,
4670 -1, 929, -1, 576, -1, -1, 579, -1, -1, 582,
4671 142, 143, 144, 145, 146, 147, 102, -1, -1, 1274,
4672 481, 1276, 108, -1, 778, 779, -1, -1, 1283, -1,
4673 -1, -1, -1, 900, -1, 1235, -1, -1, -1, -1,
4674 501, -1, -1, 1298, -1, -1, -1, -1, -1, 908,
4675 909, -1, -1, 912, -1, 628, -1, 630, -1, -1,
4676 -1, 1261, -1, -1, -1, 638, -1, -1, -1, -1,
4677 929, -1, -1, 1044, -1, 648, 1047, 650, 651, -1,
4678 -1, -1, -1, -1, -1, 658, 659, -1, 955, -1,
4679 1061, 1062, 1063, -1, -1, 1066, 1067, -1, -1, -1,
4680 1071, 1072, -1, 564, 565, -1, 567, 568, -1, -1,
4681 -1, -1, -1, 686, -1, 576, 1044, -1, -1, 1047,
4682 -1, 582, 1093, -1, -1, 698, -1, -1, -1, -1,
4683 997, -1, -1, 1061, 1062, 1063, 951, 952, 1066, 1067,
4684 -1, 956, 957, 1071, 1072, -1, -1, -1, -1, -1,
4685 -1, -1, -1, -1, 908, 909, -1, -1, 912, -1,
4686 -1, -1, -1, -1, -1, 1093, -1, 628, -1, 630,
4687 -1, -1, -1, -1, -1, 929, -1, 638, -1, -1,
4688 995, 996, -1, 998, 999, 1044, -1, 648, 1047, 650,
4689 651, -1, -1, -1, 767, -1, -1, 658, 659, -1,
4690 -1, -1, 1061, 1062, 1063, -1, -1, 1066, 1067, -1,
4691 -1, -1, 1071, 1072, -1, -1, -1, -1, -1, -1,
4692 -1, -1, -1, -1, -1, 686, -1, -1, -1, -1,
4693 -1, -1, -1, -1, 1093, -1, 1207, -1, -1, -1,
4694 -1, 1212, 1213, -1, -1, 818, -1, 820, 821, -1,
4695 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4696 -1, -1, -1, -1, 1079, -1, -1, -1, -1, -1,
4697 -1, 52, -1, 54, 55, 56, 57, 58, -1, 1207,
4698 -1, -1, -1, -1, 1212, 1213, -1, 1102, -1, -1,
4699 1044, -1, -1, 1047, -1, -1, -1, 78, -1, -1,
4700 -1, -1, -1, -1, -1, -1, -1, 1061, 1062, 1063,
4701 -1, 92, 1066, 1067, -1, 1286, -1, 1071, 1072, -1,
4702 -1, 102, -1, -1, 897, -1, 899, -1, 109, 110,
4703 903, -1, -1, -1, -1, -1, -1, -1, -1, 1093,
4704 -1, -1, -1, -1, -1, -1, -1, -1, 1207, 2,
4705 -1, -1, -1, 1212, 1213, -1, -1, 818, 1286, 820,
4706 821, 142, -1, 16, 17, -1, -1, -1, -1, -1,
4707 -1, -1, -1, -1, -1, -1, -1, -1, 951, 952,
4708 -1, -1, -1, 956, 957, -1, -1, -1, -1, -1,
4709 -1, -1, 965, -1, -1, -1, -1, 970, 971, -1,
4710 53, 54, -1, -1, -1, -1, -1, -1, -1, -1,
4711 -1, -1, -1, 986, -1, 68, -1, -1, -1, -1,
4712 -1, -1, -1, -1, 2, -1, -1, 1286, -1, -1,
4713 -1, -1, -1, -1, -1, -1, 897, -1, 899, -1,
4714 93, 94, 903, -1, 97, -1, -1, -1, -1, 102,
4715 -1, -1, 1025, 1207, -1, 1028, -1, -1, 1212, 1213,
4716 1033, 778, 779, -1, -1, -1, -1, -1, -1, -1,
4717 -1, 33, 34, 35, 36, 53, 54, -1, -1, 57,
4718 -1, -1, -1, -1, -1, 1058, -1, 49, 50, 51,
4719 951, 952, -1, -1, -1, 956, 957, 59, 60, 61,
4720 62, 63, -1, -1, 965, -1, 1079, 85, -1, 970,
4721 971, 1084, -1, -1, -1, 1088, -1, -1, -1, -1,
4722 98, 99, 100, -1, 1097, 986, -1, -1, -1, -1,
4723 -1, -1, 1286, 1106, -1, -1, -1, -1, -1, -1,
4724 -1, -1, -1, -1, -1, -1, -1, -1, 1121, 111,
4725 112, 113, 114, 115, 116, 117, 118, 119, -1, 212,
4726 -1, -1, -1, -1, 1025, -1, -1, 1028, -1, -1,
4727 -1, -1, 1033, -1, -1, -1, -1, -1, -1, -1,
4728 56, -1, 235, -1, 237, 238, 148, -1, 241, -1,
4729 243, 908, 909, -1, 247, 912, 249, 1058, 1171, -1,
4730 1173, -1, -1, -1, -1, -1, -1, -1, -1, 1182,
4731 263, 1184, 929, -1, -1, -1, -1, -1, 1079, -1,
4732 -1, 1194, -1, -1, -1, -1, 52, 1088, 54, 55,
4733 56, 57, 58, -1, 212, -1, 1097, -1, -1, -1,
4734 -1, -1, -1, -1, -1, 1106, -1, -1, -1, 1222,
4735 -1, -1, 78, -1, -1, 1228, 1229, -1, 778, 779,
4736 313, 314, 315, 316, 317, 318, 319, 320, -1, 247,
4737 -1, 249, -1, -1, -1, -1, 102, -1, -1, -1,
4738 -1, -1, 108, 109, 110, 263, -1, 340, -1, -1,
4739 -1, -1, -1, 1266, -1, -1, -1, -1, -1, -1,
4740 -1, -1, -1, -1, -1, -1, 284, -1, -1, -1,
4741 1171, -1, 1173, -1, -1, -1, 142, -1, -1, 145,
4742 -1, 1182, -1, 1184, 377, -1, 379, 1044, -1, -1,
4743 1047, 384, 385, 386, 210, 313, 162, 213, 214, 215,
4744 318, -1, -1, -1, 1061, 1062, 1063, 400, -1, 1066,
4745 1067, -1, -1, -1, 1071, 1072, -1, -1, -1, 25,
4746 -1, 1222, 340, 341, -1, -1, -1, 1228, 1229, -1,
4747 -1, -1, -1, -1, 778, 779, 1093, -1, -1, -1,
4748 -1, -1, -1, -1, -1, -1, -1, -1, 908, 909,
4749 -1, -1, 912, 446, -1, -1, -1, -1, -1, -1,
4750 -1, 379, -1, -1, -1, 1266, 384, -1, 386, 929,
4751 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
4752 86, 87, 88, 89, 90, -1, -1, -1, 481, 95,
4753 96, -1, -1, -1, -1, 101, -1, 2, -1, -1,
4754 -1, -1, -1, -1, -1, -1, -1, -1, 501, -1,
4755 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4756 52, -1, 54, 55, 56, 57, 58, -1, -1, -1,
4757 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
4758 146, 147, -1, -1, -1, -1, 78, -1, 53, 54,
4759 1207, -1, 57, -1, -1, 1212, 1213, -1, -1, -1,
4760 92, -1, -1, 481, 908, 909, -1, -1, 912, -1,
4761 102, 564, 565, -1, 567, 568, 108, 109, 110, -1,
4762 85, 499, -1, 576, 1044, 929, -1, 1047, -1, 582,
4763 -1, -1, -1, 98, 99, 100, -1, -1, -1, -1,
4764 -1, 1061, 1062, 1063, -1, -1, 1066, 1067, -1, -1,
4765 142, 1071, 1072, 145, 78, 79, 80, 81, 82, 83,
4766 84, 85, -1, 87, 88, 441, 442, -1, -1, 1286,
4767 -1, 95, 96, 1093, 450, 628, -1, 630, -1, -1,
4768 -1, -1, -1, -1, -1, 638, -1, 565, -1, -1,
4769 568, -1, -1, -1, -1, 648, -1, 650, 651, -1,
4770 -1, 579, -1, -1, 582, 658, 659, 778, 779, -1,
4771 486, -1, -1, 489, 138, 139, 140, 141, 142, 143,
4772 144, 145, 146, 147, -1, -1, -1, -1, -1, -1,
4773 -1, -1, -1, 686, -1, -1, -1, -1, -1, -1,
4774 1044, -1, -1, 1047, -1, -1, -1, 212, -1, -1,
4775 628, -1, 630, -1, -1, -1, -1, 1061, 1062, 1063,
4776 -1, -1, 1066, 1067, -1, -1, -1, 1071, 1072, -1,
4777 -1, -1, 650, -1, -1, -1, 552, -1, -1, -1,
4778 658, 659, 247, -1, 249, -1, -1, 1207, -1, 1093,
4779 -1, -1, 1212, 1213, -1, -1, -1, -1, 263, 2,
4780 576, 778, 779, -1, -1, -1, 582, -1, -1, -1,
4781 -1, -1, -1, -1, -1, -1, -1, -1, -1, 284,
4782 698, -1, -1, -1, -1, -1, -1, -1, -1, 707,
4783 -1, -1, -1, -1, -1, -1, -1, 908, 909, -1,
4784 -1, 912, -1, -1, -1, -1, -1, -1, 313, -1,
4785 53, 54, -1, 318, 57, -1, -1, -1, 929, -1,
4786 -1, -1, -1, -1, -1, 818, 1286, 820, 821, -1,
4787 -1, -1, -1, -1, -1, 340, 341, -1, -1, -1,
4788 -1, -1, 85, -1, -1, 661, -1, -1, -1, 767,
4789 666, -1, -1, -1, -1, 98, 99, 100, -1, -1,
4790 -1, -1, -1, 1207, -1, 681, -1, 683, 1212, 1213,
4791 -1, -1, -1, -1, 379, -1, -1, -1, -1, 384,
4792 -1, 386, -1, -1, -1, -1, -1, -1, -1, -1,
4793 -1, 908, 909, -1, -1, 912, -1, -1, -1, -1,
4794 818, -1, -1, 821, 897, -1, 899, -1, -1, -1,
4795 903, -1, 929, 729, -1, -1, -1, -1, -1, -1,
4796 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4797 -1, -1, -1, 1044, -1, -1, 1047, -1, -1, -1,
4798 -1, -1, 1286, 759, -1, -1, -1, -1, -1, -1,
4799 1061, 1062, 1063, -1, -1, 1066, 1067, -1, 951, 952,
4800 1071, 1072, -1, 956, 957, -1, -1, -1, -1, 212,
4801 -1, 787, 965, -1, -1, -1, 481, 970, 971, 897,
4802 796, 899, 1093, -1, -1, -1, -1, -1, -1, -1,
4803 -1, -1, -1, 986, 499, 811, -1, -1, -1, -1,
4804 -1, -1, -1, -1, 247, -1, 249, -1, -1, -1,
4805 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4806 263, -1, -1, -1, -1, -1, -1, 1044, -1, -1,
4807 1047, -1, 1025, 951, 952, 1028, 2, -1, 956, 957,
4808 1033, 284, -1, -1, 1061, 1062, 1063, 965, -1, 1066,
4809 1067, -1, 970, -1, 1071, 1072, -1, -1, -1, -1,
4810 565, -1, -1, 568, -1, 1058, -1, -1, 986, -1,
4811 313, -1, -1, -1, 579, 318, 1093, 582, -1, -1,
4812 896, -1, -1, -1, -1, -1, 1079, 53, 54, -1,
4813 -1, 57, -1, -1, -1, 1088, 1207, 340, 341, -1,
4814 -1, 1212, 1213, -1, 1097, -1, -1, 1025, -1, -1,
4815 1028, -1, -1, 1106, -1, 1033, -1, -1, -1, 85,
4816 -1, -1, -1, 628, -1, 630, -1, -1, -1, -1,
4817 -1, -1, 98, 99, 100, 101, 379, -1, -1, -1,
4818 -1, 384, -1, 386, -1, 650, -1, -1, -1, -1,
4819 -1, -1, -1, 658, 659, -1, -1, -1, 2, -1,
4820 -1, 1079, -1, -1, 980, -1, 1084, -1, -1, -1,
4821 1088, -1, -1, -1, -1, 1286, -1, -1, 1171, 1097,
4822 1173, -1, -1, -1, -1, 1001, -1, -1, 1106, 1182,
4823 1207, 1184, -1, 698, -1, 1212, 1213, -1, -1, -1,
4824 -1, -1, 52, 1121, 54, 55, 56, 57, 58, 53,
4825 54, -1, -1, 1029, -1, -1, -1, -1, -1, -1,
4826 -1, -1, -1, -1, -1, -1, -1, -1, 78, 1222,
4827 -1, -1, -1, 2, -1, 1228, 1229, -1, 481, -1,
4828 -1, -1, 92, -1, -1, -1, 212, -1, -1, -1,
4829 -1, -1, 102, 1171, 98, 1173, 499, -1, 108, 109,
4830 110, -1, 767, -1, 1182, -1, 1184, -1, -1, 1286,
4831 -1, -1, -1, 1266, -1, -1, 1194, -1, -1, -1,
4832 1096, 247, -1, 249, 53, 54, -1, -1, -1, -1,
4833 -1, -1, 142, -1, -1, 145, -1, 263, -1, -1,
4834 -1, -1, -1, -1, -1, -1, -1, 157, -1, -1,
4835 -1, -1, -1, 818, -1, -1, 821, -1, 284, -1,
4836 -1, -1, 565, -1, -1, 568, -1, -1, -1, -1,
4837 -1, -1, -1, -1, -1, -1, 579, -1, -1, 582,
4838 -1, -1, -1, -1, -1, -1, -1, 313, 1266, -1,
4839 -1, -1, 318, -1, -1, -1, -1, -1, -1, -1,
4840 1176, -1, -1, -1, -1, -1, -1, -1, 212, -1,
4841 -1, -1, -1, -1, 340, 341, -1, -1, -1, -1,
4842 -1, -1, -1, -1, -1, 628, -1, 630, -1, -1,
4843 44, -1, 897, -1, 899, -1, -1, -1, -1, -1,
4844 -1, -1, -1, 247, -1, 249, -1, 650, -1, -1,
4845 -1, -1, -1, 379, -1, 658, 659, -1, 384, 263,
4846 386, -1, -1, -1, 78, 79, 80, 81, 82, 83,
4847 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
4848 -1, 95, 96, 212, -1, -1, 951, 952, -1, -1,
4849 -1, 956, 957, -1, -1, 698, -1, -1, -1, -1,
4850 965, -1, -1, -1, -1, 970, -1, -1, -1, 313,
4851 -1, -1, -1, -1, 318, -1, -1, -1, 247, -1,
4852 249, 986, 136, -1, 138, 139, 140, 141, 142, 143,
4853 144, 145, 146, 147, 263, -1, 340, -1, -1, -1,
4854 -1, 155, -1, -1, -1, -1, -1, -1, -1, -1,
4855 -1, -1, -1, -1, -1, 481, -1, -1, -1, -1,
4856 1025, -1, -1, 1028, 767, -1, -1, -1, 1033, -1,
4857 -1, -1, -1, 499, -1, 379, -1, -1, -1, -1,
4858 384, -1, 386, -1, 313, -1, -1, -1, -1, 318,
4859 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
4860 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
4861 -1, 340, -1, -1, 1079, 818, 95, 96, 821, 1084,
4862 -1, -1, -1, 1088, -1, -1, -1, -1, -1, -1,
4863 -1, -1, 1097, -1, -1, -1, -1, -1, -1, 565,
4864 -1, 1106, 568, -1, -1, -1, -1, -1, -1, -1,
4865 379, -1, -1, 579, -1, 384, 1121, 386, -1, 138,
4866 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
4867 78, 79, 80, 81, 82, 83, 84, 481, -1, 87,
4868 88, -1, -1, -1, -1, -1, -1, 95, 96, -1,
4869 -1, -1, -1, -1, 897, -1, 899, -1, -1, -1,
4870 -1, -1, 628, -1, 630, -1, 1171, -1, 1173, -1,
4871 -1, -1, -1, -1, -1, -1, -1, 1182, -1, 1184,
4872 -1, -1, -1, -1, 650, -1, -1, -1, -1, 1194,
4873 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
4874 -1, -1, -1, -1, -1, -1, -1, -1, 951, 952,
4875 -1, -1, 481, 956, 957, -1, -1, -1, -1, -1,
4876 -1, 565, 965, -1, 568, -1, -1, 970, 44, -1,
4877 -1, -1, 698, -1, -1, -1, -1, -1, 582, -1,
4878 -1, -1, -1, 986, -1, -1, -1, -1, -1, -1,
4879 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4880 -1, 1266, 78, 79, 80, 81, 82, 83, 84, 85,
4881 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
4882 96, -1, 1025, -1, 628, 1028, 630, -1, -1, -1,
4883 1033, -1, -1, -1, -1, -1, 565, -1, -1, 568,
4884 -1, 767, -1, -1, -1, -1, 650, -1, -1, -1,
4885 -1, -1, -1, 582, 658, 659, -1, -1, -1, -1,
4886 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
4887 146, 147, -1, -1, -1, -1, 1079, -1, -1, -1,
4888 -1, 1084, -1, -1, -1, 1088, -1, -1, -1, -1,
4889 -1, -1, 818, -1, 1097, 821, -1, 0, -1, 628,
4890 -1, 630, -1, 1106, -1, 8, 9, 10, 44, -1,
4891 13, 14, 15, -1, 17, -1, -1, -1, 1121, -1,
4892 -1, 650, 25, 26, 27, -1, -1, -1, -1, 658,
4893 659, -1, -1, -1, 37, 38, -1, 40, 41, 42,
4894 43, 44, 78, 79, 80, 81, 82, 83, 84, 85,
4895 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
4896 96, -1, -1, -1, -1, 68, 69, -1, 1171, -1,
4897 1173, 897, -1, 899, -1, -1, -1, -1, -1, 1182,
4898 -1, 1184, -1, -1, -1, 44, -1, -1, -1, -1,
4899 -1, 1194, -1, -1, 97, 98, -1, -1, -1, -1,
4900 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
4901 146, 147, -1, -1, 818, -1, -1, 821, 121, 78,
4902 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4903 89, 90, -1, -1, -1, -1, 95, 96, -1, 965,
4904 -1, -1, -1, -1, 970, -1, -1, -1, -1, 152,
4905 153, -1, -1, -1, 157, 158, -1, 160, -1, 162,
4906 986, -1, -1, 1266, -1, -1, -1, -1, -1, -1,
4907 -1, -1, -1, 16, 17, -1, -1, 136, -1, 138,
4908 139, 140, 141, 142, 143, 144, 145, 146, 147, 818,
4909 -1, -1, 821, 897, -1, 899, -1, -1, -1, 1025,
4910 -1, -1, 1028, -1, -1, 48, 49, 50, 51, -1,
4911 -1, -1, 55, 56, -1, -1, -1, -1, -1, -1,
4912 -1, -1, -1, -1, -1, 68, 69, -1, -1, -1,
4913 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4914 -1, -1, -1, -1, -1, -1, -1, 951, 952, -1,
4915 -1, -1, 956, 957, -1, -1, -1, -1, 1084, 102,
4916 -1, 965, 1088, -1, -1, -1, 970, -1, 897, -1,
4917 899, 1097, -1, -1, -1, -1, -1, -1, -1, -1,
4918 1106, -1, 986, -1, -1, -1, -1, -1, -1, -1,
4919 -1, -1, -1, -1, -1, 1121, -1, -1, -1, -1,
4920 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4921 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4922 -1, 1025, 951, 952, 1028, -1, -1, 956, 957, 1033,
4923 -1, -1, -1, -1, -1, -1, 965, -1, -1, -1,
4924 -1, 970, -1, -1, -1, 1171, -1, 1173, -1, -1,
4925 -1, -1, -1, -1, -1, -1, 1182, 986, 1184, -1,
4926 -1, -1, -1, -1, -1, -1, -1, 210, 1194, -1,
4927 213, 214, 215, -1, 217, 1079, -1, -1, -1, -1,
4928 1084, -1, -1, -1, 1088, -1, -1, -1, -1, -1,
4929 -1, -1, 235, 1097, 237, 238, 1025, -1, -1, 1028,
4930 -1, -1, 1106, -1, 1033, -1, -1, -1, -1, -1,
4931 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4932 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
4933 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
4934 1266, 95, 96, -1, -1, -1, -1, -1, -1, -1,
4935 1079, -1, -1, -1, -1, -1, -1, -1, -1, 1088,
4936 -1, -1, -1, -1, -1, -1, -1, 1171, 1097, 1173,
4937 -1, -1, -1, -1, -1, -1, -1, 1106, 1182, -1,
4938 1184, -1, 136, -1, 138, 139, 140, 141, 142, 143,
4939 144, 145, 146, 147, -1, -1, -1, -1, -1, -1,
4940 -1, -1, 345, 346, 347, 348, 349, -1, 162, 352,
4941 353, 354, 355, 356, 357, 358, 359, -1, 361, -1,
4942 -1, 364, 365, 366, 367, 368, 369, 370, 371, 372,
4943 373, -1, -1, -1, 377, -1, -1, -1, -1, -1,
4944 -1, -1, 1171, -1, 1173, -1, -1, -1, -1, -1,
4945 -1, -1, -1, 1182, -1, 1184, -1, -1, -1, -1,
4946 -1, -1, 1266, -1, -1, -1, -1, -1, -1, -1,
4947 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4948 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4949 -1, -1, -1, -1, -1, -1, -1, -1, 441, 442,
4950 -1, -1, -1, 446, -1, -1, -1, 450, -1, -1,
4951 -1, -1, -1, 456, -1, -1, -1, -1, -1, -1,
4952 -1, -1, -1, -1, -1, -1, -1, -1, 471, -1,
4953 -1, -1, -1, -1, -1, -1, -1, 1266, -1, -1,
4954 -1, -1, -1, 486, -1, -1, 489, -1, -1, -1,
4955 -1, -1, -1, -1, -1, -1, -1, -1, 501, -1,
4956 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4957 -1, -1, -1, -1, -1, 518, -1, -1, -1, -1,
4958 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4959 -1, -1, -1, -1, -1, 0, 1, -1, 3, 4,
4960 5, 6, 7, -1, -1, -1, 11, 12, -1, 552,
4961 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4962 -1, 564, -1, -1, 567, 30, 31, 32, 33, 34,
4963 35, 36, -1, 576, 39, -1, -1, -1, -1, 582,
4964 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
4965 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
4966 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4967 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
4968 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
4969 -1, -1, -1, -1, 99, 638, -1, 102, 103, -1,
4970 105, 106, -1, 108, -1, 648, 111, 112, 113, 114,
4971 115, 116, 117, 118, 119, 658, 659, -1, 661, 662,
4972 663, 664, -1, 666, -1, -1, -1, -1, -1, -1,
4973 -1, -1, 675, 676, -1, -1, -1, -1, 681, -1,
4974 683, -1, -1, 148, 149, 150, -1, -1, -1, 692,
4975 0, -1, -1, -1, -1, 160, -1, 162, 8, 9,
4976 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
4977 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
4978 -1, -1, -1, -1, -1, -1, 729, 37, 38, -1,
4979 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
4980 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4981 -1, -1, -1, -1, -1, -1, 759, -1, 68, 69,
4982 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
4983 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4984 90, -1, -1, -1, 787, 95, 96, 97, 98, -1,
4985 100, 101, -1, 796, -1, -1, -1, 107, -1, -1,
4986 -1, -1, -1, -1, -1, -1, -1, -1, 811, -1,
4987 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
4988 -1, -1, -1, -1, -1, 135, 136, 137, 138, 139,
4989 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
4990 -1, -1, 152, 153, 154, 155, -1, -1, 158, 159,
4991 160, -1, 162, 78, 79, 80, 81, 82, 83, 84,
4992 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
4993 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
4994 -1, -1, -1, 886, 887, -1, 889, 890, -1, -1,
4995 -1, -1, -1, 896, -1, -1, -1, -1, 901, -1,
4996 903, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4997 -1, 136, -1, 138, 139, 140, 141, 142, 143, 144,
4998 145, 146, 147, -1, -1, -1, -1, -1, -1, -1,
4999 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5000 -1, -1, -1, -1, -1, -1, -1, 950, 951, 952,
5001 -1, -1, -1, 956, 957, -1, -1, -1, -1, -1,
5002 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5003 -1, -1, -1, -1, 0, -1, -1, 980, -1, -1,
5004 -1, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5005 -1, 17, 995, 996, -1, 998, 999, -1, 1001, 25,
5006 -1, 27, 28, 29, -1, -1, -1, -1, -1, -1,
5007 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5008 -1, -1, -1, -1, -1, -1, 1029, -1, -1, -1,
5009 1033, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5010 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5011 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5012 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5013 96, 97, 98, -1, 100, 101, 1079, -1, -1, -1,
5014 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5015 -1, -1, -1, 1096, -1, 121, -1, -1, 124, 1102,
5016 -1, -1, -1, -1, -1, -1, -1, -1, -1, 135,
5017 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5018 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
5019 -1, -1, 158, 159, 160, -1, 162, -1, -1, -1,
5020 -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
5021 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5022 -1, -1, -1, -1, -1, -1, -1, 25, -1, 27,
5023 28, 29, -1, 1176, -1, -1, -1, -1, -1, 37,
5024 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5025 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5026 88, 89, 90, -1, -1, -1, -1, 95, 96, -1,
5027 68, 69, -1, -1, -1, -1, -1, -1, -1, 1222,
5028 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5029 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5030 98, -1, 100, 101, -1, -1, -1, -1, -1, 107,
5031 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5032 -1, -1, -1, 121, -1, -1, 124, -1, -1, -1,
5033 -1, -1, -1, -1, -1, -1, -1, 135, 136, 137,
5034 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5035 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5036 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5037 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5038 -1, -1, -1, 25, 26, 27, 28, 29, -1, -1,
5039 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5040 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5041 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5042 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5043 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5044 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5045 -1, -1, -1, 95, 96, 97, 98, -1, -1, 101,
5046 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
5047 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5048 -1, -1, 124, -1, -1, -1, -1, -1, -1, -1,
5049 -1, -1, -1, -1, 136, 137, 138, 139, 140, 141,
5050 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5051 152, 153, 154, 155, 0, -1, 158, 159, 160, -1,
5052 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5053 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5054 26, 27, 28, 29, -1, -1, -1, -1, -1, -1,
5055 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5056 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5057 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5058 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5059 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5060 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5061 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5062 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5063 -1, -1, -1, -1, -1, 121, -1, -1, 124, -1,
5064 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5065 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5066 146, 147, -1, -1, -1, -1, 152, 153, 154, 155,
5067 0, -1, 158, 159, 160, -1, 162, -1, 8, 9,
5068 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
5069 -1, -1, -1, -1, -1, 25, -1, 27, 28, 29,
5070 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5071 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
5072 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5073 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
5074 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5075 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5076 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5077 100, 101, -1, -1, -1, -1, -1, 107, -1, -1,
5078 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5079 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
5080 -1, -1, -1, -1, -1, 135, 136, 137, 138, 139,
5081 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5082 -1, -1, -1, 153, 154, 155, 0, -1, 158, 159,
5083 160, -1, 162, -1, 8, 9, 10, -1, -1, 13,
5084 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5085 -1, 25, 26, 27, 28, -1, -1, -1, -1, -1,
5086 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5087 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5088 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5089 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5090 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5091 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5092 -1, 95, 96, 97, 98, -1, -1, 101, -1, -1,
5093 -1, -1, -1, 107, -1, -1, -1, -1, -1, -1,
5094 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5095 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5096 -1, -1, 136, -1, 138, 139, 140, 141, 142, 143,
5097 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
5098 154, 155, 0, 157, 158, 159, 160, -1, 162, -1,
5099 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5100 -1, -1, -1, -1, -1, -1, -1, 25, -1, 27,
5101 28, 29, -1, -1, -1, -1, -1, -1, -1, 37,
5102 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5103 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5104 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5105 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5106 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5107 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5108 98, -1, -1, 101, -1, -1, -1, -1, -1, 107,
5109 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5110 -1, -1, -1, 121, -1, -1, 124, -1, -1, -1,
5111 -1, -1, -1, -1, -1, -1, -1, -1, 136, 137,
5112 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5113 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5114 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5115 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5116 -1, -1, -1, 25, 26, 27, 28, -1, -1, -1,
5117 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5118 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5119 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5120 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5121 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5122 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5123 -1, -1, -1, 95, 96, 97, 98, -1, -1, 101,
5124 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
5125 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5126 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5127 -1, -1, -1, -1, 136, -1, 138, 139, 140, 141,
5128 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5129 152, 153, 154, 155, 0, 157, 158, 159, 160, -1,
5130 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5131 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5132 -1, 27, 28, -1, -1, -1, -1, -1, -1, -1,
5133 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5134 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5135 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5136 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5137 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5138 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5139 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5140 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5141 -1, -1, -1, -1, -1, 121, -1, -1, -1, -1,
5142 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5143 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5144 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
5145 0, 157, 158, 159, 160, -1, 162, -1, 8, 9,
5146 10, -1, -1, -1, 14, 15, -1, 17, -1, -1,
5147 -1, -1, -1, -1, -1, 25, 26, -1, -1, -1,
5148 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5149 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
5150 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5151 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
5152 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5153 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5154 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5155 100, 101, -1, -1, -1, -1, -1, -1, -1, -1,
5156 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5157 -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
5158 -1, -1, -1, -1, -1, 135, 136, -1, 138, 139,
5159 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5160 -1, -1, 152, 153, 154, 155, 0, -1, 158, -1,
5161 160, -1, 162, -1, 8, 9, 10, -1, -1, -1,
5162 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5163 -1, 25, 26, -1, -1, -1, -1, -1, -1, -1,
5164 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5165 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5166 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5167 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5168 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5169 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5170 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
5171 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5172 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5173 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5174 -1, 135, 136, -1, 138, 139, 140, 141, 142, 143,
5175 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
5176 154, 155, 0, -1, 158, -1, 160, -1, 162, -1,
5177 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
5178 -1, -1, -1, -1, -1, -1, -1, 25, -1, -1,
5179 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
5180 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5181 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5182 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5183 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5184 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5185 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5186 98, -1, 100, 101, -1, -1, -1, -1, -1, -1,
5187 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5188 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
5189 -1, -1, -1, -1, -1, -1, -1, 135, 136, -1,
5190 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5191 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5192 158, -1, 160, -1, 162, -1, 8, 9, 10, -1,
5193 -1, -1, 14, 15, -1, 17, -1, -1, -1, -1,
5194 -1, -1, -1, 25, -1, -1, -1, -1, -1, -1,
5195 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5196 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5197 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5198 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5199 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5200 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5201 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
5202 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5203 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5204 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5205 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
5206 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5207 -1, 153, 154, 155, -1, -1, 158, -1, 160, 1,
5208 162, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5209 12, -1, -1, 15, 16, -1, 18, 19, 20, 21,
5210 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
5211 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5212 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5213 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5214 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5215 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5216 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5217 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5218 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5219 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5220 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5221 10, 11, 12, -1, 14, 15, 16, -1, 18, 19,
5222 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5223 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5224 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5225 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5226 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5227 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5228 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5229 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5230 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5231 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5232 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5233 -1, -1, 10, 11, 12, -1, -1, 15, 16, 17,
5234 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5235 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5236 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5237 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5238 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5239 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5240 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5241 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5242 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5243 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5244 118, 119, -1, -1, -1, 1, -1, 3, 4, 5,
5245 6, 7, -1, -1, 10, 11, 12, -1, -1, 15,
5246 16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
5247 148, 149, 150, -1, 30, 31, 32, 33, 34, 35,
5248 36, -1, 160, 39, 162, -1, -1, -1, -1, 45,
5249 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5250 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5251 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
5252 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5253 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5254 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5255 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5256 116, 117, 118, 119, -1, -1, -1, 1, -1, 3,
5257 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
5258 -1, 15, 16, -1, 18, 19, 20, 21, 22, 23,
5259 24, -1, 148, 149, 150, -1, 30, 31, 32, 33,
5260 34, 35, 36, -1, 160, 39, 162, -1, -1, -1,
5261 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5262 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5263 64, 65, -1, -1, 68, -1, -1, -1, -1, -1,
5264 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5265 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5266 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5267 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5268 114, 115, 116, 117, 118, 119, -1, -1, -1, 1,
5269 -1, 3, 4, 5, 6, 7, -1, 9, 10, 11,
5270 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5271 22, 23, 24, -1, 148, 149, 150, -1, 30, 31,
5272 32, 33, 34, 35, 36, -1, 160, 39, 162, -1,
5273 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5274 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5275 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5276 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5277 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5278 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5279 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5280 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5281 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5282 10, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5283 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5284 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5285 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5286 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5287 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5288 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5289 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5290 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5291 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5292 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5293 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5294 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5295 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5296 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5297 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5298 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5299 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5300 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5302 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5303 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5304 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5305 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5306 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5308 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5309 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5310 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5311 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5312 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5313 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5314 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5315 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5316 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5318 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5319 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5320 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5321 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5324 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5325 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5326 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5327 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5328 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5329 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5330 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5331 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5332 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5334 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5335 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5336 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5337 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5338 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5339 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5340 148, 149, 150, -1, -1, 153, -1, -1, -1, -1,
5341 -1, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5342 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5343 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5344 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5345 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5346 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5347 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5348 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5349 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5350 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5351 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5352 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5353 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5354 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5355 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5356 148, 149, 150, -1, -1, 153, -1, -1, -1, -1,
5357 -1, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5358 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5359 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5360 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5361 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5362 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5363 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5364 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5365 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5366 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5367 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5368 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5369 118, 119, -1, 121, -1, 1, -1, 3, 4, 5,
5370 6, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5371 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5372 148, 149, 150, -1, 30, 31, 32, 33, 34, 35,
5373 36, -1, 160, 39, 162, -1, -1, -1, -1, 45,
5374 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
5375 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5376 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5377 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5378 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5379 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5380 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5381 116, 117, 118, 119, -1, -1, 1, -1, 3, 4,
5382 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5383 -1, 16, 17, 18, 19, 20, 21, 22, 23, 24,
5384 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
5385 35, 36, 158, -1, 39, -1, 162, -1, -1, -1,
5386 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5387 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5388 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5389 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5390 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5391 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5392 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5393 115, 116, 117, 118, 119, -1, -1, 0, 1, -1,
5394 3, 4, 5, 6, 7, -1, -1, -1, 11, 12,
5395 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5396 23, 24, -1, 148, 149, 150, -1, 30, 31, 32,
5397 33, 34, 35, 36, -1, 160, 39, 162, -1, -1,
5398 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5399 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5400 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5401 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5402 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5403 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5404 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
5405 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5406 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5407 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5408 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
5409 153, -1, -1, -1, -1, -1, 1, 160, 3, 4,
5410 5, 6, 7, 8, 9, 10, 11, 12, -1, 14,
5411 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
5412 25, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5413 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5414 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
5415 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5416 65, -1, -1, 68, -1, -1, -1, -1, -1, -1,
5417 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5418 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5419 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5420 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
5421 115, 116, 117, 118, 119, -1, 121, -1, -1, -1,
5422 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5423 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5424 -1, -1, -1, 148, 149, 150, -1, -1, 153, -1,
5425 3, 4, 5, 158, 7, 160, -1, -1, 11, 12,
5426 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5427 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5428 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5429 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5430 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5431 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5432 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5433 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5434 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5435 103, -1, 105, 106, -1, 108, 109, 110, 111, 112,
5436 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5437 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
5438 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5439 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
5440 32, 33, 34, 35, 36, -1, -1, 39, -1, 162,
5441 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
5442 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5443 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5444 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5445 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5446 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5447 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
5448 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5449 -1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
5450 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
5451 21, 22, 23, 24, 25, 26, 148, 149, 150, 30,
5452 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
5453 162, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5454 51, 52, 53, 54, 55, 56, 57, -1, -1, -1,
5455 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5456 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
5457 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
5458 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
5459 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
5460 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5461 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5462 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
5463 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
5464 -1, -1, -1, -1, -1, 156, 157, 3, 4, 5,
5465 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
5466 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
5467 26, -1, -1, -1, 30, 31, 32, 33, 34, 35,
5468 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
5469 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5470 56, 57, -1, -1, -1, -1, -1, -1, -1, -1,
5471 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5472 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
5473 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
5474 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5475 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
5476 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5477 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5478 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5479 146, 147, -1, 149, 150, -1, -1, -1, -1, -1,
5480 156, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5481 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
5482 22, 23, 24, 25, 26, -1, -1, -1, 30, 31,
5483 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
5484 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5485 52, 53, 54, -1, 56, -1, -1, -1, -1, -1,
5486 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5487 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
5488 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
5489 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
5490 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
5491 112, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5492 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5493 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
5494 142, 143, 144, 145, 146, 147, -1, 149, 150, -1,
5495 -1, -1, -1, -1, 156, 3, 4, 5, 6, 7,
5496 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
5497 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
5498 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
5499 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5500 48, 49, 50, 51, 52, 53, -1, -1, 56, -1,
5501 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5502 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5503 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5504 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5505 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5506 108, 109, -1, -1, 112, -1, -1, -1, -1, -1,
5507 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5508 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5509 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5510 -1, 149, 150, -1, -1, -1, -1, -1, 156, 3,
5511 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
5512 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
5513 24, 25, 26, -1, -1, -1, 30, 31, 32, 33,
5514 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
5515 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5516 -1, -1, 56, -1, -1, -1, -1, -1, -1, -1,
5517 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5518 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
5519 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
5520 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
5521 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
5522 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5523 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5524 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
5525 144, 145, 146, 147, -1, 149, 150, 3, 4, 5,
5526 -1, 7, 156, -1, -1, 11, 12, -1, -1, -1,
5527 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5528 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
5529 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5530 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5531 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5532 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5533 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5534 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5535 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5536 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
5537 116, 117, 118, 119, -1, -1, -1, -1, -1, -1,
5538 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5539 -1, -1, -1, -1, -1, 3, 4, 5, -1, 7,
5540 -1, -1, 148, 11, 12, -1, -1, -1, 16, 155,
5541 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5542 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5543 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5544 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5545 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5547 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5548 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5549 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5550 -1, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5551 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5552 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5553 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5554 148, 11, 12, -1, -1, -1, 16, 155, 18, 19,
5555 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
5556 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5557 -1, -1, -1, -1, -1, 45, 46, -1, 48, 49,
5558 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5559 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5560 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5561 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5562 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5563 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5564 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5565 -1, -1, 1, -1, 3, 4, 5, -1, 7, -1,
5566 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5567 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
5568 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5569 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5570 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5571 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5572 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
5573 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5574 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
5575 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
5576 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
5577 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
5578 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5579 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
5580 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
5581 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5582 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5583 58, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5584 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5585 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5586 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5587 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5588 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
5589 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
5590 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5591 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5592 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
5593 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5594 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5595 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
5596 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
5597 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5598 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
5599 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
5600 -1, 108, 109, 110, 111, 112, 113, 114, 115, 116,
5601 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
5602 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5603 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5604 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
5605 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5606 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5607 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5608 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5609 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5610 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5611 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5612 106, -1, 108, 109, 110, 111, 112, 113, 114, 115,
5613 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
5614 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5615 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5616 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
5617 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5618 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5619 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
5620 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5621 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5622 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5623 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5624 105, 106, -1, 108, 109, 110, 111, 112, 113, 114,
5625 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
5626 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
5627 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
5628 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
5629 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5630 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5631 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
5632 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5633 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5634 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5635 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5636 -1, 105, 106, -1, 108, 109, -1, 111, 112, 113,
5637 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5638 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5639 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5640 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
5641 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5642 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5643 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5644 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5645 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5646 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5647 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5648 103, -1, 105, 106, -1, -1, 109, 110, 111, 112,
5649 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5650 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
5651 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5652 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
5653 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5654 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
5655 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
5656 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5657 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5658 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5659 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5660 102, 103, -1, 105, 106, -1, 108, 109, -1, 111,
5661 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5662 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5663 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
5664 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
5665 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5666 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5667 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
5668 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5669 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
5670 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5671 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
5672 -1, 102, 103, -1, 105, 106, -1, -1, 109, -1,
5673 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
5674 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
5675 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5676 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
5677 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5678 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
5679 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5680 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5681 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5682 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5683 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5684 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5685 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5686 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5687 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5688 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
5689 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5690 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5691 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5692 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5693 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
5694 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5695 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
5696 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
5697 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
5698 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
5699 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5700 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
5701 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
5702 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5703 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5704 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5705 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5706 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5707 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5708 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5709 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5710 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
5711 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5712 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5713 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
5714 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5715 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5716 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5717 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
5718 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5719 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
5720 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
5721 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
5722 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
5723 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5724 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5725 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
5726 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5727 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5728 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5729 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5730 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5731 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5732 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5733 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5734 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
5735 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5736 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5737 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
5738 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5739 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5740 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5741 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5742 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5743 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5744 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5745 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5746 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
5747 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
5748 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
5749 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
5750 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5751 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5752 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5753 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5754 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5755 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5756 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5757 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
5758 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5759 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5760 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5761 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
5762 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5763 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5764 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5765 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5766 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5767 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5768 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5769 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
5770 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5771 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
5772 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5773 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
5774 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5775 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
5776 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5777 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5778 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5779 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5780 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5781 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5782 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5783 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5784 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5785 23, 24, -1, -1, -1, -1, 148, 30, 31, 32,
5786 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5787 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5788 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5789 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5790 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5791 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5792 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5793 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
5794 113, 114, 115, 116, 117, 118, 119, -1, -1, 3,
5795 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
5796 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
5797 24, -1, -1, -1, -1, 148, 30, 31, 32, 33,
5798 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5799 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5800 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5801 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5802 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5803 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5804 -1, 95, -1, -1, -1, 99, -1, -1, 102, 103,
5805 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
5806 114, 115, 116, 117, 118, 119, -1, -1, 3, 4,
5807 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5808 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5809 -1, -1, -1, -1, 148, 30, 31, 32, 33, 34,
5810 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5811 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5812 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5813 65, -1, -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 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5817 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5818 115, 116, 117, 118, 119, -1, -1, 3, 4, 5,
5819 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5820 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5821 -1, -1, -1, 148, 30, 31, 32, 33, 34, 35,
5822 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5823 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5824 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5825 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5826 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5827 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5828 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5829 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
5830 116, 117, 118, 119, -1, -1, 3, 4, 5, -1,
5831 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5832 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5833 -1, -1, 148, 30, 31, 32, 33, 34, 35, 36,
5834 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5835 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5836 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5837 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5838 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5839 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5840 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
5841 -1, -1, -1, -1, 111, 112, 113, 114, 115, 116,
5842 117, 118, 119, -1, -1, 3, 4, 5, -1, 7,
5843 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5844 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5845 -1, 148, 30, 31, 32, 33, 34, 35, 36, -1,
5846 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5847 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5848 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5849 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5850 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5851 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5852 -1, 99, -1, -1, 102, 103, -1, 105, 106, 33,
5853 34, 35, 36, 111, 112, 113, 114, 115, 116, 117,
5854 118, 119, -1, -1, -1, 49, 50, 51, 52, -1,
5855 -1, -1, 56, -1, -1, 59, 60, 61, 62, 63,
5856 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5857 148, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5858 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5859 -1, -1, -1, -1, -1, 99, -1, -1, 102, -1,
5860 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5861 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5862 -1, -1, 33, 34, 35, 36, -1, -1, -1, -1,
5863 -1, -1, -1, -1, -1, -1, -1, 141, 49, 50,
5864 51, 52, -1, -1, 148, 56, -1, 58, 59, 60,
5865 61, 62, 63, -1, -1, -1, -1, -1, 162, -1,
5866 -1, -1, -1, -1, -1, -1, -1, 78, -1, -1,
5867 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5868 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
5869 -1, 102, -1, -1, 105, 106, -1, 108, 109, -1,
5870 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
5871 -1, -1, -1, -1, -1, 33, 34, 35, 36, -1,
5872 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5873 141, 49, 50, 51, 52, -1, -1, 148, 56, -1,
5874 -1, 59, 60, 61, 62, 63, -1, -1, -1, -1,
5875 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5876 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5877 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5878 -1, 99, -1, -1, 102, -1, -1, 105, 106, -1,
5879 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5880 118, 119, -1, -1, -1, -1, -1, -1, 33, 34,
5881 35, 36, -1, -1, -1, 52, 53, -1, -1, 56,
5882 -1, -1, -1, 141, 49, 50, 51, 52, -1, -1,
5883 148, 56, -1, -1, 59, 60, 61, 62, 63, 76,
5884 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
5885 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
5886 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5887 -1, 108, 109, -1, 99, -1, -1, 102, -1, -1,
5888 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5889 115, 116, 117, 118, 119, -1, -1, -1, -1, -1,
5890 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5891 147, -1, 149, 150, 52, 53, 141, -1, 56, 156,
5892 157, -1, -1, 148, -1, -1, -1, -1, -1, -1,
5893 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5894 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5895 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5896 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5897 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
5898 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5899 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5900 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5901 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
5902 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5903 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
5904 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
5905 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
5906 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
5907 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5908 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5909 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
5910 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
5911 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
5912 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5913 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
5914 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
5915 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
5916 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
5917 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5918 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5919 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
5920 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
5921 150, 52, 53, -1, -1, 56, 156, 157, -1, -1,
5922 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5923 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
5924 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
5925 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
5926 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
5927 -1, -1, -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, 138, 139, 140,
5930 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
5931 52, 53, -1, -1, 56, 156, 157, -1, -1, -1,
5932 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5933 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
5934 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
5935 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
5936 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
5937 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5938 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5939 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
5940 142, 143, 144, 145, 146, 147, -1, 149, 150, 52,
5941 53, -1, -1, 56, 156, 157, -1, -1, -1, -1,
5942 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5943 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
5944 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
5945 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
5946 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
5947 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5948 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5949 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
5950 143, 144, 145, 146, 147, -1, 149, 150, 52, 53,
5951 -1, -1, 56, 156, 157, -1, -1, -1, -1, -1,
5952 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5953 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
5954 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
5955 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
5956 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
5957 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5958 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5959 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
5960 144, 145, 146, 147, -1, 149, 150, 52, 53, -1,
5961 -1, 56, 156, 157, -1, -1, -1, -1, -1, -1,
5962 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5963 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
5964 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
5965 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
5966 -1, -1, -1, 108, 109, -1, -1, -1, -1, -1,
5967 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5968 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5969 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
5970 145, 146, 147, -1, 149, 150, 52, 53, -1, -1,
5971 56, 156, 157, -1, -1, -1, -1, -1, -1, -1,
5972 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5973 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
5974 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
5975 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5976 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
5977 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5978 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5979 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5980 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
5981 156, 157, -1, -1, -1, -1, -1, -1, -1, -1,
5982 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
5983 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
5984 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
5985 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5986 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
5987 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5988 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5989 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5990 147, -1, 149, 150, 52, 53, -1, -1, 56, 156,
5991 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5992 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5993 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5994 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5995 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5996 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
5997 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5998 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5999 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6000 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
6001 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6002 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
6003 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
6004 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
6005 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
6006 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6007 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6008 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
6009 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6010 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
6011 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6012 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
6013 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
6014 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
6015 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
6016 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6017 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6018 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
6019 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
6020 150, 52, 53, -1, -1, 56, 156, 157, -1, -1,
6021 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6022 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
6023 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
6024 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
6025 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
6026 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6027 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6028 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
6029 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
6030 52, 53, -1, -1, 56, 156, 157, -1, -1, -1,
6031 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6032 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
6033 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
6034 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
6035 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
6036 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6037 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6038 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
6039 142, 143, 144, 145, 146, 147, -1, 149, 150, -1,
6040 -1, -1, -1, -1, 156
6041};
6042
6043/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
6044 state STATE-NUM. */
6045static const yytype_int16 yystos[] =
6046{
6047 0, 164, 165, 0, 1, 3, 4, 5, 6, 7,
6048 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
6049 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
6050 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6051 57, 59, 60, 61, 62, 63, 64, 65, 76, 77,
6052 91, 92, 99, 102, 103, 105, 106, 108, 111, 112,
6053 113, 114, 115, 116, 117, 118, 119, 148, 149, 150,
6054 166, 167, 168, 176, 178, 180, 186, 187, 193, 194,
6055 196, 197, 198, 200, 201, 202, 204, 205, 214, 217,
6056 233, 245, 246, 247, 248, 249, 250, 251, 252, 253,
6057 254, 255, 264, 286, 295, 296, 348, 349, 350, 351,
6058 352, 353, 354, 357, 359, 360, 374, 375, 377, 378,
6059 379, 380, 381, 382, 383, 384, 385, 423, 437, 3,
6060 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
6061 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
6062 24, 25, 26, 30, 31, 32, 33, 34, 35, 36,
6063 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
6064 52, 53, 56, 76, 77, 78, 79, 80, 81, 82,
6065 83, 84, 87, 88, 93, 94, 95, 96, 108, 109,
6066 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6067 149, 150, 156, 208, 209, 210, 212, 213, 374, 39,
6068 58, 99, 102, 108, 109, 110, 113, 149, 186, 187,
6069 197, 205, 214, 219, 225, 228, 230, 245, 381, 382,
6070 384, 385, 421, 422, 225, 157, 226, 227, 157, 222,
6071 226, 157, 162, 430, 54, 209, 430, 152, 169, 152,
6072 21, 22, 31, 32, 196, 214, 245, 264, 214, 214,
6073 214, 56, 47, 102, 172, 173, 174, 176, 199, 200,
6074 437, 176, 235, 220, 230, 421, 437, 219, 420, 421,
6075 437, 46, 99, 148, 155, 186, 187, 204, 233, 245,
6076 381, 382, 385, 287, 208, 363, 376, 380, 363, 364,
6077 365, 161, 161, 161, 161, 379, 193, 214, 214, 160,
6078 162, 429, 435, 436, 40, 41, 42, 43, 44, 37,
6079 38, 157, 388, 389, 390, 391, 437, 388, 390, 26,
6080 152, 222, 226, 256, 297, 28, 257, 294, 135, 155,
6081 102, 108, 201, 135, 25, 78, 79, 80, 81, 82,
6082 83, 84, 85, 86, 87, 88, 89, 90, 95, 96,
6083 101, 136, 138, 139, 140, 141, 142, 143, 144, 145,
6084 146, 147, 216, 216, 69, 97, 98, 154, 427, 234,
6085 1, 180, 189, 189, 190, 191, 190, 189, 429, 436,
6086 99, 198, 205, 245, 269, 381, 382, 385, 52, 56,
6087 95, 99, 206, 207, 245, 381, 382, 385, 207, 33,
6088 34, 35, 36, 49, 50, 51, 52, 56, 157, 185,
6089 208, 383, 418, 225, 98, 427, 428, 297, 351, 100,
6090 100, 155, 219, 56, 219, 219, 219, 363, 388, 388,
6091 135, 101, 155, 229, 437, 98, 154, 427, 100, 100,
6092 155, 229, 225, 430, 431, 225, 92, 224, 225, 230,
6093 395, 421, 437, 180, 431, 180, 54, 64, 65, 177,
6094 157, 215, 166, 172, 98, 427, 100, 175, 199, 158,
6095 429, 436, 431, 236, 431, 159, 155, 430, 434, 155,
6096 434, 153, 434, 430, 56, 379, 201, 203, 389, 155,
6097 98, 154, 427, 288, 66, 120, 122, 123, 366, 120,
6098 120, 366, 67, 366, 355, 361, 358, 362, 78, 160,
6099 168, 189, 189, 189, 189, 176, 180, 180, 52, 54,
6100 55, 56, 57, 58, 78, 92, 102, 108, 109, 110,
6101 142, 145, 274, 336, 392, 394, 395, 396, 397, 398,
6102 399, 400, 401, 402, 405, 406, 407, 408, 409, 412,
6103 413, 414, 415, 416, 135, 243, 394, 135, 244, 298,
6104 299, 107, 195, 302, 303, 302, 218, 437, 199, 155,
6105 204, 155, 218, 183, 214, 214, 214, 214, 214, 214,
6106 214, 214, 214, 214, 214, 214, 214, 181, 214, 214,
6107 214, 214, 214, 214, 214, 214, 214, 214, 214, 52,
6108 53, 56, 212, 222, 423, 424, 425, 224, 230, 52,
6109 53, 56, 212, 222, 424, 170, 172, 13, 265, 435,
6110 265, 172, 189, 172, 429, 239, 56, 98, 154, 427,
6111 25, 180, 52, 56, 206, 139, 386, 98, 154, 427,
6112 242, 419, 69, 98, 426, 52, 56, 424, 218, 218,
6113 211, 125, 135, 135, 218, 219, 108, 219, 228, 421,
6114 52, 56, 224, 52, 56, 218, 218, 422, 431, 158,
6115 431, 155, 431, 155, 431, 209, 237, 214, 153, 153,
6116 424, 424, 218, 169, 431, 174, 431, 421, 155, 203,
6117 52, 56, 224, 52, 56, 289, 368, 367, 120, 356,
6118 366, 66, 120, 120, 356, 66, 120, 214, 102, 108,
6119 270, 271, 272, 273, 397, 155, 417, 437, 431, 275,
6120 276, 155, 393, 219, 155, 417, 34, 52, 155, 393,
6121 52, 155, 393, 52, 197, 214, 170, 435, 197, 214,
6122 170, 153, 300, 298, 10, 68, 263, 304, 263, 108,
6123 193, 219, 230, 231, 232, 431, 203, 155, 178, 179,
6124 193, 205, 214, 219, 221, 232, 245, 385, 184, 182,
6125 430, 100, 100, 222, 226, 430, 432, 155, 100, 100,
6126 222, 223, 226, 437, 263, 8, 258, 344, 437, 172,
6127 13, 172, 263, 27, 266, 435, 263, 25, 238, 309,
6128 17, 260, 307, 52, 56, 224, 52, 56, 190, 241,
6129 387, 240, 52, 56, 206, 224, 170, 180, 188, 223,
6130 226, 179, 214, 221, 179, 221, 209, 219, 219, 229,
6131 100, 100, 432, 100, 100, 395, 421, 180, 221, 434,
6132 201, 432, 157, 291, 394, 369, 54, 55, 57, 373,
6133 385, 161, 366, 161, 161, 161, 272, 397, 155, 431,
6134 155, 416, 219, 135, 392, 399, 412, 414, 402, 406,
6135 408, 400, 409, 414, 398, 400, 44, 44, 263, 44,
6136 44, 263, 301, 153, 305, 219, 155, 44, 203, 44,
6137 135, 44, 98, 154, 427, 52, 56, 58, 91, 92,
6138 99, 102, 105, 106, 108, 113, 141, 286, 315, 316,
6139 317, 318, 321, 326, 327, 328, 331, 332, 333, 334,
6140 335, 336, 337, 338, 339, 340, 341, 342, 343, 348,
6141 349, 352, 353, 354, 357, 359, 360, 382, 406, 315,
6142 137, 218, 218, 195, 159, 100, 218, 218, 195, 219,
6143 232, 345, 437, 9, 15, 259, 261, 347, 437, 14,
6144 261, 262, 267, 268, 437, 268, 192, 310, 307, 263,
6145 108, 219, 306, 263, 432, 172, 435, 189, 170, 432,
6146 263, 431, 185, 297, 294, 218, 218, 100, 218, 218,
6147 431, 155, 431, 394, 290, 370, 431, 270, 273, 271,
6148 155, 393, 155, 393, 417, 155, 393, 155, 393, 393,
6149 214, 214, 214, 214, 140, 281, 282, 437, 281, 108,
6150 219, 176, 176, 218, 214, 52, 56, 224, 52, 56,
6151 339, 339, 56, 206, 323, 316, 324, 325, 326, 327,
6152 330, 432, 322, 430, 433, 52, 363, 52, 102, 380,
6153 101, 155, 140, 155, 155, 316, 89, 90, 98, 154,
6154 157, 319, 320, 52, 214, 179, 221, 179, 221, 218,
6155 179, 221, 179, 221, 101, 346, 437, 172, 171, 172,
6156 189, 263, 263, 311, 263, 219, 155, 265, 263, 170,
6157 435, 263, 218, 283, 430, 29, 124, 292, 371, 155,
6158 155, 400, 414, 400, 400, 274, 277, 280, 283, 398,
6159 400, 401, 403, 404, 410, 411, 414, 416, 172, 170,
6160 219, 432, 316, 432, 316, 328, 330, 432, 155, 113,
6161 331, 153, 125, 189, 340, 324, 328, 321, 329, 330,
6162 333, 337, 339, 339, 206, 432, 431, 324, 327, 331,
6163 324, 327, 331, 179, 221, 99, 205, 245, 381, 382,
6164 385, 265, 172, 265, 314, 315, 108, 219, 172, 263,
6165 158, 160, 293, 172, 372, 271, 393, 155, 393, 393,
6166 393, 417, 283, 140, 275, 155, 278, 279, 99, 245,
6167 155, 417, 155, 278, 155, 278, 431, 155, 155, 363,
6168 433, 431, 155, 155, 431, 431, 431, 432, 432, 432,
6169 56, 98, 154, 427, 172, 347, 172, 265, 40, 41,
6170 219, 268, 307, 308, 52, 284, 285, 396, 170, 153,
6171 172, 400, 140, 245, 277, 411, 414, 56, 98, 403,
6172 408, 400, 410, 414, 400, 329, 329, 328, 330, 52,
6173 56, 224, 52, 56, 344, 267, 312, 189, 189, 155,
6174 430, 263, 121, 393, 155, 278, 155, 278, 52, 56,
6175 417, 155, 278, 155, 278, 278, 155, 432, 172, 285,
6176 400, 414, 400, 400, 268, 309, 313, 278, 155, 278,
6177 278, 278, 400, 278
6178};
6179
6180/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
6181static const yytype_int16 yyr1[] =
6182{
6183 0, 163, 165, 164, 166, 167, 167, 167, 168, 168,
6184 169, 171, 170, 170, 172, 173, 173, 173, 174, 175,
6185 174, 177, 176, 176, 176, 176, 176, 176, 176, 176,
6186 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
6187 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
6188 178, 178, 179, 179, 179, 180, 180, 180, 180, 180,
6189 181, 182, 180, 183, 184, 180, 180, 185, 186, 188,
6190 187, 189, 189, 191, 192, 190, 193, 193, 194, 194,
6191 195, 196, 197, 197, 197, 197, 197, 197, 197, 197,
6192 197, 197, 197, 198, 198, 199, 199, 200, 200, 200,
6193 200, 200, 200, 200, 200, 200, 200, 201, 201, 202,
6194 202, 203, 203, 204, 204, 204, 204, 204, 204, 204,
6195 204, 204, 205, 205, 205, 205, 205, 205, 205, 205,
6196 205, 206, 206, 207, 207, 207, 208, 208, 208, 208,
6197 208, 209, 209, 210, 211, 210, 212, 212, 212, 212,
6198 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
6199 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
6200 212, 212, 212, 212, 212, 212, 213, 213, 213, 213,
6201 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
6202 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
6203 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
6204 213, 213, 213, 213, 213, 213, 213, 214, 214, 214,
6205 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
6206 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
6207 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
6208 214, 214, 214, 214, 214, 214, 214, 215, 214, 214,
6209 214, 214, 214, 214, 214, 216, 216, 216, 216, 217,
6210 217, 218, 219, 220, 220, 220, 220, 221, 221, 222,
6211 222, 222, 223, 223, 224, 224, 224, 224, 224, 225,
6212 225, 225, 225, 225, 227, 226, 228, 228, 229, 229,
6213 230, 230, 230, 230, 230, 230, 231, 231, 232, 232,
6214 232, 233, 233, 233, 233, 233, 233, 233, 233, 233,
6215 233, 233, 234, 233, 235, 233, 236, 233, 233, 233,
6216 233, 233, 233, 233, 233, 233, 233, 237, 233, 233,
6217 233, 233, 233, 233, 233, 233, 233, 233, 233, 238,
6218 233, 239, 233, 233, 233, 240, 233, 241, 233, 242,
6219 233, 243, 233, 244, 233, 233, 233, 233, 233, 245,
6220 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
6221 256, 257, 258, 259, 260, 261, 262, 263, 263, 264,
6222 265, 265, 265, 266, 266, 267, 267, 268, 268, 269,
6223 269, 270, 270, 271, 271, 272, 272, 272, 272, 272,
6224 273, 273, 274, 274, 276, 275, 277, 277, 277, 277,
6225 278, 278, 279, 280, 280, 280, 280, 280, 280, 280,
6226 280, 280, 280, 280, 280, 280, 280, 280, 281, 281,
6227 282, 282, 283, 283, 284, 284, 285, 285, 287, 288,
6228 289, 290, 286, 291, 291, 292, 293, 292, 294, 295,
6229 295, 295, 295, 296, 296, 296, 296, 296, 296, 296,
6230 296, 296, 297, 297, 299, 300, 301, 298, 303, 304,
6231 305, 302, 306, 306, 306, 306, 307, 308, 308, 310,
6232 311, 312, 309, 313, 313, 314, 314, 314, 315, 315,
6233 315, 315, 315, 315, 316, 317, 317, 318, 318, 319,
6234 320, 321, 321, 321, 321, 321, 321, 321, 321, 321,
6235 321, 321, 321, 321, 322, 321, 321, 323, 321, 324,
6236 324, 324, 324, 324, 324, 325, 325, 326, 326, 327,
6237 328, 328, 329, 329, 330, 331, 331, 331, 331, 332,
6238 332, 333, 333, 334, 334, 335, 335, 336, 337, 337,
6239 338, 338, 338, 338, 338, 338, 338, 338, 338, 338,
6240 339, 339, 339, 339, 339, 339, 339, 339, 339, 339,
6241 340, 341, 341, 342, 343, 343, 343, 344, 344, 345,
6242 345, 345, 346, 346, 347, 347, 348, 348, 349, 350,
6243 350, 350, 351, 352, 353, 354, 355, 355, 356, 356,
6244 357, 358, 358, 359, 360, 361, 361, 362, 362, 363,
6245 363, 364, 364, 365, 365, 366, 367, 366, 368, 369,
6246 370, 371, 372, 366, 373, 373, 373, 373, 374, 374,
6247 375, 376, 376, 377, 378, 378, 379, 379, 379, 379,
6248 380, 380, 380, 381, 381, 381, 382, 382, 382, 382,
6249 382, 382, 382, 383, 383, 384, 384, 385, 385, 387,
6250 386, 386, 388, 388, 389, 390, 391, 390, 392, 392,
6251 392, 392, 392, 393, 393, 394, 394, 394, 394, 394,
6252 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
6253 395, 396, 396, 396, 396, 397, 397, 398, 399, 399,
6254 400, 400, 401, 402, 402, 403, 403, 404, 404, 405,
6255 405, 406, 406, 407, 408, 408, 409, 410, 411, 411,
6256 412, 412, 413, 413, 414, 414, 415, 415, 416, 416,
6257 417, 417, 418, 419, 418, 420, 420, 421, 421, 422,
6258 422, 422, 422, 422, 422, 423, 423, 423, 424, 424,
6259 425, 425, 425, 426, 426, 427, 427, 428, 428, 429,
6260 429, 430, 430, 431, 432, 433, 434, 434, 435, 435,
6261 436, 436, 437
6262};
6263
6264/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
6265static const yytype_int8 yyr2[] =
6266{
6267 0, 2, 0, 2, 2, 1, 1, 3, 1, 2,
6268 3, 0, 6, 3, 2, 1, 1, 3, 1, 0,
6269 3, 0, 4, 3, 3, 3, 2, 3, 3, 3,
6270 3, 3, 4, 1, 4, 4, 6, 4, 1, 1,
6271 4, 4, 7, 6, 6, 6, 6, 4, 6, 4,
6272 6, 4, 1, 3, 1, 1, 3, 3, 3, 2,
6273 0, 0, 5, 0, 0, 5, 1, 1, 2, 0,
6274 5, 1, 1, 0, 0, 4, 1, 1, 1, 4,
6275 3, 1, 2, 3, 4, 5, 4, 5, 2, 2,
6276 2, 2, 2, 1, 3, 1, 3, 1, 2, 3,
6277 5, 2, 4, 2, 4, 1, 3, 1, 3, 2,
6278 3, 1, 3, 1, 1, 4, 3, 3, 3, 3,
6279 2, 1, 1, 1, 4, 3, 3, 3, 3, 2,
6280 1, 1, 1, 2, 1, 3, 1, 1, 1, 1,
6281 1, 1, 1, 1, 0, 4, 1, 1, 1, 1,
6282 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6283 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6284 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6285 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6286 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6287 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6288 1, 1, 1, 1, 1, 1, 1, 4, 4, 7,
6289 6, 6, 6, 6, 5, 4, 3, 3, 2, 2,
6290 2, 2, 3, 3, 3, 3, 3, 3, 4, 2,
6291 2, 3, 3, 3, 3, 1, 3, 3, 3, 3,
6292 3, 2, 2, 3, 3, 3, 3, 0, 4, 6,
6293 4, 6, 4, 6, 1, 1, 1, 1, 1, 3,
6294 3, 1, 1, 1, 2, 4, 2, 1, 3, 3,
6295 5, 3, 1, 1, 1, 1, 2, 4, 2, 1,
6296 2, 2, 4, 1, 0, 2, 2, 1, 2, 1,
6297 1, 2, 1, 3, 4, 3, 1, 1, 3, 4,
6298 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6299 1, 1, 0, 4, 0, 3, 0, 4, 3, 3,
6300 2, 3, 3, 1, 4, 3, 1, 0, 6, 4,
6301 3, 2, 1, 2, 1, 6, 6, 4, 4, 0,
6302 6, 0, 5, 5, 6, 0, 6, 0, 7, 0,
6303 5, 0, 5, 0, 5, 1, 1, 1, 1, 1,
6304 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6305 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6306 1, 1, 2, 1, 1, 1, 5, 1, 2, 1,
6307 1, 1, 3, 1, 3, 1, 3, 5, 1, 3,
6308 2, 1, 1, 1, 0, 2, 4, 2, 2, 1,
6309 2, 0, 1, 6, 8, 4, 6, 4, 2, 6,
6310 2, 4, 6, 2, 4, 2, 4, 1, 1, 1,
6311 3, 4, 1, 4, 1, 3, 1, 1, 0, 0,
6312 0, 0, 7, 4, 1, 3, 0, 4, 3, 2,
6313 4, 5, 5, 2, 4, 4, 3, 3, 3, 2,
6314 1, 4, 3, 3, 0, 0, 0, 5, 0, 0,
6315 0, 5, 1, 2, 3, 4, 5, 1, 1, 0,
6316 0, 0, 8, 1, 1, 1, 3, 3, 1, 2,
6317 3, 1, 1, 1, 1, 3, 1, 3, 1, 1,
6318 1, 1, 1, 4, 4, 4, 3, 4, 4, 4,
6319 3, 3, 3, 2, 0, 4, 2, 0, 4, 1,
6320 1, 2, 2, 4, 1, 2, 3, 1, 3, 5,
6321 2, 1, 1, 3, 1, 3, 1, 2, 1, 1,
6322 3, 2, 1, 1, 3, 2, 1, 2, 1, 1,
6323 1, 3, 3, 2, 2, 1, 1, 1, 2, 2,
6324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6325 1, 2, 2, 4, 2, 3, 1, 6, 1, 1,
6326 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
6327 1, 2, 3, 3, 3, 4, 0, 3, 1, 2,
6328 4, 0, 3, 4, 4, 0, 3, 0, 3, 0,
6329 2, 0, 2, 0, 2, 1, 0, 3, 0, 0,
6330 0, 0, 0, 8, 1, 1, 1, 1, 1, 1,
6331 2, 1, 1, 3, 1, 2, 1, 1, 1, 1,
6332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6333 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6334 4, 0, 1, 1, 3, 1, 0, 3, 4, 2,
6335 2, 1, 1, 2, 0, 6, 8, 4, 6, 4,
6336 6, 2, 4, 6, 2, 4, 2, 4, 1, 0,
6337 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
6338 1, 3, 1, 2, 1, 2, 1, 1, 3, 1,
6339 3, 1, 1, 1, 2, 1, 3, 3, 1, 3,
6340 1, 3, 1, 1, 2, 1, 1, 1, 2, 1,
6341 2, 1, 1, 0, 4, 1, 2, 1, 3, 3,
6342 2, 1, 4, 2, 1, 1, 1, 1, 1, 1,
6343 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6344 1, 0, 1, 2, 2, 2, 1, 1, 1, 1,
6345 1, 2, 0
6346};
6347
6348
6349enum { YYENOMEM = -2 };
6350
6351#define yyerrok (yyerrstatus = 0)
6352#define yyclearin (yychar = YYEMPTY)
6353
6354#define YYACCEPT goto yyacceptlab
6355#define YYABORT goto yyabortlab
6356#define YYERROR goto yyerrorlab
6357#define YYNOMEM goto yyexhaustedlab
6358
6359
6360#define YYRECOVERING() (!!yyerrstatus)
6361
6362#define YYBACKUP(Token, Value) \
6363 do \
6364 if (yychar == YYEMPTY) \
6365 { \
6366 yychar = (Token); \
6367 yylval = (Value); \
6368 YYPOPSTACK (yylen); \
6369 yystate = *yyssp; \
6370 goto yybackup; \
6371 } \
6372 else \
6373 { \
6374 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
6375 YYERROR; \
6376 } \
6377 while (0)
6378
6379/* Backward compatibility with an undocumented macro.
6380 Use YYerror or YYUNDEF. */
6381#define YYERRCODE YYUNDEF
6382
6383/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6384 If N is 0, then set CURRENT to the empty location which ends
6385 the previous symbol: RHS[0] (always defined). */
6386
6387#ifndef YYLLOC_DEFAULT
6388# define YYLLOC_DEFAULT(Current, Rhs, N) \
6389 do \
6390 if (N) \
6391 { \
6392 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
6393 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
6394 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
6395 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
6396 } \
6397 else \
6398 { \
6399 (Current).first_line = (Current).last_line = \
6400 YYRHSLOC (Rhs, 0).last_line; \
6401 (Current).first_column = (Current).last_column = \
6402 YYRHSLOC (Rhs, 0).last_column; \
6403 } \
6404 while (0)
6405#endif
6406
6407#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6408
6409
6410/* Enable debugging if requested. */
6411#if YYDEBUG
6412
6413# ifndef YYFPRINTF
6414# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6415# define YYFPRINTF fprintf
6416# endif
6417
6418# define YYDPRINTF(Args) \
6419do { \
6420 if (yydebug) \
6421 YYFPRINTF Args; \
6422} while (0)
6423
6424
6425/* YYLOCATION_PRINT -- Print the location on the stream.
6426 This macro was not mandated originally: define only if we know
6427 we won't break user code: when these are the locations we know. */
6428
6429# ifndef YYLOCATION_PRINT
6430
6431# if defined YY_LOCATION_PRINT
6432
6433 /* Temporary convenience wrapper in case some people defined the
6434 undocumented and private YY_LOCATION_PRINT macros. */
6435# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
6436
6437# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6438
6439/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
6440
6441YY_ATTRIBUTE_UNUSED
6442static int
6443yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
6444{
6445 int res = 0;
6446 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
6447 if (0 <= yylocp->first_line)
6448 {
6449 res += YYFPRINTF (p, "%d", yylocp->first_line);
6450 if (0 <= yylocp->first_column)
6451 res += YYFPRINTF (p, ".%d", yylocp->first_column);
6452 }
6453 if (0 <= yylocp->last_line)
6454 {
6455 if (yylocp->first_line < yylocp->last_line)
6456 {
6457 res += YYFPRINTF (p, "-%d", yylocp->last_line);
6458 if (0 <= end_col)
6459 res += YYFPRINTF (p, ".%d", end_col);
6460 }
6461 else if (0 <= end_col && yylocp->first_column < end_col)
6462 res += YYFPRINTF (p, "-%d", end_col);
6463 }
6464 return res;
6465}
6466
6467# define YYLOCATION_PRINT yy_location_print_
6468
6469 /* Temporary convenience wrapper in case some people defined the
6470 undocumented and private YY_LOCATION_PRINT macros. */
6471# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
6472
6473# else
6474
6475# define YYLOCATION_PRINT(File, Loc) ((void) 0)
6476 /* Temporary convenience wrapper in case some people defined the
6477 undocumented and private YY_LOCATION_PRINT macros. */
6478# define YY_LOCATION_PRINT YYLOCATION_PRINT
6479
6480# endif
6481# endif /* !defined YYLOCATION_PRINT */
6482
6483
6484# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
6485do { \
6486 if (yydebug) \
6487 { \
6488 YYFPRINTF (p, "%s ", Title); \
6489 yy_symbol_print (stderr, \
6490 Kind, Value, Location, p); \
6491 YYFPRINTF (p, "\n"); \
6492 } \
6493} while (0)
6494
6495
6496/*-----------------------------------.
6497| Print this symbol's value on YYO. |
6498`-----------------------------------*/
6499
6500static void
6501yy_symbol_value_print (FILE *yyo,
6502 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6503{
6504 FILE *yyoutput = yyo;
6505 YY_USE (yyoutput);
6506 YY_USE (yylocationp);
6507 YY_USE (p);
6508 if (!yyvaluep)
6509 return;
6510 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6511 switch (yykind)
6512 {
6513 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
6514#line 1347 "parse.y"
6515 {
6516#ifndef RIPPER
6517 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6518#else
6519 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6520#endif
6521}
6522#line 6521 "parse.c"
6523 break;
6524
6525 case YYSYMBOL_tFID: /* "method" */
6526#line 1347 "parse.y"
6527 {
6528#ifndef RIPPER
6529 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6530#else
6531 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6532#endif
6533}
6534#line 6533 "parse.c"
6535 break;
6536
6537 case YYSYMBOL_tGVAR: /* "global variable" */
6538#line 1347 "parse.y"
6539 {
6540#ifndef RIPPER
6541 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6542#else
6543 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6544#endif
6545}
6546#line 6545 "parse.c"
6547 break;
6548
6549 case YYSYMBOL_tIVAR: /* "instance variable" */
6550#line 1347 "parse.y"
6551 {
6552#ifndef RIPPER
6553 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6554#else
6555 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6556#endif
6557}
6558#line 6557 "parse.c"
6559 break;
6560
6561 case YYSYMBOL_tCONSTANT: /* "constant" */
6562#line 1347 "parse.y"
6563 {
6564#ifndef RIPPER
6565 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6566#else
6567 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6568#endif
6569}
6570#line 6569 "parse.c"
6571 break;
6572
6573 case YYSYMBOL_tCVAR: /* "class variable" */
6574#line 1347 "parse.y"
6575 {
6576#ifndef RIPPER
6577 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6578#else
6579 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6580#endif
6581}
6582#line 6581 "parse.c"
6583 break;
6584
6585 case YYSYMBOL_tLABEL: /* "label" */
6586#line 1347 "parse.y"
6587 {
6588#ifndef RIPPER
6589 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6590#else
6591 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6592#endif
6593}
6594#line 6593 "parse.c"
6595 break;
6596
6597 case YYSYMBOL_tINTEGER: /* "integer literal" */
6598#line 1354 "parse.y"
6599 {
6600#ifndef RIPPER
6601 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6602#else
6603 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6604#endif
6605}
6606#line 6605 "parse.c"
6607 break;
6608
6609 case YYSYMBOL_tFLOAT: /* "float literal" */
6610#line 1354 "parse.y"
6611 {
6612#ifndef RIPPER
6613 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6614#else
6615 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6616#endif
6617}
6618#line 6617 "parse.c"
6619 break;
6620
6621 case YYSYMBOL_tRATIONAL: /* "rational literal" */
6622#line 1354 "parse.y"
6623 {
6624#ifndef RIPPER
6625 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6626#else
6627 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6628#endif
6629}
6630#line 6629 "parse.c"
6631 break;
6632
6633 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
6634#line 1354 "parse.y"
6635 {
6636#ifndef RIPPER
6637 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6638#else
6639 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6640#endif
6641}
6642#line 6641 "parse.c"
6643 break;
6644
6645 case YYSYMBOL_tCHAR: /* "char literal" */
6646#line 1354 "parse.y"
6647 {
6648#ifndef RIPPER
6649 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6650#else
6651 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6652#endif
6653}
6654#line 6653 "parse.c"
6655 break;
6656
6657 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
6658#line 1361 "parse.y"
6659 {
6660#ifndef RIPPER
6661 rb_parser_printf(p, "$%ld", ((*yyvaluep).node)->nd_nth);
6662#else
6663 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6664#endif
6665}
6666#line 6665 "parse.c"
6667 break;
6668
6669 case YYSYMBOL_tBACK_REF: /* "back reference" */
6670#line 1368 "parse.y"
6671 {
6672#ifndef RIPPER
6673 rb_parser_printf(p, "$%c", (int)((*yyvaluep).node)->nd_nth);
6674#else
6675 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6676#endif
6677}
6678#line 6677 "parse.c"
6679 break;
6680
6681 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
6682#line 1354 "parse.y"
6683 {
6684#ifndef RIPPER
6685 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6686#else
6687 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6688#endif
6689}
6690#line 6689 "parse.c"
6691 break;
6692
6693 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
6694#line 1347 "parse.y"
6695 {
6696#ifndef RIPPER
6697 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6698#else
6699 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6700#endif
6701}
6702#line 6701 "parse.c"
6703 break;
6704
6705 case YYSYMBOL_top_compstmt: /* top_compstmt */
6706#line 1339 "parse.y"
6707 {
6708#ifndef RIPPER
6709 if (((*yyvaluep).node)) {
6710 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6711 }
6712#else
6713#endif
6714}
6715#line 6714 "parse.c"
6716 break;
6717
6718 case YYSYMBOL_top_stmts: /* top_stmts */
6719#line 1339 "parse.y"
6720 {
6721#ifndef RIPPER
6722 if (((*yyvaluep).node)) {
6723 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6724 }
6725#else
6726#endif
6727}
6728#line 6727 "parse.c"
6729 break;
6730
6731 case YYSYMBOL_top_stmt: /* top_stmt */
6732#line 1339 "parse.y"
6733 {
6734#ifndef RIPPER
6735 if (((*yyvaluep).node)) {
6736 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6737 }
6738#else
6739#endif
6740}
6741#line 6740 "parse.c"
6742 break;
6743
6744 case YYSYMBOL_begin_block: /* begin_block */
6745#line 1339 "parse.y"
6746 {
6747#ifndef RIPPER
6748 if (((*yyvaluep).node)) {
6749 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6750 }
6751#else
6752#endif
6753}
6754#line 6753 "parse.c"
6755 break;
6756
6757 case YYSYMBOL_bodystmt: /* bodystmt */
6758#line 1339 "parse.y"
6759 {
6760#ifndef RIPPER
6761 if (((*yyvaluep).node)) {
6762 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6763 }
6764#else
6765#endif
6766}
6767#line 6766 "parse.c"
6768 break;
6769
6770 case YYSYMBOL_compstmt: /* compstmt */
6771#line 1339 "parse.y"
6772 {
6773#ifndef RIPPER
6774 if (((*yyvaluep).node)) {
6775 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6776 }
6777#else
6778#endif
6779}
6780#line 6779 "parse.c"
6781 break;
6782
6783 case YYSYMBOL_stmts: /* stmts */
6784#line 1339 "parse.y"
6785 {
6786#ifndef RIPPER
6787 if (((*yyvaluep).node)) {
6788 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6789 }
6790#else
6791#endif
6792}
6793#line 6792 "parse.c"
6794 break;
6795
6796 case YYSYMBOL_stmt_or_begin: /* stmt_or_begin */
6797#line 1339 "parse.y"
6798 {
6799#ifndef RIPPER
6800 if (((*yyvaluep).node)) {
6801 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6802 }
6803#else
6804#endif
6805}
6806#line 6805 "parse.c"
6807 break;
6808
6809 case YYSYMBOL_stmt: /* stmt */
6810#line 1339 "parse.y"
6811 {
6812#ifndef RIPPER
6813 if (((*yyvaluep).node)) {
6814 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6815 }
6816#else
6817#endif
6818}
6819#line 6818 "parse.c"
6820 break;
6821
6822 case YYSYMBOL_command_asgn: /* command_asgn */
6823#line 1339 "parse.y"
6824 {
6825#ifndef RIPPER
6826 if (((*yyvaluep).node)) {
6827 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6828 }
6829#else
6830#endif
6831}
6832#line 6831 "parse.c"
6833 break;
6834
6835 case YYSYMBOL_command_rhs: /* command_rhs */
6836#line 1339 "parse.y"
6837 {
6838#ifndef RIPPER
6839 if (((*yyvaluep).node)) {
6840 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6841 }
6842#else
6843#endif
6844}
6845#line 6844 "parse.c"
6846 break;
6847
6848 case YYSYMBOL_expr: /* expr */
6849#line 1339 "parse.y"
6850 {
6851#ifndef RIPPER
6852 if (((*yyvaluep).node)) {
6853 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6854 }
6855#else
6856#endif
6857}
6858#line 6857 "parse.c"
6859 break;
6860
6861 case YYSYMBOL_def_name: /* def_name */
6862#line 1339 "parse.y"
6863 {
6864#ifndef RIPPER
6865 if (((*yyvaluep).node)) {
6866 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6867 }
6868#else
6869#endif
6870}
6871#line 6870 "parse.c"
6872 break;
6873
6874 case YYSYMBOL_defn_head: /* defn_head */
6875#line 1339 "parse.y"
6876 {
6877#ifndef RIPPER
6878 if (((*yyvaluep).node)) {
6879 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6880 }
6881#else
6882#endif
6883}
6884#line 6883 "parse.c"
6885 break;
6886
6887 case YYSYMBOL_defs_head: /* defs_head */
6888#line 1339 "parse.y"
6889 {
6890#ifndef RIPPER
6891 if (((*yyvaluep).node)) {
6892 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6893 }
6894#else
6895#endif
6896}
6897#line 6896 "parse.c"
6898 break;
6899
6900 case YYSYMBOL_expr_value: /* expr_value */
6901#line 1339 "parse.y"
6902 {
6903#ifndef RIPPER
6904 if (((*yyvaluep).node)) {
6905 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6906 }
6907#else
6908#endif
6909}
6910#line 6909 "parse.c"
6911 break;
6912
6913 case YYSYMBOL_expr_value_do: /* expr_value_do */
6914#line 1339 "parse.y"
6915 {
6916#ifndef RIPPER
6917 if (((*yyvaluep).node)) {
6918 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6919 }
6920#else
6921#endif
6922}
6923#line 6922 "parse.c"
6924 break;
6925
6926 case YYSYMBOL_command_call: /* command_call */
6927#line 1339 "parse.y"
6928 {
6929#ifndef RIPPER
6930 if (((*yyvaluep).node)) {
6931 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6932 }
6933#else
6934#endif
6935}
6936#line 6935 "parse.c"
6937 break;
6938
6939 case YYSYMBOL_block_command: /* block_command */
6940#line 1339 "parse.y"
6941 {
6942#ifndef RIPPER
6943 if (((*yyvaluep).node)) {
6944 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6945 }
6946#else
6947#endif
6948}
6949#line 6948 "parse.c"
6950 break;
6951
6952 case YYSYMBOL_cmd_brace_block: /* cmd_brace_block */
6953#line 1339 "parse.y"
6954 {
6955#ifndef RIPPER
6956 if (((*yyvaluep).node)) {
6957 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6958 }
6959#else
6960#endif
6961}
6962#line 6961 "parse.c"
6963 break;
6964
6965 case YYSYMBOL_fcall: /* fcall */
6966#line 1339 "parse.y"
6967 {
6968#ifndef RIPPER
6969 if (((*yyvaluep).node)) {
6970 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6971 }
6972#else
6973#endif
6974}
6975#line 6974 "parse.c"
6976 break;
6977
6978 case YYSYMBOL_command: /* command */
6979#line 1339 "parse.y"
6980 {
6981#ifndef RIPPER
6982 if (((*yyvaluep).node)) {
6983 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6984 }
6985#else
6986#endif
6987}
6988#line 6987 "parse.c"
6989 break;
6990
6991 case YYSYMBOL_mlhs: /* mlhs */
6992#line 1339 "parse.y"
6993 {
6994#ifndef RIPPER
6995 if (((*yyvaluep).node)) {
6996 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6997 }
6998#else
6999#endif
7000}
7001#line 7000 "parse.c"
7002 break;
7003
7004 case YYSYMBOL_mlhs_inner: /* mlhs_inner */
7005#line 1339 "parse.y"
7006 {
7007#ifndef RIPPER
7008 if (((*yyvaluep).node)) {
7009 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7010 }
7011#else
7012#endif
7013}
7014#line 7013 "parse.c"
7015 break;
7016
7017 case YYSYMBOL_mlhs_basic: /* mlhs_basic */
7018#line 1339 "parse.y"
7019 {
7020#ifndef RIPPER
7021 if (((*yyvaluep).node)) {
7022 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7023 }
7024#else
7025#endif
7026}
7027#line 7026 "parse.c"
7028 break;
7029
7030 case YYSYMBOL_mlhs_item: /* mlhs_item */
7031#line 1339 "parse.y"
7032 {
7033#ifndef RIPPER
7034 if (((*yyvaluep).node)) {
7035 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7036 }
7037#else
7038#endif
7039}
7040#line 7039 "parse.c"
7041 break;
7042
7043 case YYSYMBOL_mlhs_head: /* mlhs_head */
7044#line 1339 "parse.y"
7045 {
7046#ifndef RIPPER
7047 if (((*yyvaluep).node)) {
7048 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7049 }
7050#else
7051#endif
7052}
7053#line 7052 "parse.c"
7054 break;
7055
7056 case YYSYMBOL_mlhs_post: /* mlhs_post */
7057#line 1339 "parse.y"
7058 {
7059#ifndef RIPPER
7060 if (((*yyvaluep).node)) {
7061 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7062 }
7063#else
7064#endif
7065}
7066#line 7065 "parse.c"
7067 break;
7068
7069 case YYSYMBOL_mlhs_node: /* mlhs_node */
7070#line 1339 "parse.y"
7071 {
7072#ifndef RIPPER
7073 if (((*yyvaluep).node)) {
7074 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7075 }
7076#else
7077#endif
7078}
7079#line 7078 "parse.c"
7080 break;
7081
7082 case YYSYMBOL_lhs: /* lhs */
7083#line 1339 "parse.y"
7084 {
7085#ifndef RIPPER
7086 if (((*yyvaluep).node)) {
7087 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7088 }
7089#else
7090#endif
7091}
7092#line 7091 "parse.c"
7093 break;
7094
7095 case YYSYMBOL_cpath: /* cpath */
7096#line 1339 "parse.y"
7097 {
7098#ifndef RIPPER
7099 if (((*yyvaluep).node)) {
7100 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7101 }
7102#else
7103#endif
7104}
7105#line 7104 "parse.c"
7106 break;
7107
7108 case YYSYMBOL_fitem: /* fitem */
7109#line 1339 "parse.y"
7110 {
7111#ifndef RIPPER
7112 if (((*yyvaluep).node)) {
7113 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7114 }
7115#else
7116#endif
7117}
7118#line 7117 "parse.c"
7119 break;
7120
7121 case YYSYMBOL_undef_list: /* undef_list */
7122#line 1339 "parse.y"
7123 {
7124#ifndef RIPPER
7125 if (((*yyvaluep).node)) {
7126 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7127 }
7128#else
7129#endif
7130}
7131#line 7130 "parse.c"
7132 break;
7133
7134 case YYSYMBOL_arg: /* arg */
7135#line 1339 "parse.y"
7136 {
7137#ifndef RIPPER
7138 if (((*yyvaluep).node)) {
7139 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7140 }
7141#else
7142#endif
7143}
7144#line 7143 "parse.c"
7145 break;
7146
7147 case YYSYMBOL_rel_expr: /* rel_expr */
7148#line 1339 "parse.y"
7149 {
7150#ifndef RIPPER
7151 if (((*yyvaluep).node)) {
7152 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7153 }
7154#else
7155#endif
7156}
7157#line 7156 "parse.c"
7158 break;
7159
7160 case YYSYMBOL_arg_value: /* arg_value */
7161#line 1339 "parse.y"
7162 {
7163#ifndef RIPPER
7164 if (((*yyvaluep).node)) {
7165 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7166 }
7167#else
7168#endif
7169}
7170#line 7169 "parse.c"
7171 break;
7172
7173 case YYSYMBOL_aref_args: /* aref_args */
7174#line 1339 "parse.y"
7175 {
7176#ifndef RIPPER
7177 if (((*yyvaluep).node)) {
7178 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7179 }
7180#else
7181#endif
7182}
7183#line 7182 "parse.c"
7184 break;
7185
7186 case YYSYMBOL_arg_rhs: /* arg_rhs */
7187#line 1339 "parse.y"
7188 {
7189#ifndef RIPPER
7190 if (((*yyvaluep).node)) {
7191 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7192 }
7193#else
7194#endif
7195}
7196#line 7195 "parse.c"
7197 break;
7198
7199 case YYSYMBOL_paren_args: /* paren_args */
7200#line 1339 "parse.y"
7201 {
7202#ifndef RIPPER
7203 if (((*yyvaluep).node)) {
7204 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7205 }
7206#else
7207#endif
7208}
7209#line 7208 "parse.c"
7210 break;
7211
7212 case YYSYMBOL_opt_paren_args: /* opt_paren_args */
7213#line 1339 "parse.y"
7214 {
7215#ifndef RIPPER
7216 if (((*yyvaluep).node)) {
7217 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7218 }
7219#else
7220#endif
7221}
7222#line 7221 "parse.c"
7223 break;
7224
7225 case YYSYMBOL_opt_call_args: /* opt_call_args */
7226#line 1339 "parse.y"
7227 {
7228#ifndef RIPPER
7229 if (((*yyvaluep).node)) {
7230 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7231 }
7232#else
7233#endif
7234}
7235#line 7234 "parse.c"
7236 break;
7237
7238 case YYSYMBOL_call_args: /* call_args */
7239#line 1339 "parse.y"
7240 {
7241#ifndef RIPPER
7242 if (((*yyvaluep).node)) {
7243 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7244 }
7245#else
7246#endif
7247}
7248#line 7247 "parse.c"
7249 break;
7250
7251 case YYSYMBOL_command_args: /* command_args */
7252#line 1339 "parse.y"
7253 {
7254#ifndef RIPPER
7255 if (((*yyvaluep).node)) {
7256 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7257 }
7258#else
7259#endif
7260}
7261#line 7260 "parse.c"
7262 break;
7263
7264 case YYSYMBOL_block_arg: /* block_arg */
7265#line 1339 "parse.y"
7266 {
7267#ifndef RIPPER
7268 if (((*yyvaluep).node)) {
7269 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7270 }
7271#else
7272#endif
7273}
7274#line 7273 "parse.c"
7275 break;
7276
7277 case YYSYMBOL_opt_block_arg: /* opt_block_arg */
7278#line 1339 "parse.y"
7279 {
7280#ifndef RIPPER
7281 if (((*yyvaluep).node)) {
7282 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7283 }
7284#else
7285#endif
7286}
7287#line 7286 "parse.c"
7288 break;
7289
7290 case YYSYMBOL_args: /* args */
7291#line 1339 "parse.y"
7292 {
7293#ifndef RIPPER
7294 if (((*yyvaluep).node)) {
7295 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7296 }
7297#else
7298#endif
7299}
7300#line 7299 "parse.c"
7301 break;
7302
7303 case YYSYMBOL_mrhs_arg: /* mrhs_arg */
7304#line 1339 "parse.y"
7305 {
7306#ifndef RIPPER
7307 if (((*yyvaluep).node)) {
7308 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7309 }
7310#else
7311#endif
7312}
7313#line 7312 "parse.c"
7314 break;
7315
7316 case YYSYMBOL_mrhs: /* mrhs */
7317#line 1339 "parse.y"
7318 {
7319#ifndef RIPPER
7320 if (((*yyvaluep).node)) {
7321 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7322 }
7323#else
7324#endif
7325}
7326#line 7325 "parse.c"
7327 break;
7328
7329 case YYSYMBOL_primary: /* primary */
7330#line 1339 "parse.y"
7331 {
7332#ifndef RIPPER
7333 if (((*yyvaluep).node)) {
7334 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7335 }
7336#else
7337#endif
7338}
7339#line 7338 "parse.c"
7340 break;
7341
7342 case YYSYMBOL_primary_value: /* primary_value */
7343#line 1339 "parse.y"
7344 {
7345#ifndef RIPPER
7346 if (((*yyvaluep).node)) {
7347 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7348 }
7349#else
7350#endif
7351}
7352#line 7351 "parse.c"
7353 break;
7354
7355 case YYSYMBOL_if_tail: /* if_tail */
7356#line 1339 "parse.y"
7357 {
7358#ifndef RIPPER
7359 if (((*yyvaluep).node)) {
7360 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7361 }
7362#else
7363#endif
7364}
7365#line 7364 "parse.c"
7366 break;
7367
7368 case YYSYMBOL_opt_else: /* opt_else */
7369#line 1339 "parse.y"
7370 {
7371#ifndef RIPPER
7372 if (((*yyvaluep).node)) {
7373 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7374 }
7375#else
7376#endif
7377}
7378#line 7377 "parse.c"
7379 break;
7380
7381 case YYSYMBOL_for_var: /* for_var */
7382#line 1339 "parse.y"
7383 {
7384#ifndef RIPPER
7385 if (((*yyvaluep).node)) {
7386 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7387 }
7388#else
7389#endif
7390}
7391#line 7390 "parse.c"
7392 break;
7393
7394 case YYSYMBOL_f_marg: /* f_marg */
7395#line 1339 "parse.y"
7396 {
7397#ifndef RIPPER
7398 if (((*yyvaluep).node)) {
7399 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7400 }
7401#else
7402#endif
7403}
7404#line 7403 "parse.c"
7405 break;
7406
7407 case YYSYMBOL_f_marg_list: /* f_marg_list */
7408#line 1339 "parse.y"
7409 {
7410#ifndef RIPPER
7411 if (((*yyvaluep).node)) {
7412 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7413 }
7414#else
7415#endif
7416}
7417#line 7416 "parse.c"
7418 break;
7419
7420 case YYSYMBOL_f_margs: /* f_margs */
7421#line 1339 "parse.y"
7422 {
7423#ifndef RIPPER
7424 if (((*yyvaluep).node)) {
7425 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7426 }
7427#else
7428#endif
7429}
7430#line 7429 "parse.c"
7431 break;
7432
7433 case YYSYMBOL_f_rest_marg: /* f_rest_marg */
7434#line 1339 "parse.y"
7435 {
7436#ifndef RIPPER
7437 if (((*yyvaluep).node)) {
7438 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7439 }
7440#else
7441#endif
7442}
7443#line 7442 "parse.c"
7444 break;
7445
7446 case YYSYMBOL_block_args_tail: /* block_args_tail */
7447#line 1339 "parse.y"
7448 {
7449#ifndef RIPPER
7450 if (((*yyvaluep).node)) {
7451 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7452 }
7453#else
7454#endif
7455}
7456#line 7455 "parse.c"
7457 break;
7458
7459 case YYSYMBOL_opt_block_args_tail: /* opt_block_args_tail */
7460#line 1339 "parse.y"
7461 {
7462#ifndef RIPPER
7463 if (((*yyvaluep).node)) {
7464 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7465 }
7466#else
7467#endif
7468}
7469#line 7468 "parse.c"
7470 break;
7471
7472 case YYSYMBOL_block_param: /* block_param */
7473#line 1339 "parse.y"
7474 {
7475#ifndef RIPPER
7476 if (((*yyvaluep).node)) {
7477 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7478 }
7479#else
7480#endif
7481}
7482#line 7481 "parse.c"
7483 break;
7484
7485 case YYSYMBOL_opt_block_param: /* opt_block_param */
7486#line 1339 "parse.y"
7487 {
7488#ifndef RIPPER
7489 if (((*yyvaluep).node)) {
7490 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7491 }
7492#else
7493#endif
7494}
7495#line 7494 "parse.c"
7496 break;
7497
7498 case YYSYMBOL_block_param_def: /* block_param_def */
7499#line 1339 "parse.y"
7500 {
7501#ifndef RIPPER
7502 if (((*yyvaluep).node)) {
7503 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7504 }
7505#else
7506#endif
7507}
7508#line 7507 "parse.c"
7509 break;
7510
7511 case YYSYMBOL_opt_bv_decl: /* opt_bv_decl */
7512#line 1339 "parse.y"
7513 {
7514#ifndef RIPPER
7515 if (((*yyvaluep).node)) {
7516 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7517 }
7518#else
7519#endif
7520}
7521#line 7520 "parse.c"
7522 break;
7523
7524 case YYSYMBOL_bv_decls: /* bv_decls */
7525#line 1339 "parse.y"
7526 {
7527#ifndef RIPPER
7528 if (((*yyvaluep).node)) {
7529 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7530 }
7531#else
7532#endif
7533}
7534#line 7533 "parse.c"
7535 break;
7536
7537 case YYSYMBOL_bvar: /* bvar */
7538#line 1339 "parse.y"
7539 {
7540#ifndef RIPPER
7541 if (((*yyvaluep).node)) {
7542 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7543 }
7544#else
7545#endif
7546}
7547#line 7546 "parse.c"
7548 break;
7549
7550 case YYSYMBOL_lambda: /* lambda */
7551#line 1339 "parse.y"
7552 {
7553#ifndef RIPPER
7554 if (((*yyvaluep).node)) {
7555 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7556 }
7557#else
7558#endif
7559}
7560#line 7559 "parse.c"
7561 break;
7562
7563 case YYSYMBOL_f_larglist: /* f_larglist */
7564#line 1339 "parse.y"
7565 {
7566#ifndef RIPPER
7567 if (((*yyvaluep).node)) {
7568 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7569 }
7570#else
7571#endif
7572}
7573#line 7572 "parse.c"
7574 break;
7575
7576 case YYSYMBOL_lambda_body: /* lambda_body */
7577#line 1339 "parse.y"
7578 {
7579#ifndef RIPPER
7580 if (((*yyvaluep).node)) {
7581 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7582 }
7583#else
7584#endif
7585}
7586#line 7585 "parse.c"
7587 break;
7588
7589 case YYSYMBOL_do_block: /* do_block */
7590#line 1339 "parse.y"
7591 {
7592#ifndef RIPPER
7593 if (((*yyvaluep).node)) {
7594 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7595 }
7596#else
7597#endif
7598}
7599#line 7598 "parse.c"
7600 break;
7601
7602 case YYSYMBOL_block_call: /* block_call */
7603#line 1339 "parse.y"
7604 {
7605#ifndef RIPPER
7606 if (((*yyvaluep).node)) {
7607 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7608 }
7609#else
7610#endif
7611}
7612#line 7611 "parse.c"
7613 break;
7614
7615 case YYSYMBOL_method_call: /* method_call */
7616#line 1339 "parse.y"
7617 {
7618#ifndef RIPPER
7619 if (((*yyvaluep).node)) {
7620 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7621 }
7622#else
7623#endif
7624}
7625#line 7624 "parse.c"
7626 break;
7627
7628 case YYSYMBOL_brace_block: /* brace_block */
7629#line 1339 "parse.y"
7630 {
7631#ifndef RIPPER
7632 if (((*yyvaluep).node)) {
7633 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7634 }
7635#else
7636#endif
7637}
7638#line 7637 "parse.c"
7639 break;
7640
7641 case YYSYMBOL_brace_body: /* brace_body */
7642#line 1339 "parse.y"
7643 {
7644#ifndef RIPPER
7645 if (((*yyvaluep).node)) {
7646 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7647 }
7648#else
7649#endif
7650}
7651#line 7650 "parse.c"
7652 break;
7653
7654 case YYSYMBOL_do_body: /* do_body */
7655#line 1339 "parse.y"
7656 {
7657#ifndef RIPPER
7658 if (((*yyvaluep).node)) {
7659 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7660 }
7661#else
7662#endif
7663}
7664#line 7663 "parse.c"
7665 break;
7666
7667 case YYSYMBOL_case_args: /* case_args */
7668#line 1339 "parse.y"
7669 {
7670#ifndef RIPPER
7671 if (((*yyvaluep).node)) {
7672 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7673 }
7674#else
7675#endif
7676}
7677#line 7676 "parse.c"
7678 break;
7679
7680 case YYSYMBOL_case_body: /* case_body */
7681#line 1339 "parse.y"
7682 {
7683#ifndef RIPPER
7684 if (((*yyvaluep).node)) {
7685 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7686 }
7687#else
7688#endif
7689}
7690#line 7689 "parse.c"
7691 break;
7692
7693 case YYSYMBOL_cases: /* cases */
7694#line 1339 "parse.y"
7695 {
7696#ifndef RIPPER
7697 if (((*yyvaluep).node)) {
7698 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7699 }
7700#else
7701#endif
7702}
7703#line 7702 "parse.c"
7704 break;
7705
7706 case YYSYMBOL_p_case_body: /* p_case_body */
7707#line 1339 "parse.y"
7708 {
7709#ifndef RIPPER
7710 if (((*yyvaluep).node)) {
7711 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7712 }
7713#else
7714#endif
7715}
7716#line 7715 "parse.c"
7717 break;
7718
7719 case YYSYMBOL_p_cases: /* p_cases */
7720#line 1339 "parse.y"
7721 {
7722#ifndef RIPPER
7723 if (((*yyvaluep).node)) {
7724 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7725 }
7726#else
7727#endif
7728}
7729#line 7728 "parse.c"
7730 break;
7731
7732 case YYSYMBOL_p_top_expr: /* p_top_expr */
7733#line 1339 "parse.y"
7734 {
7735#ifndef RIPPER
7736 if (((*yyvaluep).node)) {
7737 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7738 }
7739#else
7740#endif
7741}
7742#line 7741 "parse.c"
7743 break;
7744
7745 case YYSYMBOL_p_top_expr_body: /* p_top_expr_body */
7746#line 1339 "parse.y"
7747 {
7748#ifndef RIPPER
7749 if (((*yyvaluep).node)) {
7750 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7751 }
7752#else
7753#endif
7754}
7755#line 7754 "parse.c"
7756 break;
7757
7758 case YYSYMBOL_p_expr: /* p_expr */
7759#line 1339 "parse.y"
7760 {
7761#ifndef RIPPER
7762 if (((*yyvaluep).node)) {
7763 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7764 }
7765#else
7766#endif
7767}
7768#line 7767 "parse.c"
7769 break;
7770
7771 case YYSYMBOL_p_as: /* p_as */
7772#line 1339 "parse.y"
7773 {
7774#ifndef RIPPER
7775 if (((*yyvaluep).node)) {
7776 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7777 }
7778#else
7779#endif
7780}
7781#line 7780 "parse.c"
7782 break;
7783
7784 case YYSYMBOL_p_alt: /* p_alt */
7785#line 1339 "parse.y"
7786 {
7787#ifndef RIPPER
7788 if (((*yyvaluep).node)) {
7789 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7790 }
7791#else
7792#endif
7793}
7794#line 7793 "parse.c"
7795 break;
7796
7797 case YYSYMBOL_p_expr_basic: /* p_expr_basic */
7798#line 1339 "parse.y"
7799 {
7800#ifndef RIPPER
7801 if (((*yyvaluep).node)) {
7802 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7803 }
7804#else
7805#endif
7806}
7807#line 7806 "parse.c"
7808 break;
7809
7810 case YYSYMBOL_p_args: /* p_args */
7811#line 1339 "parse.y"
7812 {
7813#ifndef RIPPER
7814 if (((*yyvaluep).node)) {
7815 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7816 }
7817#else
7818#endif
7819}
7820#line 7819 "parse.c"
7821 break;
7822
7823 case YYSYMBOL_p_args_head: /* p_args_head */
7824#line 1339 "parse.y"
7825 {
7826#ifndef RIPPER
7827 if (((*yyvaluep).node)) {
7828 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7829 }
7830#else
7831#endif
7832}
7833#line 7832 "parse.c"
7834 break;
7835
7836 case YYSYMBOL_p_args_tail: /* p_args_tail */
7837#line 1339 "parse.y"
7838 {
7839#ifndef RIPPER
7840 if (((*yyvaluep).node)) {
7841 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7842 }
7843#else
7844#endif
7845}
7846#line 7845 "parse.c"
7847 break;
7848
7849 case YYSYMBOL_p_find: /* p_find */
7850#line 1339 "parse.y"
7851 {
7852#ifndef RIPPER
7853 if (((*yyvaluep).node)) {
7854 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7855 }
7856#else
7857#endif
7858}
7859#line 7858 "parse.c"
7860 break;
7861
7862 case YYSYMBOL_p_args_post: /* p_args_post */
7863#line 1339 "parse.y"
7864 {
7865#ifndef RIPPER
7866 if (((*yyvaluep).node)) {
7867 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7868 }
7869#else
7870#endif
7871}
7872#line 7871 "parse.c"
7873 break;
7874
7875 case YYSYMBOL_p_arg: /* p_arg */
7876#line 1339 "parse.y"
7877 {
7878#ifndef RIPPER
7879 if (((*yyvaluep).node)) {
7880 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7881 }
7882#else
7883#endif
7884}
7885#line 7884 "parse.c"
7886 break;
7887
7888 case YYSYMBOL_p_kwargs: /* p_kwargs */
7889#line 1339 "parse.y"
7890 {
7891#ifndef RIPPER
7892 if (((*yyvaluep).node)) {
7893 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7894 }
7895#else
7896#endif
7897}
7898#line 7897 "parse.c"
7899 break;
7900
7901 case YYSYMBOL_p_kwarg: /* p_kwarg */
7902#line 1339 "parse.y"
7903 {
7904#ifndef RIPPER
7905 if (((*yyvaluep).node)) {
7906 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7907 }
7908#else
7909#endif
7910}
7911#line 7910 "parse.c"
7912 break;
7913
7914 case YYSYMBOL_p_kw: /* p_kw */
7915#line 1339 "parse.y"
7916 {
7917#ifndef RIPPER
7918 if (((*yyvaluep).node)) {
7919 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7920 }
7921#else
7922#endif
7923}
7924#line 7923 "parse.c"
7925 break;
7926
7927 case YYSYMBOL_p_value: /* p_value */
7928#line 1339 "parse.y"
7929 {
7930#ifndef RIPPER
7931 if (((*yyvaluep).node)) {
7932 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7933 }
7934#else
7935#endif
7936}
7937#line 7936 "parse.c"
7938 break;
7939
7940 case YYSYMBOL_p_primitive: /* p_primitive */
7941#line 1339 "parse.y"
7942 {
7943#ifndef RIPPER
7944 if (((*yyvaluep).node)) {
7945 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7946 }
7947#else
7948#endif
7949}
7950#line 7949 "parse.c"
7951 break;
7952
7953 case YYSYMBOL_p_variable: /* p_variable */
7954#line 1339 "parse.y"
7955 {
7956#ifndef RIPPER
7957 if (((*yyvaluep).node)) {
7958 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7959 }
7960#else
7961#endif
7962}
7963#line 7962 "parse.c"
7964 break;
7965
7966 case YYSYMBOL_p_var_ref: /* p_var_ref */
7967#line 1339 "parse.y"
7968 {
7969#ifndef RIPPER
7970 if (((*yyvaluep).node)) {
7971 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7972 }
7973#else
7974#endif
7975}
7976#line 7975 "parse.c"
7977 break;
7978
7979 case YYSYMBOL_p_expr_ref: /* p_expr_ref */
7980#line 1339 "parse.y"
7981 {
7982#ifndef RIPPER
7983 if (((*yyvaluep).node)) {
7984 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7985 }
7986#else
7987#endif
7988}
7989#line 7988 "parse.c"
7990 break;
7991
7992 case YYSYMBOL_p_const: /* p_const */
7993#line 1339 "parse.y"
7994 {
7995#ifndef RIPPER
7996 if (((*yyvaluep).node)) {
7997 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7998 }
7999#else
8000#endif
8001}
8002#line 8001 "parse.c"
8003 break;
8004
8005 case YYSYMBOL_opt_rescue: /* opt_rescue */
8006#line 1339 "parse.y"
8007 {
8008#ifndef RIPPER
8009 if (((*yyvaluep).node)) {
8010 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8011 }
8012#else
8013#endif
8014}
8015#line 8014 "parse.c"
8016 break;
8017
8018 case YYSYMBOL_exc_list: /* exc_list */
8019#line 1339 "parse.y"
8020 {
8021#ifndef RIPPER
8022 if (((*yyvaluep).node)) {
8023 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8024 }
8025#else
8026#endif
8027}
8028#line 8027 "parse.c"
8029 break;
8030
8031 case YYSYMBOL_exc_var: /* exc_var */
8032#line 1339 "parse.y"
8033 {
8034#ifndef RIPPER
8035 if (((*yyvaluep).node)) {
8036 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8037 }
8038#else
8039#endif
8040}
8041#line 8040 "parse.c"
8042 break;
8043
8044 case YYSYMBOL_opt_ensure: /* opt_ensure */
8045#line 1339 "parse.y"
8046 {
8047#ifndef RIPPER
8048 if (((*yyvaluep).node)) {
8049 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8050 }
8051#else
8052#endif
8053}
8054#line 8053 "parse.c"
8055 break;
8056
8057 case YYSYMBOL_literal: /* literal */
8058#line 1339 "parse.y"
8059 {
8060#ifndef RIPPER
8061 if (((*yyvaluep).node)) {
8062 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8063 }
8064#else
8065#endif
8066}
8067#line 8066 "parse.c"
8068 break;
8069
8070 case YYSYMBOL_strings: /* strings */
8071#line 1339 "parse.y"
8072 {
8073#ifndef RIPPER
8074 if (((*yyvaluep).node)) {
8075 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8076 }
8077#else
8078#endif
8079}
8080#line 8079 "parse.c"
8081 break;
8082
8083 case YYSYMBOL_string: /* string */
8084#line 1339 "parse.y"
8085 {
8086#ifndef RIPPER
8087 if (((*yyvaluep).node)) {
8088 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8089 }
8090#else
8091#endif
8092}
8093#line 8092 "parse.c"
8094 break;
8095
8096 case YYSYMBOL_string1: /* string1 */
8097#line 1339 "parse.y"
8098 {
8099#ifndef RIPPER
8100 if (((*yyvaluep).node)) {
8101 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8102 }
8103#else
8104#endif
8105}
8106#line 8105 "parse.c"
8107 break;
8108
8109 case YYSYMBOL_xstring: /* xstring */
8110#line 1339 "parse.y"
8111 {
8112#ifndef RIPPER
8113 if (((*yyvaluep).node)) {
8114 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8115 }
8116#else
8117#endif
8118}
8119#line 8118 "parse.c"
8120 break;
8121
8122 case YYSYMBOL_regexp: /* regexp */
8123#line 1339 "parse.y"
8124 {
8125#ifndef RIPPER
8126 if (((*yyvaluep).node)) {
8127 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8128 }
8129#else
8130#endif
8131}
8132#line 8131 "parse.c"
8133 break;
8134
8135 case YYSYMBOL_words: /* words */
8136#line 1339 "parse.y"
8137 {
8138#ifndef RIPPER
8139 if (((*yyvaluep).node)) {
8140 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8141 }
8142#else
8143#endif
8144}
8145#line 8144 "parse.c"
8146 break;
8147
8148 case YYSYMBOL_word_list: /* word_list */
8149#line 1339 "parse.y"
8150 {
8151#ifndef RIPPER
8152 if (((*yyvaluep).node)) {
8153 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8154 }
8155#else
8156#endif
8157}
8158#line 8157 "parse.c"
8159 break;
8160
8161 case YYSYMBOL_word: /* word */
8162#line 1339 "parse.y"
8163 {
8164#ifndef RIPPER
8165 if (((*yyvaluep).node)) {
8166 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8167 }
8168#else
8169#endif
8170}
8171#line 8170 "parse.c"
8172 break;
8173
8174 case YYSYMBOL_symbols: /* symbols */
8175#line 1339 "parse.y"
8176 {
8177#ifndef RIPPER
8178 if (((*yyvaluep).node)) {
8179 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8180 }
8181#else
8182#endif
8183}
8184#line 8183 "parse.c"
8185 break;
8186
8187 case YYSYMBOL_symbol_list: /* symbol_list */
8188#line 1339 "parse.y"
8189 {
8190#ifndef RIPPER
8191 if (((*yyvaluep).node)) {
8192 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8193 }
8194#else
8195#endif
8196}
8197#line 8196 "parse.c"
8198 break;
8199
8200 case YYSYMBOL_qwords: /* qwords */
8201#line 1339 "parse.y"
8202 {
8203#ifndef RIPPER
8204 if (((*yyvaluep).node)) {
8205 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8206 }
8207#else
8208#endif
8209}
8210#line 8209 "parse.c"
8211 break;
8212
8213 case YYSYMBOL_qsymbols: /* qsymbols */
8214#line 1339 "parse.y"
8215 {
8216#ifndef RIPPER
8217 if (((*yyvaluep).node)) {
8218 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8219 }
8220#else
8221#endif
8222}
8223#line 8222 "parse.c"
8224 break;
8225
8226 case YYSYMBOL_qword_list: /* qword_list */
8227#line 1339 "parse.y"
8228 {
8229#ifndef RIPPER
8230 if (((*yyvaluep).node)) {
8231 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8232 }
8233#else
8234#endif
8235}
8236#line 8235 "parse.c"
8237 break;
8238
8239 case YYSYMBOL_qsym_list: /* qsym_list */
8240#line 1339 "parse.y"
8241 {
8242#ifndef RIPPER
8243 if (((*yyvaluep).node)) {
8244 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8245 }
8246#else
8247#endif
8248}
8249#line 8248 "parse.c"
8250 break;
8251
8252 case YYSYMBOL_string_contents: /* string_contents */
8253#line 1339 "parse.y"
8254 {
8255#ifndef RIPPER
8256 if (((*yyvaluep).node)) {
8257 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8258 }
8259#else
8260#endif
8261}
8262#line 8261 "parse.c"
8263 break;
8264
8265 case YYSYMBOL_xstring_contents: /* xstring_contents */
8266#line 1339 "parse.y"
8267 {
8268#ifndef RIPPER
8269 if (((*yyvaluep).node)) {
8270 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8271 }
8272#else
8273#endif
8274}
8275#line 8274 "parse.c"
8276 break;
8277
8278 case YYSYMBOL_regexp_contents: /* regexp_contents */
8279#line 1339 "parse.y"
8280 {
8281#ifndef RIPPER
8282 if (((*yyvaluep).node)) {
8283 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8284 }
8285#else
8286#endif
8287}
8288#line 8287 "parse.c"
8289 break;
8290
8291 case YYSYMBOL_string_content: /* string_content */
8292#line 1339 "parse.y"
8293 {
8294#ifndef RIPPER
8295 if (((*yyvaluep).node)) {
8296 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8297 }
8298#else
8299#endif
8300}
8301#line 8300 "parse.c"
8302 break;
8303
8304 case YYSYMBOL_string_dvar: /* string_dvar */
8305#line 1339 "parse.y"
8306 {
8307#ifndef RIPPER
8308 if (((*yyvaluep).node)) {
8309 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8310 }
8311#else
8312#endif
8313}
8314#line 8313 "parse.c"
8315 break;
8316
8317 case YYSYMBOL_symbol: /* symbol */
8318#line 1339 "parse.y"
8319 {
8320#ifndef RIPPER
8321 if (((*yyvaluep).node)) {
8322 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8323 }
8324#else
8325#endif
8326}
8327#line 8326 "parse.c"
8328 break;
8329
8330 case YYSYMBOL_ssym: /* ssym */
8331#line 1339 "parse.y"
8332 {
8333#ifndef RIPPER
8334 if (((*yyvaluep).node)) {
8335 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8336 }
8337#else
8338#endif
8339}
8340#line 8339 "parse.c"
8341 break;
8342
8343 case YYSYMBOL_dsym: /* dsym */
8344#line 1339 "parse.y"
8345 {
8346#ifndef RIPPER
8347 if (((*yyvaluep).node)) {
8348 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8349 }
8350#else
8351#endif
8352}
8353#line 8352 "parse.c"
8354 break;
8355
8356 case YYSYMBOL_numeric: /* numeric */
8357#line 1339 "parse.y"
8358 {
8359#ifndef RIPPER
8360 if (((*yyvaluep).node)) {
8361 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8362 }
8363#else
8364#endif
8365}
8366#line 8365 "parse.c"
8367 break;
8368
8369 case YYSYMBOL_simple_numeric: /* simple_numeric */
8370#line 1339 "parse.y"
8371 {
8372#ifndef RIPPER
8373 if (((*yyvaluep).node)) {
8374 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8375 }
8376#else
8377#endif
8378}
8379#line 8378 "parse.c"
8380 break;
8381
8382 case YYSYMBOL_var_ref: /* var_ref */
8383#line 1339 "parse.y"
8384 {
8385#ifndef RIPPER
8386 if (((*yyvaluep).node)) {
8387 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8388 }
8389#else
8390#endif
8391}
8392#line 8391 "parse.c"
8393 break;
8394
8395 case YYSYMBOL_var_lhs: /* var_lhs */
8396#line 1339 "parse.y"
8397 {
8398#ifndef RIPPER
8399 if (((*yyvaluep).node)) {
8400 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8401 }
8402#else
8403#endif
8404}
8405#line 8404 "parse.c"
8406 break;
8407
8408 case YYSYMBOL_backref: /* backref */
8409#line 1339 "parse.y"
8410 {
8411#ifndef RIPPER
8412 if (((*yyvaluep).node)) {
8413 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8414 }
8415#else
8416#endif
8417}
8418#line 8417 "parse.c"
8419 break;
8420
8421 case YYSYMBOL_superclass: /* superclass */
8422#line 1339 "parse.y"
8423 {
8424#ifndef RIPPER
8425 if (((*yyvaluep).node)) {
8426 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8427 }
8428#else
8429#endif
8430}
8431#line 8430 "parse.c"
8432 break;
8433
8434 case YYSYMBOL_f_opt_paren_args: /* f_opt_paren_args */
8435#line 1339 "parse.y"
8436 {
8437#ifndef RIPPER
8438 if (((*yyvaluep).node)) {
8439 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8440 }
8441#else
8442#endif
8443}
8444#line 8443 "parse.c"
8445 break;
8446
8447 case YYSYMBOL_f_paren_args: /* f_paren_args */
8448#line 1339 "parse.y"
8449 {
8450#ifndef RIPPER
8451 if (((*yyvaluep).node)) {
8452 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8453 }
8454#else
8455#endif
8456}
8457#line 8456 "parse.c"
8458 break;
8459
8460 case YYSYMBOL_f_arglist: /* f_arglist */
8461#line 1339 "parse.y"
8462 {
8463#ifndef RIPPER
8464 if (((*yyvaluep).node)) {
8465 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8466 }
8467#else
8468#endif
8469}
8470#line 8469 "parse.c"
8471 break;
8472
8473 case YYSYMBOL_args_tail: /* args_tail */
8474#line 1339 "parse.y"
8475 {
8476#ifndef RIPPER
8477 if (((*yyvaluep).node)) {
8478 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8479 }
8480#else
8481#endif
8482}
8483#line 8482 "parse.c"
8484 break;
8485
8486 case YYSYMBOL_opt_args_tail: /* opt_args_tail */
8487#line 1339 "parse.y"
8488 {
8489#ifndef RIPPER
8490 if (((*yyvaluep).node)) {
8491 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8492 }
8493#else
8494#endif
8495}
8496#line 8495 "parse.c"
8497 break;
8498
8499 case YYSYMBOL_f_args: /* f_args */
8500#line 1339 "parse.y"
8501 {
8502#ifndef RIPPER
8503 if (((*yyvaluep).node)) {
8504 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8505 }
8506#else
8507#endif
8508}
8509#line 8508 "parse.c"
8510 break;
8511
8512 case YYSYMBOL_f_arg_item: /* f_arg_item */
8513#line 1339 "parse.y"
8514 {
8515#ifndef RIPPER
8516 if (((*yyvaluep).node)) {
8517 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8518 }
8519#else
8520#endif
8521}
8522#line 8521 "parse.c"
8523 break;
8524
8525 case YYSYMBOL_f_arg: /* f_arg */
8526#line 1339 "parse.y"
8527 {
8528#ifndef RIPPER
8529 if (((*yyvaluep).node)) {
8530 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8531 }
8532#else
8533#endif
8534}
8535#line 8534 "parse.c"
8536 break;
8537
8538 case YYSYMBOL_f_kw: /* f_kw */
8539#line 1339 "parse.y"
8540 {
8541#ifndef RIPPER
8542 if (((*yyvaluep).node)) {
8543 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8544 }
8545#else
8546#endif
8547}
8548#line 8547 "parse.c"
8549 break;
8550
8551 case YYSYMBOL_f_block_kw: /* f_block_kw */
8552#line 1339 "parse.y"
8553 {
8554#ifndef RIPPER
8555 if (((*yyvaluep).node)) {
8556 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8557 }
8558#else
8559#endif
8560}
8561#line 8560 "parse.c"
8562 break;
8563
8564 case YYSYMBOL_f_block_kwarg: /* f_block_kwarg */
8565#line 1339 "parse.y"
8566 {
8567#ifndef RIPPER
8568 if (((*yyvaluep).node)) {
8569 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8570 }
8571#else
8572#endif
8573}
8574#line 8573 "parse.c"
8575 break;
8576
8577 case YYSYMBOL_f_kwarg: /* f_kwarg */
8578#line 1339 "parse.y"
8579 {
8580#ifndef RIPPER
8581 if (((*yyvaluep).node)) {
8582 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8583 }
8584#else
8585#endif
8586}
8587#line 8586 "parse.c"
8588 break;
8589
8590 case YYSYMBOL_f_opt: /* f_opt */
8591#line 1339 "parse.y"
8592 {
8593#ifndef RIPPER
8594 if (((*yyvaluep).node)) {
8595 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8596 }
8597#else
8598#endif
8599}
8600#line 8599 "parse.c"
8601 break;
8602
8603 case YYSYMBOL_f_block_opt: /* f_block_opt */
8604#line 1339 "parse.y"
8605 {
8606#ifndef RIPPER
8607 if (((*yyvaluep).node)) {
8608 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8609 }
8610#else
8611#endif
8612}
8613#line 8612 "parse.c"
8614 break;
8615
8616 case YYSYMBOL_f_block_optarg: /* f_block_optarg */
8617#line 1339 "parse.y"
8618 {
8619#ifndef RIPPER
8620 if (((*yyvaluep).node)) {
8621 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8622 }
8623#else
8624#endif
8625}
8626#line 8625 "parse.c"
8627 break;
8628
8629 case YYSYMBOL_f_optarg: /* f_optarg */
8630#line 1339 "parse.y"
8631 {
8632#ifndef RIPPER
8633 if (((*yyvaluep).node)) {
8634 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8635 }
8636#else
8637#endif
8638}
8639#line 8638 "parse.c"
8640 break;
8641
8642 case YYSYMBOL_singleton: /* singleton */
8643#line 1339 "parse.y"
8644 {
8645#ifndef RIPPER
8646 if (((*yyvaluep).node)) {
8647 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8648 }
8649#else
8650#endif
8651}
8652#line 8651 "parse.c"
8653 break;
8654
8655 case YYSYMBOL_assoc_list: /* assoc_list */
8656#line 1339 "parse.y"
8657 {
8658#ifndef RIPPER
8659 if (((*yyvaluep).node)) {
8660 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8661 }
8662#else
8663#endif
8664}
8665#line 8664 "parse.c"
8666 break;
8667
8668 case YYSYMBOL_assocs: /* assocs */
8669#line 1339 "parse.y"
8670 {
8671#ifndef RIPPER
8672 if (((*yyvaluep).node)) {
8673 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8674 }
8675#else
8676#endif
8677}
8678#line 8677 "parse.c"
8679 break;
8680
8681 case YYSYMBOL_assoc: /* assoc */
8682#line 1339 "parse.y"
8683 {
8684#ifndef RIPPER
8685 if (((*yyvaluep).node)) {
8686 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8687 }
8688#else
8689#endif
8690}
8691#line 8690 "parse.c"
8692 break;
8693
8694 case YYSYMBOL_none: /* none */
8695#line 1339 "parse.y"
8696 {
8697#ifndef RIPPER
8698 if (((*yyvaluep).node)) {
8699 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8700 }
8701#else
8702#endif
8703}
8704#line 8703 "parse.c"
8705 break;
8706
8707 default:
8708 break;
8709 }
8710 YY_IGNORE_MAYBE_UNINITIALIZED_END
8711}
8712
8713
8714/*---------------------------.
8715| Print this symbol on YYO. |
8716`---------------------------*/
8717
8718static void
8719yy_symbol_print (FILE *yyo,
8720 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
8721{
8722 YYFPRINTF (p, "%s %s (",
8723 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
8724
8725 YYLOCATION_PRINT (yyo, yylocationp);
8726 YYFPRINTF (p, ": ");
8727 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
8728 YYFPRINTF (p, ")");
8729}
8730
8731/*------------------------------------------------------------------.
8732| yy_stack_print -- Print the state stack from its BOTTOM up to its |
8733| TOP (included). |
8734`------------------------------------------------------------------*/
8735
8736static void
8737ruby_parser_yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
8738#define yy_stack_print(b, t) ruby_parser_yy_stack_print(b, t, p)
8739{
8740 YYFPRINTF (p, "Stack now");
8741 for (; yybottom <= yytop; yybottom++)
8742 {
8743 int yybot = *yybottom;
8744 YYFPRINTF (p, " %d", yybot);
8745 }
8746 YYFPRINTF (p, "\n");
8747}
8748
8749# define YY_STACK_PRINT(Bottom, Top) \
8750do { \
8751 if (yydebug) \
8752 yy_stack_print ((Bottom), (Top)); \
8753} while (0)
8754
8755
8756/*------------------------------------------------.
8757| Report that the YYRULE is going to be reduced. |
8758`------------------------------------------------*/
8759
8760static void
8761yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
8762 int yyrule, struct parser_params *p)
8763{
8764 int yylno = yyrline[yyrule];
8765 int yynrhs = yyr2[yyrule];
8766 int yyi;
8767 YYFPRINTF (p, "Reducing stack by rule %d (line %d):\n",
8768 yyrule - 1, yylno);
8769 /* The symbols being reduced. */
8770 for (yyi = 0; yyi < yynrhs; yyi++)
8771 {
8772 YYFPRINTF (p, " $%d = ", yyi + 1);
8773 yy_symbol_print (stderr,
8774 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
8775 &yyvsp[(yyi + 1) - (yynrhs)],
8776 &(yylsp[(yyi + 1) - (yynrhs)]), p);
8777 YYFPRINTF (p, "\n");
8778 }
8779}
8780
8781# define YY_REDUCE_PRINT(Rule) \
8782do { \
8783 if (yydebug) \
8784 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
8785} while (0)
8786
8787/* Nonzero means print parse trace. It is left uninitialized so that
8788 multiple parsers can coexist. */
8789#ifndef yydebug
8790int yydebug;
8791#endif
8792#else /* !YYDEBUG */
8793# define YYDPRINTF(Args) ((void) 0)
8794# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
8795# define YY_STACK_PRINT(Bottom, Top)
8796# define YY_REDUCE_PRINT(Rule)
8797#endif /* !YYDEBUG */
8798
8799
8800/* YYINITDEPTH -- initial size of the parser's stacks. */
8801#ifndef YYINITDEPTH
8802# define YYINITDEPTH 200
8803#endif
8804
8805/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
8806 if the built-in stack extension method is used).
8807
8808 Do not make this value too large; the results are undefined if
8809 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
8810 evaluated with infinite-precision integer arithmetic. */
8811
8812#ifndef YYMAXDEPTH
8813# define YYMAXDEPTH 10000
8814#endif
8815
8816
8817/* Context of a parse error. */
8818typedef struct
8819{
8820 yy_state_t *yyssp;
8821 yysymbol_kind_t yytoken;
8822 YYLTYPE *yylloc;
8823} yypcontext_t;
8824
8825/* Put in YYARG at most YYARGN of the expected tokens given the
8826 current YYCTX, and return the number of tokens stored in YYARG. If
8827 YYARG is null, return the number of expected tokens (guaranteed to
8828 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
8829 Return 0 if there are more than YYARGN expected tokens, yet fill
8830 YYARG up to YYARGN. */
8831static int
8832yypcontext_expected_tokens (const yypcontext_t *yyctx,
8833 yysymbol_kind_t yyarg[], int yyargn)
8834{
8835 /* Actual size of YYARG. */
8836 int yycount = 0;
8837 int yyn = yypact[+*yyctx->yyssp];
8838 if (!yypact_value_is_default (yyn))
8839 {
8840 /* Start YYX at -YYN if negative to avoid negative indexes in
8841 YYCHECK. In other words, skip the first -YYN actions for
8842 this state because they are default actions. */
8843 int yyxbegin = yyn < 0 ? -yyn : 0;
8844 /* Stay within bounds of both yycheck and yytname. */
8845 int yychecklim = YYLAST - yyn + 1;
8846 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
8847 int yyx;
8848 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
8849 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
8850 && !yytable_value_is_error (yytable[yyx + yyn]))
8851 {
8852 if (!yyarg)
8853 ++yycount;
8854 else if (yycount == yyargn)
8855 return 0;
8856 else
8857 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
8858 }
8859 }
8860 if (yyarg && yycount == 0 && 0 < yyargn)
8861 yyarg[0] = YYSYMBOL_YYEMPTY;
8862 return yycount;
8863}
8864
8865
8866
8867
8868#ifndef yystrlen
8869# if defined __GLIBC__ && defined _STRING_H
8870# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
8871# else
8872/* Return the length of YYSTR. */
8873static YYPTRDIFF_T
8874yystrlen (const char *yystr)
8875{
8876 YYPTRDIFF_T yylen;
8877 for (yylen = 0; yystr[yylen]; yylen++)
8878 continue;
8879 return yylen;
8880}
8881# endif
8882#endif
8883
8884#ifndef yystpcpy
8885# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
8886# define yystpcpy stpcpy
8887# else
8888/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
8889 YYDEST. */
8890static char *
8891yystpcpy (char *yydest, const char *yysrc)
8892{
8893 char *yyd = yydest;
8894 const char *yys = yysrc;
8895
8896 while ((*yyd++ = *yys++) != '\0')
8897 continue;
8898
8899 return yyd - 1;
8900}
8901# endif
8902#endif
8903
8904#ifndef yytnamerr
8905/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
8906 quotes and backslashes, so that it's suitable for yyerror. The
8907 heuristic is that double-quoting is unnecessary unless the string
8908 contains an apostrophe, a comma, or backslash (other than
8909 backslash-backslash). YYSTR is taken from yytname. If YYRES is
8910 null, do not copy; instead, return the length of what the result
8911 would have been. */
8912static YYPTRDIFF_T
8913yytnamerr (char *yyres, const char *yystr)
8914{
8915 if (*yystr == '"')
8916 {
8917 YYPTRDIFF_T yyn = 0;
8918 char const *yyp = yystr;
8919 for (;;)
8920 switch (*++yyp)
8921 {
8922 case '\'':
8923 case ',':
8924 goto do_not_strip_quotes;
8925
8926 case '\\':
8927 if (*++yyp != '\\')
8928 goto do_not_strip_quotes;
8929 else
8930 goto append;
8931
8932 append:
8933 default:
8934 if (yyres)
8935 yyres[yyn] = *yyp;
8936 yyn++;
8937 break;
8938
8939 case '"':
8940 if (yyres)
8941 yyres[yyn] = '\0';
8942 return yyn;
8943 }
8944 do_not_strip_quotes: ;
8945 }
8946
8947 if (yyres)
8948 return yystpcpy (yyres, yystr) - yyres;
8949 else
8950 return yystrlen (yystr);
8951}
8952#endif
8953
8954
8955static int
8956yy_syntax_error_arguments (const yypcontext_t *yyctx,
8957 yysymbol_kind_t yyarg[], int yyargn)
8958{
8959 /* Actual size of YYARG. */
8960 int yycount = 0;
8961 /* There are many possibilities here to consider:
8962 - If this state is a consistent state with a default action, then
8963 the only way this function was invoked is if the default action
8964 is an error action. In that case, don't check for expected
8965 tokens because there are none.
8966 - The only way there can be no lookahead present (in yychar) is if
8967 this state is a consistent state with a default action. Thus,
8968 detecting the absence of a lookahead is sufficient to determine
8969 that there is no unexpected or expected token to report. In that
8970 case, just report a simple "syntax error".
8971 - Don't assume there isn't a lookahead just because this state is a
8972 consistent state with a default action. There might have been a
8973 previous inconsistent state, consistent state with a non-default
8974 action, or user semantic action that manipulated yychar.
8975 - Of course, the expected token list depends on states to have
8976 correct lookahead information, and it depends on the parser not
8977 to perform extra reductions after fetching a lookahead from the
8978 scanner and before detecting a syntax error. Thus, state merging
8979 (from LALR or IELR) and default reductions corrupt the expected
8980 token list. However, the list is correct for canonical LR with
8981 one exception: it will still contain any token that will not be
8982 accepted due to an error action in a later state.
8983 */
8984 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
8985 {
8986 int yyn;
8987 if (yyarg)
8988 yyarg[yycount] = yyctx->yytoken;
8989 ++yycount;
8990 yyn = yypcontext_expected_tokens (yyctx,
8991 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
8992 if (yyn == YYENOMEM)
8993 return YYENOMEM;
8994 else
8995 yycount += yyn;
8996 }
8997 return yycount;
8998}
8999
9000/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
9001 about the unexpected token YYTOKEN for the state stack whose top is
9002 YYSSP.
9003
9004 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
9005 not large enough to hold the message. In that case, also set
9006 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
9007 required number of bytes is too large to store. */
9008static int
9009yysyntax_error (struct parser_params *p, YYPTRDIFF_T *yymsg_alloc, char **yymsg,
9010 const yypcontext_t *yyctx)
9011{
9012 enum { YYARGS_MAX = 5 };
9013 /* Internationalized format string. */
9014 const char *yyformat = YY_NULLPTR;
9015 /* Arguments of yyformat: reported tokens (one for the "unexpected",
9016 one per "expected"). */
9017 yysymbol_kind_t yyarg[YYARGS_MAX];
9018 /* Cumulated lengths of YYARG. */
9019 YYPTRDIFF_T yysize = 0;
9020
9021 /* Actual size of YYARG. */
9022 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
9023 if (yycount == YYENOMEM)
9024 return YYENOMEM;
9025
9026 switch (yycount)
9027 {
9028#define YYCASE_(N, S) \
9029 case N: \
9030 yyformat = S; \
9031 break
9032 default: /* Avoid compiler warnings. */
9033 YYCASE_(0, YY_("syntax error"));
9034 YYCASE_(1, YY_("syntax error, unexpected %s"));
9035 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
9036 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
9037 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
9038 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
9039#undef YYCASE_
9040 }
9041
9042 /* Compute error message size. Don't count the "%s"s, but reserve
9043 room for the terminator. */
9044 yysize = yystrlen (yyformat) - 2 * yycount + 1;
9045 {
9046 int yyi;
9047 for (yyi = 0; yyi < yycount; ++yyi)
9048 {
9049 YYPTRDIFF_T yysize1
9050 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
9051 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
9052 yysize = yysize1;
9053 else
9054 return YYENOMEM;
9055 }
9056 }
9057
9058 if (*yymsg_alloc < yysize)
9059 {
9060 *yymsg_alloc = 2 * yysize;
9061 if (! (yysize <= *yymsg_alloc
9062 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
9063 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
9064 return -1;
9065 }
9066
9067 /* Avoid sprintf, as that infringes on the user's name space.
9068 Don't have undefined behavior even if the translation
9069 produced a string with the wrong number of "%s"s. */
9070 {
9071 char *yyp = *yymsg;
9072 int yyi = 0;
9073 while ((*yyp = *yyformat) != '\0')
9074 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
9075 {
9076 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
9077 yyformat += 2;
9078 }
9079 else
9080 {
9081 ++yyp;
9082 ++yyformat;
9083 }
9084 }
9085 return 0;
9086}
9087
9088
9089/*-----------------------------------------------.
9090| Release the memory associated to this symbol. |
9091`-----------------------------------------------*/
9092
9093static void
9094yydestruct (const char *yymsg,
9095 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
9096{
9097 YY_USE (yyvaluep);
9098 YY_USE (yylocationp);
9099 YY_USE (p);
9100 if (!yymsg)
9101 yymsg = "Deleting";
9102 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
9103
9104 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
9105 YY_USE (yykind);
9106 YY_IGNORE_MAYBE_UNINITIALIZED_END
9107}
9108
9109
9110
9111
9112
9113
9114/*----------.
9115| yyparse. |
9116`----------*/
9117
9118int
9119yyparse (struct parser_params *p)
9120{
9121/* Lookahead token kind. */
9122int yychar;
9123
9124
9125/* The semantic value of the lookahead symbol. */
9126/* Default value used for initialization, for pacifying older GCCs
9127 or non-GCC compilers. */
9128YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
9129YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
9130
9131/* Location data for the lookahead symbol. */
9132static YYLTYPE yyloc_default
9133# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
9134 = { 1, 1, 1, 1 }
9135# endif
9136;
9137YYLTYPE yylloc = yyloc_default;
9138
9139 /* Number of syntax errors so far. */
9140 int yynerrs = 0;
9141
9142 yy_state_fast_t yystate = 0;
9143 /* Number of tokens to shift before error messages enabled. */
9144 int yyerrstatus = 0;
9145
9146 /* Refer to the stacks through separate pointers, to allow yyoverflow
9147 to reallocate them elsewhere. */
9148
9149 /* Their size. */
9150 YYPTRDIFF_T yystacksize = YYINITDEPTH;
9151
9152 /* The state stack: array, bottom, top. */
9153 yy_state_t yyssa[YYINITDEPTH];
9154 yy_state_t *yyss = yyssa;
9155 yy_state_t *yyssp = yyss;
9156
9157 /* The semantic value stack: array, bottom, top. */
9158 YYSTYPE yyvsa[YYINITDEPTH];
9159 YYSTYPE *yyvs = yyvsa;
9160 YYSTYPE *yyvsp = yyvs;
9161
9162 /* The location stack: array, bottom, top. */
9163 YYLTYPE yylsa[YYINITDEPTH];
9164 YYLTYPE *yyls = yylsa;
9165 YYLTYPE *yylsp = yyls;
9166
9167 int yyn;
9168 /* The return value of yyparse. */
9169 int yyresult;
9170 /* Lookahead symbol kind. */
9171 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
9172 /* The variables used to return semantic value and location from the
9173 action routines. */
9174 YYSTYPE yyval;
9175 YYLTYPE yyloc;
9176
9177 /* The locations where the error started and ended. */
9178 YYLTYPE yyerror_range[3];
9179
9180 /* Buffer for error messages, and its allocated size. */
9181 char yymsgbuf[128];
9182 char *yymsg = yymsgbuf;
9183 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
9184
9185#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
9186
9187 /* The number of symbols on the RHS of the reduced rule.
9188 Keep to zero when no symbol should be popped. */
9189 int yylen = 0;
9190
9191 YYDPRINTF ((p, "Starting parse\n"));
9192
9193 yychar = YYEMPTY; /* Cause a token to be read. */
9194
9195
9196/* User initialization code. */
9197#line 1379 "parse.y"
9198{
9199 RUBY_SET_YYLLOC_OF_NONE(yylloc);
9200}
9201
9202#line 9198 "parse.c"
9203
9204 yylsp[0] = yylloc;
9205 goto yysetstate;
9206
9207
9208/*------------------------------------------------------------.
9209| yynewstate -- push a new state, which is found in yystate. |
9210`------------------------------------------------------------*/
9211yynewstate:
9212 /* In all cases, when you get here, the value and location stacks
9213 have just been pushed. So pushing a state here evens the stacks. */
9214 yyssp++;
9215
9216
9217/*--------------------------------------------------------------------.
9218| yysetstate -- set current state (the top of the stack) to yystate. |
9219`--------------------------------------------------------------------*/
9220yysetstate:
9221 YYDPRINTF ((p, "Entering state %d\n", yystate));
9222 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
9223 YY_IGNORE_USELESS_CAST_BEGIN
9224 *yyssp = YY_CAST (yy_state_t, yystate);
9225 YY_IGNORE_USELESS_CAST_END
9226 YY_STACK_PRINT (yyss, yyssp);
9227
9228 if (yyss + yystacksize - 1 <= yyssp)
9229#if !defined yyoverflow && !defined YYSTACK_RELOCATE
9230 YYNOMEM;
9231#else
9232 {
9233 /* Get the current used size of the three stacks, in elements. */
9234 YYPTRDIFF_T yysize = yyssp - yyss + 1;
9235
9236# if defined yyoverflow
9237 {
9238 /* Give user a chance to reallocate the stack. Use copies of
9239 these so that the &'s don't force the real ones into
9240 memory. */
9241 yy_state_t *yyss1 = yyss;
9242 YYSTYPE *yyvs1 = yyvs;
9243 YYLTYPE *yyls1 = yyls;
9244
9245 /* Each stack pointer address is followed by the size of the
9246 data in use in that stack, in bytes. This used to be a
9247 conditional around just the two extra args, but that might
9248 be undefined if yyoverflow is a macro. */
9249 yyoverflow (YY_("memory exhausted"),
9250 &yyss1, yysize * YYSIZEOF (*yyssp),
9251 &yyvs1, yysize * YYSIZEOF (*yyvsp),
9252 &yyls1, yysize * YYSIZEOF (*yylsp),
9253 &yystacksize);
9254 yyss = yyss1;
9255 yyvs = yyvs1;
9256 yyls = yyls1;
9257 }
9258# else /* defined YYSTACK_RELOCATE */
9259 /* Extend the stack our own way. */
9260 if (YYMAXDEPTH <= yystacksize)
9261 YYNOMEM;
9262 yystacksize *= 2;
9263 if (YYMAXDEPTH < yystacksize)
9264 yystacksize = YYMAXDEPTH;
9265
9266 {
9267 yy_state_t *yyss1 = yyss;
9268 union yyalloc *yyptr =
9269 YY_CAST (union yyalloc *,
9270 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
9271 if (! yyptr)
9272 YYNOMEM;
9273 YYSTACK_RELOCATE (yyss_alloc, yyss);
9274 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
9275 YYSTACK_RELOCATE (yyls_alloc, yyls);
9276# undef YYSTACK_RELOCATE
9277 if (yyss1 != yyssa)
9278 YYSTACK_FREE (yyss1);
9279 }
9280# endif
9281
9282 yyssp = yyss + yysize - 1;
9283 yyvsp = yyvs + yysize - 1;
9284 yylsp = yyls + yysize - 1;
9285
9286 YY_IGNORE_USELESS_CAST_BEGIN
9287 YYDPRINTF ((p, "Stack size increased to %ld\n",
9288 YY_CAST (long, yystacksize)));
9289 YY_IGNORE_USELESS_CAST_END
9290
9291 if (yyss + yystacksize - 1 <= yyssp)
9292 YYABORT;
9293 }
9294#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
9295
9296
9297 if (yystate == YYFINAL)
9298 YYACCEPT;
9299
9300 goto yybackup;
9301
9302
9303/*-----------.
9304| yybackup. |
9305`-----------*/
9306yybackup:
9307 /* Do appropriate processing given the current state. Read a
9308 lookahead token if we need one and don't already have one. */
9309
9310 /* First try to decide what to do without reference to lookahead token. */
9311 yyn = yypact[yystate];
9312 if (yypact_value_is_default (yyn))
9313 goto yydefault;
9314
9315 /* Not known => get a lookahead token if don't already have one. */
9316
9317 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
9318 if (yychar == YYEMPTY)
9319 {
9320 YYDPRINTF ((p, "Reading a token\n"));
9321 yychar = yylex (&yylval, &yylloc, p);
9322 }
9323
9324 if (yychar <= END_OF_INPUT)
9325 {
9326 yychar = END_OF_INPUT;
9327 yytoken = YYSYMBOL_YYEOF;
9328 YYDPRINTF ((p, "Now at end of input.\n"));
9329 }
9330 else if (yychar == YYerror)
9331 {
9332 /* The scanner already issued an error message, process directly
9333 to error recovery. But do not keep the error token as
9334 lookahead, it is too special and may lead us to an endless
9335 loop in error recovery. */
9336 yychar = YYUNDEF;
9337 yytoken = YYSYMBOL_YYerror;
9338 yyerror_range[1] = yylloc;
9339 goto yyerrlab1;
9340 }
9341 else
9342 {
9343 yytoken = YYTRANSLATE (yychar);
9344 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
9345 }
9346
9347 /* If the proper action on seeing token YYTOKEN is to reduce or to
9348 detect an error, take that action. */
9349 yyn += yytoken;
9350 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
9351 goto yydefault;
9352 yyn = yytable[yyn];
9353 if (yyn <= 0)
9354 {
9355 if (yytable_value_is_error (yyn))
9356 goto yyerrlab;
9357 yyn = -yyn;
9358 goto yyreduce;
9359 }
9360
9361 /* Count tokens shifted since error; after three, turn off error
9362 status. */
9363 if (yyerrstatus)
9364 yyerrstatus--;
9365
9366 /* Shift the lookahead token. */
9367 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
9368 yystate = yyn;
9369 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
9370 *++yyvsp = yylval;
9371 YY_IGNORE_MAYBE_UNINITIALIZED_END
9372 *++yylsp = yylloc;
9373
9374 /* Discard the shifted token. */
9375 yychar = YYEMPTY;
9376 goto yynewstate;
9377
9378
9379/*-----------------------------------------------------------.
9380| yydefault -- do the default action for the current state. |
9381`-----------------------------------------------------------*/
9382yydefault:
9383 yyn = yydefact[yystate];
9384 if (yyn == 0)
9385 goto yyerrlab;
9386 goto yyreduce;
9387
9388
9389/*-----------------------------.
9390| yyreduce -- do a reduction. |
9391`-----------------------------*/
9392yyreduce:
9393 /* yyn is the number of a rule to reduce with. */
9394 yylen = yyr2[yyn];
9395
9396 /* If YYLEN is nonzero, implement the default value of the action:
9397 '$$ = $1'.
9398
9399 Otherwise, the following line sets YYVAL to garbage.
9400 This behavior is undocumented and Bison
9401 users should not rely upon it. Assigning to YYVAL
9402 unconditionally makes the parser a bit smaller, and it avoids a
9403 GCC warning that YYVAL may be used uninitialized. */
9404 yyval = yyvsp[1-yylen];
9405
9406 /* Default location. */
9407 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
9408 yyerror_range[1] = yyloc;
9409 YY_REDUCE_PRINT (yyn);
9410 switch (yyn)
9411 {
9412 case 2: /* $@1: %empty */
9413#line 1588 "parse.y"
9414 {
9415 SET_LEX_STATE(EXPR_BEG);
9416 local_push(p, ifndef_ripper(1)+0);
9417 }
9418#line 9414 "parse.c"
9419 break;
9420
9421 case 3: /* program: $@1 top_compstmt */
9422#line 1593 "parse.y"
9423 {
9424 /*%%%*/
9425 if ((yyvsp[0].node) && !compile_for_eval) {
9426 NODE *node = (yyvsp[0].node);
9427 /* last expression should not be void */
9428 if (nd_type_p(node, NODE_BLOCK)) {
9429 while (node->nd_next) {
9430 node = node->nd_next;
9431 }
9432 node = node->nd_head;
9433 }
9434 node = remove_begin(node);
9435 void_expr(p, node);
9436 }
9437 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
9438 /*% %*/
9439 /*% ripper[final]: program!($2) %*/
9440 local_pop(p);
9441 }
9442#line 9438 "parse.c"
9443 break;
9444
9445 case 4: /* top_compstmt: top_stmts opt_terms */
9446#line 1615 "parse.y"
9447 {
9448 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
9449 }
9450#line 9446 "parse.c"
9451 break;
9452
9453 case 5: /* top_stmts: none */
9454#line 1621 "parse.y"
9455 {
9456 /*%%%*/
9457 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9458 /*% %*/
9459 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
9460 }
9461#line 9457 "parse.c"
9462 break;
9463
9464 case 6: /* top_stmts: top_stmt */
9465#line 1628 "parse.y"
9466 {
9467 /*%%%*/
9468 (yyval.node) = newline_node((yyvsp[0].node));
9469 /*% %*/
9470 /*% ripper: stmts_add!(stmts_new!, $1) %*/
9471 }
9472#line 9468 "parse.c"
9473 break;
9474
9475 case 7: /* top_stmts: top_stmts terms top_stmt */
9476#line 1635 "parse.y"
9477 {
9478 /*%%%*/
9479 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
9480 /*% %*/
9481 /*% ripper: stmts_add!($1, $3) %*/
9482 }
9483#line 9479 "parse.c"
9484 break;
9485
9486 case 9: /* top_stmt: "`BEGIN'" begin_block */
9487#line 1645 "parse.y"
9488 {
9489 (yyval.node) = (yyvsp[0].node);
9490 }
9491#line 9487 "parse.c"
9492 break;
9493
9494 case 10: /* begin_block: '{' top_compstmt '}' */
9495#line 1651 "parse.y"
9496 {
9497 /*%%%*/
9498 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
9499 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
9500 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9501 /*% %*/
9502 /*% ripper: BEGIN!($2) %*/
9503 }
9504#line 9500 "parse.c"
9505 break;
9506
9507 case 11: /* $@2: %empty */
9508#line 1663 "parse.y"
9509 {if (!(yyvsp[-1].node)) {yyerror1(&(yylsp[0]), "else without rescue is useless");}}
9510#line 9506 "parse.c"
9511 break;
9512
9513 case 12: /* bodystmt: compstmt opt_rescue k_else $@2 compstmt opt_ensure */
9514#line 1666 "parse.y"
9515 {
9516 /*%%%*/
9517 (yyval.node) = new_bodystmt(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9518 /*% %*/
9519 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/
9520 }
9521#line 9517 "parse.c"
9522 break;
9523
9524 case 13: /* bodystmt: compstmt opt_rescue opt_ensure */
9525#line 1675 "parse.y"
9526 {
9527 /*%%%*/
9528 (yyval.node) = new_bodystmt(p, (yyvsp[-2].node), (yyvsp[-1].node), 0, (yyvsp[0].node), &(yyloc));
9529 /*% %*/
9530 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/
9531 }
9532#line 9528 "parse.c"
9533 break;
9534
9535 case 14: /* compstmt: stmts opt_terms */
9536#line 1684 "parse.y"
9537 {
9538 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
9539 }
9540#line 9536 "parse.c"
9541 break;
9542
9543 case 15: /* stmts: none */
9544#line 1690 "parse.y"
9545 {
9546 /*%%%*/
9547 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9548 /*% %*/
9549 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
9550 }
9551#line 9547 "parse.c"
9552 break;
9553
9554 case 16: /* stmts: stmt_or_begin */
9555#line 1697 "parse.y"
9556 {
9557 /*%%%*/
9558 (yyval.node) = newline_node((yyvsp[0].node));
9559 /*% %*/
9560 /*% ripper: stmts_add!(stmts_new!, $1) %*/
9561 }
9562#line 9558 "parse.c"
9563 break;
9564
9565 case 17: /* stmts: stmts terms stmt_or_begin */
9566#line 1704 "parse.y"
9567 {
9568 /*%%%*/
9569 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
9570 /*% %*/
9571 /*% ripper: stmts_add!($1, $3) %*/
9572 }
9573#line 9569 "parse.c"
9574 break;
9575
9576 case 18: /* stmt_or_begin: stmt */
9577#line 1713 "parse.y"
9578 {
9579 (yyval.node) = (yyvsp[0].node);
9580 }
9581#line 9577 "parse.c"
9582 break;
9583
9584 case 19: /* $@3: %empty */
9585#line 1717 "parse.y"
9586 {
9587 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
9588 }
9589#line 9585 "parse.c"
9590 break;
9591
9592 case 20: /* stmt_or_begin: "`BEGIN'" $@3 begin_block */
9593#line 1721 "parse.y"
9594 {
9595 (yyval.node) = (yyvsp[0].node);
9596 }
9597#line 9593 "parse.c"
9598 break;
9599
9600 case 21: /* $@4: %empty */
9601#line 1726 "parse.y"
9602 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
9603#line 9599 "parse.c"
9604 break;
9605
9606 case 22: /* stmt: "`alias'" fitem $@4 fitem */
9607#line 1727 "parse.y"
9608 {
9609 /*%%%*/
9610 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9611 /*% %*/
9612 /*% ripper: alias!($2, $4) %*/
9613 }
9614#line 9610 "parse.c"
9615 break;
9616
9617 case 23: /* stmt: "`alias'" "global variable" "global variable" */
9618#line 1734 "parse.y"
9619 {
9620 /*%%%*/
9621 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
9622 /*% %*/
9623 /*% ripper: var_alias!($2, $3) %*/
9624 }
9625#line 9621 "parse.c"
9626 break;
9627
9628 case 24: /* stmt: "`alias'" "global variable" "back reference" */
9629#line 1741 "parse.y"
9630 {
9631 /*%%%*/
9632 char buf[2];
9633 buf[0] = '$';
9634 buf[1] = (char)(yyvsp[0].node)->nd_nth;
9635 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
9636 /*% %*/
9637 /*% ripper: var_alias!($2, $3) %*/
9638 }
9639#line 9635 "parse.c"
9640 break;
9641
9642 case 25: /* stmt: "`alias'" "global variable" "numbered reference" */
9643#line 1751 "parse.y"
9644 {
9645 static const char mesg[] = "can't make alias for the number variables";
9646 /*%%%*/
9647 yyerror1(&(yylsp[0]), mesg);
9648 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9649 /*% %*/
9650 /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/
9651 }
9652#line 9648 "parse.c"
9653 break;
9654
9655 case 26: /* stmt: "`undef'" undef_list */
9656#line 1760 "parse.y"
9657 {
9658 /*%%%*/
9659 (yyval.node) = (yyvsp[0].node);
9660 /*% %*/
9661 /*% ripper: undef!($2) %*/
9662 }
9663#line 9659 "parse.c"
9664 break;
9665
9666 case 27: /* stmt: stmt "`if' modifier" expr_value */
9667#line 1767 "parse.y"
9668 {
9669 /*%%%*/
9670 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
9671 fixpos((yyval.node), (yyvsp[0].node));
9672 /*% %*/
9673 /*% ripper: if_mod!($3, $1) %*/
9674 }
9675#line 9671 "parse.c"
9676 break;
9677
9678 case 28: /* stmt: stmt "`unless' modifier" expr_value */
9679#line 1775 "parse.y"
9680 {
9681 /*%%%*/
9682 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
9683 fixpos((yyval.node), (yyvsp[0].node));
9684 /*% %*/
9685 /*% ripper: unless_mod!($3, $1) %*/
9686 }
9687#line 9683 "parse.c"
9688 break;
9689
9690 case 29: /* stmt: stmt "`while' modifier" expr_value */
9691#line 1783 "parse.y"
9692 {
9693 /*%%%*/
9694 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
9695 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
9696 }
9697 else {
9698 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
9699 }
9700 /*% %*/
9701 /*% ripper: while_mod!($3, $1) %*/
9702 }
9703#line 9699 "parse.c"
9704 break;
9705
9706 case 30: /* stmt: stmt "`until' modifier" expr_value */
9707#line 1795 "parse.y"
9708 {
9709 /*%%%*/
9710 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
9711 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
9712 }
9713 else {
9714 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
9715 }
9716 /*% %*/
9717 /*% ripper: until_mod!($3, $1) %*/
9718 }
9719#line 9715 "parse.c"
9720 break;
9721
9722 case 31: /* stmt: stmt "`rescue' modifier" stmt */
9723#line 1807 "parse.y"
9724 {
9725 /*%%%*/
9726 NODE *resq;
9727 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9728 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
9729 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-2].node)), resq, 0, &(yyloc));
9730 /*% %*/
9731 /*% ripper: rescue_mod!($1, $3) %*/
9732 }
9733#line 9729 "parse.c"
9734 break;
9735
9736 case 32: /* stmt: "`END'" '{' compstmt '}' */
9737#line 1817 "parse.y"
9738 {
9739 if (p->ctxt.in_def) {
9740 rb_warn0("END in method; use at_exit");
9741 }
9742 /*%%%*/
9743 {
9744 NODE *scope = NEW_NODE(
9745 NODE_SCOPE, 0 /* tbl */, (yyvsp[-1].node) /* body */, 0 /* args */, &(yyloc));
9746 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
9747 }
9748 /*% %*/
9749 /*% ripper: END!($3) %*/
9750 }
9751#line 9747 "parse.c"
9752 break;
9753
9754 case 34: /* stmt: mlhs '=' lex_ctxt command_call */
9755#line 1832 "parse.y"
9756 {
9757 /*%%%*/
9758 value_expr((yyvsp[0].node));
9759 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9760 /*% %*/
9761 /*% ripper: massign!($1, $4) %*/
9762 }
9763#line 9759 "parse.c"
9764 break;
9765
9766 case 35: /* stmt: lhs '=' lex_ctxt mrhs */
9767#line 1840 "parse.y"
9768 {
9769 /*%%%*/
9770 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9771 /*% %*/
9772 /*% ripper: assign!($1, $4) %*/
9773 }
9774#line 9770 "parse.c"
9775 break;
9776
9777 case 36: /* stmt: mlhs '=' lex_ctxt mrhs_arg "`rescue' modifier" stmt */
9778#line 1847 "parse.y"
9779 {
9780 /*%%%*/
9781 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9782 (yyval.node) = node_assign(p, (yyvsp[-5].node), NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc)), (yyvsp[-3].ctxt), &(yyloc));
9783 /*% %*/
9784 /*% ripper: massign!($1, rescue_mod!($4, $6)) %*/
9785 }
9786#line 9782 "parse.c"
9787 break;
9788
9789 case 37: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
9790#line 1855 "parse.y"
9791 {
9792 /*%%%*/
9793 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9794 /*% %*/
9795 /*% ripper: massign!($1, $4) %*/
9796 }
9797#line 9793 "parse.c"
9798 break;
9799
9800 case 39: /* stmt: error */
9801#line 1863 "parse.y"
9802 {
9803 /*%%%*/
9804 (yyval.node) = NEW_ERROR(&(yyloc));
9805 /*% %*/
9806 }
9807#line 9803 "parse.c"
9808 break;
9809
9810 case 40: /* command_asgn: lhs '=' lex_ctxt command_rhs */
9811#line 1871 "parse.y"
9812 {
9813 /*%%%*/
9814 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9815 /*% %*/
9816 /*% ripper: assign!($1, $4) %*/
9817 }
9818#line 9814 "parse.c"
9819 break;
9820
9821 case 41: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
9822#line 1878 "parse.y"
9823 {
9824 /*%%%*/
9825 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9826 /*% %*/
9827 /*% ripper: opassign!($1, $2, $4) %*/
9828 }
9829#line 9825 "parse.c"
9830 break;
9831
9832 case 42: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
9833#line 1885 "parse.y"
9834 {
9835 /*%%%*/
9836 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
9837 /*% %*/
9838 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
9839
9840 }
9841#line 9837 "parse.c"
9842 break;
9843
9844 case 43: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
9845#line 1893 "parse.y"
9846 {
9847 /*%%%*/
9848 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
9849 /*% %*/
9850 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
9851 }
9852#line 9848 "parse.c"
9853 break;
9854
9855 case 44: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
9856#line 1900 "parse.y"
9857 {
9858 /*%%%*/
9859 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
9860 /*% %*/
9861 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
9862 }
9863#line 9859 "parse.c"
9864 break;
9865
9866 case 45: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
9867#line 1907 "parse.y"
9868 {
9869 /*%%%*/
9870 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
9871 (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));
9872 /*% %*/
9873 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
9874 }
9875#line 9871 "parse.c"
9876 break;
9877
9878 case 46: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
9879#line 1915 "parse.y"
9880 {
9881 /*%%%*/
9882 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
9883 /*% %*/
9884 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
9885 }
9886#line 9882 "parse.c"
9887 break;
9888
9889 case 47: /* command_asgn: defn_head f_opt_paren_args '=' command */
9890#line 1922 "parse.y"
9891 {
9892 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
9893 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9894 /*%%%*/
9895 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9896 /*% %*/
9897 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
9898 /*% ripper: def!(get_value($1), $2, $4) %*/
9899 local_pop(p);
9900 }
9901#line 9897 "parse.c"
9902 break;
9903
9904 case 48: /* command_asgn: defn_head f_opt_paren_args '=' command "`rescue' modifier" arg */
9905#line 1933 "parse.y"
9906 {
9907 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
9908 restore_defun(p, (yyvsp[-5].node)->nd_defn);
9909 /*%%%*/
9910 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9911 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
9912 /*% %*/
9913 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
9914 /*% ripper: def!(get_value($1), $2, $4) %*/
9915 local_pop(p);
9916 }
9917#line 9913 "parse.c"
9918 break;
9919
9920 case 49: /* command_asgn: defs_head f_opt_paren_args '=' command */
9921#line 1945 "parse.y"
9922 {
9923 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
9924 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9925 /*%%%*/
9926 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9927 /*%
9928 $1 = get_value($1);
9929 %*/
9930 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
9931 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
9932 local_pop(p);
9933 }
9934#line 9930 "parse.c"
9935 break;
9936
9937 case 50: /* command_asgn: defs_head f_opt_paren_args '=' command "`rescue' modifier" arg */
9938#line 1958 "parse.y"
9939 {
9940 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
9941 restore_defun(p, (yyvsp[-5].node)->nd_defn);
9942 /*%%%*/
9943 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9944 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
9945 /*%
9946 $1 = get_value($1);
9947 %*/
9948 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
9949 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
9950 local_pop(p);
9951 }
9952#line 9948 "parse.c"
9953 break;
9954
9955 case 51: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
9956#line 1972 "parse.y"
9957 {
9958 /*%%%*/
9959 rb_backref_error(p, (yyvsp[-3].node));
9960 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9961 /*% %*/
9962 /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/
9963 }
9964#line 9960 "parse.c"
9965 break;
9966
9967 case 52: /* command_rhs: command_call */
9968#line 1982 "parse.y"
9969 {
9970 value_expr((yyvsp[0].node));
9971 (yyval.node) = (yyvsp[0].node);
9972 }
9973#line 9969 "parse.c"
9974 break;
9975
9976 case 53: /* command_rhs: command_call "`rescue' modifier" stmt */
9977#line 1987 "parse.y"
9978 {
9979 /*%%%*/
9980 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9981 value_expr((yyvsp[-2].node));
9982 (yyval.node) = NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
9983 /*% %*/
9984 /*% ripper: rescue_mod!($1, $3) %*/
9985 }
9986#line 9982 "parse.c"
9987 break;
9988
9989 case 56: /* expr: expr "`and'" expr */
9990#line 2000 "parse.y"
9991 {
9992 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9993 }
9994#line 9990 "parse.c"
9995 break;
9996
9997 case 57: /* expr: expr "`or'" expr */
9998#line 2004 "parse.y"
9999 {
10000 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10001 }
10002#line 9998 "parse.c"
10003 break;
10004
10005 case 58: /* expr: "`not'" opt_nl expr */
10006#line 2008 "parse.y"
10007 {
10008 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
10009 }
10010#line 10006 "parse.c"
10011 break;
10012
10013 case 59: /* expr: '!' command_call */
10014#line 2012 "parse.y"
10015 {
10016 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
10017 }
10018#line 10014 "parse.c"
10019 break;
10020
10021 case 60: /* @5: %empty */
10022#line 2016 "parse.y"
10023 {
10024 value_expr((yyvsp[-1].node));
10025 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
10026 p->command_start = FALSE;
10027 (yyvsp[0].ctxt) = p->ctxt;
10028 p->ctxt.in_kwarg = 1;
10029 (yyval.tbl) = push_pvtbl(p);
10030 }
10031#line 10027 "parse.c"
10032 break;
10033
10034 case 61: /* @6: %empty */
10035#line 2024 "parse.y"
10036 {
10037 (yyval.tbl) = push_pktbl(p);
10038 }
10039#line 10035 "parse.c"
10040 break;
10041
10042 case 62: /* expr: arg "=>" @5 @6 p_top_expr_body */
10043#line 2028 "parse.y"
10044 {
10045 pop_pktbl(p, (yyvsp[-1].tbl));
10046 pop_pvtbl(p, (yyvsp[-2].tbl));
10047 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10048 /*%%%*/
10049 (yyval.node) = NEW_CASE3((yyvsp[-4].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc));
10050 /*% %*/
10051 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
10052 }
10053#line 10049 "parse.c"
10054 break;
10055
10056 case 63: /* @7: %empty */
10057#line 2038 "parse.y"
10058 {
10059 value_expr((yyvsp[-1].node));
10060 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
10061 p->command_start = FALSE;
10062 (yyvsp[0].ctxt) = p->ctxt;
10063 p->ctxt.in_kwarg = 1;
10064 (yyval.tbl) = push_pvtbl(p);
10065 }
10066#line 10062 "parse.c"
10067 break;
10068
10069 case 64: /* @8: %empty */
10070#line 2046 "parse.y"
10071 {
10072 (yyval.tbl) = push_pktbl(p);
10073 }
10074#line 10070 "parse.c"
10075 break;
10076
10077 case 65: /* expr: arg "`in'" @7 @8 p_top_expr_body */
10078#line 2050 "parse.y"
10079 {
10080 pop_pktbl(p, (yyvsp[-1].tbl));
10081 pop_pvtbl(p, (yyvsp[-2].tbl));
10082 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10083 /*%%%*/
10084 (yyval.node) = NEW_CASE3((yyvsp[-4].node), NEW_IN((yyvsp[0].node), NEW_TRUE(&(yylsp[0])), NEW_FALSE(&(yylsp[0])), &(yylsp[0])), &(yyloc));
10085 /*% %*/
10086 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
10087 }
10088#line 10084 "parse.c"
10089 break;
10090
10091 case 67: /* def_name: fname */
10092#line 2063 "parse.y"
10093 {
10094 ID fname = get_id((yyvsp[0].id));
10095 ID cur_arg = p->cur_arg;
10096 YYSTYPE c = {.ctxt = p->ctxt};
10097 numparam_name(p, fname);
10098 NODE *save =
10099 NODE_NEW_TEMPORAL(NODE_SELF,
10100 /*head*/numparam_push(p),
10101 /*nth*/p->max_numparam,
10102 /*cval*/c.val);
10103 local_push(p, 0);
10104 p->cur_arg = 0;
10105 p->ctxt.in_def = 1;
10106 (yyval.node) = NEW_NODE(NODE_SELF, /*vid*/cur_arg, /*mid*/fname, /*args*/save, &(yyloc));
10107 /*%%%*/
10108 /*%
10109 $$ = NEW_RIPPER(fname, get_value($1), $$, &NULL_LOC);
10110 %*/
10111 }
10112#line 10108 "parse.c"
10113 break;
10114
10115 case 68: /* defn_head: k_def def_name */
10116#line 2085 "parse.y"
10117 {
10118 (yyval.node) = (yyvsp[0].node);
10119 /*%%%*/
10120 (yyval.node) = NEW_NODE(NODE_DEFN, 0, (yyval.node)->nd_mid, (yyval.node), &(yyloc));
10121 /*% %*/
10122 }
10123#line 10119 "parse.c"
10124 break;
10125
10126 case 69: /* $@9: %empty */
10127#line 2094 "parse.y"
10128 {
10129 SET_LEX_STATE(EXPR_FNAME);
10130 p->ctxt.in_argdef = 1;
10131 }
10132#line 10128 "parse.c"
10133 break;
10134
10135 case 70: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
10136#line 2099 "parse.y"
10137 {
10138 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
10139 (yyval.node) = (yyvsp[0].node);
10140 /*%%%*/
10141 (yyval.node) = NEW_NODE(NODE_DEFS, (yyvsp[-3].node), (yyval.node)->nd_mid, (yyval.node), &(yyloc));
10142 /*%
10143 VALUE ary = rb_ary_new_from_args(3, $2, $3, get_value($$));
10144 add_mark_object(p, ary);
10145 $<node>$->nd_rval = ary;
10146 %*/
10147 }
10148#line 10144 "parse.c"
10149 break;
10150
10151 case 71: /* expr_value: expr */
10152#line 2113 "parse.y"
10153 {
10154 value_expr((yyvsp[0].node));
10155 (yyval.node) = (yyvsp[0].node);
10156 }
10157#line 10153 "parse.c"
10158 break;
10159
10160 case 72: /* expr_value: error */
10161#line 2118 "parse.y"
10162 {
10163 /*%%%*/
10164 (yyval.node) = NEW_ERROR(&(yyloc));
10165 /*% %*/
10166 }
10167#line 10163 "parse.c"
10168 break;
10169
10170 case 73: /* $@10: %empty */
10171#line 2125 "parse.y"
10172 {COND_PUSH(1);}
10173#line 10169 "parse.c"
10174 break;
10175
10176 case 74: /* $@11: %empty */
10177#line 2125 "parse.y"
10178 {COND_POP();}
10179#line 10175 "parse.c"
10180 break;
10181
10182 case 75: /* expr_value_do: $@10 expr_value do $@11 */
10183#line 2126 "parse.y"
10184 {
10185 (yyval.node) = (yyvsp[-2].node);
10186 }
10187#line 10183 "parse.c"
10188 break;
10189
10190 case 79: /* block_command: block_call call_op2 operation2 command_args */
10191#line 2137 "parse.y"
10192 {
10193 /*%%%*/
10194 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10195 /*% %*/
10196 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
10197 }
10198#line 10194 "parse.c"
10199 break;
10200
10201 case 80: /* cmd_brace_block: "{ arg" brace_body '}' */
10202#line 2146 "parse.y"
10203 {
10204 (yyval.node) = (yyvsp[-1].node);
10205 /*%%%*/
10206 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10207 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10208 /*% %*/
10209 }
10210#line 10206 "parse.c"
10211 break;
10212
10213 case 81: /* fcall: operation */
10214#line 2156 "parse.y"
10215 {
10216 /*%%%*/
10217 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
10218 nd_set_line((yyval.node), p->tokline);
10219 /*% %*/
10220 /*% ripper: $1 %*/
10221 }
10222#line 10218 "parse.c"
10223 break;
10224
10225 case 82: /* command: fcall command_args */
10226#line 2166 "parse.y"
10227 {
10228 /*%%%*/
10229 (yyvsp[-1].node)->nd_args = (yyvsp[0].node);
10230 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
10231 (yyval.node) = (yyvsp[-1].node);
10232 /*% %*/
10233 /*% ripper: command!($1, $2) %*/
10234 }
10235#line 10231 "parse.c"
10236 break;
10237
10238 case 83: /* command: fcall command_args cmd_brace_block */
10239#line 2175 "parse.y"
10240 {
10241 /*%%%*/
10242 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
10243 (yyvsp[-2].node)->nd_args = (yyvsp[-1].node);
10244 (yyval.node) = method_add_block(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10245 fixpos((yyval.node), (yyvsp[-2].node));
10246 nd_set_last_loc((yyvsp[-2].node), (yylsp[-1]).end_pos);
10247 /*% %*/
10248 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
10249 }
10250#line 10246 "parse.c"
10251 break;
10252
10253 case 84: /* command: primary_value call_op operation2 command_args */
10254#line 2186 "parse.y"
10255 {
10256 /*%%%*/
10257 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
10258 /*% %*/
10259 /*% ripper: command_call!($1, $2, $3, $4) %*/
10260 }
10261#line 10257 "parse.c"
10262 break;
10263
10264 case 85: /* command: primary_value call_op operation2 command_args cmd_brace_block */
10265#line 2193 "parse.y"
10266 {
10267 /*%%%*/
10268 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10269 /*% %*/
10270 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
10271 }
10272#line 10268 "parse.c"
10273 break;
10274
10275 case 86: /* command: primary_value "::" operation2 command_args */
10276#line 2200 "parse.y"
10277 {
10278 /*%%%*/
10279 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
10280 /*% %*/
10281 /*% ripper: command_call!($1, $2, $3, $4) %*/
10282 }
10283#line 10279 "parse.c"
10284 break;
10285
10286 case 87: /* command: primary_value "::" operation2 command_args cmd_brace_block */
10287#line 2207 "parse.y"
10288 {
10289 /*%%%*/
10290 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10291 /*% %*/
10292 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
10293 }
10294#line 10290 "parse.c"
10295 break;
10296
10297 case 88: /* command: "`super'" command_args */
10298#line 2214 "parse.y"
10299 {
10300 /*%%%*/
10301 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
10302 fixpos((yyval.node), (yyvsp[0].node));
10303 /*% %*/
10304 /*% ripper: super!($2) %*/
10305 }
10306#line 10302 "parse.c"
10307 break;
10308
10309 case 89: /* command: "`yield'" command_args */
10310#line 2222 "parse.y"
10311 {
10312 /*%%%*/
10313 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
10314 fixpos((yyval.node), (yyvsp[0].node));
10315 /*% %*/
10316 /*% ripper: yield!($2) %*/
10317 }
10318#line 10314 "parse.c"
10319 break;
10320
10321 case 90: /* command: k_return call_args */
10322#line 2230 "parse.y"
10323 {
10324 /*%%%*/
10325 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
10326 /*% %*/
10327 /*% ripper: return!($2) %*/
10328 }
10329#line 10325 "parse.c"
10330 break;
10331
10332 case 91: /* command: "`break'" call_args */
10333#line 2237 "parse.y"
10334 {
10335 /*%%%*/
10336 (yyval.node) = NEW_BREAK(ret_args(p, (yyvsp[0].node)), &(yyloc));
10337 /*% %*/
10338 /*% ripper: break!($2) %*/
10339 }
10340#line 10336 "parse.c"
10341 break;
10342
10343 case 92: /* command: "`next'" call_args */
10344#line 2244 "parse.y"
10345 {
10346 /*%%%*/
10347 (yyval.node) = NEW_NEXT(ret_args(p, (yyvsp[0].node)), &(yyloc));
10348 /*% %*/
10349 /*% ripper: next!($2) %*/
10350 }
10351#line 10347 "parse.c"
10352 break;
10353
10354 case 94: /* mlhs: "(" mlhs_inner rparen */
10355#line 2254 "parse.y"
10356 {
10357 /*%%%*/
10358 (yyval.node) = (yyvsp[-1].node);
10359 /*% %*/
10360 /*% ripper: mlhs_paren!($2) %*/
10361 }
10362#line 10358 "parse.c"
10363 break;
10364
10365 case 96: /* mlhs_inner: "(" mlhs_inner rparen */
10366#line 2264 "parse.y"
10367 {
10368 /*%%%*/
10369 (yyval.node) = NEW_MASGN(NEW_LIST((yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
10370 /*% %*/
10371 /*% ripper: mlhs_paren!($2) %*/
10372 }
10373#line 10369 "parse.c"
10374 break;
10375
10376 case 97: /* mlhs_basic: mlhs_head */
10377#line 2273 "parse.y"
10378 {
10379 /*%%%*/
10380 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
10381 /*% %*/
10382 /*% ripper: $1 %*/
10383 }
10384#line 10380 "parse.c"
10385 break;
10386
10387 case 98: /* mlhs_basic: mlhs_head mlhs_item */
10388#line 2280 "parse.y"
10389 {
10390 /*%%%*/
10391 (yyval.node) = NEW_MASGN(list_append(p, (yyvsp[-1].node),(yyvsp[0].node)), 0, &(yyloc));
10392 /*% %*/
10393 /*% ripper: mlhs_add!($1, $2) %*/
10394 }
10395#line 10391 "parse.c"
10396 break;
10397
10398 case 99: /* mlhs_basic: mlhs_head "*" mlhs_node */
10399#line 2287 "parse.y"
10400 {
10401 /*%%%*/
10402 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10403 /*% %*/
10404 /*% ripper: mlhs_add_star!($1, $3) %*/
10405 }
10406#line 10402 "parse.c"
10407 break;
10408
10409 case 100: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
10410#line 2294 "parse.y"
10411 {
10412 /*%%%*/
10413 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
10414 /*% %*/
10415 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
10416 }
10417#line 10413 "parse.c"
10418 break;
10419
10420 case 101: /* mlhs_basic: mlhs_head "*" */
10421#line 2301 "parse.y"
10422 {
10423 /*%%%*/
10424 (yyval.node) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
10425 /*% %*/
10426 /*% ripper: mlhs_add_star!($1, Qnil) %*/
10427 }
10428#line 10424 "parse.c"
10429 break;
10430
10431 case 102: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
10432#line 2308 "parse.y"
10433 {
10434 /*%%%*/
10435 (yyval.node) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
10436 /*% %*/
10437 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
10438 }
10439#line 10435 "parse.c"
10440 break;
10441
10442 case 103: /* mlhs_basic: "*" mlhs_node */
10443#line 2315 "parse.y"
10444 {
10445 /*%%%*/
10446 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
10447 /*% %*/
10448 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
10449 }
10450#line 10446 "parse.c"
10451 break;
10452
10453 case 104: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
10454#line 2322 "parse.y"
10455 {
10456 /*%%%*/
10457 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
10458 /*% %*/
10459 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
10460 }
10461#line 10457 "parse.c"
10462 break;
10463
10464 case 105: /* mlhs_basic: "*" */
10465#line 2329 "parse.y"
10466 {
10467 /*%%%*/
10468 (yyval.node) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
10469 /*% %*/
10470 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
10471 }
10472#line 10468 "parse.c"
10473 break;
10474
10475 case 106: /* mlhs_basic: "*" ',' mlhs_post */
10476#line 2336 "parse.y"
10477 {
10478 /*%%%*/
10479 (yyval.node) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
10480 /*% %*/
10481 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
10482 }
10483#line 10479 "parse.c"
10484 break;
10485
10486 case 108: /* mlhs_item: "(" mlhs_inner rparen */
10487#line 2346 "parse.y"
10488 {
10489 /*%%%*/
10490 (yyval.node) = (yyvsp[-1].node);
10491 /*% %*/
10492 /*% ripper: mlhs_paren!($2) %*/
10493 }
10494#line 10490 "parse.c"
10495 break;
10496
10497 case 109: /* mlhs_head: mlhs_item ',' */
10498#line 2355 "parse.y"
10499 {
10500 /*%%%*/
10501 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
10502 /*% %*/
10503 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
10504 }
10505#line 10501 "parse.c"
10506 break;
10507
10508 case 110: /* mlhs_head: mlhs_head mlhs_item ',' */
10509#line 2362 "parse.y"
10510 {
10511 /*%%%*/
10512 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
10513 /*% %*/
10514 /*% ripper: mlhs_add!($1, $2) %*/
10515 }
10516#line 10512 "parse.c"
10517 break;
10518
10519 case 111: /* mlhs_post: mlhs_item */
10520#line 2371 "parse.y"
10521 {
10522 /*%%%*/
10523 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
10524 /*% %*/
10525 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
10526 }
10527#line 10523 "parse.c"
10528 break;
10529
10530 case 112: /* mlhs_post: mlhs_post ',' mlhs_item */
10531#line 2378 "parse.y"
10532 {
10533 /*%%%*/
10534 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
10535 /*% %*/
10536 /*% ripper: mlhs_add!($1, $3) %*/
10537 }
10538#line 10534 "parse.c"
10539 break;
10540
10541 case 113: /* mlhs_node: user_variable */
10542#line 2387 "parse.y"
10543 {
10544 /*%%%*/
10545 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10546 /*% %*/
10547 /*% ripper: assignable(p, var_field(p, $1)) %*/
10548 }
10549#line 10545 "parse.c"
10550 break;
10551
10552 case 114: /* mlhs_node: keyword_variable */
10553#line 2394 "parse.y"
10554 {
10555 /*%%%*/
10556 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10557 /*% %*/
10558 /*% ripper: assignable(p, var_field(p, $1)) %*/
10559 }
10560#line 10556 "parse.c"
10561 break;
10562
10563 case 115: /* mlhs_node: primary_value '[' opt_call_args rbracket */
10564#line 2401 "parse.y"
10565 {
10566 /*%%%*/
10567 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10568 /*% %*/
10569 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
10570 }
10571#line 10567 "parse.c"
10572 break;
10573
10574 case 116: /* mlhs_node: primary_value call_op "local variable or method" */
10575#line 2408 "parse.y"
10576 {
10577 if ((yyvsp[-1].id) == tANDDOT) {
10578 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
10579 }
10580 /*%%%*/
10581 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10582 /*% %*/
10583 /*% ripper: field!($1, $2, $3) %*/
10584 }
10585#line 10581 "parse.c"
10586 break;
10587
10588 case 117: /* mlhs_node: primary_value "::" "local variable or method" */
10589#line 2418 "parse.y"
10590 {
10591 /*%%%*/
10592 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
10593 /*% %*/
10594 /*% ripper: const_path_field!($1, $3) %*/
10595 }
10596#line 10592 "parse.c"
10597 break;
10598
10599 case 118: /* mlhs_node: primary_value call_op "constant" */
10600#line 2425 "parse.y"
10601 {
10602 if ((yyvsp[-1].id) == tANDDOT) {
10603 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
10604 }
10605 /*%%%*/
10606 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10607 /*% %*/
10608 /*% ripper: field!($1, $2, $3) %*/
10609 }
10610#line 10606 "parse.c"
10611 break;
10612
10613 case 119: /* mlhs_node: primary_value "::" "constant" */
10614#line 2435 "parse.y"
10615 {
10616 /*%%%*/
10617 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
10618 /*% %*/
10619 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
10620 }
10621#line 10617 "parse.c"
10622 break;
10623
10624 case 120: /* mlhs_node: ":: at EXPR_BEG" "constant" */
10625#line 2442 "parse.y"
10626 {
10627 /*%%%*/
10628 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
10629 /*% %*/
10630 /*% ripper: const_decl(p, top_const_field!($2)) %*/
10631 }
10632#line 10628 "parse.c"
10633 break;
10634
10635 case 121: /* mlhs_node: backref */
10636#line 2449 "parse.y"
10637 {
10638 /*%%%*/
10639 rb_backref_error(p, (yyvsp[0].node));
10640 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10641 /*% %*/
10642 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
10643 }
10644#line 10640 "parse.c"
10645 break;
10646
10647 case 122: /* lhs: user_variable */
10648#line 2459 "parse.y"
10649 {
10650 /*%%%*/
10651 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10652 /*% %*/
10653 /*% ripper: assignable(p, var_field(p, $1)) %*/
10654 }
10655#line 10651 "parse.c"
10656 break;
10657
10658 case 123: /* lhs: keyword_variable */
10659#line 2466 "parse.y"
10660 {
10661 /*%%%*/
10662 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10663 /*% %*/
10664 /*% ripper: assignable(p, var_field(p, $1)) %*/
10665 }
10666#line 10662 "parse.c"
10667 break;
10668
10669 case 124: /* lhs: primary_value '[' opt_call_args rbracket */
10670#line 2473 "parse.y"
10671 {
10672 /*%%%*/
10673 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10674 /*% %*/
10675 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
10676 }
10677#line 10673 "parse.c"
10678 break;
10679
10680 case 125: /* lhs: primary_value call_op "local variable or method" */
10681#line 2480 "parse.y"
10682 {
10683 /*%%%*/
10684 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10685 /*% %*/
10686 /*% ripper: field!($1, $2, $3) %*/
10687 }
10688#line 10684 "parse.c"
10689 break;
10690
10691 case 126: /* lhs: primary_value "::" "local variable or method" */
10692#line 2487 "parse.y"
10693 {
10694 /*%%%*/
10695 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
10696 /*% %*/
10697 /*% ripper: field!($1, $2, $3) %*/
10698 }
10699#line 10695 "parse.c"
10700 break;
10701
10702 case 127: /* lhs: primary_value call_op "constant" */
10703#line 2494 "parse.y"
10704 {
10705 /*%%%*/
10706 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10707 /*% %*/
10708 /*% ripper: field!($1, $2, $3) %*/
10709 }
10710#line 10706 "parse.c"
10711 break;
10712
10713 case 128: /* lhs: primary_value "::" "constant" */
10714#line 2501 "parse.y"
10715 {
10716 /*%%%*/
10717 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
10718 /*% %*/
10719 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
10720 }
10721#line 10717 "parse.c"
10722 break;
10723
10724 case 129: /* lhs: ":: at EXPR_BEG" "constant" */
10725#line 2508 "parse.y"
10726 {
10727 /*%%%*/
10728 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
10729 /*% %*/
10730 /*% ripper: const_decl(p, top_const_field!($2)) %*/
10731 }
10732#line 10728 "parse.c"
10733 break;
10734
10735 case 130: /* lhs: backref */
10736#line 2515 "parse.y"
10737 {
10738 /*%%%*/
10739 rb_backref_error(p, (yyvsp[0].node));
10740 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10741 /*% %*/
10742 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
10743 }
10744#line 10740 "parse.c"
10745 break;
10746
10747 case 131: /* cname: "local variable or method" */
10748#line 2525 "parse.y"
10749 {
10750 static const char mesg[] = "class/module name must be CONSTANT";
10751 /*%%%*/
10752 yyerror1(&(yylsp[0]), mesg);
10753 /*% %*/
10754 /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/
10755 }
10756#line 10752 "parse.c"
10757 break;
10758
10759 case 133: /* cpath: ":: at EXPR_BEG" cname */
10760#line 2536 "parse.y"
10761 {
10762 /*%%%*/
10763 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
10764 /*% %*/
10765 /*% ripper: top_const_ref!($2) %*/
10766 }
10767#line 10763 "parse.c"
10768 break;
10769
10770 case 134: /* cpath: cname */
10771#line 2543 "parse.y"
10772 {
10773 /*%%%*/
10774 (yyval.node) = NEW_COLON2(0, (yyval.node), &(yyloc));
10775 /*% %*/
10776 /*% ripper: const_ref!($1) %*/
10777 }
10778#line 10774 "parse.c"
10779 break;
10780
10781 case 135: /* cpath: primary_value "::" cname */
10782#line 2550 "parse.y"
10783 {
10784 /*%%%*/
10785 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
10786 /*% %*/
10787 /*% ripper: const_path_ref!($1, $3) %*/
10788 }
10789#line 10785 "parse.c"
10790 break;
10791
10792 case 139: /* fname: op */
10793#line 2562 "parse.y"
10794 {
10795 SET_LEX_STATE(EXPR_ENDFN);
10796 (yyval.id) = (yyvsp[0].id);
10797 }
10798#line 10794 "parse.c"
10799 break;
10800
10801 case 141: /* fitem: fname */
10802#line 2570 "parse.y"
10803 {
10804 /*%%%*/
10805 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
10806 /*% %*/
10807 /*% ripper: symbol_literal!($1) %*/
10808 }
10809#line 10805 "parse.c"
10810 break;
10811
10812 case 143: /* undef_list: fitem */
10813#line 2580 "parse.y"
10814 {
10815 /*%%%*/
10816 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
10817 /*% %*/
10818 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
10819 }
10820#line 10816 "parse.c"
10821 break;
10822
10823 case 144: /* $@12: %empty */
10824#line 2586 "parse.y"
10825 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
10826#line 10822 "parse.c"
10827 break;
10828
10829 case 145: /* undef_list: undef_list ',' $@12 fitem */
10830#line 2587 "parse.y"
10831 {
10832 /*%%%*/
10833 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
10834 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
10835 /*% %*/
10836 /*% ripper: rb_ary_push($1, get_value($4)) %*/
10837 }
10838#line 10834 "parse.c"
10839 break;
10840
10841 case 146: /* op: '|' */
10842#line 2596 "parse.y"
10843 { ifndef_ripper((yyval.id) = '|'); }
10844#line 10840 "parse.c"
10845 break;
10846
10847 case 147: /* op: '^' */
10848#line 2597 "parse.y"
10849 { ifndef_ripper((yyval.id) = '^'); }
10850#line 10846 "parse.c"
10851 break;
10852
10853 case 148: /* op: '&' */
10854#line 2598 "parse.y"
10855 { ifndef_ripper((yyval.id) = '&'); }
10856#line 10852 "parse.c"
10857 break;
10858
10859 case 149: /* op: "<=>" */
10860#line 2599 "parse.y"
10861 { ifndef_ripper((yyval.id) = tCMP); }
10862#line 10858 "parse.c"
10863 break;
10864
10865 case 150: /* op: "==" */
10866#line 2600 "parse.y"
10867 { ifndef_ripper((yyval.id) = tEQ); }
10868#line 10864 "parse.c"
10869 break;
10870
10871 case 151: /* op: "===" */
10872#line 2601 "parse.y"
10873 { ifndef_ripper((yyval.id) = tEQQ); }
10874#line 10870 "parse.c"
10875 break;
10876
10877 case 152: /* op: "=~" */
10878#line 2602 "parse.y"
10879 { ifndef_ripper((yyval.id) = tMATCH); }
10880#line 10876 "parse.c"
10881 break;
10882
10883 case 153: /* op: "!~" */
10884#line 2603 "parse.y"
10885 { ifndef_ripper((yyval.id) = tNMATCH); }
10886#line 10882 "parse.c"
10887 break;
10888
10889 case 154: /* op: '>' */
10890#line 2604 "parse.y"
10891 { ifndef_ripper((yyval.id) = '>'); }
10892#line 10888 "parse.c"
10893 break;
10894
10895 case 155: /* op: ">=" */
10896#line 2605 "parse.y"
10897 { ifndef_ripper((yyval.id) = tGEQ); }
10898#line 10894 "parse.c"
10899 break;
10900
10901 case 156: /* op: '<' */
10902#line 2606 "parse.y"
10903 { ifndef_ripper((yyval.id) = '<'); }
10904#line 10900 "parse.c"
10905 break;
10906
10907 case 157: /* op: "<=" */
10908#line 2607 "parse.y"
10909 { ifndef_ripper((yyval.id) = tLEQ); }
10910#line 10906 "parse.c"
10911 break;
10912
10913 case 158: /* op: "!=" */
10914#line 2608 "parse.y"
10915 { ifndef_ripper((yyval.id) = tNEQ); }
10916#line 10912 "parse.c"
10917 break;
10918
10919 case 159: /* op: "<<" */
10920#line 2609 "parse.y"
10921 { ifndef_ripper((yyval.id) = tLSHFT); }
10922#line 10918 "parse.c"
10923 break;
10924
10925 case 160: /* op: ">>" */
10926#line 2610 "parse.y"
10927 { ifndef_ripper((yyval.id) = tRSHFT); }
10928#line 10924 "parse.c"
10929 break;
10930
10931 case 161: /* op: '+' */
10932#line 2611 "parse.y"
10933 { ifndef_ripper((yyval.id) = '+'); }
10934#line 10930 "parse.c"
10935 break;
10936
10937 case 162: /* op: '-' */
10938#line 2612 "parse.y"
10939 { ifndef_ripper((yyval.id) = '-'); }
10940#line 10936 "parse.c"
10941 break;
10942
10943 case 163: /* op: '*' */
10944#line 2613 "parse.y"
10945 { ifndef_ripper((yyval.id) = '*'); }
10946#line 10942 "parse.c"
10947 break;
10948
10949 case 164: /* op: "*" */
10950#line 2614 "parse.y"
10951 { ifndef_ripper((yyval.id) = '*'); }
10952#line 10948 "parse.c"
10953 break;
10954
10955 case 165: /* op: '/' */
10956#line 2615 "parse.y"
10957 { ifndef_ripper((yyval.id) = '/'); }
10958#line 10954 "parse.c"
10959 break;
10960
10961 case 166: /* op: '%' */
10962#line 2616 "parse.y"
10963 { ifndef_ripper((yyval.id) = '%'); }
10964#line 10960 "parse.c"
10965 break;
10966
10967 case 167: /* op: "**" */
10968#line 2617 "parse.y"
10969 { ifndef_ripper((yyval.id) = tPOW); }
10970#line 10966 "parse.c"
10971 break;
10972
10973 case 168: /* op: "**arg" */
10974#line 2618 "parse.y"
10975 { ifndef_ripper((yyval.id) = tDSTAR); }
10976#line 10972 "parse.c"
10977 break;
10978
10979 case 169: /* op: '!' */
10980#line 2619 "parse.y"
10981 { ifndef_ripper((yyval.id) = '!'); }
10982#line 10978 "parse.c"
10983 break;
10984
10985 case 170: /* op: '~' */
10986#line 2620 "parse.y"
10987 { ifndef_ripper((yyval.id) = '~'); }
10988#line 10984 "parse.c"
10989 break;
10990
10991 case 171: /* op: "unary+" */
10992#line 2621 "parse.y"
10993 { ifndef_ripper((yyval.id) = tUPLUS); }
10994#line 10990 "parse.c"
10995 break;
10996
10997 case 172: /* op: "unary-" */
10998#line 2622 "parse.y"
10999 { ifndef_ripper((yyval.id) = tUMINUS); }
11000#line 10996 "parse.c"
11001 break;
11002
11003 case 173: /* op: "[]" */
11004#line 2623 "parse.y"
11005 { ifndef_ripper((yyval.id) = tAREF); }
11006#line 11002 "parse.c"
11007 break;
11008
11009 case 174: /* op: "[]=" */
11010#line 2624 "parse.y"
11011 { ifndef_ripper((yyval.id) = tASET); }
11012#line 11008 "parse.c"
11013 break;
11014
11015 case 175: /* op: '`' */
11016#line 2625 "parse.y"
11017 { ifndef_ripper((yyval.id) = '`'); }
11018#line 11014 "parse.c"
11019 break;
11020
11021 case 217: /* arg: lhs '=' lex_ctxt arg_rhs */
11022#line 2643 "parse.y"
11023 {
11024 /*%%%*/
11025 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11026 /*% %*/
11027 /*% ripper: assign!($1, $4) %*/
11028 }
11029#line 11025 "parse.c"
11030 break;
11031
11032 case 218: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
11033#line 2650 "parse.y"
11034 {
11035 /*%%%*/
11036 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11037 /*% %*/
11038 /*% ripper: opassign!($1, $2, $4) %*/
11039 }
11040#line 11036 "parse.c"
11041 break;
11042
11043 case 219: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
11044#line 2657 "parse.y"
11045 {
11046 /*%%%*/
11047 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
11048 /*% %*/
11049 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
11050 }
11051#line 11047 "parse.c"
11052 break;
11053
11054 case 220: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11055#line 2664 "parse.y"
11056 {
11057 /*%%%*/
11058 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11059 /*% %*/
11060 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11061 }
11062#line 11058 "parse.c"
11063 break;
11064
11065 case 221: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
11066#line 2671 "parse.y"
11067 {
11068 /*%%%*/
11069 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11070 /*% %*/
11071 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11072 }
11073#line 11069 "parse.c"
11074 break;
11075
11076 case 222: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11077#line 2678 "parse.y"
11078 {
11079 /*%%%*/
11080 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11081 /*% %*/
11082 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11083 }
11084#line 11080 "parse.c"
11085 break;
11086
11087 case 223: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
11088#line 2685 "parse.y"
11089 {
11090 /*%%%*/
11091 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
11092 (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));
11093 /*% %*/
11094 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
11095 }
11096#line 11092 "parse.c"
11097 break;
11098
11099 case 224: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
11100#line 2693 "parse.y"
11101 {
11102 /*%%%*/
11103 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
11104 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11105 /*% %*/
11106 /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
11107 }
11108#line 11104 "parse.c"
11109 break;
11110
11111 case 225: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
11112#line 2701 "parse.y"
11113 {
11114 /*%%%*/
11115 rb_backref_error(p, (yyvsp[-3].node));
11116 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11117 /*% %*/
11118 /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/
11119 }
11120#line 11116 "parse.c"
11121 break;
11122
11123 case 226: /* arg: arg ".." arg */
11124#line 2709 "parse.y"
11125 {
11126 /*%%%*/
11127 value_expr((yyvsp[-2].node));
11128 value_expr((yyvsp[0].node));
11129 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11130 /*% %*/
11131 /*% ripper: dot2!($1, $3) %*/
11132 }
11133#line 11129 "parse.c"
11134 break;
11135
11136 case 227: /* arg: arg "..." arg */
11137#line 2718 "parse.y"
11138 {
11139 /*%%%*/
11140 value_expr((yyvsp[-2].node));
11141 value_expr((yyvsp[0].node));
11142 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11143 /*% %*/
11144 /*% ripper: dot3!($1, $3) %*/
11145 }
11146#line 11142 "parse.c"
11147 break;
11148
11149 case 228: /* arg: arg ".." */
11150#line 2727 "parse.y"
11151 {
11152 /*%%%*/
11153 value_expr((yyvsp[-1].node));
11154 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11155 /*% %*/
11156 /*% ripper: dot2!($1, Qnil) %*/
11157 }
11158#line 11154 "parse.c"
11159 break;
11160
11161 case 229: /* arg: arg "..." */
11162#line 2735 "parse.y"
11163 {
11164 /*%%%*/
11165 value_expr((yyvsp[-1].node));
11166 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11167 /*% %*/
11168 /*% ripper: dot3!($1, Qnil) %*/
11169 }
11170#line 11166 "parse.c"
11171 break;
11172
11173 case 230: /* arg: "(.." arg */
11174#line 2743 "parse.y"
11175 {
11176 /*%%%*/
11177 value_expr((yyvsp[0].node));
11178 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11179 /*% %*/
11180 /*% ripper: dot2!(Qnil, $2) %*/
11181 }
11182#line 11178 "parse.c"
11183 break;
11184
11185 case 231: /* arg: "(..." arg */
11186#line 2751 "parse.y"
11187 {
11188 /*%%%*/
11189 value_expr((yyvsp[0].node));
11190 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11191 /*% %*/
11192 /*% ripper: dot3!(Qnil, $2) %*/
11193 }
11194#line 11190 "parse.c"
11195 break;
11196
11197 case 232: /* arg: arg '+' arg */
11198#line 2759 "parse.y"
11199 {
11200 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11201 }
11202#line 11198 "parse.c"
11203 break;
11204
11205 case 233: /* arg: arg '-' arg */
11206#line 2763 "parse.y"
11207 {
11208 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11209 }
11210#line 11206 "parse.c"
11211 break;
11212
11213 case 234: /* arg: arg '*' arg */
11214#line 2767 "parse.y"
11215 {
11216 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11217 }
11218#line 11214 "parse.c"
11219 break;
11220
11221 case 235: /* arg: arg '/' arg */
11222#line 2771 "parse.y"
11223 {
11224 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11225 }
11226#line 11222 "parse.c"
11227 break;
11228
11229 case 236: /* arg: arg '%' arg */
11230#line 2775 "parse.y"
11231 {
11232 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11233 }
11234#line 11230 "parse.c"
11235 break;
11236
11237 case 237: /* arg: arg "**" arg */
11238#line 2779 "parse.y"
11239 {
11240 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11241 }
11242#line 11238 "parse.c"
11243 break;
11244
11245 case 238: /* arg: tUMINUS_NUM simple_numeric "**" arg */
11246#line 2783 "parse.y"
11247 {
11248 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
11249 }
11250#line 11246 "parse.c"
11251 break;
11252
11253 case 239: /* arg: "unary+" arg */
11254#line 2787 "parse.y"
11255 {
11256 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
11257 }
11258#line 11254 "parse.c"
11259 break;
11260
11261 case 240: /* arg: "unary-" arg */
11262#line 2791 "parse.y"
11263 {
11264 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
11265 }
11266#line 11262 "parse.c"
11267 break;
11268
11269 case 241: /* arg: arg '|' arg */
11270#line 2795 "parse.y"
11271 {
11272 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11273 }
11274#line 11270 "parse.c"
11275 break;
11276
11277 case 242: /* arg: arg '^' arg */
11278#line 2799 "parse.y"
11279 {
11280 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11281 }
11282#line 11278 "parse.c"
11283 break;
11284
11285 case 243: /* arg: arg '&' arg */
11286#line 2803 "parse.y"
11287 {
11288 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11289 }
11290#line 11286 "parse.c"
11291 break;
11292
11293 case 244: /* arg: arg "<=>" arg */
11294#line 2807 "parse.y"
11295 {
11296 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11297 }
11298#line 11294 "parse.c"
11299 break;
11300
11301 case 246: /* arg: arg "==" arg */
11302#line 2812 "parse.y"
11303 {
11304 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11305 }
11306#line 11302 "parse.c"
11307 break;
11308
11309 case 247: /* arg: arg "===" arg */
11310#line 2816 "parse.y"
11311 {
11312 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11313 }
11314#line 11310 "parse.c"
11315 break;
11316
11317 case 248: /* arg: arg "!=" arg */
11318#line 2820 "parse.y"
11319 {
11320 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11321 }
11322#line 11318 "parse.c"
11323 break;
11324
11325 case 249: /* arg: arg "=~" arg */
11326#line 2824 "parse.y"
11327 {
11328 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11329 }
11330#line 11326 "parse.c"
11331 break;
11332
11333 case 250: /* arg: arg "!~" arg */
11334#line 2828 "parse.y"
11335 {
11336 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11337 }
11338#line 11334 "parse.c"
11339 break;
11340
11341 case 251: /* arg: '!' arg */
11342#line 2832 "parse.y"
11343 {
11344 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
11345 }
11346#line 11342 "parse.c"
11347 break;
11348
11349 case 252: /* arg: '~' arg */
11350#line 2836 "parse.y"
11351 {
11352 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
11353 }
11354#line 11350 "parse.c"
11355 break;
11356
11357 case 253: /* arg: arg "<<" arg */
11358#line 2840 "parse.y"
11359 {
11360 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11361 }
11362#line 11358 "parse.c"
11363 break;
11364
11365 case 254: /* arg: arg ">>" arg */
11366#line 2844 "parse.y"
11367 {
11368 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11369 }
11370#line 11366 "parse.c"
11371 break;
11372
11373 case 255: /* arg: arg "&&" arg */
11374#line 2848 "parse.y"
11375 {
11376 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11377 }
11378#line 11374 "parse.c"
11379 break;
11380
11381 case 256: /* arg: arg "||" arg */
11382#line 2852 "parse.y"
11383 {
11384 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11385 }
11386#line 11382 "parse.c"
11387 break;
11388
11389 case 257: /* $@13: %empty */
11390#line 2855 "parse.y"
11391 {p->ctxt.in_defined = 1;}
11392#line 11388 "parse.c"
11393 break;
11394
11395 case 258: /* arg: "`defined?'" opt_nl $@13 arg */
11396#line 2856 "parse.y"
11397 {
11398 p->ctxt.in_defined = 0;
11399 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
11400 }
11401#line 11397 "parse.c"
11402 break;
11403
11404 case 259: /* arg: arg '?' arg opt_nl ':' arg */
11405#line 2861 "parse.y"
11406 {
11407 /*%%%*/
11408 value_expr((yyvsp[-5].node));
11409 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11410 fixpos((yyval.node), (yyvsp[-5].node));
11411 /*% %*/
11412 /*% ripper: ifop!($1, $3, $6) %*/
11413 }
11414#line 11410 "parse.c"
11415 break;
11416
11417 case 260: /* arg: defn_head f_opt_paren_args '=' arg */
11418#line 2870 "parse.y"
11419 {
11420 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
11421 restore_defun(p, (yyvsp[-3].node)->nd_defn);
11422 /*%%%*/
11423 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11424 /*% %*/
11425 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
11426 /*% ripper: def!(get_value($1), $2, $4) %*/
11427 local_pop(p);
11428 }
11429#line 11425 "parse.c"
11430 break;
11431
11432 case 261: /* arg: defn_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
11433#line 2881 "parse.y"
11434 {
11435 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
11436 restore_defun(p, (yyvsp[-5].node)->nd_defn);
11437 /*%%%*/
11438 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
11439 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
11440 /*% %*/
11441 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
11442 /*% ripper: def!(get_value($1), $2, $4) %*/
11443 local_pop(p);
11444 }
11445#line 11441 "parse.c"
11446 break;
11447
11448 case 262: /* arg: defs_head f_opt_paren_args '=' arg */
11449#line 2893 "parse.y"
11450 {
11451 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
11452 restore_defun(p, (yyvsp[-3].node)->nd_defn);
11453 /*%%%*/
11454 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11455 /*%
11456 $1 = get_value($1);
11457 %*/
11458 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
11459 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
11460 local_pop(p);
11461 }
11462#line 11458 "parse.c"
11463 break;
11464
11465 case 263: /* arg: defs_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
11466#line 2906 "parse.y"
11467 {
11468 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
11469 restore_defun(p, (yyvsp[-5].node)->nd_defn);
11470 /*%%%*/
11471 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
11472 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
11473 /*%
11474 $1 = get_value($1);
11475 %*/
11476 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
11477 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
11478 local_pop(p);
11479 }
11480#line 11476 "parse.c"
11481 break;
11482
11483 case 264: /* arg: primary */
11484#line 2920 "parse.y"
11485 {
11486 (yyval.node) = (yyvsp[0].node);
11487 }
11488#line 11484 "parse.c"
11489 break;
11490
11491 case 265: /* relop: '>' */
11492#line 2925 "parse.y"
11493 {(yyval.id) = '>';}
11494#line 11490 "parse.c"
11495 break;
11496
11497 case 266: /* relop: '<' */
11498#line 2926 "parse.y"
11499 {(yyval.id) = '<';}
11500#line 11496 "parse.c"
11501 break;
11502
11503 case 267: /* relop: ">=" */
11504#line 2927 "parse.y"
11505 {(yyval.id) = idGE;}
11506#line 11502 "parse.c"
11507 break;
11508
11509 case 268: /* relop: "<=" */
11510#line 2928 "parse.y"
11511 {(yyval.id) = idLE;}
11512#line 11508 "parse.c"
11513 break;
11514
11515 case 269: /* rel_expr: arg relop arg */
11516#line 2932 "parse.y"
11517 {
11518 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11519 }
11520#line 11516 "parse.c"
11521 break;
11522
11523 case 270: /* rel_expr: rel_expr relop arg */
11524#line 2936 "parse.y"
11525 {
11526 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
11527 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11528 }
11529#line 11525 "parse.c"
11530 break;
11531
11532 case 271: /* lex_ctxt: none */
11533#line 2943 "parse.y"
11534 {
11535 (yyval.ctxt) = p->ctxt;
11536 }
11537#line 11533 "parse.c"
11538 break;
11539
11540 case 272: /* arg_value: arg */
11541#line 2949 "parse.y"
11542 {
11543 value_expr((yyvsp[0].node));
11544 (yyval.node) = (yyvsp[0].node);
11545 }
11546#line 11542 "parse.c"
11547 break;
11548
11549 case 274: /* aref_args: args trailer */
11550#line 2957 "parse.y"
11551 {
11552 (yyval.node) = (yyvsp[-1].node);
11553 }
11554#line 11550 "parse.c"
11555 break;
11556
11557 case 275: /* aref_args: args ',' assocs trailer */
11558#line 2961 "parse.y"
11559 {
11560 /*%%%*/
11561 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
11562 /*% %*/
11563 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
11564 }
11565#line 11561 "parse.c"
11566 break;
11567
11568 case 276: /* aref_args: assocs trailer */
11569#line 2968 "parse.y"
11570 {
11571 /*%%%*/
11572 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
11573 /*% %*/
11574 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
11575 }
11576#line 11572 "parse.c"
11577 break;
11578
11579 case 277: /* arg_rhs: arg */
11580#line 2977 "parse.y"
11581 {
11582 value_expr((yyvsp[0].node));
11583 (yyval.node) = (yyvsp[0].node);
11584 }
11585#line 11581 "parse.c"
11586 break;
11587
11588 case 278: /* arg_rhs: arg "`rescue' modifier" arg */
11589#line 2982 "parse.y"
11590 {
11591 /*%%%*/
11592 value_expr((yyvsp[-2].node));
11593 (yyval.node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
11594 /*% %*/
11595 /*% ripper: rescue_mod!($1, $3) %*/
11596 }
11597#line 11593 "parse.c"
11598 break;
11599
11600 case 279: /* paren_args: '(' opt_call_args rparen */
11601#line 2992 "parse.y"
11602 {
11603 /*%%%*/
11604 (yyval.node) = (yyvsp[-1].node);
11605 /*% %*/
11606 /*% ripper: arg_paren!(escape_Qundef($2)) %*/
11607 }
11608#line 11604 "parse.c"
11609 break;
11610
11611 case 280: /* paren_args: '(' args ',' args_forward rparen */
11612#line 2999 "parse.y"
11613 {
11614 if (!check_forwarding_args(p)) {
11615 (yyval.node) = Qnone;
11616 }
11617 else {
11618 /*%%%*/
11619 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
11620 /*% %*/
11621 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
11622 }
11623 }
11624#line 11620 "parse.c"
11625 break;
11626
11627 case 281: /* paren_args: '(' args_forward rparen */
11628#line 3011 "parse.y"
11629 {
11630 if (!check_forwarding_args(p)) {
11631 (yyval.node) = Qnone;
11632 }
11633 else {
11634 /*%%%*/
11635 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
11636 /*% %*/
11637 /*% ripper: arg_paren!($2) %*/
11638 }
11639 }
11640#line 11636 "parse.c"
11641 break;
11642
11643 case 286: /* opt_call_args: args ',' */
11644#line 3031 "parse.y"
11645 {
11646 (yyval.node) = (yyvsp[-1].node);
11647 }
11648#line 11644 "parse.c"
11649 break;
11650
11651 case 287: /* opt_call_args: args ',' assocs ',' */
11652#line 3035 "parse.y"
11653 {
11654 /*%%%*/
11655 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
11656 /*% %*/
11657 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
11658 }
11659#line 11655 "parse.c"
11660 break;
11661
11662 case 288: /* opt_call_args: assocs ',' */
11663#line 3042 "parse.y"
11664 {
11665 /*%%%*/
11666 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
11667 /*% %*/
11668 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
11669 }
11670#line 11666 "parse.c"
11671 break;
11672
11673 case 289: /* call_args: command */
11674#line 3051 "parse.y"
11675 {
11676 /*%%%*/
11677 value_expr((yyvsp[0].node));
11678 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11679 /*% %*/
11680 /*% ripper: args_add!(args_new!, $1) %*/
11681 }
11682#line 11678 "parse.c"
11683 break;
11684
11685 case 290: /* call_args: args opt_block_arg */
11686#line 3059 "parse.y"
11687 {
11688 /*%%%*/
11689 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node));
11690 /*% %*/
11691 /*% ripper: args_add_block!($1, $2) %*/
11692 }
11693#line 11689 "parse.c"
11694 break;
11695
11696 case 291: /* call_args: assocs opt_block_arg */
11697#line 3066 "parse.y"
11698 {
11699 /*%%%*/
11700 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
11701 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
11702 /*% %*/
11703 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
11704 }
11705#line 11701 "parse.c"
11706 break;
11707
11708 case 292: /* call_args: args ',' assocs opt_block_arg */
11709#line 3074 "parse.y"
11710 {
11711 /*%%%*/
11712 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
11713 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
11714 /*% %*/
11715 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
11716 }
11717#line 11713 "parse.c"
11718 break;
11719
11720 case 294: /* $@14: %empty */
11721#line 3085 "parse.y"
11722 {
11723 /* If call_args starts with a open paren '(' or '[',
11724 * look-ahead reading of the letters calls CMDARG_PUSH(0),
11725 * but the push must be done after CMDARG_PUSH(1).
11726 * So this code makes them consistent by first cancelling
11727 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
11728 * and finally redoing CMDARG_PUSH(0).
11729 */
11730 int lookahead = 0;
11731 switch (yychar) {
11732 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
11733 lookahead = 1;
11734 }
11735 if (lookahead) CMDARG_POP();
11736 CMDARG_PUSH(1);
11737 if (lookahead) CMDARG_PUSH(0);
11738 }
11739#line 11735 "parse.c"
11740 break;
11741
11742 case 295: /* command_args: $@14 call_args */
11743#line 3103 "parse.y"
11744 {
11745 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
11746 * but the push must be done after CMDARG_POP() in the parser.
11747 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
11748 * CMDARG_POP() to pop 1 pushed by command_args,
11749 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
11750 */
11751 int lookahead = 0;
11752 switch (yychar) {
11753 case tLBRACE_ARG:
11754 lookahead = 1;
11755 }
11756 if (lookahead) CMDARG_POP();
11757 CMDARG_POP();
11758 if (lookahead) CMDARG_PUSH(0);
11759 (yyval.node) = (yyvsp[0].node);
11760 }
11761#line 11757 "parse.c"
11762 break;
11763
11764 case 296: /* block_arg: "&" arg_value */
11765#line 3123 "parse.y"
11766 {
11767 /*%%%*/
11768 (yyval.node) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
11769 /*% %*/
11770 /*% ripper: $2 %*/
11771 }
11772#line 11768 "parse.c"
11773 break;
11774
11775 case 297: /* block_arg: "&" */
11776#line 3130 "parse.y"
11777 {
11778 if (!local_id(p, idFWD_BLOCK)) {
11779 compile_error(p, "no anonymous block parameter");
11780 }
11781 /*%%%*/
11782 (yyval.node) = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[0])), &(yyloc));
11783 /*% %*/
11784 /*% ripper: Qnil %*/
11785 }
11786#line 11782 "parse.c"
11787 break;
11788
11789 case 298: /* opt_block_arg: ',' block_arg */
11790#line 3142 "parse.y"
11791 {
11792 (yyval.node) = (yyvsp[0].node);
11793 }
11794#line 11790 "parse.c"
11795 break;
11796
11797 case 299: /* opt_block_arg: none */
11798#line 3146 "parse.y"
11799 {
11800 (yyval.node) = 0;
11801 }
11802#line 11798 "parse.c"
11803 break;
11804
11805 case 300: /* args: arg_value */
11806#line 3153 "parse.y"
11807 {
11808 /*%%%*/
11809 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11810 /*% %*/
11811 /*% ripper: args_add!(args_new!, $1) %*/
11812 }
11813#line 11809 "parse.c"
11814 break;
11815
11816 case 301: /* args: "*" arg_value */
11817#line 3160 "parse.y"
11818 {
11819 /*%%%*/
11820 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
11821 /*% %*/
11822 /*% ripper: args_add_star!(args_new!, $2) %*/
11823 }
11824#line 11820 "parse.c"
11825 break;
11826
11827 case 302: /* args: "*" */
11828#line 3167 "parse.y"
11829 {
11830 if (!local_id(p, idFWD_REST) ||
11831 local_id(p, idFWD_ALL)) {
11832 compile_error(p, "no anonymous rest parameter");
11833 }
11834 /*%%%*/
11835 (yyval.node) = NEW_SPLAT(NEW_LVAR(idFWD_REST, &(yylsp[0])), &(yyloc));
11836 /*% %*/
11837 /*% ripper: args_add_star!(args_new!, Qnil) %*/
11838 }
11839#line 11835 "parse.c"
11840 break;
11841
11842 case 303: /* args: args ',' arg_value */
11843#line 3178 "parse.y"
11844 {
11845 /*%%%*/
11846 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11847 /*% %*/
11848 /*% ripper: args_add!($1, $3) %*/
11849 }
11850#line 11846 "parse.c"
11851 break;
11852
11853 case 304: /* args: args ',' "*" arg_value */
11854#line 3185 "parse.y"
11855 {
11856 /*%%%*/
11857 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11858 /*% %*/
11859 /*% ripper: args_add_star!($1, $4) %*/
11860 }
11861#line 11857 "parse.c"
11862 break;
11863
11864 case 305: /* args: args ',' "*" */
11865#line 3192 "parse.y"
11866 {
11867 if (!local_id(p, idFWD_REST) ||
11868 local_id(p, idFWD_ALL)) {
11869 compile_error(p, "no anonymous rest parameter");
11870 }
11871 /*%%%*/
11872 (yyval.node) = rest_arg_append(p, (yyvsp[-2].node), NEW_LVAR(idFWD_REST, &(yylsp[0])), &(yyloc));
11873 /*% %*/
11874 /*% ripper: args_add_star!($1, Qnil) %*/
11875 }
11876#line 11872 "parse.c"
11877 break;
11878
11879 case 308: /* mrhs: args ',' arg_value */
11880#line 3211 "parse.y"
11881 {
11882 /*%%%*/
11883 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11884 /*% %*/
11885 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
11886 }
11887#line 11883 "parse.c"
11888 break;
11889
11890 case 309: /* mrhs: args ',' "*" arg_value */
11891#line 3218 "parse.y"
11892 {
11893 /*%%%*/
11894 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11895 /*% %*/
11896 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
11897 }
11898#line 11894 "parse.c"
11899 break;
11900
11901 case 310: /* mrhs: "*" arg_value */
11902#line 3225 "parse.y"
11903 {
11904 /*%%%*/
11905 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
11906 /*% %*/
11907 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
11908 }
11909#line 11905 "parse.c"
11910 break;
11911
11912 case 321: /* primary: "method" */
11913#line 3244 "parse.y"
11914 {
11915 /*%%%*/
11916 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
11917 /*% %*/
11918 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
11919 }
11920#line 11916 "parse.c"
11921 break;
11922
11923 case 322: /* $@15: %empty */
11924#line 3251 "parse.y"
11925 {
11926 CMDARG_PUSH(0);
11927 }
11928#line 11924 "parse.c"
11929 break;
11930
11931 case 323: /* primary: k_begin $@15 bodystmt k_end */
11932#line 3256 "parse.y"
11933 {
11934 CMDARG_POP();
11935 /*%%%*/
11936 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
11937 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
11938 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
11939 /*% %*/
11940 /*% ripper: begin!($3) %*/
11941 }
11942#line 11938 "parse.c"
11943 break;
11944
11945 case 324: /* $@16: %empty */
11946#line 3265 "parse.y"
11947 {SET_LEX_STATE(EXPR_ENDARG);}
11948#line 11944 "parse.c"
11949 break;
11950
11951 case 325: /* primary: "( arg" $@16 rparen */
11952#line 3266 "parse.y"
11953 {
11954 /*%%%*/
11955 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11956 /*% %*/
11957 /*% ripper: paren!(0) %*/
11958 }
11959#line 11955 "parse.c"
11960 break;
11961
11962 case 326: /* $@17: %empty */
11963#line 3272 "parse.y"
11964 {SET_LEX_STATE(EXPR_ENDARG);}
11965#line 11961 "parse.c"
11966 break;
11967
11968 case 327: /* primary: "( arg" stmt $@17 rparen */
11969#line 3273 "parse.y"
11970 {
11971 /*%%%*/
11972 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) (yyvsp[-2].node)->nd_state = 0;
11973 (yyval.node) = (yyvsp[-2].node);
11974 /*% %*/
11975 /*% ripper: paren!($2) %*/
11976 }
11977#line 11973 "parse.c"
11978 break;
11979
11980 case 328: /* primary: "(" compstmt ')' */
11981#line 3281 "parse.y"
11982 {
11983 /*%%%*/
11984 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) (yyvsp[-1].node)->nd_state = 0;
11985 (yyval.node) = (yyvsp[-1].node);
11986 /*% %*/
11987 /*% ripper: paren!($2) %*/
11988 }
11989#line 11985 "parse.c"
11990 break;
11991
11992 case 329: /* primary: primary_value "::" "constant" */
11993#line 3289 "parse.y"
11994 {
11995 /*%%%*/
11996 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11997 /*% %*/
11998 /*% ripper: const_path_ref!($1, $3) %*/
11999 }
12000#line 11996 "parse.c"
12001 break;
12002
12003 case 330: /* primary: ":: at EXPR_BEG" "constant" */
12004#line 3296 "parse.y"
12005 {
12006 /*%%%*/
12007 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
12008 /*% %*/
12009 /*% ripper: top_const_ref!($2) %*/
12010 }
12011#line 12007 "parse.c"
12012 break;
12013
12014 case 331: /* primary: "[" aref_args ']' */
12015#line 3303 "parse.y"
12016 {
12017 /*%%%*/
12018 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12019 /*% %*/
12020 /*% ripper: array!(escape_Qundef($2)) %*/
12021 }
12022#line 12018 "parse.c"
12023 break;
12024
12025 case 332: /* primary: "{" assoc_list '}' */
12026#line 3310 "parse.y"
12027 {
12028 /*%%%*/
12029 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
12030 (yyval.node)->nd_brace = TRUE;
12031 /*% %*/
12032 /*% ripper: hash!(escape_Qundef($2)) %*/
12033 }
12034#line 12030 "parse.c"
12035 break;
12036
12037 case 333: /* primary: k_return */
12038#line 3318 "parse.y"
12039 {
12040 /*%%%*/
12041 (yyval.node) = NEW_RETURN(0, &(yyloc));
12042 /*% %*/
12043 /*% ripper: return0! %*/
12044 }
12045#line 12041 "parse.c"
12046 break;
12047
12048 case 334: /* primary: "`yield'" '(' call_args rparen */
12049#line 3325 "parse.y"
12050 {
12051 /*%%%*/
12052 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
12053 /*% %*/
12054 /*% ripper: yield!(paren!($3)) %*/
12055 }
12056#line 12052 "parse.c"
12057 break;
12058
12059 case 335: /* primary: "`yield'" '(' rparen */
12060#line 3332 "parse.y"
12061 {
12062 /*%%%*/
12063 (yyval.node) = NEW_YIELD(0, &(yyloc));
12064 /*% %*/
12065 /*% ripper: yield!(paren!(args_new!)) %*/
12066 }
12067#line 12063 "parse.c"
12068 break;
12069
12070 case 336: /* primary: "`yield'" */
12071#line 3339 "parse.y"
12072 {
12073 /*%%%*/
12074 (yyval.node) = NEW_YIELD(0, &(yyloc));
12075 /*% %*/
12076 /*% ripper: yield0! %*/
12077 }
12078#line 12074 "parse.c"
12079 break;
12080
12081 case 337: /* $@18: %empty */
12082#line 3345 "parse.y"
12083 {p->ctxt.in_defined = 1;}
12084#line 12080 "parse.c"
12085 break;
12086
12087 case 338: /* primary: "`defined?'" opt_nl '(' $@18 expr rparen */
12088#line 3346 "parse.y"
12089 {
12090 p->ctxt.in_defined = 0;
12091 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
12092 }
12093#line 12089 "parse.c"
12094 break;
12095
12096 case 339: /* primary: "`not'" '(' expr rparen */
12097#line 3351 "parse.y"
12098 {
12099 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
12100 }
12101#line 12097 "parse.c"
12102 break;
12103
12104 case 340: /* primary: "`not'" '(' rparen */
12105#line 3355 "parse.y"
12106 {
12107 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12108 }
12109#line 12105 "parse.c"
12110 break;
12111
12112 case 341: /* primary: fcall brace_block */
12113#line 3359 "parse.y"
12114 {
12115 /*%%%*/
12116 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12117 /*% %*/
12118 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
12119 }
12120#line 12116 "parse.c"
12121 break;
12122
12123 case 343: /* primary: method_call brace_block */
12124#line 3367 "parse.y"
12125 {
12126 /*%%%*/
12127 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
12128 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12129 /*% %*/
12130 /*% ripper: method_add_block!($1, $2) %*/
12131 }
12132#line 12128 "parse.c"
12133 break;
12134
12135 case 345: /* primary: k_if expr_value then compstmt if_tail k_end */
12136#line 3379 "parse.y"
12137 {
12138 /*%%%*/
12139 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
12140 fixpos((yyval.node), (yyvsp[-4].node));
12141 /*% %*/
12142 /*% ripper: if!($2, $4, escape_Qundef($5)) %*/
12143 }
12144#line 12140 "parse.c"
12145 break;
12146
12147 case 346: /* primary: k_unless expr_value then compstmt opt_else k_end */
12148#line 3390 "parse.y"
12149 {
12150 /*%%%*/
12151 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
12152 fixpos((yyval.node), (yyvsp[-4].node));
12153 /*% %*/
12154 /*% ripper: unless!($2, $4, escape_Qundef($5)) %*/
12155 }
12156#line 12152 "parse.c"
12157 break;
12158
12159 case 347: /* primary: k_while expr_value_do compstmt k_end */
12160#line 3400 "parse.y"
12161 {
12162 /*%%%*/
12163 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
12164 fixpos((yyval.node), (yyvsp[-2].node));
12165 /*% %*/
12166 /*% ripper: while!($2, $3) %*/
12167 }
12168#line 12164 "parse.c"
12169 break;
12170
12171 case 348: /* primary: k_until expr_value_do compstmt k_end */
12172#line 3410 "parse.y"
12173 {
12174 /*%%%*/
12175 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
12176 fixpos((yyval.node), (yyvsp[-2].node));
12177 /*% %*/
12178 /*% ripper: until!($2, $3) %*/
12179 }
12180#line 12176 "parse.c"
12181 break;
12182
12183 case 349: /* @19: %empty */
12184#line 3418 "parse.y"
12185 {
12186 (yyval.val) = p->case_labels;
12187 p->case_labels = Qnil;
12188 }
12189#line 12185 "parse.c"
12190 break;
12191
12192 case 350: /* primary: k_case expr_value opt_terms @19 case_body k_end */
12193#line 3424 "parse.y"
12194 {
12195 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
12196 p->case_labels = (yyvsp[-2].val);
12197 /*%%%*/
12198 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
12199 fixpos((yyval.node), (yyvsp[-4].node));
12200 /*% %*/
12201 /*% ripper: case!($2, $5) %*/
12202 }
12203#line 12199 "parse.c"
12204 break;
12205
12206 case 351: /* @20: %empty */
12207#line 3434 "parse.y"
12208 {
12209 (yyval.val) = p->case_labels;
12210 p->case_labels = 0;
12211 }
12212#line 12208 "parse.c"
12213 break;
12214
12215 case 352: /* primary: k_case opt_terms @20 case_body k_end */
12216#line 3440 "parse.y"
12217 {
12218 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
12219 p->case_labels = (yyvsp[-2].val);
12220 /*%%%*/
12221 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
12222 /*% %*/
12223 /*% ripper: case!(Qnil, $4) %*/
12224 }
12225#line 12221 "parse.c"
12226 break;
12227
12228 case 353: /* primary: k_case expr_value opt_terms p_case_body k_end */
12229#line 3451 "parse.y"
12230 {
12231 /*%%%*/
12232 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12233 /*% %*/
12234 /*% ripper: case!($2, $4) %*/
12235 }
12236#line 12232 "parse.c"
12237 break;
12238
12239 case 354: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
12240#line 3460 "parse.y"
12241 {
12242 /*%%%*/
12243 /*
12244 * for a, b, c in e
12245 * #=>
12246 * e.each{|*x| a, b, c = x}
12247 *
12248 * for a in e
12249 * #=>
12250 * e.each{|x| a, = x}
12251 */
12252 ID id = internal_id(p);
12253 NODE *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
12254 NODE *args, *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
12255 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
12256 tbl->ids[0] = id; /* internal id */
12257
12258 switch (nd_type((yyvsp[-4].node))) {
12259 case NODE_LASGN:
12260 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
12261 (yyvsp[-4].node)->nd_value = internal_var;
12262 id = 0;
12263 m->nd_plen = 1;
12264 m->nd_next = (yyvsp[-4].node);
12265 break;
12266 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
12267 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
12268 break;
12269 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
12270 m->nd_next = node_assign(p, NEW_MASGN(NEW_LIST((yyvsp[-4].node), &(yylsp[-4])), 0, &(yylsp[-4])), internal_var, NO_LEX_CTXT, &(yylsp[-4]));
12271 }
12272 /* {|*internal_id| <m> = internal_id; ... } */
12273 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
12274 scope = NEW_NODE(NODE_SCOPE, tbl, (yyvsp[-1].node), args, &(yyloc));
12275 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
12276 fixpos((yyval.node), (yyvsp[-4].node));
12277 /*% %*/
12278 /*% ripper: for!($2, $4, $5) %*/
12279 }
12280#line 12276 "parse.c"
12281 break;
12282
12283 case 355: /* $@21: %empty */
12284#line 3500 "parse.y"
12285 {
12286 if (p->ctxt.in_def) {
12287 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[-1]));
12288 yyerror1(&loc, "class definition in method body");
12289 }
12290 p->ctxt.in_class = 1;
12291 local_push(p, 0);
12292 }
12293#line 12289 "parse.c"
12294 break;
12295
12296 case 356: /* primary: k_class cpath superclass $@21 bodystmt k_end */
12297#line 3510 "parse.y"
12298 {
12299 /*%%%*/
12300 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
12301 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
12302 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
12303 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
12304 /*% %*/
12305 /*% ripper: class!($2, $3, $5) %*/
12306 local_pop(p);
12307 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
12308 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
12309 }
12310#line 12306 "parse.c"
12311 break;
12312
12313 case 357: /* $@22: %empty */
12314#line 3523 "parse.y"
12315 {
12316 p->ctxt.in_def = 0;
12317 p->ctxt.in_class = 0;
12318 local_push(p, 0);
12319 }
12320#line 12316 "parse.c"
12321 break;
12322
12323 case 358: /* primary: k_class "<<" expr $@22 term bodystmt k_end */
12324#line 3531 "parse.y"
12325 {
12326 /*%%%*/
12327 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
12328 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
12329 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
12330 fixpos((yyval.node), (yyvsp[-4].node));
12331 /*% %*/
12332 /*% ripper: sclass!($3, $6) %*/
12333 local_pop(p);
12334 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
12335 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
12336 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
12337 }
12338#line 12334 "parse.c"
12339 break;
12340
12341 case 359: /* $@23: %empty */
12342#line 3545 "parse.y"
12343 {
12344 if (p->ctxt.in_def) {
12345 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
12346 yyerror1(&loc, "module definition in method body");
12347 }
12348 p->ctxt.in_class = 1;
12349 local_push(p, 0);
12350 }
12351#line 12347 "parse.c"
12352 break;
12353
12354 case 360: /* primary: k_module cpath $@23 bodystmt k_end */
12355#line 3555 "parse.y"
12356 {
12357 /*%%%*/
12358 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12359 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
12360 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
12361 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
12362 /*% %*/
12363 /*% ripper: module!($2, $4) %*/
12364 local_pop(p);
12365 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
12366 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
12367 }
12368#line 12364 "parse.c"
12369 break;
12370
12371 case 361: /* $@24: %empty */
12372#line 3569 "parse.y"
12373 {
12374 /*%%%*/
12375 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
12376 /*% %*/
12377 }
12378#line 12374 "parse.c"
12379 break;
12380
12381 case 362: /* primary: defn_head f_arglist $@24 bodystmt k_end */
12382#line 3576 "parse.y"
12383 {
12384 restore_defun(p, (yyvsp[-4].node)->nd_defn);
12385 /*%%%*/
12386 (yyval.node) = set_defun_body(p, (yyvsp[-4].node), (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12387 /*% %*/
12388 /*% ripper: def!(get_value($1), $2, $4) %*/
12389 local_pop(p);
12390 }
12391#line 12387 "parse.c"
12392 break;
12393
12394 case 363: /* $@25: %empty */
12395#line 3586 "parse.y"
12396 {
12397 /*%%%*/
12398 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
12399 /*% %*/
12400 }
12401#line 12397 "parse.c"
12402 break;
12403
12404 case 364: /* primary: defs_head f_arglist $@25 bodystmt k_end */
12405#line 3593 "parse.y"
12406 {
12407 restore_defun(p, (yyvsp[-4].node)->nd_defn);
12408 /*%%%*/
12409 (yyval.node) = set_defun_body(p, (yyvsp[-4].node), (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12410 /*%
12411 $1 = get_value($1);
12412 %*/
12413 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
12414 local_pop(p);
12415 }
12416#line 12412 "parse.c"
12417 break;
12418
12419 case 365: /* primary: "`break'" */
12420#line 3604 "parse.y"
12421 {
12422 /*%%%*/
12423 (yyval.node) = NEW_BREAK(0, &(yyloc));
12424 /*% %*/
12425 /*% ripper: break!(args_new!) %*/
12426 }
12427#line 12423 "parse.c"
12428 break;
12429
12430 case 366: /* primary: "`next'" */
12431#line 3611 "parse.y"
12432 {
12433 /*%%%*/
12434 (yyval.node) = NEW_NEXT(0, &(yyloc));
12435 /*% %*/
12436 /*% ripper: next!(args_new!) %*/
12437 }
12438#line 12434 "parse.c"
12439 break;
12440
12441 case 367: /* primary: "`redo'" */
12442#line 3618 "parse.y"
12443 {
12444 /*%%%*/
12445 (yyval.node) = NEW_REDO(&(yyloc));
12446 /*% %*/
12447 /*% ripper: redo! %*/
12448 }
12449#line 12445 "parse.c"
12450 break;
12451
12452 case 368: /* primary: "`retry'" */
12453#line 3625 "parse.y"
12454 {
12455 /*%%%*/
12456 (yyval.node) = NEW_RETRY(&(yyloc));
12457 /*% %*/
12458 /*% ripper: retry! %*/
12459 }
12460#line 12456 "parse.c"
12461 break;
12462
12463 case 369: /* primary_value: primary */
12464#line 3634 "parse.y"
12465 {
12466 value_expr((yyvsp[0].node));
12467 (yyval.node) = (yyvsp[0].node);
12468 }
12469#line 12465 "parse.c"
12470 break;
12471
12472 case 370: /* k_begin: "`begin'" */
12473#line 3641 "parse.y"
12474 {
12475 token_info_push(p, "begin", &(yyloc));
12476 /*%%%*/
12477 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12478 /*% %*/
12479 }
12480#line 12476 "parse.c"
12481 break;
12482
12483 case 371: /* k_if: "`if'" */
12484#line 3650 "parse.y"
12485 {
12486 WARN_EOL("if");
12487 token_info_push(p, "if", &(yyloc));
12488 if (p->token_info && p->token_info->nonspc &&
12489 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
12490 const char *tok = p->lex.ptok - rb_strlen_lit("if");
12491 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
12492 beg += rb_strlen_lit("else");
12493 while (beg < tok && ISSPACE(*beg)) beg++;
12494 if (beg == tok) {
12495 p->token_info->nonspc = 0;
12496 }
12497 }
12498 /*%%%*/
12499 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12500 /*% %*/
12501 }
12502#line 12498 "parse.c"
12503 break;
12504
12505 case 372: /* k_unless: "`unless'" */
12506#line 3670 "parse.y"
12507 {
12508 token_info_push(p, "unless", &(yyloc));
12509 /*%%%*/
12510 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12511 /*% %*/
12512 }
12513#line 12509 "parse.c"
12514 break;
12515
12516 case 373: /* k_while: "`while'" */
12517#line 3679 "parse.y"
12518 {
12519 token_info_push(p, "while", &(yyloc));
12520 /*%%%*/
12521 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12522 /*% %*/
12523 }
12524#line 12520 "parse.c"
12525 break;
12526
12527 case 374: /* k_until: "`until'" */
12528#line 3688 "parse.y"
12529 {
12530 token_info_push(p, "until", &(yyloc));
12531 /*%%%*/
12532 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12533 /*% %*/
12534 }
12535#line 12531 "parse.c"
12536 break;
12537
12538 case 375: /* k_case: "`case'" */
12539#line 3697 "parse.y"
12540 {
12541 token_info_push(p, "case", &(yyloc));
12542 /*%%%*/
12543 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12544 /*% %*/
12545 }
12546#line 12542 "parse.c"
12547 break;
12548
12549 case 376: /* k_for: "`for'" */
12550#line 3706 "parse.y"
12551 {
12552 token_info_push(p, "for", &(yyloc));
12553 /*%%%*/
12554 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12555 /*% %*/
12556 }
12557#line 12553 "parse.c"
12558 break;
12559
12560 case 377: /* k_class: "`class'" */
12561#line 3715 "parse.y"
12562 {
12563 token_info_push(p, "class", &(yyloc));
12564 (yyval.ctxt) = p->ctxt;
12565 /*%%%*/
12566 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12567 /*% %*/
12568 }
12569#line 12565 "parse.c"
12570 break;
12571
12572 case 378: /* k_module: "`module'" */
12573#line 3725 "parse.y"
12574 {
12575 token_info_push(p, "module", &(yyloc));
12576 (yyval.ctxt) = p->ctxt;
12577 /*%%%*/
12578 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12579 /*% %*/
12580 }
12581#line 12577 "parse.c"
12582 break;
12583
12584 case 379: /* k_def: "`def'" */
12585#line 3735 "parse.y"
12586 {
12587 token_info_push(p, "def", &(yyloc));
12588 p->ctxt.in_argdef = 1;
12589 }
12590#line 12586 "parse.c"
12591 break;
12592
12593 case 380: /* k_do: "`do'" */
12594#line 3742 "parse.y"
12595 {
12596 token_info_push(p, "do", &(yyloc));
12597 /*%%%*/
12598 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12599 /*% %*/
12600
12601 }
12602#line 12598 "parse.c"
12603 break;
12604
12605 case 381: /* k_do_block: "`do' for block" */
12606#line 3752 "parse.y"
12607 {
12608 token_info_push(p, "do", &(yyloc));
12609 /*%%%*/
12610 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12611 /*% %*/
12612 }
12613#line 12609 "parse.c"
12614 break;
12615
12616 case 382: /* k_rescue: "`rescue'" */
12617#line 3761 "parse.y"
12618 {
12619 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
12620 }
12621#line 12617 "parse.c"
12622 break;
12623
12624 case 383: /* k_ensure: "`ensure'" */
12625#line 3767 "parse.y"
12626 {
12627 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
12628 }
12629#line 12625 "parse.c"
12630 break;
12631
12632 case 384: /* k_when: "`when'" */
12633#line 3773 "parse.y"
12634 {
12635 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
12636 }
12637#line 12633 "parse.c"
12638 break;
12639
12640 case 385: /* k_else: "`else'" */
12641#line 3779 "parse.y"
12642 {
12643 token_info *ptinfo_beg = p->token_info;
12644 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
12645 token_info_warn(p, "else", p->token_info, same, &(yyloc));
12646 if (same) {
12647 token_info e;
12648 e.next = ptinfo_beg->next;
12649 e.token = "else";
12650 token_info_setup(&e, p->lex.pbeg, &(yyloc));
12651 if (!e.nonspc) *ptinfo_beg = e;
12652 }
12653 }
12654#line 12650 "parse.c"
12655 break;
12656
12657 case 386: /* k_elsif: "`elsif'" */
12658#line 3794 "parse.y"
12659 {
12660 WARN_EOL("elsif");
12661 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
12662 }
12663#line 12659 "parse.c"
12664 break;
12665
12666 case 387: /* k_end: "`end'" */
12667#line 3801 "parse.y"
12668 {
12669 token_info_pop(p, "end", &(yyloc));
12670 /*%%%*/
12671 pop_end_expect_token_locations(p);
12672 /*% %*/
12673 }
12674#line 12670 "parse.c"
12675 break;
12676
12677 case 388: /* k_end: "dummy end" */
12678#line 3808 "parse.y"
12679 {
12680 compile_error(p, "syntax error, unexpected end-of-input");
12681 }
12682#line 12678 "parse.c"
12683 break;
12684
12685 case 389: /* k_return: "`return'" */
12686#line 3814 "parse.y"
12687 {
12688 if (p->ctxt.in_class && !p->ctxt.in_def && !dyna_in_block(p))
12689 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
12690 }
12691#line 12687 "parse.c"
12692 break;
12693
12694 case 396: /* if_tail: k_elsif expr_value then compstmt if_tail */
12695#line 3833 "parse.y"
12696 {
12697 /*%%%*/
12698 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12699 fixpos((yyval.node), (yyvsp[-3].node));
12700 /*% %*/
12701 /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/
12702 }
12703#line 12699 "parse.c"
12704 break;
12705
12706 case 398: /* opt_else: k_else compstmt */
12707#line 3844 "parse.y"
12708 {
12709 /*%%%*/
12710 (yyval.node) = (yyvsp[0].node);
12711 /*% %*/
12712 /*% ripper: else!($2) %*/
12713 }
12714#line 12710 "parse.c"
12715 break;
12716
12717 case 401: /* f_marg: f_norm_arg */
12718#line 3857 "parse.y"
12719 {
12720 /*%%%*/
12721 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12722 mark_lvar_used(p, (yyval.node));
12723 /*% %*/
12724 /*% ripper: assignable(p, $1) %*/
12725 }
12726#line 12722 "parse.c"
12727 break;
12728
12729 case 402: /* f_marg: "(" f_margs rparen */
12730#line 3865 "parse.y"
12731 {
12732 /*%%%*/
12733 (yyval.node) = (yyvsp[-1].node);
12734 /*% %*/
12735 /*% ripper: mlhs_paren!($2) %*/
12736 }
12737#line 12733 "parse.c"
12738 break;
12739
12740 case 403: /* f_marg_list: f_marg */
12741#line 3874 "parse.y"
12742 {
12743 /*%%%*/
12744 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12745 /*% %*/
12746 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
12747 }
12748#line 12744 "parse.c"
12749 break;
12750
12751 case 404: /* f_marg_list: f_marg_list ',' f_marg */
12752#line 3881 "parse.y"
12753 {
12754 /*%%%*/
12755 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
12756 /*% %*/
12757 /*% ripper: mlhs_add!($1, $3) %*/
12758 }
12759#line 12755 "parse.c"
12760 break;
12761
12762 case 405: /* f_margs: f_marg_list */
12763#line 3890 "parse.y"
12764 {
12765 /*%%%*/
12766 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
12767 /*% %*/
12768 /*% ripper: $1 %*/
12769 }
12770#line 12766 "parse.c"
12771 break;
12772
12773 case 406: /* f_margs: f_marg_list ',' f_rest_marg */
12774#line 3897 "parse.y"
12775 {
12776 /*%%%*/
12777 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12778 /*% %*/
12779 /*% ripper: mlhs_add_star!($1, $3) %*/
12780 }
12781#line 12777 "parse.c"
12782 break;
12783
12784 case 407: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
12785#line 3904 "parse.y"
12786 {
12787 /*%%%*/
12788 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
12789 /*% %*/
12790 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
12791 }
12792#line 12788 "parse.c"
12793 break;
12794
12795 case 408: /* f_margs: f_rest_marg */
12796#line 3911 "parse.y"
12797 {
12798 /*%%%*/
12799 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
12800 /*% %*/
12801 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
12802 }
12803#line 12799 "parse.c"
12804 break;
12805
12806 case 409: /* f_margs: f_rest_marg ',' f_marg_list */
12807#line 3918 "parse.y"
12808 {
12809 /*%%%*/
12810 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
12811 /*% %*/
12812 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
12813 }
12814#line 12810 "parse.c"
12815 break;
12816
12817 case 410: /* f_rest_marg: "*" f_norm_arg */
12818#line 3927 "parse.y"
12819 {
12820 /*%%%*/
12821 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12822 mark_lvar_used(p, (yyval.node));
12823 /*% %*/
12824 /*% ripper: assignable(p, $2) %*/
12825 }
12826#line 12822 "parse.c"
12827 break;
12828
12829 case 411: /* f_rest_marg: "*" */
12830#line 3935 "parse.y"
12831 {
12832 /*%%%*/
12833 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
12834 /*% %*/
12835 /*% ripper: Qnil %*/
12836 }
12837#line 12833 "parse.c"
12838 break;
12839
12840 case 413: /* f_any_kwrest: f_no_kwarg */
12841#line 3944 "parse.y"
12842 {(yyval.id) = ID2VAL(idNil);}
12843#line 12839 "parse.c"
12844 break;
12845
12846 case 414: /* $@26: %empty */
12847#line 3947 "parse.y"
12848 {p->ctxt.in_argdef = 0;}
12849#line 12845 "parse.c"
12850 break;
12851
12852 case 416: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
12853#line 3950 "parse.y"
12854 {
12855 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12856 }
12857#line 12853 "parse.c"
12858 break;
12859
12860 case 417: /* block_args_tail: f_block_kwarg opt_f_block_arg */
12861#line 3954 "parse.y"
12862 {
12863 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
12864 }
12865#line 12861 "parse.c"
12866 break;
12867
12868 case 418: /* block_args_tail: f_any_kwrest opt_f_block_arg */
12869#line 3958 "parse.y"
12870 {
12871 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12872 }
12873#line 12869 "parse.c"
12874 break;
12875
12876 case 419: /* block_args_tail: f_block_arg */
12877#line 3962 "parse.y"
12878 {
12879 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
12880 }
12881#line 12877 "parse.c"
12882 break;
12883
12884 case 420: /* opt_block_args_tail: ',' block_args_tail */
12885#line 3968 "parse.y"
12886 {
12887 (yyval.node) = (yyvsp[0].node);
12888 }
12889#line 12885 "parse.c"
12890 break;
12891
12892 case 421: /* opt_block_args_tail: %empty */
12893#line 3972 "parse.y"
12894 {
12895 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12896 }
12897#line 12893 "parse.c"
12898 break;
12899
12900 case 422: /* excessed_comma: ',' */
12901#line 3978 "parse.y"
12902 {
12903 /* magic number for rest_id in iseq_set_arguments() */
12904 /*%%%*/
12905 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
12906 /*% %*/
12907 /*% ripper: excessed_comma! %*/
12908 }
12909#line 12905 "parse.c"
12910 break;
12911
12912 case 423: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
12913#line 3988 "parse.y"
12914 {
12915 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12916 }
12917#line 12913 "parse.c"
12918 break;
12919
12920 case 424: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
12921#line 3992 "parse.y"
12922 {
12923 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12924 }
12925#line 12921 "parse.c"
12926 break;
12927
12928 case 425: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
12929#line 3996 "parse.y"
12930 {
12931 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12932 }
12933#line 12929 "parse.c"
12934 break;
12935
12936 case 426: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
12937#line 4000 "parse.y"
12938 {
12939 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12940 }
12941#line 12937 "parse.c"
12942 break;
12943
12944 case 427: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
12945#line 4004 "parse.y"
12946 {
12947 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12948 }
12949#line 12945 "parse.c"
12950 break;
12951
12952 case 428: /* block_param: f_arg excessed_comma */
12953#line 4008 "parse.y"
12954 {
12955 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12956 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), Qnone, (yyval.node), &(yyloc));
12957 }
12958#line 12954 "parse.c"
12959 break;
12960
12961 case 429: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
12962#line 4013 "parse.y"
12963 {
12964 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12965 }
12966#line 12962 "parse.c"
12967 break;
12968
12969 case 430: /* block_param: f_arg opt_block_args_tail */
12970#line 4017 "parse.y"
12971 {
12972 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12973 }
12974#line 12970 "parse.c"
12975 break;
12976
12977 case 431: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
12978#line 4021 "parse.y"
12979 {
12980 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12981 }
12982#line 12978 "parse.c"
12983 break;
12984
12985 case 432: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
12986#line 4025 "parse.y"
12987 {
12988 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12989 }
12990#line 12986 "parse.c"
12991 break;
12992
12993 case 433: /* block_param: f_block_optarg opt_block_args_tail */
12994#line 4029 "parse.y"
12995 {
12996 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12997 }
12998#line 12994 "parse.c"
12999 break;
13000
13001 case 434: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
13002#line 4033 "parse.y"
13003 {
13004 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13005 }
13006#line 13002 "parse.c"
13007 break;
13008
13009 case 435: /* block_param: f_rest_arg opt_block_args_tail */
13010#line 4037 "parse.y"
13011 {
13012 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
13013 }
13014#line 13010 "parse.c"
13015 break;
13016
13017 case 436: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
13018#line 4041 "parse.y"
13019 {
13020 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13021 }
13022#line 13018 "parse.c"
13023 break;
13024
13025 case 437: /* block_param: block_args_tail */
13026#line 4045 "parse.y"
13027 {
13028 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
13029 }
13030#line 13026 "parse.c"
13031 break;
13032
13033 case 439: /* opt_block_param: block_param_def */
13034#line 4052 "parse.y"
13035 {
13036 p->command_start = TRUE;
13037 }
13038#line 13034 "parse.c"
13039 break;
13040
13041 case 440: /* block_param_def: '|' opt_bv_decl '|' */
13042#line 4058 "parse.y"
13043 {
13044 p->cur_arg = 0;
13045 p->max_numparam = ORDINAL_PARAM;
13046 p->ctxt.in_argdef = 0;
13047 /*%%%*/
13048 (yyval.node) = 0;
13049 /*% %*/
13050 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/
13051 }
13052#line 13048 "parse.c"
13053 break;
13054
13055 case 441: /* block_param_def: '|' block_param opt_bv_decl '|' */
13056#line 4068 "parse.y"
13057 {
13058 p->cur_arg = 0;
13059 p->max_numparam = ORDINAL_PARAM;
13060 p->ctxt.in_argdef = 0;
13061 /*%%%*/
13062 (yyval.node) = (yyvsp[-2].node);
13063 /*% %*/
13064 /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/
13065 }
13066#line 13062 "parse.c"
13067 break;
13068
13069 case 442: /* opt_bv_decl: opt_nl */
13070#line 4081 "parse.y"
13071 {
13072 (yyval.node) = 0;
13073 }
13074#line 13070 "parse.c"
13075 break;
13076
13077 case 443: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
13078#line 4085 "parse.y"
13079 {
13080 /*%%%*/
13081 (yyval.node) = 0;
13082 /*% %*/
13083 /*% ripper: $3 %*/
13084 }
13085#line 13081 "parse.c"
13086 break;
13087
13088 case 446: /* bvar: "local variable or method" */
13089#line 4100 "parse.y"
13090 {
13091 new_bv(p, get_id((yyvsp[0].id)));
13092 /*% ripper: get_value($1) %*/
13093 }
13094#line 13090 "parse.c"
13095 break;
13096
13097 case 447: /* bvar: f_bad_arg */
13098#line 4105 "parse.y"
13099 {
13100 (yyval.node) = 0;
13101 }
13102#line 13098 "parse.c"
13103 break;
13104
13105 case 448: /* @27: %empty */
13106#line 4111 "parse.y"
13107 {
13108 token_info_push(p, "->", &(yylsp[0]));
13109 (yyvsp[0].vars) = dyna_push(p);
13110 (yyval.num) = p->lex.lpar_beg;
13111 p->lex.lpar_beg = p->lex.paren_nest;
13112 }
13113#line 13109 "parse.c"
13114 break;
13115
13116 case 449: /* @28: %empty */
13117#line 4117 "parse.y"
13118 {
13119 (yyval.num) = p->max_numparam;
13120 p->max_numparam = 0;
13121 }
13122#line 13118 "parse.c"
13123 break;
13124
13125 case 450: /* @29: %empty */
13126#line 4121 "parse.y"
13127 {
13128 (yyval.node) = numparam_push(p);
13129 }
13130#line 13126 "parse.c"
13131 break;
13132
13133 case 451: /* $@30: %empty */
13134#line 4125 "parse.y"
13135 {
13136 CMDARG_PUSH(0);
13137 }
13138#line 13134 "parse.c"
13139 break;
13140
13141 case 452: /* lambda: "->" @27 @28 @29 f_larglist $@30 lambda_body */
13142#line 4129 "parse.y"
13143 {
13144 int max_numparam = p->max_numparam;
13145 p->lex.lpar_beg = (yyvsp[-5].num);
13146 p->max_numparam = (yyvsp[-4].num);
13147 CMDARG_POP();
13148 (yyvsp[-2].node) = args_with_numbered(p, (yyvsp[-2].node), max_numparam);
13149 /*%%%*/
13150 {
13151 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13152 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node), (yyvsp[0].node), &loc);
13153 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
13154 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13155 nd_set_first_loc((yyval.node), (yylsp[-6]).beg_pos);
13156 }
13157 /*% %*/
13158 /*% ripper: lambda!($5, $7) %*/
13159 numparam_pop(p, (yyvsp[-3].node));
13160 dyna_pop(p, (yyvsp[-6].vars));
13161 }
13162#line 13158 "parse.c"
13163 break;
13164
13165 case 453: /* f_larglist: '(' f_args opt_bv_decl ')' */
13166#line 4151 "parse.y"
13167 {
13168 p->ctxt.in_argdef = 0;
13169 /*%%%*/
13170 (yyval.node) = (yyvsp[-2].node);
13171 p->max_numparam = ORDINAL_PARAM;
13172 /*% %*/
13173 /*% ripper: paren!($2) %*/
13174 }
13175#line 13171 "parse.c"
13176 break;
13177
13178 case 454: /* f_larglist: f_args */
13179#line 4160 "parse.y"
13180 {
13181 p->ctxt.in_argdef = 0;
13182 /*%%%*/
13183 if (!args_info_empty_p((yyvsp[0].node)->nd_ainfo))
13184 p->max_numparam = ORDINAL_PARAM;
13185 /*% %*/
13186 (yyval.node) = (yyvsp[0].node);
13187 }
13188#line 13184 "parse.c"
13189 break;
13190
13191 case 455: /* lambda_body: tLAMBEG compstmt '}' */
13192#line 4171 "parse.y"
13193 {
13194 token_info_pop(p, "}", &(yylsp[0]));
13195 (yyval.node) = (yyvsp[-1].node);
13196 }
13197#line 13193 "parse.c"
13198 break;
13199
13200 case 456: /* $@31: %empty */
13201#line 4176 "parse.y"
13202 {
13203 /*%%%*/
13204 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13205 /*% %*/
13206 }
13207#line 13203 "parse.c"
13208 break;
13209
13210 case 457: /* lambda_body: "`do' for lambda" $@31 bodystmt k_end */
13211#line 4182 "parse.y"
13212 {
13213 (yyval.node) = (yyvsp[-1].node);
13214 }
13215#line 13211 "parse.c"
13216 break;
13217
13218 case 458: /* do_block: k_do_block do_body k_end */
13219#line 4188 "parse.y"
13220 {
13221 (yyval.node) = (yyvsp[-1].node);
13222 /*%%%*/
13223 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13224 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13225 /*% %*/
13226 }
13227#line 13223 "parse.c"
13228 break;
13229
13230 case 459: /* block_call: command do_block */
13231#line 4198 "parse.y"
13232 {
13233 /*%%%*/
13234 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
13235 compile_error(p, "block given to yield");
13236 }
13237 else {
13238 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
13239 }
13240 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13241 fixpos((yyval.node), (yyvsp[-1].node));
13242 /*% %*/
13243 /*% ripper: method_add_block!($1, $2) %*/
13244 }
13245#line 13241 "parse.c"
13246 break;
13247
13248 case 460: /* block_call: block_call call_op2 operation2 opt_paren_args */
13249#line 4212 "parse.y"
13250 {
13251 /*%%%*/
13252 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13253 /*% %*/
13254 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
13255 }
13256#line 13252 "parse.c"
13257 break;
13258
13259 case 461: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
13260#line 4219 "parse.y"
13261 {
13262 /*%%%*/
13263 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
13264 /*% %*/
13265 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
13266 }
13267#line 13263 "parse.c"
13268 break;
13269
13270 case 462: /* block_call: block_call call_op2 operation2 command_args do_block */
13271#line 4226 "parse.y"
13272 {
13273 /*%%%*/
13274 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
13275 /*% %*/
13276 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
13277 }
13278#line 13274 "parse.c"
13279 break;
13280
13281 case 463: /* method_call: fcall paren_args */
13282#line 4235 "parse.y"
13283 {
13284 /*%%%*/
13285 (yyval.node) = (yyvsp[-1].node);
13286 (yyval.node)->nd_args = (yyvsp[0].node);
13287 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
13288 /*% %*/
13289 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
13290 }
13291#line 13287 "parse.c"
13292 break;
13293
13294 case 464: /* method_call: primary_value call_op operation2 opt_paren_args */
13295#line 4244 "parse.y"
13296 {
13297 /*%%%*/
13298 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13299 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13300 /*% %*/
13301 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
13302 }
13303#line 13299 "parse.c"
13304 break;
13305
13306 case 465: /* method_call: primary_value "::" operation2 paren_args */
13307#line 4252 "parse.y"
13308 {
13309 /*%%%*/
13310 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13311 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13312 /*% %*/
13313 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
13314 }
13315#line 13311 "parse.c"
13316 break;
13317
13318 case 466: /* method_call: primary_value "::" operation3 */
13319#line 4260 "parse.y"
13320 {
13321 /*%%%*/
13322 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
13323 /*% %*/
13324 /*% ripper: call!($1, $2, $3) %*/
13325 }
13326#line 13322 "parse.c"
13327 break;
13328
13329 case 467: /* method_call: primary_value call_op paren_args */
13330#line 4267 "parse.y"
13331 {
13332 /*%%%*/
13333 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13334 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13335 /*% %*/
13336 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
13337 }
13338#line 13334 "parse.c"
13339 break;
13340
13341 case 468: /* method_call: primary_value "::" paren_args */
13342#line 4275 "parse.y"
13343 {
13344 /*%%%*/
13345 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13346 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13347 /*% %*/
13348 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
13349 }
13350#line 13346 "parse.c"
13351 break;
13352
13353 case 469: /* method_call: "`super'" paren_args */
13354#line 4283 "parse.y"
13355 {
13356 /*%%%*/
13357 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
13358 /*% %*/
13359 /*% ripper: super!($2) %*/
13360 }
13361#line 13357 "parse.c"
13362 break;
13363
13364 case 470: /* method_call: "`super'" */
13365#line 4290 "parse.y"
13366 {
13367 /*%%%*/
13368 (yyval.node) = NEW_ZSUPER(&(yyloc));
13369 /*% %*/
13370 /*% ripper: zsuper! %*/
13371 }
13372#line 13368 "parse.c"
13373 break;
13374
13375 case 471: /* method_call: primary_value '[' opt_call_args rbracket */
13376#line 4297 "parse.y"
13377 {
13378 /*%%%*/
13379 if ((yyvsp[-3].node) && nd_type_p((yyvsp[-3].node), NODE_SELF))
13380 (yyval.node) = NEW_FCALL(tAREF, (yyvsp[-1].node), &(yyloc));
13381 else
13382 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
13383 fixpos((yyval.node), (yyvsp[-3].node));
13384 /*% %*/
13385 /*% ripper: aref!($1, escape_Qundef($3)) %*/
13386 }
13387#line 13383 "parse.c"
13388 break;
13389
13390 case 472: /* brace_block: '{' brace_body '}' */
13391#line 4310 "parse.y"
13392 {
13393 (yyval.node) = (yyvsp[-1].node);
13394 /*%%%*/
13395 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13396 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13397 /*% %*/
13398 }
13399#line 13395 "parse.c"
13400 break;
13401
13402 case 473: /* brace_block: k_do do_body k_end */
13403#line 4318 "parse.y"
13404 {
13405 (yyval.node) = (yyvsp[-1].node);
13406 /*%%%*/
13407 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13408 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13409 /*% %*/
13410 }
13411#line 13407 "parse.c"
13412 break;
13413
13414 case 474: /* @32: %empty */
13415#line 4327 "parse.y"
13416 {(yyval.vars) = dyna_push(p);}
13417#line 13413 "parse.c"
13418 break;
13419
13420 case 475: /* @33: %empty */
13421#line 4328 "parse.y"
13422 {
13423 (yyval.num) = p->max_numparam;
13424 p->max_numparam = 0;
13425 }
13426#line 13422 "parse.c"
13427 break;
13428
13429 case 476: /* @34: %empty */
13430#line 4332 "parse.y"
13431 {
13432 (yyval.node) = numparam_push(p);
13433 }
13434#line 13430 "parse.c"
13435 break;
13436
13437 case 477: /* brace_body: @32 @33 @34 opt_block_param compstmt */
13438#line 4336 "parse.y"
13439 {
13440 int max_numparam = p->max_numparam;
13441 p->max_numparam = (yyvsp[-3].num);
13442 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
13443 /*%%%*/
13444 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13445 /*% %*/
13446 /*% ripper: brace_block!(escape_Qundef($4), $5) %*/
13447 numparam_pop(p, (yyvsp[-2].node));
13448 dyna_pop(p, (yyvsp[-4].vars));
13449 }
13450#line 13446 "parse.c"
13451 break;
13452
13453 case 478: /* @35: %empty */
13454#line 4349 "parse.y"
13455 {(yyval.vars) = dyna_push(p);}
13456#line 13452 "parse.c"
13457 break;
13458
13459 case 479: /* @36: %empty */
13460#line 4350 "parse.y"
13461 {
13462 (yyval.num) = p->max_numparam;
13463 p->max_numparam = 0;
13464 }
13465#line 13461 "parse.c"
13466 break;
13467
13468 case 480: /* @37: %empty */
13469#line 4354 "parse.y"
13470 {
13471 (yyval.node) = numparam_push(p);
13472 CMDARG_PUSH(0);
13473 }
13474#line 13470 "parse.c"
13475 break;
13476
13477 case 481: /* do_body: @35 @36 @37 opt_block_param bodystmt */
13478#line 4359 "parse.y"
13479 {
13480 int max_numparam = p->max_numparam;
13481 p->max_numparam = (yyvsp[-3].num);
13482 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
13483 /*%%%*/
13484 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13485 /*% %*/
13486 /*% ripper: do_block!(escape_Qundef($4), $5) %*/
13487 CMDARG_POP();
13488 numparam_pop(p, (yyvsp[-2].node));
13489 dyna_pop(p, (yyvsp[-4].vars));
13490 }
13491#line 13487 "parse.c"
13492 break;
13493
13494 case 482: /* case_args: arg_value */
13495#line 4374 "parse.y"
13496 {
13497 /*%%%*/
13498 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
13499 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13500 /*% %*/
13501 /*% ripper: args_add!(args_new!, $1) %*/
13502 }
13503#line 13499 "parse.c"
13504 break;
13505
13506 case 483: /* case_args: "*" arg_value */
13507#line 4382 "parse.y"
13508 {
13509 /*%%%*/
13510 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
13511 /*% %*/
13512 /*% ripper: args_add_star!(args_new!, $2) %*/
13513 }
13514#line 13510 "parse.c"
13515 break;
13516
13517 case 484: /* case_args: case_args ',' arg_value */
13518#line 4389 "parse.y"
13519 {
13520 /*%%%*/
13521 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
13522 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13523 /*% %*/
13524 /*% ripper: args_add!($1, $3) %*/
13525 }
13526#line 13522 "parse.c"
13527 break;
13528
13529 case 485: /* case_args: case_args ',' "*" arg_value */
13530#line 4397 "parse.y"
13531 {
13532 /*%%%*/
13533 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
13534 /*% %*/
13535 /*% ripper: args_add_star!($1, $4) %*/
13536 }
13537#line 13533 "parse.c"
13538 break;
13539
13540 case 486: /* case_body: k_when case_args then compstmt cases */
13541#line 4408 "parse.y"
13542 {
13543 /*%%%*/
13544 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13545 fixpos((yyval.node), (yyvsp[-3].node));
13546 /*% %*/
13547 /*% ripper: when!($2, $4, escape_Qundef($5)) %*/
13548 }
13549#line 13545 "parse.c"
13550 break;
13551
13552 case 489: /* @38: %empty */
13553#line 4422 "parse.y"
13554 {
13555 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
13556 p->command_start = FALSE;
13557 (yyvsp[0].ctxt) = p->ctxt;
13558 p->ctxt.in_kwarg = 1;
13559 (yyval.tbl) = push_pvtbl(p);
13560 }
13561#line 13557 "parse.c"
13562 break;
13563
13564 case 490: /* @39: %empty */
13565#line 4429 "parse.y"
13566 {
13567 (yyval.tbl) = push_pktbl(p);
13568 }
13569#line 13565 "parse.c"
13570 break;
13571
13572 case 491: /* $@40: %empty */
13573#line 4433 "parse.y"
13574 {
13575 pop_pktbl(p, (yyvsp[-2].tbl));
13576 pop_pvtbl(p, (yyvsp[-3].tbl));
13577 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
13578 }
13579#line 13575 "parse.c"
13580 break;
13581
13582 case 492: /* p_case_body: "`in'" @38 @39 p_top_expr then $@40 compstmt p_cases */
13583#line 4440 "parse.y"
13584 {
13585 /*%%%*/
13586 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13587 /*% %*/
13588 /*% ripper: in!($4, $7, escape_Qundef($8)) %*/
13589 }
13590#line 13586 "parse.c"
13591 break;
13592
13593 case 496: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
13594#line 4454 "parse.y"
13595 {
13596 /*%%%*/
13597 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
13598 fixpos((yyval.node), (yyvsp[0].node));
13599 /*% %*/
13600 /*% ripper: if_mod!($3, $1) %*/
13601 }
13602#line 13598 "parse.c"
13603 break;
13604
13605 case 497: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
13606#line 4462 "parse.y"
13607 {
13608 /*%%%*/
13609 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
13610 fixpos((yyval.node), (yyvsp[0].node));
13611 /*% %*/
13612 /*% ripper: unless_mod!($3, $1) %*/
13613 }
13614#line 13610 "parse.c"
13615 break;
13616
13617 case 499: /* p_top_expr_body: p_expr ',' */
13618#line 4473 "parse.y"
13619 {
13620 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, Qnone, &(yyloc));
13621 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
13622 }
13623#line 13619 "parse.c"
13624 break;
13625
13626 case 500: /* p_top_expr_body: p_expr ',' p_args */
13627#line 4478 "parse.y"
13628 {
13629 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
13630 /*%%%*/
13631 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
13632 /*%
13633 %*/
13634 }
13635#line 13631 "parse.c"
13636 break;
13637
13638 case 501: /* p_top_expr_body: p_find */
13639#line 4486 "parse.y"
13640 {
13641 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
13642 }
13643#line 13639 "parse.c"
13644 break;
13645
13646 case 502: /* p_top_expr_body: p_args_tail */
13647#line 4490 "parse.y"
13648 {
13649 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
13650 }
13651#line 13647 "parse.c"
13652 break;
13653
13654 case 503: /* p_top_expr_body: p_kwargs */
13655#line 4494 "parse.y"
13656 {
13657 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
13658 }
13659#line 13655 "parse.c"
13660 break;
13661
13662 case 505: /* p_as: p_expr "=>" p_variable */
13663#line 4503 "parse.y"
13664 {
13665 /*%%%*/
13666 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
13667 n = list_append(p, n, (yyvsp[0].node));
13668 (yyval.node) = new_hash(p, n, &(yyloc));
13669 /*% %*/
13670 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
13671 }
13672#line 13668 "parse.c"
13673 break;
13674
13675 case 507: /* p_alt: p_alt '|' p_expr_basic */
13676#line 4515 "parse.y"
13677 {
13678 /*%%%*/
13679 (yyval.node) = NEW_NODE(NODE_OR, (yyvsp[-2].node), (yyvsp[0].node), 0, &(yyloc));
13680 /*% %*/
13681 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
13682 }
13683#line 13679 "parse.c"
13684 break;
13685
13686 case 509: /* p_lparen: '(' */
13687#line 4524 "parse.y"
13688 {(yyval.tbl) = push_pktbl(p);}
13689#line 13685 "parse.c"
13690 break;
13691
13692 case 510: /* p_lbracket: '[' */
13693#line 4525 "parse.y"
13694 {(yyval.tbl) = push_pktbl(p);}
13695#line 13691 "parse.c"
13696 break;
13697
13698 case 513: /* p_expr_basic: p_const p_lparen p_args rparen */
13699#line 4530 "parse.y"
13700 {
13701 pop_pktbl(p, (yyvsp[-2].tbl));
13702 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
13703 /*%%%*/
13704 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13705 /*%
13706 %*/
13707 }
13708#line 13704 "parse.c"
13709 break;
13710
13711 case 514: /* p_expr_basic: p_const p_lparen p_find rparen */
13712#line 4539 "parse.y"
13713 {
13714 pop_pktbl(p, (yyvsp[-2].tbl));
13715 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13716 /*%%%*/
13717 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13718 /*%
13719 %*/
13720 }
13721#line 13717 "parse.c"
13722 break;
13723
13724 case 515: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
13725#line 4548 "parse.y"
13726 {
13727 pop_pktbl(p, (yyvsp[-2].tbl));
13728 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13729 /*%%%*/
13730 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13731 /*%
13732 %*/
13733 }
13734#line 13730 "parse.c"
13735 break;
13736
13737 case 516: /* p_expr_basic: p_const '(' rparen */
13738#line 4557 "parse.y"
13739 {
13740 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
13741 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
13742 }
13743#line 13739 "parse.c"
13744 break;
13745
13746 case 517: /* p_expr_basic: p_const p_lbracket p_args rbracket */
13747#line 4562 "parse.y"
13748 {
13749 pop_pktbl(p, (yyvsp[-2].tbl));
13750 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
13751 /*%%%*/
13752 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13753 /*%
13754 %*/
13755 }
13756#line 13752 "parse.c"
13757 break;
13758
13759 case 518: /* p_expr_basic: p_const p_lbracket p_find rbracket */
13760#line 4571 "parse.y"
13761 {
13762 pop_pktbl(p, (yyvsp[-2].tbl));
13763 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13764 /*%%%*/
13765 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13766 /*%
13767 %*/
13768 }
13769#line 13765 "parse.c"
13770 break;
13771
13772 case 519: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
13773#line 4580 "parse.y"
13774 {
13775 pop_pktbl(p, (yyvsp[-2].tbl));
13776 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
13777 /*%%%*/
13778 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13779 /*%
13780 %*/
13781 }
13782#line 13778 "parse.c"
13783 break;
13784
13785 case 520: /* p_expr_basic: p_const '[' rbracket */
13786#line 4589 "parse.y"
13787 {
13788 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
13789 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
13790 }
13791#line 13787 "parse.c"
13792 break;
13793
13794 case 521: /* p_expr_basic: "[" p_args rbracket */
13795#line 4594 "parse.y"
13796 {
13797 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
13798 }
13799#line 13795 "parse.c"
13800 break;
13801
13802 case 522: /* p_expr_basic: "[" p_find rbracket */
13803#line 4598 "parse.y"
13804 {
13805 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
13806 }
13807#line 13803 "parse.c"
13808 break;
13809
13810 case 523: /* p_expr_basic: "[" rbracket */
13811#line 4602 "parse.y"
13812 {
13813 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
13814 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
13815 }
13816#line 13812 "parse.c"
13817 break;
13818
13819 case 524: /* @41: %empty */
13820#line 4607 "parse.y"
13821 {
13822 (yyval.tbl) = push_pktbl(p);
13823 (yyvsp[0].ctxt) = p->ctxt;
13824 p->ctxt.in_kwarg = 0;
13825 }
13826#line 13822 "parse.c"
13827 break;
13828
13829 case 525: /* p_expr_basic: "{" @41 p_kwargs rbrace */
13830#line 4613 "parse.y"
13831 {
13832 pop_pktbl(p, (yyvsp[-2].tbl));
13833 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
13834 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
13835 }
13836#line 13832 "parse.c"
13837 break;
13838
13839 case 526: /* p_expr_basic: "{" rbrace */
13840#line 4619 "parse.y"
13841 {
13842 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
13843 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
13844 }
13845#line 13841 "parse.c"
13846 break;
13847
13848 case 527: /* @42: %empty */
13849#line 4623 "parse.y"
13850 {(yyval.tbl) = push_pktbl(p);}
13851#line 13847 "parse.c"
13852 break;
13853
13854 case 528: /* p_expr_basic: "(" @42 p_expr rparen */
13855#line 4624 "parse.y"
13856 {
13857 pop_pktbl(p, (yyvsp[-2].tbl));
13858 (yyval.node) = (yyvsp[-1].node);
13859 }
13860#line 13856 "parse.c"
13861 break;
13862
13863 case 529: /* p_args: p_expr */
13864#line 4631 "parse.y"
13865 {
13866 /*%%%*/
13867 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
13868 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &(yyloc));
13869 /*%
13870 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, 0, Qnone, &@$);
13871 %*/
13872 }
13873#line 13869 "parse.c"
13874 break;
13875
13876 case 530: /* p_args: p_args_head */
13877#line 4640 "parse.y"
13878 {
13879 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, Qnone, &(yyloc));
13880 }
13881#line 13877 "parse.c"
13882 break;
13883
13884 case 531: /* p_args: p_args_head p_arg */
13885#line 4644 "parse.y"
13886 {
13887 /*%%%*/
13888 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, Qnone, &(yyloc));
13889 /*%
13890 VALUE pre_args = rb_ary_concat($1, get_value($2));
13891 $$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$);
13892 %*/
13893 }
13894#line 13890 "parse.c"
13895 break;
13896
13897 case 532: /* p_args: p_args_head p_rest */
13898#line 4653 "parse.y"
13899 {
13900 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, (yyvsp[0].id), Qnone, &(yyloc));
13901 }
13902#line 13898 "parse.c"
13903 break;
13904
13905 case 533: /* p_args: p_args_head p_rest ',' p_args_post */
13906#line 4657 "parse.y"
13907 {
13908 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
13909 }
13910#line 13906 "parse.c"
13911 break;
13912
13913 case 535: /* p_args_head: p_arg ',' */
13914#line 4664 "parse.y"
13915 {
13916 (yyval.node) = (yyvsp[-1].node);
13917 }
13918#line 13914 "parse.c"
13919 break;
13920
13921 case 536: /* p_args_head: p_args_head p_arg ',' */
13922#line 4668 "parse.y"
13923 {
13924 /*%%%*/
13925 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
13926 /*% %*/
13927 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
13928 }
13929#line 13925 "parse.c"
13930 break;
13931
13932 case 537: /* p_args_tail: p_rest */
13933#line 4677 "parse.y"
13934 {
13935 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].id), Qnone, &(yyloc));
13936 }
13937#line 13933 "parse.c"
13938 break;
13939
13940 case 538: /* p_args_tail: p_rest ',' p_args_post */
13941#line 4681 "parse.y"
13942 {
13943 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
13944 }
13945#line 13941 "parse.c"
13946 break;
13947
13948 case 539: /* p_find: p_rest ',' p_args_post ',' p_rest */
13949#line 4687 "parse.y"
13950 {
13951 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].id), (yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
13952 }
13953#line 13949 "parse.c"
13954 break;
13955
13956 case 540: /* p_rest: "*" "local variable or method" */
13957#line 4694 "parse.y"
13958 {
13959 (yyval.id) = (yyvsp[0].id);
13960 }
13961#line 13957 "parse.c"
13962 break;
13963
13964 case 541: /* p_rest: "*" */
13965#line 4698 "parse.y"
13966 {
13967 (yyval.id) = 0;
13968 }
13969#line 13965 "parse.c"
13970 break;
13971
13972 case 543: /* p_args_post: p_args_post ',' p_arg */
13973#line 4705 "parse.y"
13974 {
13975 /*%%%*/
13976 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
13977 /*% %*/
13978 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
13979 }
13980#line 13976 "parse.c"
13981 break;
13982
13983 case 544: /* p_arg: p_expr */
13984#line 4714 "parse.y"
13985 {
13986 /*%%%*/
13987 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13988 /*% %*/
13989 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
13990 }
13991#line 13987 "parse.c"
13992 break;
13993
13994 case 545: /* p_kwargs: p_kwarg ',' p_any_kwrest */
13995#line 4723 "parse.y"
13996 {
13997 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
13998 }
13999#line 13995 "parse.c"
14000 break;
14001
14002 case 546: /* p_kwargs: p_kwarg */
14003#line 4727 "parse.y"
14004 {
14005 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
14006 }
14007#line 14003 "parse.c"
14008 break;
14009
14010 case 547: /* p_kwargs: p_kwarg ',' */
14011#line 4731 "parse.y"
14012 {
14013 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
14014 }
14015#line 14011 "parse.c"
14016 break;
14017
14018 case 548: /* p_kwargs: p_any_kwrest */
14019#line 4735 "parse.y"
14020 {
14021 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
14022 }
14023#line 14019 "parse.c"
14024 break;
14025
14026 case 550: /* p_kwarg: p_kwarg ',' p_kw */
14027#line 4743 "parse.y"
14028 {
14029 /*%%%*/
14030 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
14031 /*% %*/
14032 /*% ripper: rb_ary_push($1, $3) %*/
14033 }
14034#line 14030 "parse.c"
14035 break;
14036
14037 case 551: /* p_kw: p_kw_label p_expr */
14038#line 4752 "parse.y"
14039 {
14040 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
14041 /*%%%*/
14042 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
14043 /*% %*/
14044 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
14045 }
14046#line 14042 "parse.c"
14047 break;
14048
14049 case 552: /* p_kw: p_kw_label */
14050#line 4760 "parse.y"
14051 {
14052 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14053 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
14054 yyerror1(&(yylsp[0]), "key must be valid as local variables");
14055 }
14056 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14057 /*%%%*/
14058 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
14059 /*% %*/
14060 /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/
14061 }
14062#line 14058 "parse.c"
14063 break;
14064
14065 case 554: /* p_kw_label: "string literal" string_contents tLABEL_END */
14066#line 4775 "parse.y"
14067 {
14068 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
14069 /*%%%*/
14070 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
14071 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
14072 (yyval.id) = SYM2ID(node->nd_lit);
14073 }
14074 /*%
14075 if (ripper_is_node_yylval($2) && RNODE($2)->nd_cval) {
14076 VALUE label = RNODE($2)->nd_cval;
14077 VALUE rval = RNODE($2)->nd_rval;
14078 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
14079 RNODE($$)->nd_loc = loc;
14080 }
14081 %*/
14082 else {
14083 yyerror1(&loc, "symbol literal with interpolation is not allowed");
14084 (yyval.id) = 0;
14085 }
14086 }
14087#line 14083 "parse.c"
14088 break;
14089
14090 case 555: /* p_kwrest: kwrest_mark "local variable or method" */
14091#line 4798 "parse.y"
14092 {
14093 (yyval.id) = (yyvsp[0].id);
14094 }
14095#line 14091 "parse.c"
14096 break;
14097
14098 case 556: /* p_kwrest: kwrest_mark */
14099#line 4802 "parse.y"
14100 {
14101 (yyval.id) = 0;
14102 }
14103#line 14099 "parse.c"
14104 break;
14105
14106 case 557: /* p_kwnorest: kwrest_mark "`nil'" */
14107#line 4808 "parse.y"
14108 {
14109 (yyval.id) = 0;
14110 }
14111#line 14107 "parse.c"
14112 break;
14113
14114 case 559: /* p_any_kwrest: p_kwnorest */
14115#line 4814 "parse.y"
14116 {(yyval.id) = ID2VAL(idNil);}
14117#line 14113 "parse.c"
14118 break;
14119
14120 case 561: /* p_value: p_primitive ".." p_primitive */
14121#line 4819 "parse.y"
14122 {
14123 /*%%%*/
14124 value_expr((yyvsp[-2].node));
14125 value_expr((yyvsp[0].node));
14126 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14127 /*% %*/
14128 /*% ripper: dot2!($1, $3) %*/
14129 }
14130#line 14126 "parse.c"
14131 break;
14132
14133 case 562: /* p_value: p_primitive "..." p_primitive */
14134#line 4828 "parse.y"
14135 {
14136 /*%%%*/
14137 value_expr((yyvsp[-2].node));
14138 value_expr((yyvsp[0].node));
14139 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14140 /*% %*/
14141 /*% ripper: dot3!($1, $3) %*/
14142 }
14143#line 14139 "parse.c"
14144 break;
14145
14146 case 563: /* p_value: p_primitive ".." */
14147#line 4837 "parse.y"
14148 {
14149 /*%%%*/
14150 value_expr((yyvsp[-1].node));
14151 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
14152 /*% %*/
14153 /*% ripper: dot2!($1, Qnil) %*/
14154 }
14155#line 14151 "parse.c"
14156 break;
14157
14158 case 564: /* p_value: p_primitive "..." */
14159#line 4845 "parse.y"
14160 {
14161 /*%%%*/
14162 value_expr((yyvsp[-1].node));
14163 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
14164 /*% %*/
14165 /*% ripper: dot3!($1, Qnil) %*/
14166 }
14167#line 14163 "parse.c"
14168 break;
14169
14170 case 568: /* p_value: "(.." p_primitive */
14171#line 4856 "parse.y"
14172 {
14173 /*%%%*/
14174 value_expr((yyvsp[0].node));
14175 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
14176 /*% %*/
14177 /*% ripper: dot2!(Qnil, $2) %*/
14178 }
14179#line 14175 "parse.c"
14180 break;
14181
14182 case 569: /* p_value: "(..." p_primitive */
14183#line 4864 "parse.y"
14184 {
14185 /*%%%*/
14186 value_expr((yyvsp[0].node));
14187 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
14188 /*% %*/
14189 /*% ripper: dot3!(Qnil, $2) %*/
14190 }
14191#line 14187 "parse.c"
14192 break;
14193
14194 case 578: /* p_primitive: keyword_variable */
14195#line 4882 "parse.y"
14196 {
14197 /*%%%*/
14198 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14199 /*% %*/
14200 /*% ripper: var_ref!($1) %*/
14201 }
14202#line 14198 "parse.c"
14203 break;
14204
14205 case 580: /* p_variable: "local variable or method" */
14206#line 4892 "parse.y"
14207 {
14208 /*%%%*/
14209 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
14210 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14211 /*% %*/
14212 /*% ripper: assignable(p, var_field(p, $1)) %*/
14213 }
14214#line 14210 "parse.c"
14215 break;
14216
14217 case 581: /* p_var_ref: '^' "local variable or method" */
14218#line 4902 "parse.y"
14219 {
14220 /*%%%*/
14221 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
14222 if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
14223 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
14224 }
14225 (yyval.node) = n;
14226 /*% %*/
14227 /*% ripper: var_ref!($2) %*/
14228 }
14229#line 14225 "parse.c"
14230 break;
14231
14232 case 582: /* p_var_ref: '^' nonlocal_var */
14233#line 4913 "parse.y"
14234 {
14235 /*%%%*/
14236 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14237 /*% %*/
14238 /*% ripper: var_ref!($2) %*/
14239 }
14240#line 14236 "parse.c"
14241 break;
14242
14243 case 583: /* p_expr_ref: '^' "(" expr_value rparen */
14244#line 4922 "parse.y"
14245 {
14246 /*%%%*/
14247 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
14248 /*% %*/
14249 /*% ripper: begin!($3) %*/
14250 }
14251#line 14247 "parse.c"
14252 break;
14253
14254 case 584: /* p_const: ":: at EXPR_BEG" cname */
14255#line 4931 "parse.y"
14256 {
14257 /*%%%*/
14258 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
14259 /*% %*/
14260 /*% ripper: top_const_ref!($2) %*/
14261 }
14262#line 14258 "parse.c"
14263 break;
14264
14265 case 585: /* p_const: p_const "::" cname */
14266#line 4938 "parse.y"
14267 {
14268 /*%%%*/
14269 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
14270 /*% %*/
14271 /*% ripper: const_path_ref!($1, $3) %*/
14272 }
14273#line 14269 "parse.c"
14274 break;
14275
14276 case 586: /* p_const: "constant" */
14277#line 4945 "parse.y"
14278 {
14279 /*%%%*/
14280 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
14281 /*% %*/
14282 /*% ripper: var_ref!($1) %*/
14283 }
14284#line 14280 "parse.c"
14285 break;
14286
14287 case 587: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
14288#line 4956 "parse.y"
14289 {
14290 /*%%%*/
14291 (yyval.node) = NEW_RESBODY((yyvsp[-4].node),
14292 (yyvsp[-3].node) ? block_append(p, node_assign(p, (yyvsp[-3].node), NEW_ERRINFO(&(yylsp[-3])), NO_LEX_CTXT, &(yylsp[-3])), (yyvsp[-1].node)) : (yyvsp[-1].node),
14293 (yyvsp[0].node), &(yyloc));
14294
14295 if ((yyvsp[-4].node)) {
14296 fixpos((yyval.node), (yyvsp[-4].node));
14297 }
14298 else if ((yyvsp[-3].node)) {
14299 fixpos((yyval.node), (yyvsp[-3].node));
14300 }
14301 else {
14302 fixpos((yyval.node), (yyvsp[-1].node));
14303 }
14304 /*% %*/
14305 /*% ripper: rescue!(escape_Qundef($2), escape_Qundef($3), escape_Qundef($5), escape_Qundef($6)) %*/
14306 }
14307#line 14303 "parse.c"
14308 break;
14309
14310 case 589: /* exc_list: arg_value */
14311#line 4978 "parse.y"
14312 {
14313 /*%%%*/
14314 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14315 /*% %*/
14316 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
14317 }
14318#line 14314 "parse.c"
14319 break;
14320
14321 case 590: /* exc_list: mrhs */
14322#line 4985 "parse.y"
14323 {
14324 /*%%%*/
14325 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
14326 /*% %*/
14327 /*% ripper: $1 %*/
14328 }
14329#line 14325 "parse.c"
14330 break;
14331
14332 case 592: /* exc_var: "=>" lhs */
14333#line 4995 "parse.y"
14334 {
14335 (yyval.node) = (yyvsp[0].node);
14336 }
14337#line 14333 "parse.c"
14338 break;
14339
14340 case 594: /* opt_ensure: k_ensure compstmt */
14341#line 5002 "parse.y"
14342 {
14343 /*%%%*/
14344 (yyval.node) = (yyvsp[0].node);
14345 /*% %*/
14346 /*% ripper: ensure!($2) %*/
14347 }
14348#line 14344 "parse.c"
14349 break;
14350
14351 case 598: /* strings: string */
14352#line 5016 "parse.y"
14353 {
14354 /*%%%*/
14355 NODE *node = (yyvsp[0].node);
14356 if (!node) {
14357 node = NEW_STR(STR_NEW0(), &(yyloc));
14358 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
14359 }
14360 else {
14361 node = evstr2dstr(p, node);
14362 }
14363 (yyval.node) = node;
14364 /*% %*/
14365 /*% ripper: $1 %*/
14366 }
14367#line 14363 "parse.c"
14368 break;
14369
14370 case 601: /* string: string string1 */
14371#line 5035 "parse.y"
14372 {
14373 /*%%%*/
14374 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14375 /*% %*/
14376 /*% ripper: string_concat!($1, $2) %*/
14377 }
14378#line 14374 "parse.c"
14379 break;
14380
14381 case 602: /* string1: "string literal" string_contents "terminator" */
14382#line 5044 "parse.y"
14383 {
14384 /*%%%*/
14385 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
14386 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
14387 /*% %*/
14388 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
14389 }
14390#line 14386 "parse.c"
14391 break;
14392
14393 case 603: /* xstring: "backtick literal" xstring_contents "terminator" */
14394#line 5054 "parse.y"
14395 {
14396 /*%%%*/
14397 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
14398 /*% %*/
14399 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
14400 }
14401#line 14397 "parse.c"
14402 break;
14403
14404 case 604: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
14405#line 5063 "parse.y"
14406 {
14407 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
14408 }
14409#line 14405 "parse.c"
14410 break;
14411
14412 case 605: /* words: "word list" ' ' word_list "terminator" */
14413#line 5069 "parse.y"
14414 {
14415 /*%%%*/
14416 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14417 /*% %*/
14418 /*% ripper: array!($3) %*/
14419 }
14420#line 14416 "parse.c"
14421 break;
14422
14423 case 606: /* word_list: %empty */
14424#line 5078 "parse.y"
14425 {
14426 /*%%%*/
14427 (yyval.node) = 0;
14428 /*% %*/
14429 /*% ripper: words_new! %*/
14430 }
14431#line 14427 "parse.c"
14432 break;
14433
14434 case 607: /* word_list: word_list word ' ' */
14435#line 5085 "parse.y"
14436 {
14437 /*%%%*/
14438 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
14439 /*% %*/
14440 /*% ripper: words_add!($1, $2) %*/
14441 }
14442#line 14438 "parse.c"
14443 break;
14444
14445 case 609: /* word: word string_content */
14446#line 5096 "parse.y"
14447 {
14448 /*%%%*/
14449 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14450 /*% %*/
14451 /*% ripper: word_add!($1, $2) %*/
14452 }
14453#line 14449 "parse.c"
14454 break;
14455
14456 case 610: /* symbols: "symbol list" ' ' symbol_list "terminator" */
14457#line 5105 "parse.y"
14458 {
14459 /*%%%*/
14460 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14461 /*% %*/
14462 /*% ripper: array!($3) %*/
14463 }
14464#line 14460 "parse.c"
14465 break;
14466
14467 case 611: /* symbol_list: %empty */
14468#line 5114 "parse.y"
14469 {
14470 /*%%%*/
14471 (yyval.node) = 0;
14472 /*% %*/
14473 /*% ripper: symbols_new! %*/
14474 }
14475#line 14471 "parse.c"
14476 break;
14477
14478 case 612: /* symbol_list: symbol_list word ' ' */
14479#line 5121 "parse.y"
14480 {
14481 /*%%%*/
14482 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
14483 /*% %*/
14484 /*% ripper: symbols_add!($1, $2) %*/
14485 }
14486#line 14482 "parse.c"
14487 break;
14488
14489 case 613: /* qwords: "verbatim word list" ' ' qword_list "terminator" */
14490#line 5130 "parse.y"
14491 {
14492 /*%%%*/
14493 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14494 /*% %*/
14495 /*% ripper: array!($3) %*/
14496 }
14497#line 14493 "parse.c"
14498 break;
14499
14500 case 614: /* qsymbols: "verbatim symbol list" ' ' qsym_list "terminator" */
14501#line 5139 "parse.y"
14502 {
14503 /*%%%*/
14504 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14505 /*% %*/
14506 /*% ripper: array!($3) %*/
14507 }
14508#line 14504 "parse.c"
14509 break;
14510
14511 case 615: /* qword_list: %empty */
14512#line 5148 "parse.y"
14513 {
14514 /*%%%*/
14515 (yyval.node) = 0;
14516 /*% %*/
14517 /*% ripper: qwords_new! %*/
14518 }
14519#line 14515 "parse.c"
14520 break;
14521
14522 case 616: /* qword_list: qword_list "literal content" ' ' */
14523#line 5155 "parse.y"
14524 {
14525 /*%%%*/
14526 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
14527 /*% %*/
14528 /*% ripper: qwords_add!($1, $2) %*/
14529 }
14530#line 14526 "parse.c"
14531 break;
14532
14533 case 617: /* qsym_list: %empty */
14534#line 5164 "parse.y"
14535 {
14536 /*%%%*/
14537 (yyval.node) = 0;
14538 /*% %*/
14539 /*% ripper: qsymbols_new! %*/
14540 }
14541#line 14537 "parse.c"
14542 break;
14543
14544 case 618: /* qsym_list: qsym_list "literal content" ' ' */
14545#line 5171 "parse.y"
14546 {
14547 /*%%%*/
14548 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
14549 /*% %*/
14550 /*% ripper: qsymbols_add!($1, $2) %*/
14551 }
14552#line 14548 "parse.c"
14553 break;
14554
14555 case 619: /* string_contents: %empty */
14556#line 5180 "parse.y"
14557 {
14558 /*%%%*/
14559 (yyval.node) = 0;
14560 /*% %*/
14561 /*% ripper: string_content! %*/
14562 /*%%%*/
14563 /*%
14564 $$ = ripper_new_yylval(p, 0, $$, 0);
14565 %*/
14566 }
14567#line 14563 "parse.c"
14568 break;
14569
14570 case 620: /* string_contents: string_contents string_content */
14571#line 5191 "parse.y"
14572 {
14573 /*%%%*/
14574 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14575 /*% %*/
14576 /*% ripper: string_add!($1, $2) %*/
14577 /*%%%*/
14578 /*%
14579 if (ripper_is_node_yylval($1) && ripper_is_node_yylval($2) &&
14580 !RNODE($1)->nd_cval) {
14581 RNODE($1)->nd_cval = RNODE($2)->nd_cval;
14582 RNODE($1)->nd_rval = add_mark_object(p, $$);
14583 $$ = $1;
14584 }
14585 %*/
14586 }
14587#line 14583 "parse.c"
14588 break;
14589
14590 case 621: /* xstring_contents: %empty */
14591#line 5209 "parse.y"
14592 {
14593 /*%%%*/
14594 (yyval.node) = 0;
14595 /*% %*/
14596 /*% ripper: xstring_new! %*/
14597 }
14598#line 14594 "parse.c"
14599 break;
14600
14601 case 622: /* xstring_contents: xstring_contents string_content */
14602#line 5216 "parse.y"
14603 {
14604 /*%%%*/
14605 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14606 /*% %*/
14607 /*% ripper: xstring_add!($1, $2) %*/
14608 }
14609#line 14605 "parse.c"
14610 break;
14611
14612 case 623: /* regexp_contents: %empty */
14613#line 5225 "parse.y"
14614 {
14615 /*%%%*/
14616 (yyval.node) = 0;
14617 /*% %*/
14618 /*% ripper: regexp_new! %*/
14619 /*%%%*/
14620 /*%
14621 $$ = ripper_new_yylval(p, 0, $$, 0);
14622 %*/
14623 }
14624#line 14620 "parse.c"
14625 break;
14626
14627 case 624: /* regexp_contents: regexp_contents string_content */
14628#line 5236 "parse.y"
14629 {
14630 /*%%%*/
14631 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
14632 if (!head) {
14633 (yyval.node) = tail;
14634 }
14635 else if (!tail) {
14636 (yyval.node) = head;
14637 }
14638 else {
14639 switch (nd_type(head)) {
14640 case NODE_STR:
14641 nd_set_type(head, NODE_DSTR);
14642 break;
14643 case NODE_DSTR:
14644 break;
14645 default:
14646 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
14647 break;
14648 }
14649 (yyval.node) = list_append(p, head, tail);
14650 }
14651 /*%
14652 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
14653 if (ripper_is_node_yylval(n1)) {
14654 s1 = RNODE(n1)->nd_cval;
14655 n1 = RNODE(n1)->nd_rval;
14656 }
14657 if (ripper_is_node_yylval(n2)) {
14658 s2 = RNODE(n2)->nd_cval;
14659 n2 = RNODE(n2)->nd_rval;
14660 }
14661 $$ = dispatch2(regexp_add, n1, n2);
14662 if (!s1 && s2) {
14663 $$ = ripper_new_yylval(p, 0, $$, s2);
14664 }
14665 %*/
14666 }
14667#line 14663 "parse.c"
14668 break;
14669
14670 case 626: /* @43: %empty */
14671#line 5279 "parse.y"
14672 {
14673 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
14674 (yyval.strterm) = p->lex.strterm;
14675 p->lex.strterm = 0;
14676 SET_LEX_STATE(EXPR_BEG);
14677 }
14678#line 14674 "parse.c"
14679 break;
14680
14681 case 627: /* string_content: tSTRING_DVAR @43 string_dvar */
14682#line 5286 "parse.y"
14683 {
14684 p->lex.strterm = (yyvsp[-1].strterm);
14685 /*%%%*/
14686 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
14687 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
14688 /*% %*/
14689 /*% ripper: string_dvar!($3) %*/
14690 }
14691#line 14687 "parse.c"
14692 break;
14693
14694 case 628: /* $@44: %empty */
14695#line 5295 "parse.y"
14696 {
14697 CMDARG_PUSH(0);
14698 COND_PUSH(0);
14699 }
14700#line 14696 "parse.c"
14701 break;
14702
14703 case 629: /* @45: %empty */
14704#line 5299 "parse.y"
14705 {
14706 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
14707 (yyval.strterm) = p->lex.strterm;
14708 p->lex.strterm = 0;
14709 }
14710#line 14706 "parse.c"
14711 break;
14712
14713 case 630: /* @46: %empty */
14714#line 5304 "parse.y"
14715 {
14716 (yyval.num) = p->lex.state;
14717 SET_LEX_STATE(EXPR_BEG);
14718 }
14719#line 14715 "parse.c"
14720 break;
14721
14722 case 631: /* @47: %empty */
14723#line 5308 "parse.y"
14724 {
14725 (yyval.num) = p->lex.brace_nest;
14726 p->lex.brace_nest = 0;
14727 }
14728#line 14724 "parse.c"
14729 break;
14730
14731 case 632: /* @48: %empty */
14732#line 5312 "parse.y"
14733 {
14734 (yyval.num) = p->heredoc_indent;
14735 p->heredoc_indent = 0;
14736 }
14737#line 14733 "parse.c"
14738 break;
14739
14740 case 633: /* string_content: tSTRING_DBEG $@44 @45 @46 @47 @48 compstmt "'}'" */
14741#line 5317 "parse.y"
14742 {
14743 COND_POP();
14744 CMDARG_POP();
14745 p->lex.strterm = (yyvsp[-5].strterm);
14746 SET_LEX_STATE((yyvsp[-4].num));
14747 p->lex.brace_nest = (yyvsp[-3].num);
14748 p->heredoc_indent = (yyvsp[-2].num);
14749 p->heredoc_line_indent = -1;
14750 /*%%%*/
14751 if ((yyvsp[-1].node)) (yyvsp[-1].node)->flags &= ~NODE_FL_NEWLINE;
14752 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
14753 /*% %*/
14754 /*% ripper: string_embexpr!($7) %*/
14755 }
14756#line 14752 "parse.c"
14757 break;
14758
14759 case 634: /* string_dvar: "global variable" */
14760#line 5334 "parse.y"
14761 {
14762 /*%%%*/
14763 (yyval.node) = NEW_GVAR((yyvsp[0].id), &(yyloc));
14764 /*% %*/
14765 /*% ripper: var_ref!($1) %*/
14766 }
14767#line 14763 "parse.c"
14768 break;
14769
14770 case 635: /* string_dvar: "instance variable" */
14771#line 5341 "parse.y"
14772 {
14773 /*%%%*/
14774 (yyval.node) = NEW_IVAR((yyvsp[0].id), &(yyloc));
14775 /*% %*/
14776 /*% ripper: var_ref!($1) %*/
14777 }
14778#line 14774 "parse.c"
14779 break;
14780
14781 case 636: /* string_dvar: "class variable" */
14782#line 5348 "parse.y"
14783 {
14784 /*%%%*/
14785 (yyval.node) = NEW_CVAR((yyvsp[0].id), &(yyloc));
14786 /*% %*/
14787 /*% ripper: var_ref!($1) %*/
14788 }
14789#line 14785 "parse.c"
14790 break;
14791
14792 case 640: /* ssym: "symbol literal" sym */
14793#line 5362 "parse.y"
14794 {
14795 SET_LEX_STATE(EXPR_END);
14796 /*%%%*/
14797 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
14798 /*% %*/
14799 /*% ripper: symbol_literal!(symbol!($2)) %*/
14800 }
14801#line 14797 "parse.c"
14802 break;
14803
14804 case 643: /* dsym: "symbol literal" string_contents "terminator" */
14805#line 5376 "parse.y"
14806 {
14807 SET_LEX_STATE(EXPR_END);
14808 /*%%%*/
14809 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
14810 /*% %*/
14811 /*% ripper: dyna_symbol!($2) %*/
14812 }
14813#line 14809 "parse.c"
14814 break;
14815
14816 case 645: /* numeric: tUMINUS_NUM simple_numeric */
14817#line 5387 "parse.y"
14818 {
14819 /*%%%*/
14820 (yyval.node) = (yyvsp[0].node);
14821 RB_OBJ_WRITE(p->ast, &(yyval.node)->nd_lit, negate_lit(p, (yyval.node)->nd_lit));
14822 /*% %*/
14823 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
14824 }
14825#line 14821 "parse.c"
14826 break;
14827
14828 case 656: /* keyword_variable: "`nil'" */
14829#line 5412 "parse.y"
14830 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
14831#line 14827 "parse.c"
14832 break;
14833
14834 case 657: /* keyword_variable: "`self'" */
14835#line 5413 "parse.y"
14836 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
14837#line 14833 "parse.c"
14838 break;
14839
14840 case 658: /* keyword_variable: "`true'" */
14841#line 5414 "parse.y"
14842 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
14843#line 14839 "parse.c"
14844 break;
14845
14846 case 659: /* keyword_variable: "`false'" */
14847#line 5415 "parse.y"
14848 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
14849#line 14845 "parse.c"
14850 break;
14851
14852 case 660: /* keyword_variable: "`__FILE__'" */
14853#line 5416 "parse.y"
14854 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
14855#line 14851 "parse.c"
14856 break;
14857
14858 case 661: /* keyword_variable: "`__LINE__'" */
14859#line 5417 "parse.y"
14860 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
14861#line 14857 "parse.c"
14862 break;
14863
14864 case 662: /* keyword_variable: "`__ENCODING__'" */
14865#line 5418 "parse.y"
14866 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
14867#line 14863 "parse.c"
14868 break;
14869
14870 case 663: /* var_ref: user_variable */
14871#line 5422 "parse.y"
14872 {
14873 /*%%%*/
14874 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14875 /*%
14876 if (id_is_var(p, get_id($1))) {
14877 $$ = dispatch1(var_ref, $1);
14878 }
14879 else {
14880 $$ = dispatch1(vcall, $1);
14881 }
14882 %*/
14883 }
14884#line 14880 "parse.c"
14885 break;
14886
14887 case 664: /* var_ref: keyword_variable */
14888#line 5435 "parse.y"
14889 {
14890 /*%%%*/
14891 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14892 /*% %*/
14893 /*% ripper: var_ref!($1) %*/
14894 }
14895#line 14891 "parse.c"
14896 break;
14897
14898 case 665: /* var_lhs: user_variable */
14899#line 5444 "parse.y"
14900 {
14901 /*%%%*/
14902 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14903 /*% %*/
14904 /*% ripper: assignable(p, var_field(p, $1)) %*/
14905 }
14906#line 14902 "parse.c"
14907 break;
14908
14909 case 666: /* var_lhs: keyword_variable */
14910#line 5451 "parse.y"
14911 {
14912 /*%%%*/
14913 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14914 /*% %*/
14915 /*% ripper: assignable(p, var_field(p, $1)) %*/
14916 }
14917#line 14913 "parse.c"
14918 break;
14919
14920 case 669: /* $@49: %empty */
14921#line 5464 "parse.y"
14922 {
14923 SET_LEX_STATE(EXPR_BEG);
14924 p->command_start = TRUE;
14925 }
14926#line 14922 "parse.c"
14927 break;
14928
14929 case 670: /* superclass: '<' $@49 expr_value term */
14930#line 5469 "parse.y"
14931 {
14932 (yyval.node) = (yyvsp[-1].node);
14933 }
14934#line 14930 "parse.c"
14935 break;
14936
14937 case 671: /* superclass: %empty */
14938#line 5473 "parse.y"
14939 {
14940 /*%%%*/
14941 (yyval.node) = 0;
14942 /*% %*/
14943 /*% ripper: Qnil %*/
14944 }
14945#line 14941 "parse.c"
14946 break;
14947
14948 case 673: /* f_opt_paren_args: none */
14949#line 5483 "parse.y"
14950 {
14951 p->ctxt.in_argdef = 0;
14952 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[-1]));
14953 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[-1]));
14954 }
14955#line 14951 "parse.c"
14956 break;
14957
14958 case 674: /* f_paren_args: '(' f_args rparen */
14959#line 5491 "parse.y"
14960 {
14961 /*%%%*/
14962 (yyval.node) = (yyvsp[-1].node);
14963 /*% %*/
14964 /*% ripper: paren!($2) %*/
14965 SET_LEX_STATE(EXPR_BEG);
14966 p->command_start = TRUE;
14967 p->ctxt.in_argdef = 0;
14968 }
14969#line 14965 "parse.c"
14970 break;
14971
14972 case 676: /* @50: %empty */
14973#line 5503 "parse.y"
14974 {
14975 (yyval.ctxt) = p->ctxt;
14976 p->ctxt.in_kwarg = 1;
14977 p->ctxt.in_argdef = 1;
14978 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
14979 }
14980#line 14976 "parse.c"
14981 break;
14982
14983 case 677: /* f_arglist: @50 f_args term */
14984#line 5510 "parse.y"
14985 {
14986 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
14987 p->ctxt.in_argdef = 0;
14988 (yyval.node) = (yyvsp[-1].node);
14989 SET_LEX_STATE(EXPR_BEG);
14990 p->command_start = TRUE;
14991 }
14992#line 14988 "parse.c"
14993 break;
14994
14995 case 678: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
14996#line 5520 "parse.y"
14997 {
14998 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
14999 }
15000#line 14996 "parse.c"
15001 break;
15002
15003 case 679: /* args_tail: f_kwarg opt_f_block_arg */
15004#line 5524 "parse.y"
15005 {
15006 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
15007 }
15008#line 15004 "parse.c"
15009 break;
15010
15011 case 680: /* args_tail: f_any_kwrest opt_f_block_arg */
15012#line 5528 "parse.y"
15013 {
15014 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
15015 }
15016#line 15012 "parse.c"
15017 break;
15018
15019 case 681: /* args_tail: f_block_arg */
15020#line 5532 "parse.y"
15021 {
15022 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
15023 }
15024#line 15020 "parse.c"
15025 break;
15026
15027 case 682: /* args_tail: args_forward */
15028#line 5536 "parse.y"
15029 {
15030 add_forwarding_args(p);
15031 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[0].id), ID2VAL(idFWD_BLOCK), &(yylsp[0]));
15032 /*%%%*/
15033 ((yyval.node)->nd_ainfo)->forwarding = 1;
15034 /*% %*/
15035 }
15036#line 15032 "parse.c"
15037 break;
15038
15039 case 683: /* opt_args_tail: ',' args_tail */
15040#line 5546 "parse.y"
15041 {
15042 (yyval.node) = (yyvsp[0].node);
15043 }
15044#line 15040 "parse.c"
15045 break;
15046
15047 case 684: /* opt_args_tail: %empty */
15048#line 5550 "parse.y"
15049 {
15050 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
15051 }
15052#line 15048 "parse.c"
15053 break;
15054
15055 case 685: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
15056#line 5556 "parse.y"
15057 {
15058 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15059 }
15060#line 15056 "parse.c"
15061 break;
15062
15063 case 686: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15064#line 5560 "parse.y"
15065 {
15066 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15067 }
15068#line 15064 "parse.c"
15069 break;
15070
15071 case 687: /* f_args: f_arg ',' f_optarg opt_args_tail */
15072#line 5564 "parse.y"
15073 {
15074 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15075 }
15076#line 15072 "parse.c"
15077 break;
15078
15079 case 688: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
15080#line 5568 "parse.y"
15081 {
15082 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15083 }
15084#line 15080 "parse.c"
15085 break;
15086
15087 case 689: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
15088#line 5572 "parse.y"
15089 {
15090 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15091 }
15092#line 15088 "parse.c"
15093 break;
15094
15095 case 690: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
15096#line 5576 "parse.y"
15097 {
15098 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15099 }
15100#line 15096 "parse.c"
15101 break;
15102
15103 case 691: /* f_args: f_arg opt_args_tail */
15104#line 5580 "parse.y"
15105 {
15106 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15107 }
15108#line 15104 "parse.c"
15109 break;
15110
15111 case 692: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
15112#line 5584 "parse.y"
15113 {
15114 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15115 }
15116#line 15112 "parse.c"
15117 break;
15118
15119 case 693: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15120#line 5588 "parse.y"
15121 {
15122 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15123 }
15124#line 15120 "parse.c"
15125 break;
15126
15127 case 694: /* f_args: f_optarg opt_args_tail */
15128#line 5592 "parse.y"
15129 {
15130 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15131 }
15132#line 15128 "parse.c"
15133 break;
15134
15135 case 695: /* f_args: f_optarg ',' f_arg opt_args_tail */
15136#line 5596 "parse.y"
15137 {
15138 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15139 }
15140#line 15136 "parse.c"
15141 break;
15142
15143 case 696: /* f_args: f_rest_arg opt_args_tail */
15144#line 5600 "parse.y"
15145 {
15146 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15147 }
15148#line 15144 "parse.c"
15149 break;
15150
15151 case 697: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
15152#line 5604 "parse.y"
15153 {
15154 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15155 }
15156#line 15152 "parse.c"
15157 break;
15158
15159 case 698: /* f_args: args_tail */
15160#line 5608 "parse.y"
15161 {
15162 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15163 }
15164#line 15160 "parse.c"
15165 break;
15166
15167 case 699: /* f_args: %empty */
15168#line 5612 "parse.y"
15169 {
15170 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
15171 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[0]));
15172 }
15173#line 15169 "parse.c"
15174 break;
15175
15176 case 700: /* args_forward: "(..." */
15177#line 5619 "parse.y"
15178 {
15179 /*%%%*/
15180#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
15181 (yyval.id) = 0;
15182#else
15183 (yyval.id) = idFWD_KWREST;
15184#endif
15185 /*% %*/
15186 /*% ripper: args_forward! %*/
15187 }
15188#line 15184 "parse.c"
15189 break;
15190
15191 case 701: /* f_bad_arg: "constant" */
15192#line 5632 "parse.y"
15193 {
15194 static const char mesg[] = "formal argument cannot be a constant";
15195 /*%%%*/
15196 yyerror1(&(yylsp[0]), mesg);
15197 (yyval.id) = 0;
15198 /*% %*/
15199 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
15200 }
15201#line 15197 "parse.c"
15202 break;
15203
15204 case 702: /* f_bad_arg: "instance variable" */
15205#line 5641 "parse.y"
15206 {
15207 static const char mesg[] = "formal argument cannot be an instance variable";
15208 /*%%%*/
15209 yyerror1(&(yylsp[0]), mesg);
15210 (yyval.id) = 0;
15211 /*% %*/
15212 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
15213 }
15214#line 15210 "parse.c"
15215 break;
15216
15217 case 703: /* f_bad_arg: "global variable" */
15218#line 5650 "parse.y"
15219 {
15220 static const char mesg[] = "formal argument cannot be a global variable";
15221 /*%%%*/
15222 yyerror1(&(yylsp[0]), mesg);
15223 (yyval.id) = 0;
15224 /*% %*/
15225 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
15226 }
15227#line 15223 "parse.c"
15228 break;
15229
15230 case 704: /* f_bad_arg: "class variable" */
15231#line 5659 "parse.y"
15232 {
15233 static const char mesg[] = "formal argument cannot be a class variable";
15234 /*%%%*/
15235 yyerror1(&(yylsp[0]), mesg);
15236 (yyval.id) = 0;
15237 /*% %*/
15238 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
15239 }
15240#line 15236 "parse.c"
15241 break;
15242
15243 case 706: /* f_norm_arg: "local variable or method" */
15244#line 5671 "parse.y"
15245 {
15246 formal_argument(p, (yyvsp[0].id));
15247 p->max_numparam = ORDINAL_PARAM;
15248 (yyval.id) = (yyvsp[0].id);
15249 }
15250#line 15246 "parse.c"
15251 break;
15252
15253 case 707: /* f_arg_asgn: f_norm_arg */
15254#line 5679 "parse.y"
15255 {
15256 ID id = get_id((yyvsp[0].id));
15257 arg_var(p, id);
15258 p->cur_arg = id;
15259 (yyval.id) = (yyvsp[0].id);
15260 }
15261#line 15257 "parse.c"
15262 break;
15263
15264 case 708: /* f_arg_item: f_arg_asgn */
15265#line 5688 "parse.y"
15266 {
15267 p->cur_arg = 0;
15268 /*%%%*/
15269 (yyval.node) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
15270 /*% %*/
15271 /*% ripper: get_value($1) %*/
15272 }
15273#line 15269 "parse.c"
15274 break;
15275
15276 case 709: /* f_arg_item: "(" f_margs rparen */
15277#line 5696 "parse.y"
15278 {
15279 /*%%%*/
15280 ID tid = internal_id(p);
15281 YYLTYPE loc;
15282 loc.beg_pos = (yylsp[-1]).beg_pos;
15283 loc.end_pos = (yylsp[-1]).beg_pos;
15284 arg_var(p, tid);
15285 if (dyna_in_block(p)) {
15286 (yyvsp[-1].node)->nd_value = NEW_DVAR(tid, &loc);
15287 }
15288 else {
15289 (yyvsp[-1].node)->nd_value = NEW_LVAR(tid, &loc);
15290 }
15291 (yyval.node) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
15292 (yyval.node)->nd_next = (yyvsp[-1].node);
15293 /*% %*/
15294 /*% ripper: mlhs_paren!($2) %*/
15295 }
15296#line 15292 "parse.c"
15297 break;
15298
15299 case 711: /* f_arg: f_arg ',' f_arg_item */
15300#line 5719 "parse.y"
15301 {
15302 /*%%%*/
15303 (yyval.node) = (yyvsp[-2].node);
15304 (yyval.node)->nd_plen++;
15305 (yyval.node)->nd_next = block_append(p, (yyval.node)->nd_next, (yyvsp[0].node)->nd_next);
15306 rb_discard_node(p, (yyvsp[0].node));
15307 /*% %*/
15308 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15309 }
15310#line 15306 "parse.c"
15311 break;
15312
15313 case 712: /* f_label: "label" */
15314#line 5732 "parse.y"
15315 {
15316 arg_var(p, formal_argument(p, (yyvsp[0].id)));
15317 p->cur_arg = get_id((yyvsp[0].id));
15318 p->max_numparam = ORDINAL_PARAM;
15319 p->ctxt.in_argdef = 0;
15320 (yyval.id) = (yyvsp[0].id);
15321 }
15322#line 15318 "parse.c"
15323 break;
15324
15325 case 713: /* f_kw: f_label arg_value */
15326#line 5742 "parse.y"
15327 {
15328 p->cur_arg = 0;
15329 p->ctxt.in_argdef = 1;
15330 /*%%%*/
15331 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15332 /*% %*/
15333 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
15334 }
15335#line 15331 "parse.c"
15336 break;
15337
15338 case 714: /* f_kw: f_label */
15339#line 5751 "parse.y"
15340 {
15341 p->cur_arg = 0;
15342 p->ctxt.in_argdef = 1;
15343 /*%%%*/
15344 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
15345 /*% %*/
15346 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
15347 }
15348#line 15344 "parse.c"
15349 break;
15350
15351 case 715: /* f_block_kw: f_label primary_value */
15352#line 5762 "parse.y"
15353 {
15354 p->ctxt.in_argdef = 1;
15355 /*%%%*/
15356 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15357 /*% %*/
15358 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
15359 }
15360#line 15356 "parse.c"
15361 break;
15362
15363 case 716: /* f_block_kw: f_label */
15364#line 5770 "parse.y"
15365 {
15366 p->ctxt.in_argdef = 1;
15367 /*%%%*/
15368 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
15369 /*% %*/
15370 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
15371 }
15372#line 15368 "parse.c"
15373 break;
15374
15375 case 717: /* f_block_kwarg: f_block_kw */
15376#line 5780 "parse.y"
15377 {
15378 /*%%%*/
15379 (yyval.node) = (yyvsp[0].node);
15380 /*% %*/
15381 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15382 }
15383#line 15379 "parse.c"
15384 break;
15385
15386 case 718: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
15387#line 5787 "parse.y"
15388 {
15389 /*%%%*/
15390 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
15391 /*% %*/
15392 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15393 }
15394#line 15390 "parse.c"
15395 break;
15396
15397 case 719: /* f_kwarg: f_kw */
15398#line 5797 "parse.y"
15399 {
15400 /*%%%*/
15401 (yyval.node) = (yyvsp[0].node);
15402 /*% %*/
15403 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15404 }
15405#line 15401 "parse.c"
15406 break;
15407
15408 case 720: /* f_kwarg: f_kwarg ',' f_kw */
15409#line 5804 "parse.y"
15410 {
15411 /*%%%*/
15412 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
15413 /*% %*/
15414 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15415 }
15416#line 15412 "parse.c"
15417 break;
15418
15419 case 723: /* f_no_kwarg: p_kwnorest */
15420#line 5817 "parse.y"
15421 {
15422 /*%%%*/
15423 /*% %*/
15424 /*% ripper: nokw_param!(Qnil) %*/
15425 }
15426#line 15422 "parse.c"
15427 break;
15428
15429 case 724: /* f_kwrest: kwrest_mark "local variable or method" */
15430#line 5825 "parse.y"
15431 {
15432 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
15433 /*%%%*/
15434 (yyval.id) = (yyvsp[0].id);
15435 /*% %*/
15436 /*% ripper: kwrest_param!($2) %*/
15437 }
15438#line 15434 "parse.c"
15439 break;
15440
15441 case 725: /* f_kwrest: kwrest_mark */
15442#line 5833 "parse.y"
15443 {
15444 arg_var(p, idFWD_KWREST);
15445 /*%%%*/
15446 (yyval.id) = idFWD_KWREST;
15447 /*% %*/
15448 /*% ripper: kwrest_param!(Qnil) %*/
15449 }
15450#line 15446 "parse.c"
15451 break;
15452
15453 case 726: /* f_opt: f_arg_asgn f_eq arg_value */
15454#line 5843 "parse.y"
15455 {
15456 p->cur_arg = 0;
15457 p->ctxt.in_argdef = 1;
15458 /*%%%*/
15459 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15460 /*% %*/
15461 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
15462 }
15463#line 15459 "parse.c"
15464 break;
15465
15466 case 727: /* f_block_opt: f_arg_asgn f_eq primary_value */
15467#line 5854 "parse.y"
15468 {
15469 p->cur_arg = 0;
15470 p->ctxt.in_argdef = 1;
15471 /*%%%*/
15472 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15473 /*% %*/
15474 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
15475 }
15476#line 15472 "parse.c"
15477 break;
15478
15479 case 728: /* f_block_optarg: f_block_opt */
15480#line 5865 "parse.y"
15481 {
15482 /*%%%*/
15483 (yyval.node) = (yyvsp[0].node);
15484 /*% %*/
15485 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15486 }
15487#line 15483 "parse.c"
15488 break;
15489
15490 case 729: /* f_block_optarg: f_block_optarg ',' f_block_opt */
15491#line 5872 "parse.y"
15492 {
15493 /*%%%*/
15494 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
15495 /*% %*/
15496 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15497 }
15498#line 15494 "parse.c"
15499 break;
15500
15501 case 730: /* f_optarg: f_opt */
15502#line 5881 "parse.y"
15503 {
15504 /*%%%*/
15505 (yyval.node) = (yyvsp[0].node);
15506 /*% %*/
15507 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15508 }
15509#line 15505 "parse.c"
15510 break;
15511
15512 case 731: /* f_optarg: f_optarg ',' f_opt */
15513#line 5888 "parse.y"
15514 {
15515 /*%%%*/
15516 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
15517 /*% %*/
15518 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15519 }
15520#line 15516 "parse.c"
15521 break;
15522
15523 case 734: /* f_rest_arg: restarg_mark "local variable or method" */
15524#line 5901 "parse.y"
15525 {
15526 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
15527 /*%%%*/
15528 (yyval.id) = (yyvsp[0].id);
15529 /*% %*/
15530 /*% ripper: rest_param!($2) %*/
15531 }
15532#line 15528 "parse.c"
15533 break;
15534
15535 case 735: /* f_rest_arg: restarg_mark */
15536#line 5909 "parse.y"
15537 {
15538 arg_var(p, idFWD_REST);
15539 /*%%%*/
15540 (yyval.id) = idFWD_REST;
15541 /*% %*/
15542 /*% ripper: rest_param!(Qnil) %*/
15543 }
15544#line 15540 "parse.c"
15545 break;
15546
15547 case 738: /* f_block_arg: blkarg_mark "local variable or method" */
15548#line 5923 "parse.y"
15549 {
15550 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
15551 /*%%%*/
15552 (yyval.id) = (yyvsp[0].id);
15553 /*% %*/
15554 /*% ripper: blockarg!($2) %*/
15555 }
15556#line 15552 "parse.c"
15557 break;
15558
15559 case 739: /* f_block_arg: blkarg_mark */
15560#line 5931 "parse.y"
15561 {
15562 arg_var(p, idFWD_BLOCK);
15563 /*%%%*/
15564 (yyval.id) = idFWD_BLOCK;
15565 /*% %*/
15566 /*% ripper: blockarg!(Qnil) %*/
15567 }
15568#line 15564 "parse.c"
15569 break;
15570
15571 case 740: /* opt_f_block_arg: ',' f_block_arg */
15572#line 5941 "parse.y"
15573 {
15574 (yyval.id) = (yyvsp[0].id);
15575 }
15576#line 15572 "parse.c"
15577 break;
15578
15579 case 741: /* opt_f_block_arg: none */
15580#line 5945 "parse.y"
15581 {
15582 (yyval.id) = Qnull;
15583 }
15584#line 15580 "parse.c"
15585 break;
15586
15587 case 742: /* singleton: var_ref */
15588#line 5951 "parse.y"
15589 {
15590 value_expr((yyvsp[0].node));
15591 (yyval.node) = (yyvsp[0].node);
15592 }
15593#line 15589 "parse.c"
15594 break;
15595
15596 case 743: /* $@51: %empty */
15597#line 5955 "parse.y"
15598 {SET_LEX_STATE(EXPR_BEG);}
15599#line 15595 "parse.c"
15600 break;
15601
15602 case 744: /* singleton: '(' $@51 expr rparen */
15603#line 5956 "parse.y"
15604 {
15605 /*%%%*/
15606 switch (nd_type((yyvsp[-1].node))) {
15607 case NODE_STR:
15608 case NODE_DSTR:
15609 case NODE_XSTR:
15610 case NODE_DXSTR:
15611 case NODE_DREGX:
15612 case NODE_LIT:
15613 case NODE_LIST:
15614 case NODE_ZLIST:
15615 yyerror1(&(yylsp[-1]), "can't define singleton method for literals");
15616 break;
15617 default:
15618 value_expr((yyvsp[-1].node));
15619 break;
15620 }
15621 (yyval.node) = (yyvsp[-1].node);
15622 /*% %*/
15623 /*% ripper: paren!($3) %*/
15624 }
15625#line 15621 "parse.c"
15626 break;
15627
15628 case 746: /* assoc_list: assocs trailer */
15629#line 5981 "parse.y"
15630 {
15631 /*%%%*/
15632 (yyval.node) = (yyvsp[-1].node);
15633 /*% %*/
15634 /*% ripper: assoclist_from_args!($1) %*/
15635 }
15636#line 15632 "parse.c"
15637 break;
15638
15639 case 748: /* assocs: assocs ',' assoc */
15640#line 5992 "parse.y"
15641 {
15642 /*%%%*/
15643 NODE *assocs = (yyvsp[-2].node);
15644 NODE *tail = (yyvsp[0].node);
15645 if (!assocs) {
15646 assocs = tail;
15647 }
15648 else if (tail) {
15649 if (assocs->nd_head &&
15650 !tail->nd_head && nd_type_p(tail->nd_next, NODE_LIST) &&
15651 nd_type_p(tail->nd_next->nd_head, NODE_HASH)) {
15652 /* DSTAR */
15653 tail = tail->nd_next->nd_head->nd_head;
15654 }
15655 assocs = list_concat(assocs, tail);
15656 }
15657 (yyval.node) = assocs;
15658 /*% %*/
15659 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15660 }
15661#line 15657 "parse.c"
15662 break;
15663
15664 case 749: /* assoc: arg_value "=>" arg_value */
15665#line 6015 "parse.y"
15666 {
15667 /*%%%*/
15668 if (nd_type_p((yyvsp[-2].node), NODE_STR)) {
15669 nd_set_type((yyvsp[-2].node), NODE_LIT);
15670 RB_OBJ_WRITE(p->ast, &(yyvsp[-2].node)->nd_lit, rb_fstring((yyvsp[-2].node)->nd_lit));
15671 }
15672 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
15673 /*% %*/
15674 /*% ripper: assoc_new!($1, $3) %*/
15675 }
15676#line 15672 "parse.c"
15677 break;
15678
15679 case 750: /* assoc: "label" arg_value */
15680#line 6026 "parse.y"
15681 {
15682 /*%%%*/
15683 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
15684 /*% %*/
15685 /*% ripper: assoc_new!($1, $2) %*/
15686 }
15687#line 15683 "parse.c"
15688 break;
15689
15690 case 751: /* assoc: "label" */
15691#line 6033 "parse.y"
15692 {
15693 /*%%%*/
15694 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
15695 if (!val) val = NEW_BEGIN(0, &(yyloc));
15696 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
15697 /*% %*/
15698 /*% ripper: assoc_new!($1, Qnil) %*/
15699 }
15700#line 15696 "parse.c"
15701 break;
15702
15703 case 752: /* assoc: "string literal" string_contents tLABEL_END arg_value */
15704#line 6042 "parse.y"
15705 {
15706 /*%%%*/
15707 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
15708 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
15709 /*% %*/
15710 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
15711 }
15712#line 15708 "parse.c"
15713 break;
15714
15715 case 753: /* assoc: "**arg" arg_value */
15716#line 6050 "parse.y"
15717 {
15718 /*%%%*/
15719 if (nd_type_p((yyvsp[0].node), NODE_HASH) &&
15720 !((yyvsp[0].node)->nd_head && (yyvsp[0].node)->nd_head->nd_alen)) {
15721 static VALUE empty_hash;
15722 if (!empty_hash) {
15723 empty_hash = rb_obj_freeze(rb_hash_new());
15724 rb_gc_register_mark_object(empty_hash);
15725 }
15726 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
15727 }
15728 else
15729 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
15730 /*% %*/
15731 /*% ripper: assoc_splat!($2) %*/
15732 }
15733#line 15729 "parse.c"
15734 break;
15735
15736 case 754: /* assoc: "**arg" */
15737#line 6067 "parse.y"
15738 {
15739 if (!local_id(p, idFWD_KWREST) ||
15740 local_id(p, idFWD_ALL)) {
15741 compile_error(p, "no anonymous keyword rest parameter");
15742 }
15743 /*%%%*/
15744 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)),
15745 NEW_LVAR(idFWD_KWREST, &(yyloc)));
15746 /*% %*/
15747 /*% ripper: assoc_splat!(Qnil) %*/
15748 }
15749#line 15745 "parse.c"
15750 break;
15751
15752 case 778: /* term: ';' */
15753#line 6127 "parse.y"
15754 {yyerrok;token_flush(p);}
15755#line 15751 "parse.c"
15756 break;
15757
15758 case 779: /* term: '\n' */
15759#line 6129 "parse.y"
15760 {
15761 (yyloc).end_pos = (yyloc).beg_pos;
15762 token_flush(p);
15763 }
15764#line 15760 "parse.c"
15765 break;
15766
15767 case 781: /* terms: terms ';' */
15768#line 6136 "parse.y"
15769 {yyerrok;}
15770#line 15766 "parse.c"
15771 break;
15772
15773 case 782: /* none: %empty */
15774#line 6140 "parse.y"
15775 {
15776 (yyval.node) = Qnull;
15777 }
15778#line 15774 "parse.c"
15779 break;
15780
15781
15782#line 15778 "parse.c"
15783
15784 default: break;
15785 }
15786 /* User semantic actions sometimes alter yychar, and that requires
15787 that yytoken be updated with the new translation. We take the
15788 approach of translating immediately before every use of yytoken.
15789 One alternative is translating here after every semantic action,
15790 but that translation would be missed if the semantic action invokes
15791 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
15792 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
15793 incorrect destructor might then be invoked immediately. In the
15794 case of YYERROR or YYBACKUP, subsequent parser actions might lead
15795 to an incorrect destructor call or verbose syntax error message
15796 before the lookahead is translated. */
15797 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
15798
15799 YYPOPSTACK (yylen);
15800 yylen = 0;
15801
15802 *++yyvsp = yyval;
15803 *++yylsp = yyloc;
15804
15805 /* Now 'shift' the result of the reduction. Determine what state
15806 that goes to, based on the state we popped back to and the rule
15807 number reduced by. */
15808 {
15809 const int yylhs = yyr1[yyn] - YYNTOKENS;
15810 const int yyi = yypgoto[yylhs] + *yyssp;
15811 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
15812 ? yytable[yyi]
15813 : yydefgoto[yylhs]);
15814 }
15815
15816 goto yynewstate;
15817
15818
15819/*--------------------------------------.
15820| yyerrlab -- here on detecting error. |
15821`--------------------------------------*/
15822yyerrlab:
15823 /* Make sure we have latest lookahead translation. See comments at
15824 user semantic actions for why this is necessary. */
15825 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
15826 /* If not already recovering from an error, report this error. */
15827 if (!yyerrstatus)
15828 {
15829 ++yynerrs;
15830 {
15831 yypcontext_t yyctx
15832 = {yyssp, yytoken, &yylloc};
15833 char const *yymsgp = YY_("syntax error");
15834 int yysyntax_error_status;
15835 yysyntax_error_status = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
15836 if (yysyntax_error_status == 0)
15837 yymsgp = yymsg;
15838 else if (yysyntax_error_status == -1)
15839 {
15840 if (yymsg != yymsgbuf)
15841 YYSTACK_FREE (yymsg);
15842 yymsg = YY_CAST (char *,
15843 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
15844 if (yymsg)
15845 {
15846 yysyntax_error_status
15847 = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
15848 yymsgp = yymsg;
15849 }
15850 else
15851 {
15852 yymsg = yymsgbuf;
15853 yymsg_alloc = sizeof yymsgbuf;
15854 yysyntax_error_status = YYENOMEM;
15855 }
15856 }
15857 yyerror (&yylloc, p, yymsgp);
15858 if (yysyntax_error_status == YYENOMEM)
15859 YYNOMEM;
15860 }
15861 }
15862
15863 yyerror_range[1] = yylloc;
15864 if (yyerrstatus == 3)
15865 {
15866 /* If just tried and failed to reuse lookahead token after an
15867 error, discard it. */
15868
15869 if (yychar <= END_OF_INPUT)
15870 {
15871 /* Return failure if at end of input. */
15872 if (yychar == END_OF_INPUT)
15873 YYABORT;
15874 }
15875 else
15876 {
15877 yydestruct ("Error: discarding",
15878 yytoken, &yylval, &yylloc, p);
15879 yychar = YYEMPTY;
15880 }
15881 }
15882
15883 /* Else will try to reuse lookahead token after shifting the error
15884 token. */
15885 goto yyerrlab1;
15886
15887
15888/*---------------------------------------------------.
15889| yyerrorlab -- error raised explicitly by YYERROR. |
15890`---------------------------------------------------*/
15891yyerrorlab:
15892 /* Pacify compilers when the user code never invokes YYERROR and the
15893 label yyerrorlab therefore never appears in user code. */
15894 if (0)
15895 YYERROR;
15896 ++yynerrs;
15897
15898 /* Do not reclaim the symbols of the rule whose action triggered
15899 this YYERROR. */
15900 YYPOPSTACK (yylen);
15901 yylen = 0;
15902 YY_STACK_PRINT (yyss, yyssp);
15903 yystate = *yyssp;
15904 goto yyerrlab1;
15905
15906
15907/*-------------------------------------------------------------.
15908| yyerrlab1 -- common code for both syntax error and YYERROR. |
15909`-------------------------------------------------------------*/
15910yyerrlab1:
15911 yyerrstatus = 3; /* Each real token shifted decrements this. */
15912
15913 /* Pop stack until we find a state that shifts the error token. */
15914 for (;;)
15915 {
15916 yyn = yypact[yystate];
15917 if (!yypact_value_is_default (yyn))
15918 {
15919 yyn += YYSYMBOL_YYerror;
15920 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
15921 {
15922 yyn = yytable[yyn];
15923 if (0 < yyn)
15924 break;
15925 }
15926 }
15927
15928 /* Pop the current state because it cannot handle the error token. */
15929 if (yyssp == yyss)
15930 YYABORT;
15931
15932 yyerror_range[1] = *yylsp;
15933 yydestruct ("Error: popping",
15934 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
15935 YYPOPSTACK (1);
15936 yystate = *yyssp;
15937 YY_STACK_PRINT (yyss, yyssp);
15938 }
15939
15940 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
15941 *++yyvsp = yylval;
15942 YY_IGNORE_MAYBE_UNINITIALIZED_END
15943
15944 yyerror_range[2] = yylloc;
15945 ++yylsp;
15946 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
15947
15948 /* Shift the error token. */
15949 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
15950
15951 yystate = yyn;
15952 goto yynewstate;
15953
15954
15955/*-------------------------------------.
15956| yyacceptlab -- YYACCEPT comes here. |
15957`-------------------------------------*/
15958yyacceptlab:
15959 yyresult = 0;
15960 goto yyreturnlab;
15961
15962
15963/*-----------------------------------.
15964| yyabortlab -- YYABORT comes here. |
15965`-----------------------------------*/
15966yyabortlab:
15967 yyresult = 1;
15968 goto yyreturnlab;
15969
15970
15971/*-----------------------------------------------------------.
15972| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
15973`-----------------------------------------------------------*/
15974yyexhaustedlab:
15975 yyerror (&yylloc, p, YY_("memory exhausted"));
15976 yyresult = 2;
15977 goto yyreturnlab;
15978
15979
15980/*----------------------------------------------------------.
15981| yyreturnlab -- parsing is finished, clean up and return. |
15982`----------------------------------------------------------*/
15983yyreturnlab:
15984 if (yychar != YYEMPTY)
15985 {
15986 /* Make sure we have latest lookahead translation. See comments at
15987 user semantic actions for why this is necessary. */
15988 yytoken = YYTRANSLATE (yychar);
15989 yydestruct ("Cleanup: discarding lookahead",
15990 yytoken, &yylval, &yylloc, p);
15991 }
15992 /* Do not reclaim the symbols of the rule whose action triggered
15993 this YYABORT or YYACCEPT. */
15994 YYPOPSTACK (yylen);
15995 YY_STACK_PRINT (yyss, yyssp);
15996 while (yyssp != yyss)
15997 {
15998 yydestruct ("Cleanup: popping",
15999 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
16000 YYPOPSTACK (1);
16001 }
16002#ifndef yyoverflow
16003 if (yyss != yyssa)
16004 YYSTACK_FREE (yyss);
16005#endif
16006 if (yymsg != yymsgbuf)
16007 YYSTACK_FREE (yymsg);
16008 return yyresult;
16009}
16010
16011#line 6144 "parse.y"
16012
16013# undef p
16014# undef yylex
16015# undef yylval
16016# define yylval (*p->lval)
16017
16018static int regx_options(struct parser_params*);
16019static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
16020static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
16021static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
16022static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
16023
16024#ifndef RIPPER
16025# define set_yylval_node(x) { \
16026 YYLTYPE _cur_loc; \
16027 rb_parser_set_location(p, &_cur_loc); \
16028 yylval.node = (x); \
16029}
16030# define set_yylval_str(x) \
16031do { \
16032 set_yylval_node(NEW_STR(x, &_cur_loc)); \
16033 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16034} while(0)
16035# define set_yylval_literal(x) \
16036do { \
16037 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
16038 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16039} while(0)
16040# define set_yylval_num(x) (yylval.num = (x))
16041# define set_yylval_id(x) (yylval.id = (x))
16042# define set_yylval_name(x) (yylval.id = (x))
16043# define yylval_id() (yylval.id)
16044#else
16045static inline VALUE
16046ripper_yylval_id(struct parser_params *p, ID x)
16047{
16048 return ripper_new_yylval(p, x, ID2SYM(x), 0);
16049}
16050# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
16051# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
16052# define set_yylval_id(x) (void)(x)
16053# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
16054# define set_yylval_literal(x) add_mark_object(p, (x))
16055# define set_yylval_node(x) (yylval.val = ripper_new_yylval(p, 0, 0, STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)))
16056# define yylval_id() yylval.id
16057# define _cur_loc NULL_LOC /* dummy */
16058#endif
16059
16060#define set_yylval_noname() set_yylval_id(keyword_nil)
16061#define has_delayed_token(p) (!NIL_P(p->delayed.token))
16062
16063#ifndef RIPPER
16064#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
16065#define dispatch_scan_event(p, t) parser_dispatch_scan_event(p, t, __LINE__)
16066
16067static bool
16068parser_has_token(struct parser_params *p)
16069{
16070 if (p->keep_tokens && (p->lex.pcur < p->lex.ptok)) rb_bug("lex.pcur < lex.ptok. (line: %d) %ld|%ld|%ld", p->ruby_sourceline, p->lex.ptok - p->lex.pbeg, p->lex.pcur - p->lex.ptok, p->lex.pend - p->lex.pcur);
16071 return p->lex.pcur > p->lex.ptok;
16072}
16073
16074static VALUE
16075code_loc_to_ary(const rb_code_location_t *loc)
16076{
16077 VALUE ary = rb_ary_new_from_args(4,
16078 INT2NUM(loc->beg_pos.lineno), INT2NUM(loc->beg_pos.column),
16079 INT2NUM(loc->end_pos.lineno), INT2NUM(loc->end_pos.column));
16080 rb_obj_freeze(ary);
16081
16082 return ary;
16083}
16084
16085static void
16086parser_append_tokens(struct parser_params *p, VALUE str, enum yytokentype t, int line)
16087{
16088 VALUE ary;
16089 int token_id;
16090
16091 ary = rb_ary_new2(4);
16092 token_id = p->token_id;
16093 rb_ary_push(ary, INT2FIX(token_id));
16094 rb_ary_push(ary, ID2SYM(parser_token2id(t)));
16095 rb_ary_push(ary, str);
16096 rb_ary_push(ary, code_loc_to_ary(p->yylloc));
16097 rb_obj_freeze(ary);
16098 rb_ary_push(p->tokens, ary);
16099 p->token_id++;
16100
16101 if (p->debug) {
16102 rb_parser_printf(p, "Append tokens (line: %d) %"PRIsVALUE"\n", line, ary);
16103 }
16104}
16105
16106static void
16107parser_dispatch_scan_event(struct parser_params *p, enum yytokentype t, int line)
16108{
16109 debug_token_line(p, "parser_dispatch_scan_event", line);
16110
16111 if (!parser_has_token(p)) return;
16112
16113 RUBY_SET_YYLLOC(*p->yylloc);
16114
16115 if (p->keep_tokens) {
16116 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16117 parser_append_tokens(p, str, t, line);
16118 }
16119
16120 token_flush(p);
16121}
16122
16123#define dispatch_delayed_token(p, t) parser_dispatch_delayed_token(p, t, __LINE__)
16124static void
16125parser_dispatch_delayed_token(struct parser_params *p, enum yytokentype t, int line)
16126{
16127 int saved_line = p->ruby_sourceline;
16128 const char *saved_tokp = p->lex.ptok;
16129
16130 debug_token_line(p, "parser_dispatch_delayed_token", line);
16131
16132 if (!has_delayed_token(p)) return;
16133
16134 RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(*p->yylloc);
16135
16136 if (p->keep_tokens) {
16137 p->ruby_sourceline = p->delayed.beg_line;
16138 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
16139 parser_append_tokens(p, p->delayed.token, t, line);
16140 p->ruby_sourceline = saved_line;
16141 p->lex.ptok = saved_tokp;
16142 }
16143
16144 p->delayed.token = Qnil;
16145}
16146#else
16147#define literal_flush(p, ptr) ((void)(ptr))
16148
16149#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val))
16150
16151static inline VALUE
16152intern_sym(const char *name)
16153{
16154 ID id = rb_intern_const(name);
16155 return ID2SYM(id);
16156}
16157
16158static int
16159ripper_has_scan_event(struct parser_params *p)
16160{
16161 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
16162 return p->lex.pcur > p->lex.ptok;
16163}
16164
16165static VALUE
16166ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
16167{
16168 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16169 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
16170 RUBY_SET_YYLLOC(*p->yylloc);
16171 token_flush(p);
16172 return rval;
16173}
16174
16175static void
16176ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
16177{
16178 if (!ripper_has_scan_event(p)) return;
16179 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
16180}
16181#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
16182
16183static void
16184ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
16185{
16186 int saved_line = p->ruby_sourceline;
16187 const char *saved_tokp = p->lex.ptok;
16188
16189 if (!has_delayed_token(p)) return;
16190 p->ruby_sourceline = p->delayed.beg_line;
16191 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
16192 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
16193 p->delayed.token = Qnil;
16194 p->ruby_sourceline = saved_line;
16195 p->lex.ptok = saved_tokp;
16196}
16197#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
16198#endif /* RIPPER */
16199
16200static inline int
16201is_identchar(const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
16202{
16203 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
16204}
16205
16206static inline int
16207parser_is_identchar(struct parser_params *p)
16208{
16209 return !(p)->eofp && is_identchar(p->lex.pcur-1, p->lex.pend, p->enc);
16210}
16211
16212static inline int
16213parser_isascii(struct parser_params *p)
16214{
16215 return ISASCII(*(p->lex.pcur-1));
16216}
16217
16218static void
16219token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
16220{
16221 int column = 1, nonspc = 0, i;
16222 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
16223 if (*ptr == '\t') {
16224 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
16225 }
16226 column++;
16227 if (*ptr != ' ' && *ptr != '\t') {
16228 nonspc = 1;
16229 }
16230 }
16231
16232 ptinfo->beg = loc->beg_pos;
16233 ptinfo->indent = column;
16234 ptinfo->nonspc = nonspc;
16235}
16236
16237static void
16238token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
16239{
16240 token_info *ptinfo;
16241
16242 if (!p->token_info_enabled) return;
16243 ptinfo = ALLOC(token_info);
16244 ptinfo->token = token;
16245 ptinfo->next = p->token_info;
16246 token_info_setup(ptinfo, p->lex.pbeg, loc);
16247
16248 p->token_info = ptinfo;
16249}
16250
16251static void
16252token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
16253{
16254 token_info *ptinfo_beg = p->token_info;
16255
16256 if (!ptinfo_beg) return;
16257 p->token_info = ptinfo_beg->next;
16258
16259 /* indentation check of matched keywords (begin..end, if..end, etc.) */
16260 token_info_warn(p, token, ptinfo_beg, 1, loc);
16261 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
16262}
16263
16264static void
16265token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
16266{
16267 token_info *ptinfo_beg = p->token_info;
16268
16269 if (!ptinfo_beg) return;
16270 p->token_info = ptinfo_beg->next;
16271
16272 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
16273 ptinfo_beg->beg.column != beg_pos.column ||
16274 strcmp(ptinfo_beg->token, token)) {
16275 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
16276 beg_pos.lineno, beg_pos.column, token,
16277 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
16278 ptinfo_beg->token);
16279 }
16280
16281 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
16282}
16283
16284static void
16285token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
16286{
16287 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
16288 if (!p->token_info_enabled) return;
16289 if (!ptinfo_beg) return;
16290 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
16291 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
16292 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
16293 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
16294 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
16295 rb_warn3L(ptinfo_end->beg.lineno,
16296 "mismatched indentations at '%s' with '%s' at %d",
16297 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
16298}
16299
16300static int
16301parser_precise_mbclen(struct parser_params *p, const char *ptr)
16302{
16303 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
16304 if (!MBCLEN_CHARFOUND_P(len)) {
16305 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
16306 return -1;
16307 }
16308 return len;
16309}
16310
16311#ifndef RIPPER
16312static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
16313
16314static inline void
16315parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
16316{
16317 VALUE str;
16318 int lineno = p->ruby_sourceline;
16319 if (!yylloc) {
16320 return;
16321 }
16322 else if (yylloc->beg_pos.lineno == lineno) {
16323 str = p->lex.lastline;
16324 }
16325 else {
16326 return;
16327 }
16328 ruby_show_error_line(p->error_buffer, yylloc, lineno, str);
16329}
16330
16331static int
16332parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
16333{
16334#if 0
16335 YYLTYPE current;
16336
16337 if (!yylloc) {
16338 yylloc = RUBY_SET_YYLLOC(current);
16339 }
16340 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
16341 p->ruby_sourceline != yylloc->end_pos.lineno)) {
16342 yylloc = 0;
16343 }
16344#endif
16345 compile_error(p, "%s", msg);
16346 parser_show_error_line(p, yylloc);
16347 return 0;
16348}
16349
16350static int
16351parser_yyerror0(struct parser_params *p, const char *msg)
16352{
16353 YYLTYPE current;
16354 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
16355}
16356
16357static void
16358ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
16359{
16360 VALUE mesg;
16361 const int max_line_margin = 30;
16362 const char *ptr, *ptr_end, *pt, *pb;
16363 const char *pre = "", *post = "", *pend;
16364 const char *code = "", *caret = "";
16365 const char *lim;
16366 const char *const pbeg = RSTRING_PTR(str);
16367 char *buf;
16368 long len;
16369 int i;
16370
16371 if (!yylloc) return;
16372 pend = RSTRING_END(str);
16373 if (pend > pbeg && pend[-1] == '\n') {
16374 if (--pend > pbeg && pend[-1] == '\r') --pend;
16375 }
16376
16377 pt = pend;
16378 if (lineno == yylloc->end_pos.lineno &&
16379 (pend - pbeg) > yylloc->end_pos.column) {
16380 pt = pbeg + yylloc->end_pos.column;
16381 }
16382
16383 ptr = ptr_end = pt;
16384 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
16385 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
16386
16387 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
16388 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
16389
16390 len = ptr_end - ptr;
16391 if (len > 4) {
16392 if (ptr > pbeg) {
16393 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
16394 if (ptr > pbeg) pre = "...";
16395 }
16396 if (ptr_end < pend) {
16397 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
16398 if (ptr_end < pend) post = "...";
16399 }
16400 }
16401 pb = pbeg;
16402 if (lineno == yylloc->beg_pos.lineno) {
16403 pb += yylloc->beg_pos.column;
16404 if (pb > pt) pb = pt;
16405 }
16406 if (pb < ptr) pb = ptr;
16407 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
16408 return;
16409 }
16410 if (RTEST(errbuf)) {
16411 mesg = rb_attr_get(errbuf, idMesg);
16412 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
16413 rb_str_cat_cstr(mesg, "\n");
16414 }
16415 else {
16416 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
16417 }
16418 if (!errbuf && rb_stderr_tty_p()) {
16419#define CSI_BEGIN "\033["
16420#define CSI_SGR "m"
16421 rb_str_catf(mesg,
16422 CSI_BEGIN""CSI_SGR"%s" /* pre */
16423 CSI_BEGIN"1"CSI_SGR"%.*s"
16424 CSI_BEGIN"1;4"CSI_SGR"%.*s"
16425 CSI_BEGIN";1"CSI_SGR"%.*s"
16426 CSI_BEGIN""CSI_SGR"%s" /* post */
16427 "\n",
16428 pre,
16429 (int)(pb - ptr), ptr,
16430 (int)(pt - pb), pb,
16431 (int)(ptr_end - pt), pt,
16432 post);
16433 }
16434 else {
16435 char *p2;
16436
16437 len = ptr_end - ptr;
16438 lim = pt < pend ? pt : pend;
16439 i = (int)(lim - ptr);
16440 buf = ALLOCA_N(char, i+2);
16441 code = ptr;
16442 caret = p2 = buf;
16443 if (ptr <= pb) {
16444 while (ptr < pb) {
16445 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
16446 }
16447 *p2++ = '^';
16448 ptr++;
16449 }
16450 if (lim > ptr) {
16451 memset(p2, '~', (lim - ptr));
16452 p2 += (lim - ptr);
16453 }
16454 *p2 = '\0';
16455 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
16456 pre, (int)len, code, post,
16457 pre, caret);
16458 }
16459 if (!errbuf) rb_write_error_str(mesg);
16460}
16461#else
16462static int
16463parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
16464{
16465 const char *pcur = 0, *ptok = 0;
16466 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
16467 p->ruby_sourceline == yylloc->end_pos.lineno) {
16468 pcur = p->lex.pcur;
16469 ptok = p->lex.ptok;
16470 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
16471 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
16472 }
16473 parser_yyerror0(p, msg);
16474 if (pcur) {
16475 p->lex.ptok = ptok;
16476 p->lex.pcur = pcur;
16477 }
16478 return 0;
16479}
16480
16481static int
16482parser_yyerror0(struct parser_params *p, const char *msg)
16483{
16484 dispatch1(parse_error, STR_NEW2(msg));
16485 ripper_error(p);
16486 return 0;
16487}
16488
16489static inline void
16490parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
16491{
16492}
16493#endif /* !RIPPER */
16494
16495#ifndef RIPPER
16496static int
16497vtable_size(const struct vtable *tbl)
16498{
16499 if (!DVARS_TERMINAL_P(tbl)) {
16500 return tbl->pos;
16501 }
16502 else {
16503 return 0;
16504 }
16505}
16506#endif
16507
16508static struct vtable *
16509vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
16510{
16511 struct vtable *tbl = ALLOC(struct vtable);
16512 tbl->pos = 0;
16513 tbl->capa = 8;
16514 tbl->tbl = ALLOC_N(ID, tbl->capa);
16515 tbl->prev = prev;
16516#ifndef RIPPER
16517 if (p->debug) {
16518 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
16519 }
16520#endif
16521 return tbl;
16522}
16523#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
16524
16525static void
16526vtable_free_gen(struct parser_params *p, int line, const char *name,
16527 struct vtable *tbl)
16528{
16529#ifndef RIPPER
16530 if (p->debug) {
16531 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
16532 }
16533#endif
16534 if (!DVARS_TERMINAL_P(tbl)) {
16535 if (tbl->tbl) {
16536 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
16537 }
16538 ruby_sized_xfree(tbl, sizeof(*tbl));
16539 }
16540}
16541#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
16542
16543static void
16544vtable_add_gen(struct parser_params *p, int line, const char *name,
16545 struct vtable *tbl, ID id)
16546{
16547#ifndef RIPPER
16548 if (p->debug) {
16549 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
16550 line, name, (void *)tbl, rb_id2name(id));
16551 }
16552#endif
16553 if (DVARS_TERMINAL_P(tbl)) {
16554 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
16555 return;
16556 }
16557 if (tbl->pos == tbl->capa) {
16558 tbl->capa = tbl->capa * 2;
16559 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
16560 }
16561 tbl->tbl[tbl->pos++] = id;
16562}
16563#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
16564
16565#ifndef RIPPER
16566static void
16567vtable_pop_gen(struct parser_params *p, int line, const char *name,
16568 struct vtable *tbl, int n)
16569{
16570 if (p->debug) {
16571 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
16572 line, name, (void *)tbl, n);
16573 }
16574 if (tbl->pos < n) {
16575 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
16576 return;
16577 }
16578 tbl->pos -= n;
16579}
16580#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
16581#endif
16582
16583static int
16584vtable_included(const struct vtable * tbl, ID id)
16585{
16586 int i;
16587
16588 if (!DVARS_TERMINAL_P(tbl)) {
16589 for (i = 0; i < tbl->pos; i++) {
16590 if (tbl->tbl[i] == id) {
16591 return i+1;
16592 }
16593 }
16594 }
16595 return 0;
16596}
16597
16598static void parser_prepare(struct parser_params *p);
16599
16600#ifndef RIPPER
16601static NODE *parser_append_options(struct parser_params *p, NODE *node);
16602
16603static VALUE
16604debug_lines(VALUE fname)
16605{
16606 ID script_lines;
16607 CONST_ID(script_lines, "SCRIPT_LINES__");
16608 if (rb_const_defined_at(rb_cObject, script_lines)) {
16609 VALUE hash = rb_const_get_at(rb_cObject, script_lines);
16610 if (RB_TYPE_P(hash, T_HASH)) {
16611 VALUE lines = rb_ary_new();
16612 rb_hash_aset(hash, fname, lines);
16613 return lines;
16614 }
16615 }
16616 return 0;
16617}
16618
16619static int
16620e_option_supplied(struct parser_params *p)
16621{
16622 return strcmp(p->ruby_sourcefile, "-e") == 0;
16623}
16624
16625static VALUE
16626yycompile0(VALUE arg)
16627{
16628 int n;
16629 NODE *tree;
16630 struct parser_params *p = (struct parser_params *)arg;
16631 VALUE cov = Qfalse;
16632
16633 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string)) {
16634 p->debug_lines = debug_lines(p->ruby_sourcefile_string);
16635 if (p->debug_lines && p->ruby_sourceline > 0) {
16636 VALUE str = rb_default_rs;
16637 n = p->ruby_sourceline;
16638 do {
16639 rb_ary_push(p->debug_lines, str);
16640 } while (--n);
16641 }
16642
16643 if (!e_option_supplied(p)) {
16644 cov = Qtrue;
16645 }
16646 }
16647
16648 if (p->keep_script_lines || ruby_vm_keep_script_lines) {
16649 if (!p->debug_lines) {
16650 p->debug_lines = rb_ary_new();
16651 }
16652
16653 RB_OBJ_WRITE(p->ast, &p->ast->body.script_lines, p->debug_lines);
16654 }
16655
16656 parser_prepare(p);
16657#define RUBY_DTRACE_PARSE_HOOK(name) \
16658 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
16659 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
16660 }
16661 RUBY_DTRACE_PARSE_HOOK(BEGIN);
16662 n = yyparse(p);
16663 RUBY_DTRACE_PARSE_HOOK(END);
16664 p->debug_lines = 0;
16665
16666 p->lex.strterm = 0;
16667 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
16668 if (n || p->error_p) {
16669 VALUE mesg = p->error_buffer;
16670 if (!mesg) {
16672 }
16673 if (!p->error_tolerant) {
16674 rb_set_errinfo(mesg);
16675 return FALSE;
16676 }
16677 }
16678 tree = p->eval_tree;
16679 if (!tree) {
16680 tree = NEW_NIL(&NULL_LOC);
16681 }
16682 else {
16683 VALUE opt = p->compile_option;
16684 VALUE tokens = p->tokens;
16685 NODE *prelude;
16686 NODE *body = parser_append_options(p, tree->nd_body);
16687 if (!opt) opt = rb_obj_hide(rb_ident_hash_new());
16688 rb_hash_aset(opt, rb_sym_intern_ascii_cstr("coverage_enabled"), cov);
16689 prelude = block_append(p, p->eval_tree_begin, body);
16690 tree->nd_body = prelude;
16691 RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt);
16692 if (p->keep_tokens) {
16693 rb_obj_freeze(tokens);
16694 rb_ast_set_tokens(p->ast, tokens);
16695 }
16696 }
16697 p->ast->body.root = tree;
16698 if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count);
16699 return TRUE;
16700}
16701
16702static rb_ast_t *
16703yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line)
16704{
16705 rb_ast_t *ast;
16706 if (NIL_P(fname)) {
16707 p->ruby_sourcefile_string = Qnil;
16708 p->ruby_sourcefile = "(none)";
16709 }
16710 else {
16711 p->ruby_sourcefile_string = rb_fstring(fname);
16712 p->ruby_sourcefile = StringValueCStr(fname);
16713 }
16714 p->ruby_sourceline = line - 1;
16715
16716 p->lvtbl = NULL;
16717
16718 p->ast = ast = rb_ast_new();
16719 rb_suppress_tracing(yycompile0, (VALUE)p);
16720 p->ast = 0;
16721 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
16722
16723 while (p->lvtbl) {
16724 local_pop(p);
16725 }
16726
16727 return ast;
16728}
16729#endif /* !RIPPER */
16730
16731static rb_encoding *
16732must_be_ascii_compatible(VALUE s)
16733{
16734 rb_encoding *enc = rb_enc_get(s);
16735 if (!rb_enc_asciicompat(enc)) {
16736 rb_raise(rb_eArgError, "invalid source encoding");
16737 }
16738 return enc;
16739}
16740
16741static VALUE
16742lex_get_str(struct parser_params *p, VALUE s)
16743{
16744 char *beg, *end, *start;
16745 long len;
16746
16747 beg = RSTRING_PTR(s);
16748 len = RSTRING_LEN(s);
16749 start = beg;
16750 if (p->lex.gets_.ptr) {
16751 if (len == p->lex.gets_.ptr) return Qnil;
16752 beg += p->lex.gets_.ptr;
16753 len -= p->lex.gets_.ptr;
16754 }
16755 end = memchr(beg, '\n', len);
16756 if (end) len = ++end - beg;
16757 p->lex.gets_.ptr += len;
16758 return rb_str_subseq(s, beg - start, len);
16759}
16760
16761static VALUE
16762lex_getline(struct parser_params *p)
16763{
16764 VALUE line = (*p->lex.gets)(p, p->lex.input);
16765 if (NIL_P(line)) return line;
16766 must_be_ascii_compatible(line);
16767 if (RB_OBJ_FROZEN(line)) line = rb_str_dup(line); // needed for RubyVM::AST.of because script_lines in iseq is deep-frozen
16768 p->line_count++;
16769 return line;
16770}
16771
16772static const rb_data_type_t parser_data_type;
16773
16774#ifndef RIPPER
16775static rb_ast_t*
16776parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
16777{
16778 struct parser_params *p;
16779
16780 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
16781
16782 p->lex.gets = lex_get_str;
16783 p->lex.gets_.ptr = 0;
16784 p->lex.input = rb_str_new_frozen(s);
16785 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
16786
16787 return yycompile(vparser, p, fname, line);
16788}
16789
16790rb_ast_t*
16791rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
16792{
16793 return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);
16794}
16795
16796rb_ast_t*
16797rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
16798{
16799 must_be_ascii_compatible(s);
16800 return parser_compile_string(vparser, f, s, line);
16801}
16802
16803VALUE rb_io_gets_internal(VALUE io);
16804
16805static VALUE
16806lex_io_gets(struct parser_params *p, VALUE io)
16807{
16808 return rb_io_gets_internal(io);
16809}
16810
16811rb_ast_t*
16812rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
16813{
16814 struct parser_params *p;
16815
16816 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
16817
16818 p->lex.gets = lex_io_gets;
16819 p->lex.input = file;
16820 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
16821
16822 return yycompile(vparser, p, fname, start);
16823}
16824
16825static VALUE
16826lex_generic_gets(struct parser_params *p, VALUE input)
16827{
16828 return (*p->lex.gets_.call)(input, p->line_count);
16829}
16830
16831rb_ast_t*
16832rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
16833{
16834 struct parser_params *p;
16835
16836 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
16837
16838 p->lex.gets = lex_generic_gets;
16839 p->lex.gets_.call = lex_gets;
16840 p->lex.input = input;
16841 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
16842
16843 return yycompile(vparser, p, fname, start);
16844}
16845#endif /* !RIPPER */
16846
16847#define STR_FUNC_ESCAPE 0x01
16848#define STR_FUNC_EXPAND 0x02
16849#define STR_FUNC_REGEXP 0x04
16850#define STR_FUNC_QWORDS 0x08
16851#define STR_FUNC_SYMBOL 0x10
16852#define STR_FUNC_INDENT 0x20
16853#define STR_FUNC_LABEL 0x40
16854#define STR_FUNC_LIST 0x4000
16855#define STR_FUNC_TERM 0x8000
16856
16857enum string_type {
16858 str_label = STR_FUNC_LABEL,
16859 str_squote = (0),
16860 str_dquote = (STR_FUNC_EXPAND),
16861 str_xquote = (STR_FUNC_EXPAND),
16862 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
16863 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
16864 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
16865 str_ssym = (STR_FUNC_SYMBOL),
16866 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
16867};
16868
16869static VALUE
16870parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
16871{
16872 VALUE str;
16873
16874 str = rb_enc_str_new(ptr, len, enc);
16875 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
16876 if (is_ascii_string(str)) {
16877 }
16878 else if (rb_is_usascii_enc(enc0) && enc != rb_utf8_encoding()) {
16879 rb_enc_associate(str, rb_ascii8bit_encoding());
16880 }
16881 }
16882
16883 return str;
16884}
16885
16886#define peek(p,c) peek_n(p, (c), 0)
16887#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
16888#define peekc(p) peekc_n(p, 0)
16889#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
16890
16891static void
16892add_delayed_token(struct parser_params *p, const char *tok, const char *end, int line)
16893{
16894#ifndef RIPPER
16895 debug_token_line(p, "add_delayed_token", line);
16896#endif
16897
16898 if (tok < end) {
16899 if (!has_delayed_token(p)) {
16900 p->delayed.token = rb_str_buf_new(end - tok);
16901 rb_enc_associate(p->delayed.token, p->enc);
16902 p->delayed.beg_line = p->ruby_sourceline;
16903 p->delayed.beg_col = rb_long2int(tok - p->lex.pbeg);
16904 }
16905 rb_str_buf_cat(p->delayed.token, tok, end - tok);
16906 p->delayed.end_line = p->ruby_sourceline;
16907 p->delayed.end_col = rb_long2int(end - p->lex.pbeg);
16908 p->lex.ptok = end;
16909 }
16910}
16911
16912static int
16913nextline(struct parser_params *p, int set_encoding)
16914{
16915 VALUE v = p->lex.nextline;
16916 p->lex.nextline = 0;
16917 if (!v) {
16918 if (p->eofp)
16919 return -1;
16920
16921 if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
16922 goto end_of_input;
16923 }
16924
16925 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
16926 end_of_input:
16927 p->eofp = 1;
16928 lex_goto_eol(p);
16929 return -1;
16930 }
16931#ifndef RIPPER
16932 if (p->debug_lines) {
16933 if (set_encoding) rb_enc_associate(v, p->enc);
16934 rb_ary_push(p->debug_lines, v);
16935 }
16936#endif
16937 p->cr_seen = FALSE;
16938 }
16939 else if (NIL_P(v)) {
16940 /* after here-document without terminator */
16941 goto end_of_input;
16942 }
16943 add_delayed_token(p, p->lex.ptok, p->lex.pend, __LINE__);
16944 if (p->heredoc_end > 0) {
16945 p->ruby_sourceline = p->heredoc_end;
16946 p->heredoc_end = 0;
16947 }
16948 p->ruby_sourceline++;
16949 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
16950 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
16951 token_flush(p);
16952 p->lex.lastline = v;
16953 return 0;
16954}
16955
16956static int
16957parser_cr(struct parser_params *p, int c)
16958{
16959 if (peek(p, '\n')) {
16960 p->lex.pcur++;
16961 c = '\n';
16962 }
16963 return c;
16964}
16965
16966static inline int
16967nextc0(struct parser_params *p, int set_encoding)
16968{
16969 int c;
16970
16971 if (UNLIKELY((p->lex.pcur == p->lex.pend) || p->eofp || RTEST(p->lex.nextline))) {
16972 if (nextline(p, set_encoding)) return -1;
16973 }
16974 c = (unsigned char)*p->lex.pcur++;
16975 if (UNLIKELY(c == '\r')) {
16976 c = parser_cr(p, c);
16977 }
16978
16979 return c;
16980}
16981#define nextc(p) nextc0(p, TRUE)
16982
16983static void
16984pushback(struct parser_params *p, int c)
16985{
16986 if (c == -1) return;
16987 p->lex.pcur--;
16988 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
16989 p->lex.pcur--;
16990 }
16991}
16992
16993#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
16994
16995#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
16996#define tok(p) (p)->tokenbuf
16997#define toklen(p) (p)->tokidx
16998
16999static int
17000looking_at_eol_p(struct parser_params *p)
17001{
17002 const char *ptr = p->lex.pcur;
17003 while (ptr < p->lex.pend) {
17004 int c = (unsigned char)*ptr++;
17005 int eol = (c == '\n' || c == '#');
17006 if (eol || !ISSPACE(c)) {
17007 return eol;
17008 }
17009 }
17010 return TRUE;
17011}
17012
17013static char*
17014newtok(struct parser_params *p)
17015{
17016 p->tokidx = 0;
17017 p->tokline = p->ruby_sourceline;
17018 if (!p->tokenbuf) {
17019 p->toksiz = 60;
17020 p->tokenbuf = ALLOC_N(char, 60);
17021 }
17022 if (p->toksiz > 4096) {
17023 p->toksiz = 60;
17024 REALLOC_N(p->tokenbuf, char, 60);
17025 }
17026 return p->tokenbuf;
17027}
17028
17029static char *
17030tokspace(struct parser_params *p, int n)
17031{
17032 p->tokidx += n;
17033
17034 if (p->tokidx >= p->toksiz) {
17035 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
17036 REALLOC_N(p->tokenbuf, char, p->toksiz);
17037 }
17038 return &p->tokenbuf[p->tokidx-n];
17039}
17040
17041static void
17042tokadd(struct parser_params *p, int c)
17043{
17044 p->tokenbuf[p->tokidx++] = (char)c;
17045 if (p->tokidx >= p->toksiz) {
17046 p->toksiz *= 2;
17047 REALLOC_N(p->tokenbuf, char, p->toksiz);
17048 }
17049}
17050
17051static int
17052tok_hex(struct parser_params *p, size_t *numlen)
17053{
17054 int c;
17055
17056 c = scan_hex(p->lex.pcur, 2, numlen);
17057 if (!*numlen) {
17058 yyerror0("invalid hex escape");
17059 token_flush(p);
17060 return 0;
17061 }
17062 p->lex.pcur += *numlen;
17063 return c;
17064}
17065
17066#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
17067
17068static int
17069escaped_control_code(int c)
17070{
17071 int c2 = 0;
17072 switch (c) {
17073 case ' ':
17074 c2 = 's';
17075 break;
17076 case '\n':
17077 c2 = 'n';
17078 break;
17079 case '\t':
17080 c2 = 't';
17081 break;
17082 case '\v':
17083 c2 = 'v';
17084 break;
17085 case '\r':
17086 c2 = 'r';
17087 break;
17088 case '\f':
17089 c2 = 'f';
17090 break;
17091 }
17092 return c2;
17093}
17094
17095#define WARN_SPACE_CHAR(c, prefix) \
17096 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
17097
17098static int
17099tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
17100 int regexp_literal, int wide)
17101{
17102 size_t numlen;
17103 int codepoint = scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
17104 p->lex.pcur += numlen;
17105 if (p->lex.strterm == NULL ||
17106 (p->lex.strterm->flags & STRTERM_HEREDOC) ||
17107 (p->lex.strterm->u.literal.u1.func != str_regexp)) {
17108 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
17109 literal_flush(p, p->lex.pcur);
17110 yyerror0("invalid Unicode escape");
17111 return wide && numlen > 0;
17112 }
17113 if (codepoint > 0x10ffff) {
17114 literal_flush(p, p->lex.pcur);
17115 yyerror0("invalid Unicode codepoint (too large)");
17116 return wide;
17117 }
17118 if ((codepoint & 0xfffff800) == 0xd800) {
17119 literal_flush(p, p->lex.pcur);
17120 yyerror0("invalid Unicode codepoint");
17121 return wide;
17122 }
17123 }
17124 if (regexp_literal) {
17125 tokcopy(p, (int)numlen);
17126 }
17127 else if (codepoint >= 0x80) {
17128 rb_encoding *utf8 = rb_utf8_encoding();
17129 if (*encp && utf8 != *encp) {
17130 YYLTYPE loc = RUBY_INIT_YYLLOC();
17131 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
17132 parser_show_error_line(p, &loc);
17133 return wide;
17134 }
17135 *encp = utf8;
17136 tokaddmbc(p, codepoint, *encp);
17137 }
17138 else {
17139 tokadd(p, codepoint);
17140 }
17141 return TRUE;
17142}
17143
17144static int tokadd_mbchar(struct parser_params *p, int c);
17145
17146static int
17147tokskip_mbchar(struct parser_params *p)
17148{
17149 int len = parser_precise_mbclen(p, p->lex.pcur-1);
17150 if (len > 0) {
17151 p->lex.pcur += len - 1;
17152 }
17153 return len;
17154}
17155
17156/* return value is for ?\u3042 */
17157static void
17158tokadd_utf8(struct parser_params *p, rb_encoding **encp,
17159 int term, int symbol_literal, int regexp_literal)
17160{
17161 /*
17162 * If `term` is not -1, then we allow multiple codepoints in \u{}
17163 * upto `term` byte, otherwise we're parsing a character literal.
17164 * And then add the codepoints to the current token.
17165 */
17166 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
17167
17168 const int open_brace = '{', close_brace = '}';
17169
17170 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
17171
17172 if (peek(p, open_brace)) { /* handle \u{...} form */
17173 if (regexp_literal && p->lex.strterm->u.literal.u1.func == str_regexp) {
17174 /*
17175 * Skip parsing validation code and copy bytes as-is until term or
17176 * closing brace, in order to correctly handle extended regexps where
17177 * invalid unicode escapes are allowed in comments. The regexp parser
17178 * does its own validation and will catch any issues.
17179 */
17180 tokadd(p, open_brace);
17181 while (++p->lex.pcur < p->lex.pend) {
17182 int c = peekc(p);
17183 if (c == close_brace) {
17184 tokadd(p, c);
17185 ++p->lex.pcur;
17186 break;
17187 }
17188 else if (c == term) {
17189 break;
17190 }
17191 if (c == '\\' && p->lex.pcur + 1 < p->lex.pend) {
17192 tokadd(p, c);
17193 c = *++p->lex.pcur;
17194 }
17195 tokadd_mbchar(p, c);
17196 }
17197 }
17198 else {
17199 const char *second = NULL;
17200 int c, last = nextc(p);
17201 if (p->lex.pcur >= p->lex.pend) goto unterminated;
17202 while (ISSPACE(c = *p->lex.pcur) && ++p->lex.pcur < p->lex.pend);
17203 while (c != close_brace) {
17204 if (c == term) goto unterminated;
17205 if (second == multiple_codepoints)
17206 second = p->lex.pcur;
17207 if (regexp_literal) tokadd(p, last);
17208 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
17209 break;
17210 }
17211 while (ISSPACE(c = *p->lex.pcur)) {
17212 if (++p->lex.pcur >= p->lex.pend) goto unterminated;
17213 last = c;
17214 }
17215 if (term == -1 && !second)
17216 second = multiple_codepoints;
17217 }
17218
17219 if (c != close_brace) {
17220 unterminated:
17221 token_flush(p);
17222 yyerror0("unterminated Unicode escape");
17223 return;
17224 }
17225 if (second && second != multiple_codepoints) {
17226 const char *pcur = p->lex.pcur;
17227 p->lex.pcur = second;
17228 dispatch_scan_event(p, tSTRING_CONTENT);
17229 token_flush(p);
17230 p->lex.pcur = pcur;
17231 yyerror0(multiple_codepoints);
17232 token_flush(p);
17233 }
17234
17235 if (regexp_literal) tokadd(p, close_brace);
17236 nextc(p);
17237 }
17238 }
17239 else { /* handle \uxxxx form */
17240 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
17241 token_flush(p);
17242 return;
17243 }
17244 }
17245}
17246
17247#define ESCAPE_CONTROL 1
17248#define ESCAPE_META 2
17249
17250static int
17251read_escape(struct parser_params *p, int flags, rb_encoding **encp)
17252{
17253 int c;
17254 size_t numlen;
17255
17256 switch (c = nextc(p)) {
17257 case '\\': /* Backslash */
17258 return c;
17259
17260 case 'n': /* newline */
17261 return '\n';
17262
17263 case 't': /* horizontal tab */
17264 return '\t';
17265
17266 case 'r': /* carriage-return */
17267 return '\r';
17268
17269 case 'f': /* form-feed */
17270 return '\f';
17271
17272 case 'v': /* vertical tab */
17273 return '\13';
17274
17275 case 'a': /* alarm(bell) */
17276 return '\007';
17277
17278 case 'e': /* escape */
17279 return 033;
17280
17281 case '0': case '1': case '2': case '3': /* octal constant */
17282 case '4': case '5': case '6': case '7':
17283 pushback(p, c);
17284 c = scan_oct(p->lex.pcur, 3, &numlen);
17285 p->lex.pcur += numlen;
17286 return c;
17287
17288 case 'x': /* hex constant */
17289 c = tok_hex(p, &numlen);
17290 if (numlen == 0) return 0;
17291 return c;
17292
17293 case 'b': /* backspace */
17294 return '\010';
17295
17296 case 's': /* space */
17297 return ' ';
17298
17299 case 'M':
17300 if (flags & ESCAPE_META) goto eof;
17301 if ((c = nextc(p)) != '-') {
17302 goto eof;
17303 }
17304 if ((c = nextc(p)) == '\\') {
17305 switch (peekc(p)) {
17306 case 'u': case 'U':
17307 nextc(p);
17308 goto eof;
17309 }
17310 return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
17311 }
17312 else if (c == -1) goto eof;
17313 else if (!ISASCII(c)) {
17314 tokskip_mbchar(p);
17315 goto eof;
17316 }
17317 else {
17318 int c2 = escaped_control_code(c);
17319 if (c2) {
17320 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
17321 WARN_SPACE_CHAR(c2, "\\M-");
17322 }
17323 else {
17324 WARN_SPACE_CHAR(c2, "\\C-\\M-");
17325 }
17326 }
17327 else if (ISCNTRL(c)) goto eof;
17328 return ((c & 0xff) | 0x80);
17329 }
17330
17331 case 'C':
17332 if ((c = nextc(p)) != '-') {
17333 goto eof;
17334 }
17335 case 'c':
17336 if (flags & ESCAPE_CONTROL) goto eof;
17337 if ((c = nextc(p))== '\\') {
17338 switch (peekc(p)) {
17339 case 'u': case 'U':
17340 nextc(p);
17341 goto eof;
17342 }
17343 c = read_escape(p, flags|ESCAPE_CONTROL, encp);
17344 }
17345 else if (c == '?')
17346 return 0177;
17347 else if (c == -1) goto eof;
17348 else if (!ISASCII(c)) {
17349 tokskip_mbchar(p);
17350 goto eof;
17351 }
17352 else {
17353 int c2 = escaped_control_code(c);
17354 if (c2) {
17355 if (ISCNTRL(c)) {
17356 if (flags & ESCAPE_META) {
17357 WARN_SPACE_CHAR(c2, "\\M-");
17358 }
17359 else {
17360 WARN_SPACE_CHAR(c2, "");
17361 }
17362 }
17363 else {
17364 if (flags & ESCAPE_META) {
17365 WARN_SPACE_CHAR(c2, "\\M-\\C-");
17366 }
17367 else {
17368 WARN_SPACE_CHAR(c2, "\\C-");
17369 }
17370 }
17371 }
17372 else if (ISCNTRL(c)) goto eof;
17373 }
17374 return c & 0x9f;
17375
17376 eof:
17377 case -1:
17378 yyerror0("Invalid escape character syntax");
17379 dispatch_scan_event(p, tSTRING_CONTENT);
17380 return '\0';
17381
17382 default:
17383 return c;
17384 }
17385}
17386
17387static void
17388tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
17389{
17390 int len = rb_enc_codelen(c, enc);
17391 rb_enc_mbcput(c, tokspace(p, len), enc);
17392}
17393
17394static int
17395tokadd_escape(struct parser_params *p, rb_encoding **encp)
17396{
17397 int c;
17398 size_t numlen;
17399
17400 switch (c = nextc(p)) {
17401 case '\n':
17402 return 0; /* just ignore */
17403
17404 case '0': case '1': case '2': case '3': /* octal constant */
17405 case '4': case '5': case '6': case '7':
17406 {
17407 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
17408 if (numlen == 0) goto eof;
17409 p->lex.pcur += numlen;
17410 tokcopy(p, (int)numlen + 1);
17411 }
17412 return 0;
17413
17414 case 'x': /* hex constant */
17415 {
17416 tok_hex(p, &numlen);
17417 if (numlen == 0) return -1;
17418 tokcopy(p, (int)numlen + 2);
17419 }
17420 return 0;
17421
17422 eof:
17423 case -1:
17424 yyerror0("Invalid escape character syntax");
17425 token_flush(p);
17426 return -1;
17427
17428 default:
17429 tokadd(p, '\\');
17430 tokadd(p, c);
17431 }
17432 return 0;
17433}
17434
17435static int
17436regx_options(struct parser_params *p)
17437{
17438 int kcode = 0;
17439 int kopt = 0;
17440 int options = 0;
17441 int c, opt, kc;
17442
17443 newtok(p);
17444 while (c = nextc(p), ISALPHA(c)) {
17445 if (c == 'o') {
17446 options |= RE_OPTION_ONCE;
17447 }
17448 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
17449 if (kc >= 0) {
17450 if (kc != rb_ascii8bit_encindex()) kcode = c;
17451 kopt = opt;
17452 }
17453 else {
17454 options |= opt;
17455 }
17456 }
17457 else {
17458 tokadd(p, c);
17459 }
17460 }
17461 options |= kopt;
17462 pushback(p, c);
17463 if (toklen(p)) {
17464 YYLTYPE loc = RUBY_INIT_YYLLOC();
17465 tokfix(p);
17466 compile_error(p, "unknown regexp option%s - %*s",
17467 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
17468 parser_show_error_line(p, &loc);
17469 }
17470 return options | RE_OPTION_ENCODING(kcode);
17471}
17472
17473static int
17474tokadd_mbchar(struct parser_params *p, int c)
17475{
17476 int len = parser_precise_mbclen(p, p->lex.pcur-1);
17477 if (len < 0) return -1;
17478 tokadd(p, c);
17479 p->lex.pcur += --len;
17480 if (len > 0) tokcopy(p, len);
17481 return c;
17482}
17483
17484static inline int
17485simple_re_meta(int c)
17486{
17487 switch (c) {
17488 case '$': case '*': case '+': case '.':
17489 case '?': case '^': case '|':
17490 case ')': case ']': case '}': case '>':
17491 return TRUE;
17492 default:
17493 return FALSE;
17494 }
17495}
17496
17497static int
17498parser_update_heredoc_indent(struct parser_params *p, int c)
17499{
17500 if (p->heredoc_line_indent == -1) {
17501 if (c == '\n') p->heredoc_line_indent = 0;
17502 }
17503 else {
17504 if (c == ' ') {
17505 p->heredoc_line_indent++;
17506 return TRUE;
17507 }
17508 else if (c == '\t') {
17509 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
17510 p->heredoc_line_indent = w * TAB_WIDTH;
17511 return TRUE;
17512 }
17513 else if (c != '\n') {
17514 if (p->heredoc_indent > p->heredoc_line_indent) {
17515 p->heredoc_indent = p->heredoc_line_indent;
17516 }
17517 p->heredoc_line_indent = -1;
17518 }
17519 }
17520 return FALSE;
17521}
17522
17523static void
17524parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
17525{
17526 YYLTYPE loc = RUBY_INIT_YYLLOC();
17527 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
17528 compile_error(p, "%s mixed within %s source", n1, n2);
17529 parser_show_error_line(p, &loc);
17530}
17531
17532static void
17533parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
17534{
17535 const char *pos = p->lex.pcur;
17536 p->lex.pcur = beg;
17537 parser_mixed_error(p, enc1, enc2);
17538 p->lex.pcur = pos;
17539}
17540
17541static int
17542tokadd_string(struct parser_params *p,
17543 int func, int term, int paren, long *nest,
17544 rb_encoding **encp, rb_encoding **enc)
17545{
17546 int c;
17547 bool erred = false;
17548#ifdef RIPPER
17549 const int heredoc_end = (p->heredoc_end ? p->heredoc_end + 1 : 0);
17550 int top_of_line = FALSE;
17551#endif
17552
17553#define mixed_error(enc1, enc2) \
17554 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
17555#define mixed_escape(beg, enc1, enc2) \
17556 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
17557
17558 while ((c = nextc(p)) != -1) {
17559 if (p->heredoc_indent > 0) {
17560 parser_update_heredoc_indent(p, c);
17561 }
17562#ifdef RIPPER
17563 if (top_of_line && heredoc_end == p->ruby_sourceline) {
17564 pushback(p, c);
17565 break;
17566 }
17567#endif
17568
17569 if (paren && c == paren) {
17570 ++*nest;
17571 }
17572 else if (c == term) {
17573 if (!nest || !*nest) {
17574 pushback(p, c);
17575 break;
17576 }
17577 --*nest;
17578 }
17579 else if ((func & STR_FUNC_EXPAND) && c == '#' && p->lex.pcur < p->lex.pend) {
17580 unsigned char c2 = *p->lex.pcur;
17581 if (c2 == '$' || c2 == '@' || c2 == '{') {
17582 pushback(p, c);
17583 break;
17584 }
17585 }
17586 else if (c == '\\') {
17587 c = nextc(p);
17588 switch (c) {
17589 case '\n':
17590 if (func & STR_FUNC_QWORDS) break;
17591 if (func & STR_FUNC_EXPAND) {
17592 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
17593 continue;
17594 if (c == term) {
17595 c = '\\';
17596 goto terminate;
17597 }
17598 }
17599 tokadd(p, '\\');
17600 break;
17601
17602 case '\\':
17603 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
17604 break;
17605
17606 case 'u':
17607 if ((func & STR_FUNC_EXPAND) == 0) {
17608 tokadd(p, '\\');
17609 break;
17610 }
17611 tokadd_utf8(p, enc, term,
17612 func & STR_FUNC_SYMBOL,
17613 func & STR_FUNC_REGEXP);
17614 continue;
17615
17616 default:
17617 if (c == -1) return -1;
17618 if (!ISASCII(c)) {
17619 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
17620 goto non_ascii;
17621 }
17622 if (func & STR_FUNC_REGEXP) {
17623 switch (c) {
17624 case 'c':
17625 case 'C':
17626 case 'M': {
17627 pushback(p, c);
17628 c = read_escape(p, 0, enc);
17629
17630 int i;
17631 char escbuf[5];
17632 snprintf(escbuf, sizeof(escbuf), "\\x%02X", c);
17633 for (i = 0; i < 4; i++) {
17634 tokadd(p, escbuf[i]);
17635 }
17636 continue;
17637 }
17638 }
17639
17640 if (c == term && !simple_re_meta(c)) {
17641 tokadd(p, c);
17642 continue;
17643 }
17644 pushback(p, c);
17645 if ((c = tokadd_escape(p, enc)) < 0)
17646 return -1;
17647 if (*enc && *enc != *encp) {
17648 mixed_escape(p->lex.ptok+2, *enc, *encp);
17649 }
17650 continue;
17651 }
17652 else if (func & STR_FUNC_EXPAND) {
17653 pushback(p, c);
17654 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
17655 c = read_escape(p, 0, enc);
17656 }
17657 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
17658 /* ignore backslashed spaces in %w */
17659 }
17660 else if (c != term && !(paren && c == paren)) {
17661 tokadd(p, '\\');
17662 pushback(p, c);
17663 continue;
17664 }
17665 }
17666 }
17667 else if (!parser_isascii(p)) {
17668 non_ascii:
17669 if (!*enc) {
17670 *enc = *encp;
17671 }
17672 else if (*enc != *encp) {
17673 mixed_error(*enc, *encp);
17674 continue;
17675 }
17676 if (tokadd_mbchar(p, c) == -1) return -1;
17677 continue;
17678 }
17679 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
17680 pushback(p, c);
17681 break;
17682 }
17683 if (c & 0x80) {
17684 if (!*enc) {
17685 *enc = *encp;
17686 }
17687 else if (*enc != *encp) {
17688 mixed_error(*enc, *encp);
17689 continue;
17690 }
17691 }
17692 tokadd(p, c);
17693#ifdef RIPPER
17694 top_of_line = (c == '\n');
17695#endif
17696 }
17697 terminate:
17698 if (*enc) *encp = *enc;
17699 return c;
17700}
17701
17702static inline rb_strterm_t *
17703new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
17704{
17705 return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
17706}
17707
17708/* imemo_parser_strterm for literal */
17709#define NEW_STRTERM(func, term, paren) \
17710 new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
17711
17712#ifdef RIPPER
17713static void
17714flush_string_content(struct parser_params *p, rb_encoding *enc)
17715{
17716 VALUE content = yylval.val;
17717 if (!ripper_is_node_yylval(content))
17718 content = ripper_new_yylval(p, 0, 0, content);
17719 if (has_delayed_token(p)) {
17720 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
17721 if (len > 0) {
17722 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
17723 }
17724 dispatch_delayed_token(p, tSTRING_CONTENT);
17725 p->lex.ptok = p->lex.pcur;
17726 RNODE(content)->nd_rval = yylval.val;
17727 }
17728 dispatch_scan_event(p, tSTRING_CONTENT);
17729 if (yylval.val != content)
17730 RNODE(content)->nd_rval = yylval.val;
17731 yylval.val = content;
17732}
17733#else
17734static void
17735flush_string_content(struct parser_params *p, rb_encoding *enc)
17736{
17737 if (has_delayed_token(p)) {
17738 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
17739 if (len > 0) {
17740 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
17741 p->delayed.end_line = p->ruby_sourceline;
17742 p->delayed.end_col = rb_long2int(p->lex.pcur - p->lex.pbeg);
17743 }
17744 dispatch_delayed_token(p, tSTRING_CONTENT);
17745 p->lex.ptok = p->lex.pcur;
17746 }
17747 dispatch_scan_event(p, tSTRING_CONTENT);
17748}
17749#endif
17750
17751RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
17752/* this can be shared with ripper, since it's independent from struct
17753 * parser_params. */
17754#ifndef RIPPER
17755#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
17756#define SPECIAL_PUNCT(idx) ( \
17757 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
17758 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
17759 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
17760 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
17761 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
17762 BIT('0', idx))
17763const unsigned int ruby_global_name_punct_bits[] = {
17764 SPECIAL_PUNCT(0),
17765 SPECIAL_PUNCT(1),
17766 SPECIAL_PUNCT(2),
17767};
17768#undef BIT
17769#undef SPECIAL_PUNCT
17770#endif
17771
17772static enum yytokentype
17773parser_peek_variable_name(struct parser_params *p)
17774{
17775 int c;
17776 const char *ptr = p->lex.pcur;
17777
17778 if (ptr + 1 >= p->lex.pend) return 0;
17779 c = *ptr++;
17780 switch (c) {
17781 case '$':
17782 if ((c = *ptr) == '-') {
17783 if (++ptr >= p->lex.pend) return 0;
17784 c = *ptr;
17785 }
17786 else if (is_global_name_punct(c) || ISDIGIT(c)) {
17787 return tSTRING_DVAR;
17788 }
17789 break;
17790 case '@':
17791 if ((c = *ptr) == '@') {
17792 if (++ptr >= p->lex.pend) return 0;
17793 c = *ptr;
17794 }
17795 break;
17796 case '{':
17797 p->lex.pcur = ptr;
17798 p->command_start = TRUE;
17799 return tSTRING_DBEG;
17800 default:
17801 return 0;
17802 }
17803 if (!ISASCII(c) || c == '_' || ISALPHA(c))
17804 return tSTRING_DVAR;
17805 return 0;
17806}
17807
17808#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
17809#define IS_END() IS_lex_state(EXPR_END_ANY)
17810#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
17811#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
17812#define IS_LABEL_POSSIBLE() (\
17813 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
17814 IS_ARG())
17815#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
17816#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
17817
17818static inline enum yytokentype
17819parser_string_term(struct parser_params *p, int func)
17820{
17821 p->lex.strterm = 0;
17822 if (func & STR_FUNC_REGEXP) {
17823 set_yylval_num(regx_options(p));
17824 dispatch_scan_event(p, tREGEXP_END);
17825 SET_LEX_STATE(EXPR_END);
17826 return tREGEXP_END;
17827 }
17828 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
17829 nextc(p);
17830 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
17831 return tLABEL_END;
17832 }
17833 SET_LEX_STATE(EXPR_END);
17834 return tSTRING_END;
17835}
17836
17837static enum yytokentype
17838parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
17839{
17840 int func = (int)quote->u1.func;
17841 int term = (int)quote->u3.term;
17842 int paren = (int)quote->u2.paren;
17843 int c, space = 0;
17844 rb_encoding *enc = p->enc;
17845 rb_encoding *base_enc = 0;
17846 VALUE lit;
17847
17848 if (func & STR_FUNC_TERM) {
17849 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
17850 SET_LEX_STATE(EXPR_END);
17851 p->lex.strterm = 0;
17852 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
17853 }
17854 c = nextc(p);
17855 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
17856 do {c = nextc(p);} while (ISSPACE(c));
17857 space = 1;
17858 }
17859 if (func & STR_FUNC_LIST) {
17860 quote->u1.func &= ~STR_FUNC_LIST;
17861 space = 1;
17862 }
17863 if (c == term && !quote->u0.nest) {
17864 if (func & STR_FUNC_QWORDS) {
17865 quote->u1.func |= STR_FUNC_TERM;
17866 pushback(p, c); /* dispatch the term at tSTRING_END */
17867 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
17868 return ' ';
17869 }
17870 return parser_string_term(p, func);
17871 }
17872 if (space) {
17873 pushback(p, c);
17874 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
17875 return ' ';
17876 }
17877 newtok(p);
17878 if ((func & STR_FUNC_EXPAND) && c == '#') {
17879 int t = parser_peek_variable_name(p);
17880 if (t) return t;
17881 tokadd(p, '#');
17882 c = nextc(p);
17883 }
17884 pushback(p, c);
17885 if (tokadd_string(p, func, term, paren, &quote->u0.nest,
17886 &enc, &base_enc) == -1) {
17887 if (p->eofp) {
17888#ifndef RIPPER
17889# define unterminated_literal(mesg) yyerror0(mesg)
17890#else
17891# define unterminated_literal(mesg) compile_error(p, mesg)
17892#endif
17893 literal_flush(p, p->lex.pcur);
17894 if (func & STR_FUNC_QWORDS) {
17895 /* no content to add, bailing out here */
17896 unterminated_literal("unterminated list meets end of file");
17897 p->lex.strterm = 0;
17898 return tSTRING_END;
17899 }
17900 if (func & STR_FUNC_REGEXP) {
17901 unterminated_literal("unterminated regexp meets end of file");
17902 }
17903 else {
17904 unterminated_literal("unterminated string meets end of file");
17905 }
17906 quote->u1.func |= STR_FUNC_TERM;
17907 }
17908 }
17909
17910 tokfix(p);
17911 lit = STR_NEW3(tok(p), toklen(p), enc, func);
17912 set_yylval_str(lit);
17913 flush_string_content(p, enc);
17914
17915 return tSTRING_CONTENT;
17916}
17917
17918static enum yytokentype
17919heredoc_identifier(struct parser_params *p)
17920{
17921 /*
17922 * term_len is length of `<<"END"` except `END`,
17923 * in this case term_len is 4 (<, <, " and ").
17924 */
17925 long len, offset = p->lex.pcur - p->lex.pbeg;
17926 int c = nextc(p), term, func = 0, quote = 0;
17927 enum yytokentype token = tSTRING_BEG;
17928 int indent = 0;
17929
17930 if (c == '-') {
17931 c = nextc(p);
17932 func = STR_FUNC_INDENT;
17933 offset++;
17934 }
17935 else if (c == '~') {
17936 c = nextc(p);
17937 func = STR_FUNC_INDENT;
17938 offset++;
17939 indent = INT_MAX;
17940 }
17941 switch (c) {
17942 case '\'':
17943 func |= str_squote; goto quoted;
17944 case '"':
17945 func |= str_dquote; goto quoted;
17946 case '`':
17947 token = tXSTRING_BEG;
17948 func |= str_xquote; goto quoted;
17949
17950 quoted:
17951 quote++;
17952 offset++;
17953 term = c;
17954 len = 0;
17955 while ((c = nextc(p)) != term) {
17956 if (c == -1 || c == '\r' || c == '\n') {
17957 yyerror0("unterminated here document identifier");
17958 return -1;
17959 }
17960 }
17961 break;
17962
17963 default:
17964 if (!parser_is_identchar(p)) {
17965 pushback(p, c);
17966 if (func & STR_FUNC_INDENT) {
17967 pushback(p, indent > 0 ? '~' : '-');
17968 }
17969 return 0;
17970 }
17971 func |= str_dquote;
17972 do {
17973 int n = parser_precise_mbclen(p, p->lex.pcur-1);
17974 if (n < 0) return 0;
17975 p->lex.pcur += --n;
17976 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
17977 pushback(p, c);
17978 break;
17979 }
17980
17981 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
17982 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
17983 yyerror0("too long here document identifier");
17984 dispatch_scan_event(p, tHEREDOC_BEG);
17985 lex_goto_eol(p);
17986
17987 p->lex.strterm = new_strterm(0, 0, 0, p->lex.lastline);
17988 p->lex.strterm->flags |= STRTERM_HEREDOC;
17989 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
17990 here->offset = offset;
17991 here->sourceline = p->ruby_sourceline;
17992 here->length = (int)len;
17993 here->quote = quote;
17994 here->func = func;
17995
17996 token_flush(p);
17997 p->heredoc_indent = indent;
17998 p->heredoc_line_indent = 0;
17999 return token;
18000}
18001
18002static void
18003heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
18004{
18005 VALUE line;
18006
18007 p->lex.strterm = 0;
18008 line = here->lastline;
18009 p->lex.lastline = line;
18010 p->lex.pbeg = RSTRING_PTR(line);
18011 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
18012 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
18013 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
18014 p->heredoc_end = p->ruby_sourceline;
18015 p->ruby_sourceline = (int)here->sourceline;
18016 if (p->eofp) p->lex.nextline = Qnil;
18017 p->eofp = 0;
18018}
18019
18020static int
18021dedent_string(VALUE string, int width)
18022{
18023 char *str;
18024 long len;
18025 int i, col = 0;
18026
18027 RSTRING_GETMEM(string, str, len);
18028 for (i = 0; i < len && col < width; i++) {
18029 if (str[i] == ' ') {
18030 col++;
18031 }
18032 else if (str[i] == '\t') {
18033 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
18034 if (n > width) break;
18035 col = n;
18036 }
18037 else {
18038 break;
18039 }
18040 }
18041 if (!i) return 0;
18042 rb_str_modify(string);
18043 str = RSTRING_PTR(string);
18044 if (RSTRING_LEN(string) != len)
18045 rb_fatal("literal string changed: %+"PRIsVALUE, string);
18046 MEMMOVE(str, str + i, char, len - i);
18047 rb_str_set_len(string, len - i);
18048 return i;
18049}
18050
18051#ifndef RIPPER
18052static NODE *
18053heredoc_dedent(struct parser_params *p, NODE *root)
18054{
18055 NODE *node, *str_node, *prev_node;
18056 int indent = p->heredoc_indent;
18057 VALUE prev_lit = 0;
18058
18059 if (indent <= 0) return root;
18060 p->heredoc_indent = 0;
18061 if (!root) return root;
18062
18063 prev_node = node = str_node = root;
18064 if (nd_type_p(root, NODE_LIST)) str_node = root->nd_head;
18065
18066 while (str_node) {
18067 VALUE lit = str_node->nd_lit;
18068 if (str_node->flags & NODE_FL_NEWLINE) {
18069 dedent_string(lit, indent);
18070 }
18071 if (!prev_lit) {
18072 prev_lit = lit;
18073 }
18074 else if (!literal_concat0(p, prev_lit, lit)) {
18075 return 0;
18076 }
18077 else {
18078 NODE *end = node->nd_end;
18079 node = prev_node->nd_next = node->nd_next;
18080 if (!node) {
18081 if (nd_type_p(prev_node, NODE_DSTR))
18082 nd_set_type(prev_node, NODE_STR);
18083 break;
18084 }
18085 node->nd_end = end;
18086 goto next_str;
18087 }
18088
18089 str_node = 0;
18090 while ((node = (prev_node = node)->nd_next) != 0) {
18091 next_str:
18092 if (!nd_type_p(node, NODE_LIST)) break;
18093 if ((str_node = node->nd_head) != 0) {
18094 enum node_type type = nd_type(str_node);
18095 if (type == NODE_STR || type == NODE_DSTR) break;
18096 prev_lit = 0;
18097 str_node = 0;
18098 }
18099 }
18100 }
18101 return root;
18102}
18103#else /* RIPPER */
18104static VALUE
18105heredoc_dedent(struct parser_params *p, VALUE array)
18106{
18107 int indent = p->heredoc_indent;
18108
18109 if (indent <= 0) return array;
18110 p->heredoc_indent = 0;
18111 dispatch2(heredoc_dedent, array, INT2NUM(indent));
18112 return array;
18113}
18114
18115/*
18116 * call-seq:
18117 * Ripper.dedent_string(input, width) -> Integer
18118 *
18119 * USE OF RIPPER LIBRARY ONLY.
18120 *
18121 * Strips up to +width+ leading whitespaces from +input+,
18122 * and returns the stripped column width.
18123 */
18124static VALUE
18125parser_dedent_string(VALUE self, VALUE input, VALUE width)
18126{
18127 int wid, col;
18128
18129 StringValue(input);
18130 wid = NUM2UINT(width);
18131 col = dedent_string(input, wid);
18132 return INT2NUM(col);
18133}
18134#endif
18135
18136static int
18137whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
18138{
18139 const char *ptr = p->lex.pbeg;
18140 long n;
18141
18142 if (indent) {
18143 while (*ptr && ISSPACE(*ptr)) ptr++;
18144 }
18145 n = p->lex.pend - (ptr + len);
18146 if (n < 0) return FALSE;
18147 if (n > 0 && ptr[len] != '\n') {
18148 if (ptr[len] != '\r') return FALSE;
18149 if (n <= 1 || ptr[len+1] != '\n') return FALSE;
18150 }
18151 return strncmp(eos, ptr, len) == 0;
18152}
18153
18154static int
18155word_match_p(struct parser_params *p, const char *word, long len)
18156{
18157 if (strncmp(p->lex.pcur, word, len)) return 0;
18158 if (p->lex.pcur + len == p->lex.pend) return 1;
18159 int c = (unsigned char)p->lex.pcur[len];
18160 if (ISSPACE(c)) return 1;
18161 switch (c) {
18162 case '\0': case '\004': case '\032': return 1;
18163 }
18164 return 0;
18165}
18166
18167#define NUM_SUFFIX_R (1<<0)
18168#define NUM_SUFFIX_I (1<<1)
18169#define NUM_SUFFIX_ALL 3
18170
18171static int
18172number_literal_suffix(struct parser_params *p, int mask)
18173{
18174 int c, result = 0;
18175 const char *lastp = p->lex.pcur;
18176
18177 while ((c = nextc(p)) != -1) {
18178 if ((mask & NUM_SUFFIX_I) && c == 'i') {
18179 result |= (mask & NUM_SUFFIX_I);
18180 mask &= ~NUM_SUFFIX_I;
18181 /* r after i, rational of complex is disallowed */
18182 mask &= ~NUM_SUFFIX_R;
18183 continue;
18184 }
18185 if ((mask & NUM_SUFFIX_R) && c == 'r') {
18186 result |= (mask & NUM_SUFFIX_R);
18187 mask &= ~NUM_SUFFIX_R;
18188 continue;
18189 }
18190 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
18191 p->lex.pcur = lastp;
18192 literal_flush(p, p->lex.pcur);
18193 return 0;
18194 }
18195 pushback(p, c);
18196 break;
18197 }
18198 return result;
18199}
18200
18201static enum yytokentype
18202set_number_literal(struct parser_params *p, VALUE v,
18203 enum yytokentype type, int suffix)
18204{
18205 if (suffix & NUM_SUFFIX_I) {
18206 v = rb_complex_raw(INT2FIX(0), v);
18207 type = tIMAGINARY;
18208 }
18209 set_yylval_literal(v);
18210 SET_LEX_STATE(EXPR_END);
18211 return type;
18212}
18213
18214static enum yytokentype
18215set_integer_literal(struct parser_params *p, VALUE v, int suffix)
18216{
18217 enum yytokentype type = tINTEGER;
18218 if (suffix & NUM_SUFFIX_R) {
18219 v = rb_rational_raw1(v);
18220 type = tRATIONAL;
18221 }
18222 return set_number_literal(p, v, type, suffix);
18223}
18224
18225#ifdef RIPPER
18226static void
18227dispatch_heredoc_end(struct parser_params *p)
18228{
18229 VALUE str;
18230 if (has_delayed_token(p))
18231 dispatch_delayed_token(p, tSTRING_CONTENT);
18232 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
18233 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
18234 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
18235 lex_goto_eol(p);
18236 token_flush(p);
18237}
18238
18239#else
18240#define dispatch_heredoc_end(p) parser_dispatch_heredoc_end(p, __LINE__)
18241static void
18242parser_dispatch_heredoc_end(struct parser_params *p, int line)
18243{
18244 if (has_delayed_token(p))
18245 dispatch_delayed_token(p, tSTRING_CONTENT);
18246
18247 if (p->keep_tokens) {
18248 VALUE str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
18249 RUBY_SET_YYLLOC_OF_HEREDOC_END(*p->yylloc);
18250 parser_append_tokens(p, str, tHEREDOC_END, line);
18251 }
18252
18253 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
18254 lex_goto_eol(p);
18255 token_flush(p);
18256}
18257#endif
18258
18259static enum yytokentype
18260here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
18261{
18262 int c, func, indent = 0;
18263 const char *eos, *ptr, *ptr_end;
18264 long len;
18265 VALUE str = 0;
18266 rb_encoding *enc = p->enc;
18267 rb_encoding *base_enc = 0;
18268 int bol;
18269
18270 eos = RSTRING_PTR(here->lastline) + here->offset;
18271 len = here->length;
18272 indent = (func = here->func) & STR_FUNC_INDENT;
18273
18274 if ((c = nextc(p)) == -1) {
18275 error:
18276#ifdef RIPPER
18277 if (!has_delayed_token(p)) {
18278 dispatch_scan_event(p, tSTRING_CONTENT);
18279 }
18280 else {
18281 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
18282 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
18283 int cr = ENC_CODERANGE_UNKNOWN;
18284 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
18285 if (cr != ENC_CODERANGE_7BIT &&
18286 rb_is_usascii_enc(p->enc) &&
18287 enc != rb_utf8_encoding()) {
18288 enc = rb_ascii8bit_encoding();
18289 }
18290 }
18291 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
18292 }
18293 dispatch_delayed_token(p, tSTRING_CONTENT);
18294 }
18295 lex_goto_eol(p);
18296#endif
18297 heredoc_restore(p, &p->lex.strterm->u.heredoc);
18298 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
18299 (int)len, eos);
18300 token_flush(p);
18301 p->lex.strterm = 0;
18302 SET_LEX_STATE(EXPR_END);
18303 return tSTRING_END;
18304 }
18305 bol = was_bol(p);
18306 if (!bol) {
18307 /* not beginning of line, cannot be the terminator */
18308 }
18309 else if (p->heredoc_line_indent == -1) {
18310 /* `heredoc_line_indent == -1` means
18311 * - "after an interpolation in the same line", or
18312 * - "in a continuing line"
18313 */
18314 p->heredoc_line_indent = 0;
18315 }
18316 else if (whole_match_p(p, eos, len, indent)) {
18317 dispatch_heredoc_end(p);
18318 restore:
18319 heredoc_restore(p, &p->lex.strterm->u.heredoc);
18320 token_flush(p);
18321 p->lex.strterm = 0;
18322 SET_LEX_STATE(EXPR_END);
18323 return tSTRING_END;
18324 }
18325
18326 if (!(func & STR_FUNC_EXPAND)) {
18327 do {
18328 ptr = RSTRING_PTR(p->lex.lastline);
18329 ptr_end = p->lex.pend;
18330 if (ptr_end > ptr) {
18331 switch (ptr_end[-1]) {
18332 case '\n':
18333 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
18334 ptr_end++;
18335 break;
18336 }
18337 case '\r':
18338 --ptr_end;
18339 }
18340 }
18341
18342 if (p->heredoc_indent > 0) {
18343 long i = 0;
18344 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
18345 i++;
18346 p->heredoc_line_indent = 0;
18347 }
18348
18349 if (str)
18350 rb_str_cat(str, ptr, ptr_end - ptr);
18351 else
18352 str = STR_NEW(ptr, ptr_end - ptr);
18353 if (ptr_end < p->lex.pend) rb_str_cat(str, "\n", 1);
18354 lex_goto_eol(p);
18355 if (p->heredoc_indent > 0) {
18356 goto flush_str;
18357 }
18358 if (nextc(p) == -1) {
18359 if (str) {
18360 str = 0;
18361 }
18362 goto error;
18363 }
18364 } while (!whole_match_p(p, eos, len, indent));
18365 }
18366 else {
18367 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
18368 newtok(p);
18369 if (c == '#') {
18370 int t = parser_peek_variable_name(p);
18371 if (p->heredoc_line_indent != -1) {
18372 if (p->heredoc_indent > p->heredoc_line_indent) {
18373 p->heredoc_indent = p->heredoc_line_indent;
18374 }
18375 p->heredoc_line_indent = -1;
18376 }
18377 if (t) return t;
18378 tokadd(p, '#');
18379 c = nextc(p);
18380 }
18381 do {
18382 pushback(p, c);
18383 enc = p->enc;
18384 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
18385 if (p->eofp) goto error;
18386 goto restore;
18387 }
18388 if (c != '\n') {
18389 if (c == '\\') p->heredoc_line_indent = -1;
18390 flush:
18391 str = STR_NEW3(tok(p), toklen(p), enc, func);
18392 flush_str:
18393 set_yylval_str(str);
18394#ifndef RIPPER
18395 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
18396#endif
18397 flush_string_content(p, enc);
18398 return tSTRING_CONTENT;
18399 }
18400 tokadd(p, nextc(p));
18401 if (p->heredoc_indent > 0) {
18402 lex_goto_eol(p);
18403 goto flush;
18404 }
18405 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
18406 if ((c = nextc(p)) == -1) goto error;
18407 } while (!whole_match_p(p, eos, len, indent));
18408 str = STR_NEW3(tok(p), toklen(p), enc, func);
18409 }
18410 dispatch_heredoc_end(p);
18411#ifdef RIPPER
18412 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
18413 yylval.val, str);
18414#endif
18415 heredoc_restore(p, &p->lex.strterm->u.heredoc);
18416 token_flush(p);
18417 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
18418 set_yylval_str(str);
18419#ifndef RIPPER
18420 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
18421#endif
18422 return tSTRING_CONTENT;
18423}
18424
18425#include "lex.c"
18426
18427static int
18428arg_ambiguous(struct parser_params *p, char c)
18429{
18430#ifndef RIPPER
18431 if (c == '/') {
18432 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
18433 }
18434 else {
18435 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
18436 }
18437#else
18438 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
18439#endif
18440 return TRUE;
18441}
18442
18443static ID
18444#ifndef RIPPER
18445formal_argument(struct parser_params *p, ID lhs)
18446#else
18447formal_argument(struct parser_params *p, VALUE lhs)
18448#endif
18449{
18450 ID id = get_id(lhs);
18451
18452 switch (id_type(id)) {
18453 case ID_LOCAL:
18454 break;
18455#ifndef RIPPER
18456# define ERR(mesg) yyerror0(mesg)
18457#else
18458# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
18459#endif
18460 case ID_CONST:
18461 ERR("formal argument cannot be a constant");
18462 return 0;
18463 case ID_INSTANCE:
18464 ERR("formal argument cannot be an instance variable");
18465 return 0;
18466 case ID_GLOBAL:
18467 ERR("formal argument cannot be a global variable");
18468 return 0;
18469 case ID_CLASS:
18470 ERR("formal argument cannot be a class variable");
18471 return 0;
18472 default:
18473 ERR("formal argument must be local variable");
18474 return 0;
18475#undef ERR
18476 }
18477 shadowing_lvar(p, id);
18478 return lhs;
18479}
18480
18481static int
18482lvar_defined(struct parser_params *p, ID id)
18483{
18484 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
18485}
18486
18487/* emacsen -*- hack */
18488static long
18489parser_encode_length(struct parser_params *p, const char *name, long len)
18490{
18491 long nlen;
18492
18493 if (len > 5 && name[nlen = len - 5] == '-') {
18494 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
18495 return nlen;
18496 }
18497 if (len > 4 && name[nlen = len - 4] == '-') {
18498 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
18499 return nlen;
18500 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
18501 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
18502 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
18503 return nlen;
18504 }
18505 return len;
18506}
18507
18508static void
18509parser_set_encode(struct parser_params *p, const char *name)
18510{
18511 int idx = rb_enc_find_index(name);
18512 rb_encoding *enc;
18513 VALUE excargs[3];
18514
18515 if (idx < 0) {
18516 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
18517 error:
18518 excargs[0] = rb_eArgError;
18519 excargs[2] = rb_make_backtrace();
18520 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
18521 rb_exc_raise(rb_make_exception(3, excargs));
18522 }
18523 enc = rb_enc_from_index(idx);
18524 if (!rb_enc_asciicompat(enc)) {
18525 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
18526 goto error;
18527 }
18528 p->enc = enc;
18529#ifndef RIPPER
18530 if (p->debug_lines) {
18531 VALUE lines = p->debug_lines;
18532 long i, n = RARRAY_LEN(lines);
18533 for (i = 0; i < n; ++i) {
18534 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
18535 }
18536 }
18537#endif
18538}
18539
18540static int
18541comment_at_top(struct parser_params *p)
18542{
18543 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
18544 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
18545 while (ptr < ptr_end) {
18546 if (!ISSPACE(*ptr)) return 0;
18547 ptr++;
18548 }
18549 return 1;
18550}
18551
18552typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
18553typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
18554
18555static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
18556
18557static void
18558magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
18559{
18560 if (!comment_at_top(p)) {
18561 return;
18562 }
18563 parser_set_encode(p, val);
18564}
18565
18566static int
18567parser_get_bool(struct parser_params *p, const char *name, const char *val)
18568{
18569 switch (*val) {
18570 case 't': case 'T':
18571 if (STRCASECMP(val, "true") == 0) {
18572 return TRUE;
18573 }
18574 break;
18575 case 'f': case 'F':
18576 if (STRCASECMP(val, "false") == 0) {
18577 return FALSE;
18578 }
18579 break;
18580 }
18581 return parser_invalid_pragma_value(p, name, val);
18582}
18583
18584static int
18585parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
18586{
18587 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
18588 return -1;
18589}
18590
18591static void
18592parser_set_token_info(struct parser_params *p, const char *name, const char *val)
18593{
18594 int b = parser_get_bool(p, name, val);
18595 if (b >= 0) p->token_info_enabled = b;
18596}
18597
18598static void
18599parser_set_compile_option_flag(struct parser_params *p, const char *name, const char *val)
18600{
18601 int b;
18602
18603 if (p->token_seen) {
18604 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
18605 return;
18606 }
18607
18608 b = parser_get_bool(p, name, val);
18609 if (b < 0) return;
18610
18611 if (!p->compile_option)
18612 p->compile_option = rb_obj_hide(rb_ident_hash_new());
18613 rb_hash_aset(p->compile_option, ID2SYM(rb_intern(name)),
18614 RBOOL(b));
18615}
18616
18617static void
18618parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
18619{
18620 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
18621 if (*s == ' ' || *s == '\t') continue;
18622 if (*s == '#') break;
18623 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
18624 return;
18625 }
18626
18627 switch (*val) {
18628 case 'n': case 'N':
18629 if (STRCASECMP(val, "none") == 0) {
18630 p->ctxt.shareable_constant_value = shareable_none;
18631 return;
18632 }
18633 break;
18634 case 'l': case 'L':
18635 if (STRCASECMP(val, "literal") == 0) {
18636 p->ctxt.shareable_constant_value = shareable_literal;
18637 return;
18638 }
18639 break;
18640 case 'e': case 'E':
18641 if (STRCASECMP(val, "experimental_copy") == 0) {
18642 p->ctxt.shareable_constant_value = shareable_copy;
18643 return;
18644 }
18645 if (STRCASECMP(val, "experimental_everything") == 0) {
18646 p->ctxt.shareable_constant_value = shareable_everything;
18647 return;
18648 }
18649 break;
18650 }
18651 parser_invalid_pragma_value(p, name, val);
18652}
18653
18654# if WARN_PAST_SCOPE
18655static void
18656parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
18657{
18658 int b = parser_get_bool(p, name, val);
18659 if (b >= 0) p->past_scope_enabled = b;
18660}
18661# endif
18662
18664 const char *name;
18665 rb_magic_comment_setter_t func;
18666 rb_magic_comment_length_t length;
18667};
18668
18669static const struct magic_comment magic_comments[] = {
18670 {"coding", magic_comment_encoding, parser_encode_length},
18671 {"encoding", magic_comment_encoding, parser_encode_length},
18672 {"frozen_string_literal", parser_set_compile_option_flag},
18673 {"shareable_constant_value", parser_set_shareable_constant_value},
18674 {"warn_indent", parser_set_token_info},
18675# if WARN_PAST_SCOPE
18676 {"warn_past_scope", parser_set_past_scope},
18677# endif
18678};
18679
18680static const char *
18681magic_comment_marker(const char *str, long len)
18682{
18683 long i = 2;
18684
18685 while (i < len) {
18686 switch (str[i]) {
18687 case '-':
18688 if (str[i-1] == '*' && str[i-2] == '-') {
18689 return str + i + 1;
18690 }
18691 i += 2;
18692 break;
18693 case '*':
18694 if (i + 1 >= len) return 0;
18695 if (str[i+1] != '-') {
18696 i += 4;
18697 }
18698 else if (str[i-1] != '-') {
18699 i += 2;
18700 }
18701 else {
18702 return str + i + 2;
18703 }
18704 break;
18705 default:
18706 i += 3;
18707 break;
18708 }
18709 }
18710 return 0;
18711}
18712
18713static int
18714parser_magic_comment(struct parser_params *p, const char *str, long len)
18715{
18716 int indicator = 0;
18717 VALUE name = 0, val = 0;
18718 const char *beg, *end, *vbeg, *vend;
18719#define str_copy(_s, _p, _n) ((_s) \
18720 ? (void)(rb_str_resize((_s), (_n)), \
18721 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
18722 : (void)((_s) = STR_NEW((_p), (_n))))
18723
18724 if (len <= 7) return FALSE;
18725 if (!!(beg = magic_comment_marker(str, len))) {
18726 if (!(end = magic_comment_marker(beg, str + len - beg)))
18727 return FALSE;
18728 indicator = TRUE;
18729 str = beg;
18730 len = end - beg - 3;
18731 }
18732
18733 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
18734 while (len > 0) {
18735 const struct magic_comment *mc = magic_comments;
18736 char *s;
18737 int i;
18738 long n = 0;
18739
18740 for (; len > 0 && *str; str++, --len) {
18741 switch (*str) {
18742 case '\'': case '"': case ':': case ';':
18743 continue;
18744 }
18745 if (!ISSPACE(*str)) break;
18746 }
18747 for (beg = str; len > 0; str++, --len) {
18748 switch (*str) {
18749 case '\'': case '"': case ':': case ';':
18750 break;
18751 default:
18752 if (ISSPACE(*str)) break;
18753 continue;
18754 }
18755 break;
18756 }
18757 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
18758 if (!len) break;
18759 if (*str != ':') {
18760 if (!indicator) return FALSE;
18761 continue;
18762 }
18763
18764 do str++; while (--len > 0 && ISSPACE(*str));
18765 if (!len) break;
18766 if (*str == '"') {
18767 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
18768 if (*str == '\\') {
18769 --len;
18770 ++str;
18771 }
18772 }
18773 vend = str;
18774 if (len) {
18775 --len;
18776 ++str;
18777 }
18778 }
18779 else {
18780 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
18781 vend = str;
18782 }
18783 if (indicator) {
18784 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
18785 }
18786 else {
18787 while (len > 0 && (ISSPACE(*str))) --len, str++;
18788 if (len) return FALSE;
18789 }
18790
18791 n = end - beg;
18792 str_copy(name, beg, n);
18793 s = RSTRING_PTR(name);
18794 for (i = 0; i < n; ++i) {
18795 if (s[i] == '-') s[i] = '_';
18796 }
18797 do {
18798 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
18799 n = vend - vbeg;
18800 if (mc->length) {
18801 n = (*mc->length)(p, vbeg, n);
18802 }
18803 str_copy(val, vbeg, n);
18804 (*mc->func)(p, mc->name, RSTRING_PTR(val));
18805 break;
18806 }
18807 } while (++mc < magic_comments + numberof(magic_comments));
18808#ifdef RIPPER
18809 str_copy(val, vbeg, vend - vbeg);
18810 dispatch2(magic_comment, name, val);
18811#endif
18812 }
18813
18814 return TRUE;
18815}
18816
18817static void
18818set_file_encoding(struct parser_params *p, const char *str, const char *send)
18819{
18820 int sep = 0;
18821 const char *beg = str;
18822 VALUE s;
18823
18824 for (;;) {
18825 if (send - str <= 6) return;
18826 switch (str[6]) {
18827 case 'C': case 'c': str += 6; continue;
18828 case 'O': case 'o': str += 5; continue;
18829 case 'D': case 'd': str += 4; continue;
18830 case 'I': case 'i': str += 3; continue;
18831 case 'N': case 'n': str += 2; continue;
18832 case 'G': case 'g': str += 1; continue;
18833 case '=': case ':':
18834 sep = 1;
18835 str += 6;
18836 break;
18837 default:
18838 str += 6;
18839 if (ISSPACE(*str)) break;
18840 continue;
18841 }
18842 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
18843 sep = 0;
18844 }
18845 for (;;) {
18846 do {
18847 if (++str >= send) return;
18848 } while (ISSPACE(*str));
18849 if (sep) break;
18850 if (*str != '=' && *str != ':') return;
18851 sep = 1;
18852 str++;
18853 }
18854 beg = str;
18855 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
18856 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
18857 parser_set_encode(p, RSTRING_PTR(s));
18858 rb_str_resize(s, 0);
18859}
18860
18861static void
18862parser_prepare(struct parser_params *p)
18863{
18864 int c = nextc0(p, FALSE);
18865 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
18866 switch (c) {
18867 case '#':
18868 if (peek(p, '!')) p->has_shebang = 1;
18869 break;
18870 case 0xef: /* UTF-8 BOM marker */
18871 if (p->lex.pend - p->lex.pcur >= 2 &&
18872 (unsigned char)p->lex.pcur[0] == 0xbb &&
18873 (unsigned char)p->lex.pcur[1] == 0xbf) {
18874 p->enc = rb_utf8_encoding();
18875 p->lex.pcur += 2;
18876#ifndef RIPPER
18877 if (p->debug_lines) {
18878 rb_enc_associate(p->lex.lastline, p->enc);
18879 }
18880#endif
18881 p->lex.pbeg = p->lex.pcur;
18882 return;
18883 }
18884 break;
18885 case EOF:
18886 return;
18887 }
18888 pushback(p, c);
18889 p->enc = rb_enc_get(p->lex.lastline);
18890}
18891
18892#ifndef RIPPER
18893#define ambiguous_operator(tok, op, syn) ( \
18894 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
18895 rb_warning0("even though it seems like "syn""))
18896#else
18897#define ambiguous_operator(tok, op, syn) \
18898 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
18899#endif
18900#define warn_balanced(tok, op, syn) ((void) \
18901 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
18902 space_seen && !ISSPACE(c) && \
18903 (ambiguous_operator(tok, op, syn), 0)), \
18904 (enum yytokentype)(tok))
18905
18906static VALUE
18907parse_rational(struct parser_params *p, char *str, int len, int seen_point)
18908{
18909 VALUE v;
18910 char *point = &str[seen_point];
18911 size_t fraclen = len-seen_point-1;
18912 memmove(point, point+1, fraclen+1);
18913 v = rb_cstr_to_inum(str, 10, FALSE);
18914 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
18915}
18916
18917static enum yytokentype
18918no_digits(struct parser_params *p)
18919{
18920 yyerror0("numeric literal without digits");
18921 if (peek(p, '_')) nextc(p);
18922 /* dummy 0, for tUMINUS_NUM at numeric */
18923 return set_integer_literal(p, INT2FIX(0), 0);
18924}
18925
18926static enum yytokentype
18927parse_numeric(struct parser_params *p, int c)
18928{
18929 int is_float, seen_point, seen_e, nondigit;
18930 int suffix;
18931
18932 is_float = seen_point = seen_e = nondigit = 0;
18933 SET_LEX_STATE(EXPR_END);
18934 newtok(p);
18935 if (c == '-' || c == '+') {
18936 tokadd(p, c);
18937 c = nextc(p);
18938 }
18939 if (c == '0') {
18940 int start = toklen(p);
18941 c = nextc(p);
18942 if (c == 'x' || c == 'X') {
18943 /* hexadecimal */
18944 c = nextc(p);
18945 if (c != -1 && ISXDIGIT(c)) {
18946 do {
18947 if (c == '_') {
18948 if (nondigit) break;
18949 nondigit = c;
18950 continue;
18951 }
18952 if (!ISXDIGIT(c)) break;
18953 nondigit = 0;
18954 tokadd(p, c);
18955 } while ((c = nextc(p)) != -1);
18956 }
18957 pushback(p, c);
18958 tokfix(p);
18959 if (toklen(p) == start) {
18960 return no_digits(p);
18961 }
18962 else if (nondigit) goto trailing_uc;
18963 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
18964 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
18965 }
18966 if (c == 'b' || c == 'B') {
18967 /* binary */
18968 c = nextc(p);
18969 if (c == '0' || c == '1') {
18970 do {
18971 if (c == '_') {
18972 if (nondigit) break;
18973 nondigit = c;
18974 continue;
18975 }
18976 if (c != '0' && c != '1') break;
18977 nondigit = 0;
18978 tokadd(p, c);
18979 } while ((c = nextc(p)) != -1);
18980 }
18981 pushback(p, c);
18982 tokfix(p);
18983 if (toklen(p) == start) {
18984 return no_digits(p);
18985 }
18986 else if (nondigit) goto trailing_uc;
18987 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
18988 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
18989 }
18990 if (c == 'd' || c == 'D') {
18991 /* decimal */
18992 c = nextc(p);
18993 if (c != -1 && ISDIGIT(c)) {
18994 do {
18995 if (c == '_') {
18996 if (nondigit) break;
18997 nondigit = c;
18998 continue;
18999 }
19000 if (!ISDIGIT(c)) break;
19001 nondigit = 0;
19002 tokadd(p, c);
19003 } while ((c = nextc(p)) != -1);
19004 }
19005 pushback(p, c);
19006 tokfix(p);
19007 if (toklen(p) == start) {
19008 return no_digits(p);
19009 }
19010 else if (nondigit) goto trailing_uc;
19011 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19012 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19013 }
19014 if (c == '_') {
19015 /* 0_0 */
19016 goto octal_number;
19017 }
19018 if (c == 'o' || c == 'O') {
19019 /* prefixed octal */
19020 c = nextc(p);
19021 if (c == -1 || c == '_' || !ISDIGIT(c)) {
19022 return no_digits(p);
19023 }
19024 }
19025 if (c >= '0' && c <= '7') {
19026 /* octal */
19027 octal_number:
19028 do {
19029 if (c == '_') {
19030 if (nondigit) break;
19031 nondigit = c;
19032 continue;
19033 }
19034 if (c < '0' || c > '9') break;
19035 if (c > '7') goto invalid_octal;
19036 nondigit = 0;
19037 tokadd(p, c);
19038 } while ((c = nextc(p)) != -1);
19039 if (toklen(p) > start) {
19040 pushback(p, c);
19041 tokfix(p);
19042 if (nondigit) goto trailing_uc;
19043 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19044 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
19045 }
19046 if (nondigit) {
19047 pushback(p, c);
19048 goto trailing_uc;
19049 }
19050 }
19051 if (c > '7' && c <= '9') {
19052 invalid_octal:
19053 yyerror0("Invalid octal digit");
19054 }
19055 else if (c == '.' || c == 'e' || c == 'E') {
19056 tokadd(p, '0');
19057 }
19058 else {
19059 pushback(p, c);
19060 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19061 return set_integer_literal(p, INT2FIX(0), suffix);
19062 }
19063 }
19064
19065 for (;;) {
19066 switch (c) {
19067 case '0': case '1': case '2': case '3': case '4':
19068 case '5': case '6': case '7': case '8': case '9':
19069 nondigit = 0;
19070 tokadd(p, c);
19071 break;
19072
19073 case '.':
19074 if (nondigit) goto trailing_uc;
19075 if (seen_point || seen_e) {
19076 goto decode_num;
19077 }
19078 else {
19079 int c0 = nextc(p);
19080 if (c0 == -1 || !ISDIGIT(c0)) {
19081 pushback(p, c0);
19082 goto decode_num;
19083 }
19084 c = c0;
19085 }
19086 seen_point = toklen(p);
19087 tokadd(p, '.');
19088 tokadd(p, c);
19089 is_float++;
19090 nondigit = 0;
19091 break;
19092
19093 case 'e':
19094 case 'E':
19095 if (nondigit) {
19096 pushback(p, c);
19097 c = nondigit;
19098 goto decode_num;
19099 }
19100 if (seen_e) {
19101 goto decode_num;
19102 }
19103 nondigit = c;
19104 c = nextc(p);
19105 if (c != '-' && c != '+' && !ISDIGIT(c)) {
19106 pushback(p, c);
19107 nondigit = 0;
19108 goto decode_num;
19109 }
19110 tokadd(p, nondigit);
19111 seen_e++;
19112 is_float++;
19113 tokadd(p, c);
19114 nondigit = (c == '-' || c == '+') ? c : 0;
19115 break;
19116
19117 case '_': /* `_' in number just ignored */
19118 if (nondigit) goto decode_num;
19119 nondigit = c;
19120 break;
19121
19122 default:
19123 goto decode_num;
19124 }
19125 c = nextc(p);
19126 }
19127
19128 decode_num:
19129 pushback(p, c);
19130 if (nondigit) {
19131 trailing_uc:
19132 literal_flush(p, p->lex.pcur - 1);
19133 YYLTYPE loc = RUBY_INIT_YYLLOC();
19134 compile_error(p, "trailing `%c' in number", nondigit);
19135 parser_show_error_line(p, &loc);
19136 }
19137 tokfix(p);
19138 if (is_float) {
19139 enum yytokentype type = tFLOAT;
19140 VALUE v;
19141
19142 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
19143 if (suffix & NUM_SUFFIX_R) {
19144 type = tRATIONAL;
19145 v = parse_rational(p, tok(p), toklen(p), seen_point);
19146 }
19147 else {
19148 double d = strtod(tok(p), 0);
19149 if (errno == ERANGE) {
19150 rb_warning1("Float %s out of range", WARN_S(tok(p)));
19151 errno = 0;
19152 }
19153 v = DBL2NUM(d);
19154 }
19155 return set_number_literal(p, v, type, suffix);
19156 }
19157 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19158 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19159}
19160
19161static enum yytokentype
19162parse_qmark(struct parser_params *p, int space_seen)
19163{
19164 rb_encoding *enc;
19165 register int c;
19166 VALUE lit;
19167
19168 if (IS_END()) {
19169 SET_LEX_STATE(EXPR_VALUE);
19170 return '?';
19171 }
19172 c = nextc(p);
19173 if (c == -1) {
19174 compile_error(p, "incomplete character syntax");
19175 return 0;
19176 }
19177 if (rb_enc_isspace(c, p->enc)) {
19178 if (!IS_ARG()) {
19179 int c2 = escaped_control_code(c);
19180 if (c2) {
19181 WARN_SPACE_CHAR(c2, "?");
19182 }
19183 }
19184 ternary:
19185 pushback(p, c);
19186 SET_LEX_STATE(EXPR_VALUE);
19187 return '?';
19188 }
19189 newtok(p);
19190 enc = p->enc;
19191 if (!parser_isascii(p)) {
19192 if (tokadd_mbchar(p, c) == -1) return 0;
19193 }
19194 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
19195 p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
19196 if (space_seen) {
19197 const char *start = p->lex.pcur - 1, *ptr = start;
19198 do {
19199 int n = parser_precise_mbclen(p, ptr);
19200 if (n < 0) return -1;
19201 ptr += n;
19202 } while (ptr < p->lex.pend && is_identchar(ptr, p->lex.pend, p->enc));
19203 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
19204 " a conditional operator, put a space after `?'",
19205 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
19206 }
19207 goto ternary;
19208 }
19209 else if (c == '\\') {
19210 if (peek(p, 'u')) {
19211 nextc(p);
19212 enc = rb_utf8_encoding();
19213 tokadd_utf8(p, &enc, -1, 0, 0);
19214 }
19215 else if (!ISASCII(c = peekc(p))) {
19216 nextc(p);
19217 if (tokadd_mbchar(p, c) == -1) return 0;
19218 }
19219 else {
19220 c = read_escape(p, 0, &enc);
19221 tokadd(p, c);
19222 }
19223 }
19224 else {
19225 tokadd(p, c);
19226 }
19227 tokfix(p);
19228 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
19229 set_yylval_str(lit);
19230 SET_LEX_STATE(EXPR_END);
19231 return tCHAR;
19232}
19233
19234static enum yytokentype
19235parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
19236{
19237 register int c;
19238 const char *ptok = p->lex.pcur;
19239
19240 if (IS_BEG()) {
19241 int term;
19242 int paren;
19243
19244 c = nextc(p);
19245 quotation:
19246 if (c == -1) goto unterminated;
19247 if (!ISALNUM(c)) {
19248 term = c;
19249 if (!ISASCII(c)) goto unknown;
19250 c = 'Q';
19251 }
19252 else {
19253 term = nextc(p);
19254 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
19255 unknown:
19256 pushback(p, term);
19257 c = parser_precise_mbclen(p, p->lex.pcur);
19258 if (c < 0) return 0;
19259 p->lex.pcur += c;
19260 yyerror0("unknown type of %string");
19261 return 0;
19262 }
19263 }
19264 if (term == -1) {
19265 unterminated:
19266 compile_error(p, "unterminated quoted string meets end of file");
19267 return 0;
19268 }
19269 paren = term;
19270 if (term == '(') term = ')';
19271 else if (term == '[') term = ']';
19272 else if (term == '{') term = '}';
19273 else if (term == '<') term = '>';
19274 else paren = 0;
19275
19276 p->lex.ptok = ptok-1;
19277 switch (c) {
19278 case 'Q':
19279 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
19280 return tSTRING_BEG;
19281
19282 case 'q':
19283 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
19284 return tSTRING_BEG;
19285
19286 case 'W':
19287 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
19288 return tWORDS_BEG;
19289
19290 case 'w':
19291 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
19292 return tQWORDS_BEG;
19293
19294 case 'I':
19295 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
19296 return tSYMBOLS_BEG;
19297
19298 case 'i':
19299 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
19300 return tQSYMBOLS_BEG;
19301
19302 case 'x':
19303 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
19304 return tXSTRING_BEG;
19305
19306 case 'r':
19307 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
19308 return tREGEXP_BEG;
19309
19310 case 's':
19311 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
19312 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
19313 return tSYMBEG;
19314
19315 default:
19316 yyerror0("unknown type of %string");
19317 return 0;
19318 }
19319 }
19320 if ((c = nextc(p)) == '=') {
19321 set_yylval_id('%');
19322 SET_LEX_STATE(EXPR_BEG);
19323 return tOP_ASGN;
19324 }
19325 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
19326 goto quotation;
19327 }
19328 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19329 pushback(p, c);
19330 return warn_balanced('%', "%%", "string literal");
19331}
19332
19333static int
19334tokadd_ident(struct parser_params *p, int c)
19335{
19336 do {
19337 if (tokadd_mbchar(p, c) == -1) return -1;
19338 c = nextc(p);
19339 } while (parser_is_identchar(p));
19340 pushback(p, c);
19341 return 0;
19342}
19343
19344static ID
19345tokenize_ident(struct parser_params *p, const enum lex_state_e last_state)
19346{
19347 ID ident = TOK_INTERN();
19348
19349 set_yylval_name(ident);
19350
19351 return ident;
19352}
19353
19354static int
19355parse_numvar(struct parser_params *p)
19356{
19357 size_t len;
19358 int overflow;
19359 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
19360 const unsigned long nth_ref_max =
19362 /* NTH_REF is left-shifted to be ORed with back-ref flag and
19363 * turned into a Fixnum, in compile.c */
19364
19365 if (overflow || n > nth_ref_max) {
19366 /* compile_error()? */
19367 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
19368 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
19369 }
19370 else {
19371 return (int)n;
19372 }
19373}
19374
19375static enum yytokentype
19376parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
19377{
19378 const char *ptr = p->lex.pcur;
19379 register int c;
19380
19381 SET_LEX_STATE(EXPR_END);
19382 p->lex.ptok = ptr - 1; /* from '$' */
19383 newtok(p);
19384 c = nextc(p);
19385 switch (c) {
19386 case '_': /* $_: last read line string */
19387 c = nextc(p);
19388 if (parser_is_identchar(p)) {
19389 tokadd(p, '$');
19390 tokadd(p, '_');
19391 break;
19392 }
19393 pushback(p, c);
19394 c = '_';
19395 /* fall through */
19396 case '~': /* $~: match-data */
19397 case '*': /* $*: argv */
19398 case '$': /* $$: pid */
19399 case '?': /* $?: last status */
19400 case '!': /* $!: error string */
19401 case '@': /* $@: error position */
19402 case '/': /* $/: input record separator */
19403 case '\\': /* $\: output record separator */
19404 case ';': /* $;: field separator */
19405 case ',': /* $,: output field separator */
19406 case '.': /* $.: last read line number */
19407 case '=': /* $=: ignorecase */
19408 case ':': /* $:: load path */
19409 case '<': /* $<: reading filename */
19410 case '>': /* $>: default output handle */
19411 case '\"': /* $": already loaded files */
19412 tokadd(p, '$');
19413 tokadd(p, c);
19414 goto gvar;
19415
19416 case '-':
19417 tokadd(p, '$');
19418 tokadd(p, c);
19419 c = nextc(p);
19420 if (parser_is_identchar(p)) {
19421 if (tokadd_mbchar(p, c) == -1) return 0;
19422 }
19423 else {
19424 pushback(p, c);
19425 pushback(p, '-');
19426 return '$';
19427 }
19428 gvar:
19429 set_yylval_name(TOK_INTERN());
19430 return tGVAR;
19431
19432 case '&': /* $&: last match */
19433 case '`': /* $`: string before last match */
19434 case '\'': /* $': string after last match */
19435 case '+': /* $+: string matches last paren. */
19436 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
19437 tokadd(p, '$');
19438 tokadd(p, c);
19439 goto gvar;
19440 }
19441 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
19442 return tBACK_REF;
19443
19444 case '1': case '2': case '3':
19445 case '4': case '5': case '6':
19446 case '7': case '8': case '9':
19447 tokadd(p, '$');
19448 do {
19449 tokadd(p, c);
19450 c = nextc(p);
19451 } while (c != -1 && ISDIGIT(c));
19452 pushback(p, c);
19453 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
19454 tokfix(p);
19455 c = parse_numvar(p);
19456 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
19457 return tNTH_REF;
19458
19459 default:
19460 if (!parser_is_identchar(p)) {
19461 YYLTYPE loc = RUBY_INIT_YYLLOC();
19462 if (c == -1 || ISSPACE(c)) {
19463 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
19464 }
19465 else {
19466 pushback(p, c);
19467 compile_error(p, "`$%c' is not allowed as a global variable name", c);
19468 }
19469 parser_show_error_line(p, &loc);
19470 set_yylval_noname();
19471 return tGVAR;
19472 }
19473 /* fall through */
19474 case '0':
19475 tokadd(p, '$');
19476 }
19477
19478 if (tokadd_ident(p, c)) return 0;
19479 SET_LEX_STATE(EXPR_END);
19480 tokenize_ident(p, last_state);
19481 return tGVAR;
19482}
19483
19484#ifndef RIPPER
19485static bool
19486parser_numbered_param(struct parser_params *p, int n)
19487{
19488 if (n < 0) return false;
19489
19490 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
19491 return false;
19492 }
19493 if (p->max_numparam == ORDINAL_PARAM) {
19494 compile_error(p, "ordinary parameter is defined");
19495 return false;
19496 }
19497 struct vtable *args = p->lvtbl->args;
19498 if (p->max_numparam < n) {
19499 p->max_numparam = n;
19500 }
19501 while (n > args->pos) {
19502 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
19503 }
19504 return true;
19505}
19506#endif
19507
19508static enum yytokentype
19509parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
19510{
19511 const char *ptr = p->lex.pcur;
19512 enum yytokentype result = tIVAR;
19513 register int c = nextc(p);
19514 YYLTYPE loc;
19515
19516 p->lex.ptok = ptr - 1; /* from '@' */
19517 newtok(p);
19518 tokadd(p, '@');
19519 if (c == '@') {
19520 result = tCVAR;
19521 tokadd(p, '@');
19522 c = nextc(p);
19523 }
19524 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
19525 if (c == -1 || !parser_is_identchar(p)) {
19526 pushback(p, c);
19527 RUBY_SET_YYLLOC(loc);
19528 if (result == tIVAR) {
19529 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
19530 }
19531 else {
19532 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
19533 }
19534 parser_show_error_line(p, &loc);
19535 set_yylval_noname();
19536 SET_LEX_STATE(EXPR_END);
19537 return result;
19538 }
19539 else if (ISDIGIT(c)) {
19540 pushback(p, c);
19541 RUBY_SET_YYLLOC(loc);
19542 if (result == tIVAR) {
19543 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
19544 }
19545 else {
19546 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
19547 }
19548 parser_show_error_line(p, &loc);
19549 set_yylval_noname();
19550 SET_LEX_STATE(EXPR_END);
19551 return result;
19552 }
19553
19554 if (tokadd_ident(p, c)) return 0;
19555 tokenize_ident(p, last_state);
19556 return result;
19557}
19558
19559static enum yytokentype
19560parse_ident(struct parser_params *p, int c, int cmd_state)
19561{
19562 enum yytokentype result;
19563 int mb = ENC_CODERANGE_7BIT;
19564 const enum lex_state_e last_state = p->lex.state;
19565 ID ident;
19566 int enforce_keyword_end = 0;
19567
19568 do {
19569 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
19570 if (tokadd_mbchar(p, c) == -1) return 0;
19571 c = nextc(p);
19572 } while (parser_is_identchar(p));
19573 if ((c == '!' || c == '?') && !peek(p, '=')) {
19574 result = tFID;
19575 tokadd(p, c);
19576 }
19577 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
19578 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
19579 result = tIDENTIFIER;
19580 tokadd(p, c);
19581 }
19582 else {
19583 result = tCONSTANT; /* assume provisionally */
19584 pushback(p, c);
19585 }
19586 tokfix(p);
19587
19588 if (IS_LABEL_POSSIBLE()) {
19589 if (IS_LABEL_SUFFIX(0)) {
19590 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
19591 nextc(p);
19592 set_yylval_name(TOK_INTERN());
19593 return tLABEL;
19594 }
19595 }
19596
19597#ifndef RIPPER
19598 if (!NIL_P(peek_end_expect_token_locations(p))) {
19599 VALUE end_loc;
19600 int lineno, column;
19601 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
19602
19603 end_loc = peek_end_expect_token_locations(p);
19604 lineno = NUM2INT(rb_ary_entry(end_loc, 0));
19605 column = NUM2INT(rb_ary_entry(end_loc, 1));
19606
19607 if (p->debug) {
19608 rb_parser_printf(p, "enforce_keyword_end check. current: (%d, %d), peek: (%d, %d)\n",
19609 p->ruby_sourceline, beg_pos, lineno, column);
19610 }
19611
19612 if ((p->ruby_sourceline > lineno) && (beg_pos <= column)) {
19613 const struct kwtable *kw;
19614
19615 if ((IS_lex_state(EXPR_DOT)) && (kw = rb_reserved_word(tok(p), toklen(p))) && (kw && kw->id[0] == keyword_end)) {
19616 if (p->debug) rb_parser_printf(p, "enforce_keyword_end is enabled\n");
19617 enforce_keyword_end = 1;
19618 }
19619 }
19620 }
19621#endif
19622
19623 if (mb == ENC_CODERANGE_7BIT && (!IS_lex_state(EXPR_DOT) || enforce_keyword_end)) {
19624 const struct kwtable *kw;
19625
19626 /* See if it is a reserved word. */
19627 kw = rb_reserved_word(tok(p), toklen(p));
19628 if (kw) {
19629 enum lex_state_e state = p->lex.state;
19630 if (IS_lex_state_for(state, EXPR_FNAME)) {
19631 SET_LEX_STATE(EXPR_ENDFN);
19632 set_yylval_name(rb_intern2(tok(p), toklen(p)));
19633 return kw->id[0];
19634 }
19635 SET_LEX_STATE(kw->state);
19636 if (IS_lex_state(EXPR_BEG)) {
19637 p->command_start = TRUE;
19638 }
19639 if (kw->id[0] == keyword_do) {
19640 if (lambda_beginning_p()) {
19641 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
19642 return keyword_do_LAMBDA;
19643 }
19644 if (COND_P()) return keyword_do_cond;
19645 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
19646 return keyword_do_block;
19647 return keyword_do;
19648 }
19649 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED | EXPR_CLASS)))
19650 return kw->id[0];
19651 else {
19652 if (kw->id[0] != kw->id[1])
19653 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
19654 return kw->id[1];
19655 }
19656 }
19657 }
19658
19659 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
19660 if (cmd_state) {
19661 SET_LEX_STATE(EXPR_CMDARG);
19662 }
19663 else {
19664 SET_LEX_STATE(EXPR_ARG);
19665 }
19666 }
19667 else if (p->lex.state == EXPR_FNAME) {
19668 SET_LEX_STATE(EXPR_ENDFN);
19669 }
19670 else {
19671 SET_LEX_STATE(EXPR_END);
19672 }
19673
19674 ident = tokenize_ident(p, last_state);
19675 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
19676 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
19677 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
19678 (lvar_defined(p, ident) || NUMPARAM_ID_P(ident))) {
19679 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
19680 }
19681 return result;
19682}
19683
19684static void
19685warn_cr(struct parser_params *p)
19686{
19687 if (!p->cr_seen) {
19688 p->cr_seen = TRUE;
19689 /* carried over with p->lex.nextline for nextc() */
19690 rb_warn0("encountered \\r in middle of line, treated as a mere space");
19691 }
19692}
19693
19694static enum yytokentype
19695parser_yylex(struct parser_params *p)
19696{
19697 register int c;
19698 int space_seen = 0;
19699 int cmd_state;
19700 int label;
19701 enum lex_state_e last_state;
19702 int fallthru = FALSE;
19703 int token_seen = p->token_seen;
19704
19705 if (p->lex.strterm) {
19706 if (p->lex.strterm->flags & STRTERM_HEREDOC) {
19707 token_flush(p);
19708 return here_document(p, &p->lex.strterm->u.heredoc);
19709 }
19710 else {
19711 token_flush(p);
19712 return parse_string(p, &p->lex.strterm->u.literal);
19713 }
19714 }
19715 cmd_state = p->command_start;
19716 p->command_start = FALSE;
19717 p->token_seen = TRUE;
19718#ifndef RIPPER
19719 token_flush(p);
19720#endif
19721 retry:
19722 last_state = p->lex.state;
19723 switch (c = nextc(p)) {
19724 case '\0': /* NUL */
19725 case '\004': /* ^D */
19726 case '\032': /* ^Z */
19727 case -1: /* end of script. */
19728 p->eofp = 1;
19729#ifndef RIPPER
19730 if (!NIL_P(p->end_expect_token_locations) && RARRAY_LEN(p->end_expect_token_locations) > 0) {
19731 pop_end_expect_token_locations(p);
19732 RUBY_SET_YYLLOC_OF_DUMMY_END(*p->yylloc);
19733 return tDUMNY_END;
19734 }
19735#endif
19736 /* Set location for end-of-input because dispatch_scan_event is not called. */
19737 RUBY_SET_YYLLOC(*p->yylloc);
19738 return 0;
19739
19740 /* white spaces */
19741 case '\r':
19742 warn_cr(p);
19743 /* fall through */
19744 case ' ': case '\t': case '\f':
19745 case '\13': /* '\v' */
19746 space_seen = 1;
19747 while ((c = nextc(p))) {
19748 switch (c) {
19749 case '\r':
19750 warn_cr(p);
19751 /* fall through */
19752 case ' ': case '\t': case '\f':
19753 case '\13': /* '\v' */
19754 break;
19755 default:
19756 goto outofloop;
19757 }
19758 }
19759 outofloop:
19760 pushback(p, c);
19761 dispatch_scan_event(p, tSP);
19762#ifndef RIPPER
19763 token_flush(p);
19764#endif
19765 goto retry;
19766
19767 case '#': /* it's a comment */
19768 p->token_seen = token_seen;
19769 /* no magic_comment in shebang line */
19770 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
19771 if (comment_at_top(p)) {
19772 set_file_encoding(p, p->lex.pcur, p->lex.pend);
19773 }
19774 }
19775 lex_goto_eol(p);
19776 dispatch_scan_event(p, tCOMMENT);
19777 fallthru = TRUE;
19778 /* fall through */
19779 case '\n':
19780 p->token_seen = token_seen;
19781 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
19782 !IS_lex_state(EXPR_LABELED));
19783 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
19784 if (!fallthru) {
19785 dispatch_scan_event(p, tIGNORED_NL);
19786 }
19787 fallthru = FALSE;
19788 if (!c && p->ctxt.in_kwarg) {
19789 goto normal_newline;
19790 }
19791 goto retry;
19792 }
19793 while (1) {
19794 switch (c = nextc(p)) {
19795 case ' ': case '\t': case '\f': case '\r':
19796 case '\13': /* '\v' */
19797 space_seen = 1;
19798 break;
19799 case '#':
19800 pushback(p, c);
19801 if (space_seen) {
19802 dispatch_scan_event(p, tSP);
19803 token_flush(p);
19804 }
19805 goto retry;
19806 case '&':
19807 case '.': {
19808 dispatch_delayed_token(p, tIGNORED_NL);
19809 if (peek(p, '.') == (c == '&')) {
19810 pushback(p, c);
19811 dispatch_scan_event(p, tSP);
19812 goto retry;
19813 }
19814 }
19815 default:
19816 p->ruby_sourceline--;
19817 p->lex.nextline = p->lex.lastline;
19818 case -1: /* EOF no decrement*/
19819 lex_goto_eol(p);
19820 if (c != -1) {
19821 p->lex.ptok = p->lex.pcur;
19822 }
19823 goto normal_newline;
19824 }
19825 }
19826 normal_newline:
19827 p->command_start = TRUE;
19828 SET_LEX_STATE(EXPR_BEG);
19829 return '\n';
19830
19831 case '*':
19832 if ((c = nextc(p)) == '*') {
19833 if ((c = nextc(p)) == '=') {
19834 set_yylval_id(idPow);
19835 SET_LEX_STATE(EXPR_BEG);
19836 return tOP_ASGN;
19837 }
19838 pushback(p, c);
19839 if (IS_SPCARG(c)) {
19840 rb_warning0("`**' interpreted as argument prefix");
19841 c = tDSTAR;
19842 }
19843 else if (IS_BEG()) {
19844 c = tDSTAR;
19845 }
19846 else {
19847 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
19848 }
19849 }
19850 else {
19851 if (c == '=') {
19852 set_yylval_id('*');
19853 SET_LEX_STATE(EXPR_BEG);
19854 return tOP_ASGN;
19855 }
19856 pushback(p, c);
19857 if (IS_SPCARG(c)) {
19858 rb_warning0("`*' interpreted as argument prefix");
19859 c = tSTAR;
19860 }
19861 else if (IS_BEG()) {
19862 c = tSTAR;
19863 }
19864 else {
19865 c = warn_balanced('*', "*", "argument prefix");
19866 }
19867 }
19868 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19869 return c;
19870
19871 case '!':
19872 c = nextc(p);
19873 if (IS_AFTER_OPERATOR()) {
19874 SET_LEX_STATE(EXPR_ARG);
19875 if (c == '@') {
19876 return '!';
19877 }
19878 }
19879 else {
19880 SET_LEX_STATE(EXPR_BEG);
19881 }
19882 if (c == '=') {
19883 return tNEQ;
19884 }
19885 if (c == '~') {
19886 return tNMATCH;
19887 }
19888 pushback(p, c);
19889 return '!';
19890
19891 case '=':
19892 if (was_bol(p)) {
19893 /* skip embedded rd document */
19894 if (word_match_p(p, "begin", 5)) {
19895 int first_p = TRUE;
19896
19897 lex_goto_eol(p);
19898 dispatch_scan_event(p, tEMBDOC_BEG);
19899 for (;;) {
19900 lex_goto_eol(p);
19901 if (!first_p) {
19902 dispatch_scan_event(p, tEMBDOC);
19903 }
19904 first_p = FALSE;
19905 c = nextc(p);
19906 if (c == -1) {
19907 compile_error(p, "embedded document meets end of file");
19908 return 0;
19909 }
19910 if (c == '=' && word_match_p(p, "end", 3)) {
19911 break;
19912 }
19913 pushback(p, c);
19914 }
19915 lex_goto_eol(p);
19916 dispatch_scan_event(p, tEMBDOC_END);
19917 goto retry;
19918 }
19919 }
19920
19921 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19922 if ((c = nextc(p)) == '=') {
19923 if ((c = nextc(p)) == '=') {
19924 return tEQQ;
19925 }
19926 pushback(p, c);
19927 return tEQ;
19928 }
19929 if (c == '~') {
19930 return tMATCH;
19931 }
19932 else if (c == '>') {
19933 return tASSOC;
19934 }
19935 pushback(p, c);
19936 return '=';
19937
19938 case '<':
19939 c = nextc(p);
19940 if (c == '<' &&
19941 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
19942 !IS_END() &&
19943 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
19944 int token = heredoc_identifier(p);
19945 if (token) return token < 0 ? 0 : token;
19946 }
19947 if (IS_AFTER_OPERATOR()) {
19948 SET_LEX_STATE(EXPR_ARG);
19949 }
19950 else {
19951 if (IS_lex_state(EXPR_CLASS))
19952 p->command_start = TRUE;
19953 SET_LEX_STATE(EXPR_BEG);
19954 }
19955 if (c == '=') {
19956 if ((c = nextc(p)) == '>') {
19957 return tCMP;
19958 }
19959 pushback(p, c);
19960 return tLEQ;
19961 }
19962 if (c == '<') {
19963 if ((c = nextc(p)) == '=') {
19964 set_yylval_id(idLTLT);
19965 SET_LEX_STATE(EXPR_BEG);
19966 return tOP_ASGN;
19967 }
19968 pushback(p, c);
19969 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
19970 }
19971 pushback(p, c);
19972 return '<';
19973
19974 case '>':
19975 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19976 if ((c = nextc(p)) == '=') {
19977 return tGEQ;
19978 }
19979 if (c == '>') {
19980 if ((c = nextc(p)) == '=') {
19981 set_yylval_id(idGTGT);
19982 SET_LEX_STATE(EXPR_BEG);
19983 return tOP_ASGN;
19984 }
19985 pushback(p, c);
19986 return tRSHFT;
19987 }
19988 pushback(p, c);
19989 return '>';
19990
19991 case '"':
19992 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
19993 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
19994 p->lex.ptok = p->lex.pcur-1;
19995 return tSTRING_BEG;
19996
19997 case '`':
19998 if (IS_lex_state(EXPR_FNAME)) {
19999 SET_LEX_STATE(EXPR_ENDFN);
20000 return c;
20001 }
20002 if (IS_lex_state(EXPR_DOT)) {
20003 if (cmd_state)
20004 SET_LEX_STATE(EXPR_CMDARG);
20005 else
20006 SET_LEX_STATE(EXPR_ARG);
20007 return c;
20008 }
20009 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
20010 return tXSTRING_BEG;
20011
20012 case '\'':
20013 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
20014 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
20015 p->lex.ptok = p->lex.pcur-1;
20016 return tSTRING_BEG;
20017
20018 case '?':
20019 return parse_qmark(p, space_seen);
20020
20021 case '&':
20022 if ((c = nextc(p)) == '&') {
20023 SET_LEX_STATE(EXPR_BEG);
20024 if ((c = nextc(p)) == '=') {
20025 set_yylval_id(idANDOP);
20026 SET_LEX_STATE(EXPR_BEG);
20027 return tOP_ASGN;
20028 }
20029 pushback(p, c);
20030 return tANDOP;
20031 }
20032 else if (c == '=') {
20033 set_yylval_id('&');
20034 SET_LEX_STATE(EXPR_BEG);
20035 return tOP_ASGN;
20036 }
20037 else if (c == '.') {
20038 set_yylval_id(idANDDOT);
20039 SET_LEX_STATE(EXPR_DOT);
20040 return tANDDOT;
20041 }
20042 pushback(p, c);
20043 if (IS_SPCARG(c)) {
20044 if ((c != ':') ||
20045 (c = peekc_n(p, 1)) == -1 ||
20046 !(c == '\'' || c == '"' ||
20047 is_identchar((p->lex.pcur+1), p->lex.pend, p->enc))) {
20048 rb_warning0("`&' interpreted as argument prefix");
20049 }
20050 c = tAMPER;
20051 }
20052 else if (IS_BEG()) {
20053 c = tAMPER;
20054 }
20055 else {
20056 c = warn_balanced('&', "&", "argument prefix");
20057 }
20058 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20059 return c;
20060
20061 case '|':
20062 if ((c = nextc(p)) == '|') {
20063 SET_LEX_STATE(EXPR_BEG);
20064 if ((c = nextc(p)) == '=') {
20065 set_yylval_id(idOROP);
20066 SET_LEX_STATE(EXPR_BEG);
20067 return tOP_ASGN;
20068 }
20069 pushback(p, c);
20070 if (IS_lex_state_for(last_state, EXPR_BEG)) {
20071 c = '|';
20072 pushback(p, '|');
20073 return c;
20074 }
20075 return tOROP;
20076 }
20077 if (c == '=') {
20078 set_yylval_id('|');
20079 SET_LEX_STATE(EXPR_BEG);
20080 return tOP_ASGN;
20081 }
20082 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
20083 pushback(p, c);
20084 return '|';
20085
20086 case '+':
20087 c = nextc(p);
20088 if (IS_AFTER_OPERATOR()) {
20089 SET_LEX_STATE(EXPR_ARG);
20090 if (c == '@') {
20091 return tUPLUS;
20092 }
20093 pushback(p, c);
20094 return '+';
20095 }
20096 if (c == '=') {
20097 set_yylval_id('+');
20098 SET_LEX_STATE(EXPR_BEG);
20099 return tOP_ASGN;
20100 }
20101 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
20102 SET_LEX_STATE(EXPR_BEG);
20103 pushback(p, c);
20104 if (c != -1 && ISDIGIT(c)) {
20105 return parse_numeric(p, '+');
20106 }
20107 return tUPLUS;
20108 }
20109 SET_LEX_STATE(EXPR_BEG);
20110 pushback(p, c);
20111 return warn_balanced('+', "+", "unary operator");
20112
20113 case '-':
20114 c = nextc(p);
20115 if (IS_AFTER_OPERATOR()) {
20116 SET_LEX_STATE(EXPR_ARG);
20117 if (c == '@') {
20118 return tUMINUS;
20119 }
20120 pushback(p, c);
20121 return '-';
20122 }
20123 if (c == '=') {
20124 set_yylval_id('-');
20125 SET_LEX_STATE(EXPR_BEG);
20126 return tOP_ASGN;
20127 }
20128 if (c == '>') {
20129 SET_LEX_STATE(EXPR_ENDFN);
20130 return tLAMBDA;
20131 }
20132 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
20133 SET_LEX_STATE(EXPR_BEG);
20134 pushback(p, c);
20135 if (c != -1 && ISDIGIT(c)) {
20136 return tUMINUS_NUM;
20137 }
20138 return tUMINUS;
20139 }
20140 SET_LEX_STATE(EXPR_BEG);
20141 pushback(p, c);
20142 return warn_balanced('-', "-", "unary operator");
20143
20144 case '.': {
20145 int is_beg = IS_BEG();
20146 SET_LEX_STATE(EXPR_BEG);
20147 if ((c = nextc(p)) == '.') {
20148 if ((c = nextc(p)) == '.') {
20149 if (p->ctxt.in_argdef) {
20150 SET_LEX_STATE(EXPR_ENDARG);
20151 return tBDOT3;
20152 }
20153 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
20154 rb_warn0("... at EOL, should be parenthesized?");
20155 }
20156 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
20157 if (IS_lex_state_for(last_state, EXPR_LABEL))
20158 return tDOT3;
20159 }
20160 return is_beg ? tBDOT3 : tDOT3;
20161 }
20162 pushback(p, c);
20163 return is_beg ? tBDOT2 : tDOT2;
20164 }
20165 pushback(p, c);
20166 if (c != -1 && ISDIGIT(c)) {
20167 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
20168 parse_numeric(p, '.');
20169 if (ISDIGIT(prev)) {
20170 yyerror0("unexpected fraction part after numeric literal");
20171 }
20172 else {
20173 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
20174 }
20175 SET_LEX_STATE(EXPR_END);
20176 p->lex.ptok = p->lex.pcur;
20177 goto retry;
20178 }
20179 set_yylval_id('.');
20180 SET_LEX_STATE(EXPR_DOT);
20181 return '.';
20182 }
20183
20184 case '0': case '1': case '2': case '3': case '4':
20185 case '5': case '6': case '7': case '8': case '9':
20186 return parse_numeric(p, c);
20187
20188 case ')':
20189 COND_POP();
20190 CMDARG_POP();
20191 SET_LEX_STATE(EXPR_ENDFN);
20192 p->lex.paren_nest--;
20193 return c;
20194
20195 case ']':
20196 COND_POP();
20197 CMDARG_POP();
20198 SET_LEX_STATE(EXPR_END);
20199 p->lex.paren_nest--;
20200 return c;
20201
20202 case '}':
20203 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
20204 if (!p->lex.brace_nest--) return tSTRING_DEND;
20205 COND_POP();
20206 CMDARG_POP();
20207 SET_LEX_STATE(EXPR_END);
20208 p->lex.paren_nest--;
20209 return c;
20210
20211 case ':':
20212 c = nextc(p);
20213 if (c == ':') {
20214 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
20215 SET_LEX_STATE(EXPR_BEG);
20216 return tCOLON3;
20217 }
20218 set_yylval_id(idCOLON2);
20219 SET_LEX_STATE(EXPR_DOT);
20220 return tCOLON2;
20221 }
20222 if (IS_END() || ISSPACE(c) || c == '#') {
20223 pushback(p, c);
20224 c = warn_balanced(':', ":", "symbol literal");
20225 SET_LEX_STATE(EXPR_BEG);
20226 return c;
20227 }
20228 switch (c) {
20229 case '\'':
20230 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
20231 break;
20232 case '"':
20233 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
20234 break;
20235 default:
20236 pushback(p, c);
20237 break;
20238 }
20239 SET_LEX_STATE(EXPR_FNAME);
20240 return tSYMBEG;
20241
20242 case '/':
20243 if (IS_BEG()) {
20244 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
20245 return tREGEXP_BEG;
20246 }
20247 if ((c = nextc(p)) == '=') {
20248 set_yylval_id('/');
20249 SET_LEX_STATE(EXPR_BEG);
20250 return tOP_ASGN;
20251 }
20252 pushback(p, c);
20253 if (IS_SPCARG(c)) {
20254 arg_ambiguous(p, '/');
20255 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
20256 return tREGEXP_BEG;
20257 }
20258 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20259 return warn_balanced('/', "/", "regexp literal");
20260
20261 case '^':
20262 if ((c = nextc(p)) == '=') {
20263 set_yylval_id('^');
20264 SET_LEX_STATE(EXPR_BEG);
20265 return tOP_ASGN;
20266 }
20267 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20268 pushback(p, c);
20269 return '^';
20270
20271 case ';':
20272 SET_LEX_STATE(EXPR_BEG);
20273 p->command_start = TRUE;
20274 return ';';
20275
20276 case ',':
20277 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20278 return ',';
20279
20280 case '~':
20281 if (IS_AFTER_OPERATOR()) {
20282 if ((c = nextc(p)) != '@') {
20283 pushback(p, c);
20284 }
20285 SET_LEX_STATE(EXPR_ARG);
20286 }
20287 else {
20288 SET_LEX_STATE(EXPR_BEG);
20289 }
20290 return '~';
20291
20292 case '(':
20293 if (IS_BEG()) {
20294 c = tLPAREN;
20295 }
20296 else if (!space_seen) {
20297 /* foo( ... ) => method call, no ambiguity */
20298 }
20299 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
20300 c = tLPAREN_ARG;
20301 }
20302 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
20303 rb_warning0("parentheses after method name is interpreted as "
20304 "an argument list, not a decomposed argument");
20305 }
20306 p->lex.paren_nest++;
20307 COND_PUSH(0);
20308 CMDARG_PUSH(0);
20309 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20310 return c;
20311
20312 case '[':
20313 p->lex.paren_nest++;
20314 if (IS_AFTER_OPERATOR()) {
20315 if ((c = nextc(p)) == ']') {
20316 p->lex.paren_nest--;
20317 SET_LEX_STATE(EXPR_ARG);
20318 if ((c = nextc(p)) == '=') {
20319 return tASET;
20320 }
20321 pushback(p, c);
20322 return tAREF;
20323 }
20324 pushback(p, c);
20325 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
20326 return '[';
20327 }
20328 else if (IS_BEG()) {
20329 c = tLBRACK;
20330 }
20331 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
20332 c = tLBRACK;
20333 }
20334 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20335 COND_PUSH(0);
20336 CMDARG_PUSH(0);
20337 return c;
20338
20339 case '{':
20340 ++p->lex.brace_nest;
20341 if (lambda_beginning_p())
20342 c = tLAMBEG;
20343 else if (IS_lex_state(EXPR_LABELED))
20344 c = tLBRACE; /* hash */
20345 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
20346 c = '{'; /* block (primary) */
20347 else if (IS_lex_state(EXPR_ENDARG))
20348 c = tLBRACE_ARG; /* block (expr) */
20349 else
20350 c = tLBRACE; /* hash */
20351 if (c != tLBRACE) {
20352 p->command_start = TRUE;
20353 SET_LEX_STATE(EXPR_BEG);
20354 }
20355 else {
20356 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20357 }
20358 ++p->lex.paren_nest; /* after lambda_beginning_p() */
20359 COND_PUSH(0);
20360 CMDARG_PUSH(0);
20361 return c;
20362
20363 case '\\':
20364 c = nextc(p);
20365 if (c == '\n') {
20366 space_seen = 1;
20367 dispatch_scan_event(p, tSP);
20368 goto retry; /* skip \\n */
20369 }
20370 if (c == ' ') return tSP;
20371 if (ISSPACE(c)) return c;
20372 pushback(p, c);
20373 return '\\';
20374
20375 case '%':
20376 return parse_percent(p, space_seen, last_state);
20377
20378 case '$':
20379 return parse_gvar(p, last_state);
20380
20381 case '@':
20382 return parse_atmark(p, last_state);
20383
20384 case '_':
20385 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
20386 p->ruby__end__seen = 1;
20387 p->eofp = 1;
20388#ifndef RIPPER
20389 return -1;
20390#else
20391 lex_goto_eol(p);
20392 dispatch_scan_event(p, k__END__);
20393 return 0;
20394#endif
20395 }
20396 newtok(p);
20397 break;
20398
20399 default:
20400 if (!parser_is_identchar(p)) {
20401 compile_error(p, "Invalid char `\\x%02X' in expression", c);
20402 token_flush(p);
20403 goto retry;
20404 }
20405
20406 newtok(p);
20407 break;
20408 }
20409
20410 return parse_ident(p, c, cmd_state);
20411}
20412
20413static enum yytokentype
20414yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
20415{
20416 enum yytokentype t;
20417
20418 p->lval = lval;
20419 lval->val = Qundef;
20420 p->yylloc = yylloc;
20421
20422 t = parser_yylex(p);
20423
20424 if (has_delayed_token(p))
20425 dispatch_delayed_token(p, t);
20426 else if (t != 0)
20427 dispatch_scan_event(p, t);
20428
20429 return t;
20430}
20431
20432#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
20433
20434static NODE*
20435node_new_temporal(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
20436{
20437 NODE *n = rb_ast_newnode(p->ast, type);
20438
20439 rb_node_init(n, type, a0, a1, a2);
20440 return n;
20441}
20442
20443static NODE*
20444node_newnode(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2, const rb_code_location_t *loc)
20445{
20446 NODE *n = node_new_temporal(p, type, a0, a1, a2);
20447
20448 nd_set_loc(n, loc);
20449 nd_set_node_id(n, parser_get_node_id(p));
20450 return n;
20451}
20452
20453static NODE *
20454nd_set_loc(NODE *nd, const YYLTYPE *loc)
20455{
20456 nd->nd_loc = *loc;
20457 nd_set_line(nd, loc->beg_pos.lineno);
20458 return nd;
20459}
20460
20461#ifndef RIPPER
20462static enum node_type
20463nodetype(NODE *node) /* for debug */
20464{
20465 return (enum node_type)nd_type(node);
20466}
20467
20468static int
20469nodeline(NODE *node)
20470{
20471 return nd_line(node);
20472}
20473
20474static NODE*
20475newline_node(NODE *node)
20476{
20477 if (node) {
20478 node = remove_begin(node);
20479 node->flags |= NODE_FL_NEWLINE;
20480 }
20481 return node;
20482}
20483
20484static void
20485fixpos(NODE *node, NODE *orig)
20486{
20487 if (!node) return;
20488 if (!orig) return;
20489 nd_set_line(node, nd_line(orig));
20490}
20491
20492static void
20493parser_warning(struct parser_params *p, NODE *node, const char *mesg)
20494{
20495 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
20496}
20497
20498static void
20499parser_warn(struct parser_params *p, NODE *node, const char *mesg)
20500{
20501 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
20502}
20503
20504static NODE*
20505block_append(struct parser_params *p, NODE *head, NODE *tail)
20506{
20507 NODE *end, *h = head, *nd;
20508
20509 if (tail == 0) return head;
20510
20511 if (h == 0) return tail;
20512 switch (nd_type(h)) {
20513 case NODE_LIT:
20514 case NODE_STR:
20515 case NODE_SELF:
20516 case NODE_TRUE:
20517 case NODE_FALSE:
20518 case NODE_NIL:
20519 parser_warning(p, h, "unused literal ignored");
20520 return tail;
20521 default:
20522 h = end = NEW_BLOCK(head, &head->nd_loc);
20523 end->nd_end = end;
20524 head = end;
20525 break;
20526 case NODE_BLOCK:
20527 end = h->nd_end;
20528 break;
20529 }
20530
20531 nd = end->nd_head;
20532 switch (nd_type(nd)) {
20533 case NODE_RETURN:
20534 case NODE_BREAK:
20535 case NODE_NEXT:
20536 case NODE_REDO:
20537 case NODE_RETRY:
20538 if (RTEST(ruby_verbose)) {
20539 parser_warning(p, tail, "statement not reached");
20540 }
20541 break;
20542
20543 default:
20544 break;
20545 }
20546
20547 if (!nd_type_p(tail, NODE_BLOCK)) {
20548 tail = NEW_BLOCK(tail, &tail->nd_loc);
20549 tail->nd_end = tail;
20550 }
20551 end->nd_next = tail;
20552 h->nd_end = tail->nd_end;
20553 nd_set_last_loc(head, nd_last_loc(tail));
20554 return head;
20555}
20556
20557/* append item to the list */
20558static NODE*
20559list_append(struct parser_params *p, NODE *list, NODE *item)
20560{
20561 NODE *last;
20562
20563 if (list == 0) return NEW_LIST(item, &item->nd_loc);
20564 if (list->nd_next) {
20565 last = list->nd_next->nd_end;
20566 }
20567 else {
20568 last = list;
20569 }
20570
20571 list->nd_alen += 1;
20572 last->nd_next = NEW_LIST(item, &item->nd_loc);
20573 list->nd_next->nd_end = last->nd_next;
20574
20575 nd_set_last_loc(list, nd_last_loc(item));
20576
20577 return list;
20578}
20579
20580/* concat two lists */
20581static NODE*
20582list_concat(NODE *head, NODE *tail)
20583{
20584 NODE *last;
20585
20586 if (head->nd_next) {
20587 last = head->nd_next->nd_end;
20588 }
20589 else {
20590 last = head;
20591 }
20592
20593 head->nd_alen += tail->nd_alen;
20594 last->nd_next = tail;
20595 if (tail->nd_next) {
20596 head->nd_next->nd_end = tail->nd_next->nd_end;
20597 }
20598 else {
20599 head->nd_next->nd_end = tail;
20600 }
20601
20602 nd_set_last_loc(head, nd_last_loc(tail));
20603
20604 return head;
20605}
20606
20607static int
20608literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
20609{
20610 if (NIL_P(tail)) return 1;
20611 if (!rb_enc_compatible(head, tail)) {
20612 compile_error(p, "string literal encodings differ (%s / %s)",
20613 rb_enc_name(rb_enc_get(head)),
20614 rb_enc_name(rb_enc_get(tail)));
20615 rb_str_resize(head, 0);
20616 rb_str_resize(tail, 0);
20617 return 0;
20618 }
20619 rb_str_buf_append(head, tail);
20620 return 1;
20621}
20622
20623static VALUE
20624string_literal_head(enum node_type htype, NODE *head)
20625{
20626 if (htype != NODE_DSTR) return Qfalse;
20627 if (head->nd_next) {
20628 head = head->nd_next->nd_end->nd_head;
20629 if (!head || !nd_type_p(head, NODE_STR)) return Qfalse;
20630 }
20631 const VALUE lit = head->nd_lit;
20632 ASSUME(lit != Qfalse);
20633 return lit;
20634}
20635
20636/* concat two string literals */
20637static NODE *
20638literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
20639{
20640 enum node_type htype;
20641 VALUE lit;
20642
20643 if (!head) return tail;
20644 if (!tail) return head;
20645
20646 htype = nd_type(head);
20647 if (htype == NODE_EVSTR) {
20648 head = new_dstr(p, head, loc);
20649 htype = NODE_DSTR;
20650 }
20651 if (p->heredoc_indent > 0) {
20652 switch (htype) {
20653 case NODE_STR:
20654 nd_set_type(head, NODE_DSTR);
20655 case NODE_DSTR:
20656 return list_append(p, head, tail);
20657 default:
20658 break;
20659 }
20660 }
20661 switch (nd_type(tail)) {
20662 case NODE_STR:
20663 if ((lit = string_literal_head(htype, head)) != Qfalse) {
20664 htype = NODE_STR;
20665 }
20666 else {
20667 lit = head->nd_lit;
20668 }
20669 if (htype == NODE_STR) {
20670 if (!literal_concat0(p, lit, tail->nd_lit)) {
20671 error:
20672 rb_discard_node(p, head);
20673 rb_discard_node(p, tail);
20674 return 0;
20675 }
20676 rb_discard_node(p, tail);
20677 }
20678 else {
20679 list_append(p, head, tail);
20680 }
20681 break;
20682
20683 case NODE_DSTR:
20684 if (htype == NODE_STR) {
20685 if (!literal_concat0(p, head->nd_lit, tail->nd_lit))
20686 goto error;
20687 tail->nd_lit = head->nd_lit;
20688 rb_discard_node(p, head);
20689 head = tail;
20690 }
20691 else if (NIL_P(tail->nd_lit)) {
20692 append:
20693 head->nd_alen += tail->nd_alen - 1;
20694 if (!head->nd_next) {
20695 head->nd_next = tail->nd_next;
20696 }
20697 else if (tail->nd_next) {
20698 head->nd_next->nd_end->nd_next = tail->nd_next;
20699 head->nd_next->nd_end = tail->nd_next->nd_end;
20700 }
20701 rb_discard_node(p, tail);
20702 }
20703 else if ((lit = string_literal_head(htype, head)) != Qfalse) {
20704 if (!literal_concat0(p, lit, tail->nd_lit))
20705 goto error;
20706 tail->nd_lit = Qnil;
20707 goto append;
20708 }
20709 else {
20710 list_concat(head, NEW_NODE(NODE_LIST, NEW_STR(tail->nd_lit, loc), tail->nd_alen, tail->nd_next, loc));
20711 }
20712 break;
20713
20714 case NODE_EVSTR:
20715 if (htype == NODE_STR) {
20716 nd_set_type(head, NODE_DSTR);
20717 head->nd_alen = 1;
20718 }
20719 list_append(p, head, tail);
20720 break;
20721 }
20722 return head;
20723}
20724
20725static NODE *
20726evstr2dstr(struct parser_params *p, NODE *node)
20727{
20728 if (nd_type_p(node, NODE_EVSTR)) {
20729 node = new_dstr(p, node, &node->nd_loc);
20730 }
20731 return node;
20732}
20733
20734static NODE *
20735new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
20736{
20737 NODE *head = node;
20738
20739 if (node) {
20740 switch (nd_type(node)) {
20741 case NODE_STR:
20742 nd_set_type(node, NODE_DSTR);
20743 return node;
20744 case NODE_DSTR:
20745 break;
20746 case NODE_EVSTR:
20747 return node;
20748 }
20749 }
20750 return NEW_EVSTR(head, loc);
20751}
20752
20753static NODE *
20754new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
20755{
20756 VALUE lit = STR_NEW0();
20757 NODE *dstr = NEW_DSTR(lit, loc);
20758 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
20759 return list_append(p, dstr, node);
20760}
20761
20762static NODE *
20763call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
20764 const YYLTYPE *op_loc, const YYLTYPE *loc)
20765{
20766 NODE *expr;
20767 value_expr(recv);
20768 value_expr(arg1);
20769 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
20770 nd_set_line(expr, op_loc->beg_pos.lineno);
20771 return expr;
20772}
20773
20774static NODE *
20775call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
20776{
20777 NODE *opcall;
20778 value_expr(recv);
20779 opcall = NEW_OPCALL(recv, id, 0, loc);
20780 nd_set_line(opcall, op_loc->beg_pos.lineno);
20781 return opcall;
20782}
20783
20784static NODE *
20785new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
20786{
20787 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
20788 nd_set_line(qcall, op_loc->beg_pos.lineno);
20789 return qcall;
20790}
20791
20792static NODE*
20793new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
20794{
20795 NODE *ret;
20796 if (block) block_dup_check(p, args, block);
20797 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
20798 if (block) ret = method_add_block(p, ret, block, loc);
20799 fixpos(ret, recv);
20800 return ret;
20801}
20802
20803#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? (node)->nd_body : node)
20804static NODE*
20805match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
20806{
20807 NODE *n;
20808 int line = op_loc->beg_pos.lineno;
20809
20810 value_expr(node1);
20811 value_expr(node2);
20812 if (node1 && (n = nd_once_body(node1)) != 0) {
20813 switch (nd_type(n)) {
20814 case NODE_DREGX:
20815 {
20816 NODE *match = NEW_MATCH2(node1, node2, loc);
20817 nd_set_line(match, line);
20818 return match;
20819 }
20820
20821 case NODE_LIT:
20822 if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
20823 const VALUE lit = n->nd_lit;
20824 NODE *match = NEW_MATCH2(node1, node2, loc);
20825 match->nd_args = reg_named_capture_assign(p, lit, loc);
20826 nd_set_line(match, line);
20827 return match;
20828 }
20829 }
20830 }
20831
20832 if (node2 && (n = nd_once_body(node2)) != 0) {
20833 NODE *match3;
20834
20835 switch (nd_type(n)) {
20836 case NODE_LIT:
20837 if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
20838 /* fallthru */
20839 case NODE_DREGX:
20840 match3 = NEW_MATCH3(node2, node1, loc);
20841 return match3;
20842 }
20843 }
20844
20845 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
20846 nd_set_line(n, line);
20847 return n;
20848}
20849
20850# if WARN_PAST_SCOPE
20851static int
20852past_dvar_p(struct parser_params *p, ID id)
20853{
20854 struct vtable *past = p->lvtbl->past;
20855 while (past) {
20856 if (vtable_included(past, id)) return 1;
20857 past = past->prev;
20858 }
20859 return 0;
20860}
20861# endif
20862
20863static int
20864numparam_nested_p(struct parser_params *p)
20865{
20866 struct local_vars *local = p->lvtbl;
20867 NODE *outer = local->numparam.outer;
20868 NODE *inner = local->numparam.inner;
20869 if (outer || inner) {
20870 NODE *used = outer ? outer : inner;
20871 compile_error(p, "numbered parameter is already used in\n"
20872 "%s:%d: %s block here",
20873 p->ruby_sourcefile, nd_line(used),
20874 outer ? "outer" : "inner");
20875 parser_show_error_line(p, &used->nd_loc);
20876 return 1;
20877 }
20878 return 0;
20879}
20880
20881static NODE*
20882gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
20883{
20884 ID *vidp = NULL;
20885 NODE *node;
20886 switch (id) {
20887 case keyword_self:
20888 return NEW_SELF(loc);
20889 case keyword_nil:
20890 return NEW_NIL(loc);
20891 case keyword_true:
20892 return NEW_TRUE(loc);
20893 case keyword_false:
20894 return NEW_FALSE(loc);
20895 case keyword__FILE__:
20896 {
20897 VALUE file = p->ruby_sourcefile_string;
20898 if (NIL_P(file))
20899 file = rb_str_new(0, 0);
20900 else
20901 file = rb_str_dup(file);
20902 node = NEW_STR(file, loc);
20903 RB_OBJ_WRITTEN(p->ast, Qnil, file);
20904 }
20905 return node;
20906 case keyword__LINE__:
20907 return NEW_LIT(INT2FIX(p->tokline), loc);
20908 case keyword__ENCODING__:
20909 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
20910 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
20911 return node;
20912
20913 }
20914 switch (id_type(id)) {
20915 case ID_LOCAL:
20916 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
20917 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
20918 if (id == p->cur_arg) {
20919 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
20920 return 0;
20921 }
20922 if (vidp) *vidp |= LVAR_USED;
20923 node = NEW_DVAR(id, loc);
20924 return node;
20925 }
20926 if (local_id_ref(p, id, &vidp)) {
20927 if (id == p->cur_arg) {
20928 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
20929 return 0;
20930 }
20931 if (vidp) *vidp |= LVAR_USED;
20932 node = NEW_LVAR(id, loc);
20933 return node;
20934 }
20935 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
20936 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
20937 if (numparam_nested_p(p)) return 0;
20938 node = NEW_DVAR(id, loc);
20939 struct local_vars *local = p->lvtbl;
20940 if (!local->numparam.current) local->numparam.current = node;
20941 return node;
20942 }
20943# if WARN_PAST_SCOPE
20944 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
20945 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
20946 }
20947# endif
20948 /* method call without arguments */
20949 return NEW_VCALL(id, loc);
20950 case ID_GLOBAL:
20951 return NEW_GVAR(id, loc);
20952 case ID_INSTANCE:
20953 return NEW_IVAR(id, loc);
20954 case ID_CONST:
20955 return NEW_CONST(id, loc);
20956 case ID_CLASS:
20957 return NEW_CVAR(id, loc);
20958 }
20959 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
20960 return 0;
20961}
20962
20963static NODE *
20964opt_arg_append(NODE *opt_list, NODE *opt)
20965{
20966 NODE *opts = opt_list;
20967 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
20968
20969 while (opts->nd_next) {
20970 opts = opts->nd_next;
20971 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
20972 }
20973 opts->nd_next = opt;
20974
20975 return opt_list;
20976}
20977
20978static NODE *
20979kwd_append(NODE *kwlist, NODE *kw)
20980{
20981 if (kwlist) {
20982 opt_arg_append(kwlist, kw);
20983 }
20984 return kwlist;
20985}
20986
20987static NODE *
20988new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
20989{
20990 return NEW_DEFINED(remove_begin_all(expr), loc);
20991}
20992
20993static NODE*
20994symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
20995{
20996 enum node_type type = nd_type(symbol);
20997 switch (type) {
20998 case NODE_DSTR:
20999 nd_set_type(symbol, NODE_DSYM);
21000 break;
21001 case NODE_STR:
21002 nd_set_type(symbol, NODE_LIT);
21003 RB_OBJ_WRITTEN(p->ast, Qnil, symbol->nd_lit = rb_str_intern(symbol->nd_lit));
21004 break;
21005 default:
21006 compile_error(p, "unexpected node as symbol: %s", ruby_node_name(type));
21007 }
21008 return list_append(p, symbols, symbol);
21009}
21010
21011static NODE *
21012new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
21013{
21014 NODE *list, *prev;
21015 VALUE lit;
21016
21017 if (!node) {
21018 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
21019 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
21020 return node;
21021 }
21022 switch (nd_type(node)) {
21023 case NODE_STR:
21024 {
21025 VALUE src = node->nd_lit;
21026 nd_set_type(node, NODE_LIT);
21027 nd_set_loc(node, loc);
21028 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
21029 }
21030 break;
21031 default:
21032 lit = STR_NEW0();
21033 node = NEW_NODE(NODE_DSTR, lit, 1, NEW_LIST(node, loc), loc);
21034 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
21035 /* fall through */
21036 case NODE_DSTR:
21037 nd_set_type(node, NODE_DREGX);
21038 nd_set_loc(node, loc);
21039 node->nd_cflag = options & RE_OPTION_MASK;
21040 if (!NIL_P(node->nd_lit)) reg_fragment_check(p, node->nd_lit, options);
21041 for (list = (prev = node)->nd_next; list; list = list->nd_next) {
21042 NODE *frag = list->nd_head;
21043 enum node_type type = nd_type(frag);
21044 if (type == NODE_STR || (type == NODE_DSTR && !frag->nd_next)) {
21045 VALUE tail = frag->nd_lit;
21046 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(prev->nd_lit)) {
21047 VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
21048 if (!literal_concat0(p, lit, tail)) {
21049 return NEW_NIL(loc); /* dummy node on error */
21050 }
21051 rb_str_resize(tail, 0);
21052 prev->nd_next = list->nd_next;
21053 rb_discard_node(p, list->nd_head);
21054 rb_discard_node(p, list);
21055 list = prev;
21056 }
21057 else {
21058 prev = list;
21059 }
21060 }
21061 else {
21062 prev = 0;
21063 }
21064 }
21065 if (!node->nd_next) {
21066 VALUE src = node->nd_lit;
21067 nd_set_type(node, NODE_LIT);
21068 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
21069 }
21070 if (options & RE_OPTION_ONCE) {
21071 node = NEW_NODE(NODE_ONCE, 0, node, 0, loc);
21072 }
21073 break;
21074 }
21075 return node;
21076}
21077
21078static NODE *
21079new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
21080{
21081 if (!k) return 0;
21082 return NEW_KW_ARG(0, (k), loc);
21083}
21084
21085static NODE *
21086new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
21087{
21088 if (!node) {
21089 VALUE lit = STR_NEW0();
21090 NODE *xstr = NEW_XSTR(lit, loc);
21091 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
21092 return xstr;
21093 }
21094 switch (nd_type(node)) {
21095 case NODE_STR:
21096 nd_set_type(node, NODE_XSTR);
21097 nd_set_loc(node, loc);
21098 break;
21099 case NODE_DSTR:
21100 nd_set_type(node, NODE_DXSTR);
21101 nd_set_loc(node, loc);
21102 break;
21103 default:
21104 node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node, loc), loc);
21105 break;
21106 }
21107 return node;
21108}
21109
21110static void
21111check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
21112{
21113 VALUE lit;
21114
21115 if (!arg || !p->case_labels) return;
21116
21117 lit = rb_node_case_when_optimizable_literal(arg);
21118 if (UNDEF_P(lit)) return;
21119 if (nd_type_p(arg, NODE_STR)) {
21120 RB_OBJ_WRITTEN(p->ast, Qnil, arg->nd_lit = lit);
21121 }
21122
21123 if (NIL_P(p->case_labels)) {
21124 p->case_labels = rb_obj_hide(rb_hash_new());
21125 }
21126 else {
21127 VALUE line = rb_hash_lookup(p->case_labels, lit);
21128 if (!NIL_P(line)) {
21129 rb_warning1("duplicated `when' clause with line %d is ignored",
21130 WARN_IVAL(line));
21131 return;
21132 }
21133 }
21134 rb_hash_aset(p->case_labels, lit, INT2NUM(p->ruby_sourceline));
21135}
21136
21137#else /* !RIPPER */
21138static int
21139id_is_var(struct parser_params *p, ID id)
21140{
21141 if (is_notop_id(id)) {
21142 switch (id & ID_SCOPE_MASK) {
21143 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
21144 return 1;
21145 case ID_LOCAL:
21146 if (dyna_in_block(p)) {
21147 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
21148 }
21149 if (local_id(p, id)) return 1;
21150 /* method call without arguments */
21151 return 0;
21152 }
21153 }
21154 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
21155 return 0;
21156}
21157
21158static VALUE
21159new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
21160{
21161 VALUE src = 0, err;
21162 int options = 0;
21163 if (ripper_is_node_yylval(re)) {
21164 src = RNODE(re)->nd_cval;
21165 re = RNODE(re)->nd_rval;
21166 }
21167 if (ripper_is_node_yylval(opt)) {
21168 options = (int)RNODE(opt)->nd_tag;
21169 opt = RNODE(opt)->nd_rval;
21170 }
21171 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
21172 compile_error(p, "%"PRIsVALUE, err);
21173 }
21174 return dispatch2(regexp_literal, re, opt);
21175}
21176#endif /* !RIPPER */
21177
21178static inline enum lex_state_e
21179parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
21180{
21181 if (p->debug) {
21182 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
21183 }
21184 return p->lex.state = ls;
21185}
21186
21187#ifndef RIPPER
21188static const char rb_parser_lex_state_names[][8] = {
21189 "BEG", "END", "ENDARG", "ENDFN", "ARG",
21190 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
21191 "LABEL", "LABELED","FITEM",
21192};
21193
21194static VALUE
21195append_lex_state_name(enum lex_state_e state, VALUE buf)
21196{
21197 int i, sep = 0;
21198 unsigned int mask = 1;
21199 static const char none[] = "NONE";
21200
21201 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
21202 if ((unsigned)state & mask) {
21203 if (sep) {
21204 rb_str_cat(buf, "|", 1);
21205 }
21206 sep = 1;
21207 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
21208 }
21209 }
21210 if (!sep) {
21211 rb_str_cat(buf, none, sizeof(none)-1);
21212 }
21213 return buf;
21214}
21215
21216static void
21217flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
21218{
21219 VALUE mesg = p->debug_buffer;
21220
21221 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
21222 p->debug_buffer = Qnil;
21223 rb_io_puts(1, &mesg, out);
21224 }
21225 if (!NIL_P(str) && RSTRING_LEN(str)) {
21226 rb_io_write(p->debug_output, str);
21227 }
21228}
21229
21230enum lex_state_e
21231rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
21232 enum lex_state_e to, int line)
21233{
21234 VALUE mesg;
21235 mesg = rb_str_new_cstr("lex_state: ");
21236 append_lex_state_name(from, mesg);
21237 rb_str_cat_cstr(mesg, " -> ");
21238 append_lex_state_name(to, mesg);
21239 rb_str_catf(mesg, " at line %d\n", line);
21240 flush_debug_buffer(p, p->debug_output, mesg);
21241 return to;
21242}
21243
21244VALUE
21245rb_parser_lex_state_name(enum lex_state_e state)
21246{
21247 return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
21248}
21249
21250static void
21251append_bitstack_value(stack_type stack, VALUE mesg)
21252{
21253 if (stack == 0) {
21254 rb_str_cat_cstr(mesg, "0");
21255 }
21256 else {
21257 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
21258 for (; mask && !(stack & mask); mask >>= 1) continue;
21259 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
21260 }
21261}
21262
21263void
21264rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
21265 const char *name, int line)
21266{
21267 VALUE mesg = rb_sprintf("%s: ", name);
21268 append_bitstack_value(stack, mesg);
21269 rb_str_catf(mesg, " at line %d\n", line);
21270 flush_debug_buffer(p, p->debug_output, mesg);
21271}
21272
21273void
21274rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
21275{
21276 va_list ap;
21277 VALUE mesg = rb_str_new_cstr("internal parser error: ");
21278
21279 va_start(ap, fmt);
21280 rb_str_vcatf(mesg, fmt, ap);
21281 va_end(ap);
21282 yyerror0(RSTRING_PTR(mesg));
21283 RB_GC_GUARD(mesg);
21284
21285 mesg = rb_str_new(0, 0);
21286 append_lex_state_name(p->lex.state, mesg);
21287 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
21288 rb_str_resize(mesg, 0);
21289 append_bitstack_value(p->cond_stack, mesg);
21290 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
21291 rb_str_resize(mesg, 0);
21292 append_bitstack_value(p->cmdarg_stack, mesg);
21293 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
21294 if (p->debug_output == rb_ractor_stdout())
21295 p->debug_output = rb_ractor_stderr();
21296 p->debug = TRUE;
21297}
21298
21299static YYLTYPE *
21300rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
21301{
21302 yylloc->beg_pos.lineno = sourceline;
21303 yylloc->beg_pos.column = beg_pos;
21304 yylloc->end_pos.lineno = sourceline;
21305 yylloc->end_pos.column = end_pos;
21306 return yylloc;
21307}
21308
21309YYLTYPE *
21310rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
21311{
21312 int sourceline = here->sourceline;
21313 int beg_pos = (int)here->offset - here->quote
21314 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
21315 int end_pos = (int)here->offset + here->length + here->quote;
21316
21317 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21318}
21319
21320YYLTYPE *
21321rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc)
21322{
21323 yylloc->beg_pos.lineno = p->delayed.beg_line;
21324 yylloc->beg_pos.column = p->delayed.beg_col;
21325 yylloc->end_pos.lineno = p->delayed.end_line;
21326 yylloc->end_pos.column = p->delayed.end_col;
21327
21328 return yylloc;
21329}
21330
21331YYLTYPE *
21332rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc)
21333{
21334 int sourceline = p->ruby_sourceline;
21335 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21336 int end_pos = (int)(p->lex.pend - p->lex.pbeg);
21337 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21338}
21339
21340YYLTYPE *
21341rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc)
21342{
21343 yylloc->end_pos = yylloc->beg_pos;
21344
21345 return yylloc;
21346}
21347
21348YYLTYPE *
21349rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
21350{
21351 int sourceline = p->ruby_sourceline;
21352 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21353 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
21354 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21355}
21356
21357YYLTYPE *
21358rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
21359{
21360 int sourceline = p->ruby_sourceline;
21361 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21362 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
21363 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21364}
21365#endif /* !RIPPER */
21366
21367static int
21368assignable0(struct parser_params *p, ID id, const char **err)
21369{
21370 if (!id) return -1;
21371 switch (id) {
21372 case keyword_self:
21373 *err = "Can't change the value of self";
21374 return -1;
21375 case keyword_nil:
21376 *err = "Can't assign to nil";
21377 return -1;
21378 case keyword_true:
21379 *err = "Can't assign to true";
21380 return -1;
21381 case keyword_false:
21382 *err = "Can't assign to false";
21383 return -1;
21384 case keyword__FILE__:
21385 *err = "Can't assign to __FILE__";
21386 return -1;
21387 case keyword__LINE__:
21388 *err = "Can't assign to __LINE__";
21389 return -1;
21390 case keyword__ENCODING__:
21391 *err = "Can't assign to __ENCODING__";
21392 return -1;
21393 }
21394 switch (id_type(id)) {
21395 case ID_LOCAL:
21396 if (dyna_in_block(p)) {
21397 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
21398 compile_error(p, "Can't assign to numbered parameter _%d",
21399 NUMPARAM_ID_TO_IDX(id));
21400 return -1;
21401 }
21402 if (dvar_curr(p, id)) return NODE_DASGN;
21403 if (dvar_defined(p, id)) return NODE_DASGN;
21404 if (local_id(p, id)) return NODE_LASGN;
21405 dyna_var(p, id);
21406 return NODE_DASGN;
21407 }
21408 else {
21409 if (!local_id(p, id)) local_var(p, id);
21410 return NODE_LASGN;
21411 }
21412 break;
21413 case ID_GLOBAL: return NODE_GASGN;
21414 case ID_INSTANCE: return NODE_IASGN;
21415 case ID_CONST:
21416 if (!p->ctxt.in_def) return NODE_CDECL;
21417 *err = "dynamic constant assignment";
21418 return -1;
21419 case ID_CLASS: return NODE_CVASGN;
21420 default:
21421 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
21422 }
21423 return -1;
21424}
21425
21426#ifndef RIPPER
21427static NODE*
21428assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
21429{
21430 const char *err = 0;
21431 int node_type = assignable0(p, id, &err);
21432 switch (node_type) {
21433 case NODE_DASGN: return NEW_DASGN(id, val, loc);
21434 case NODE_LASGN: return NEW_LASGN(id, val, loc);
21435 case NODE_GASGN: return NEW_GASGN(id, val, loc);
21436 case NODE_IASGN: return NEW_IASGN(id, val, loc);
21437 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
21438 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
21439 }
21440 if (err) yyerror1(loc, err);
21441 return NEW_BEGIN(0, loc);
21442}
21443#else
21444static VALUE
21445assignable(struct parser_params *p, VALUE lhs)
21446{
21447 const char *err = 0;
21448 assignable0(p, get_id(lhs), &err);
21449 if (err) lhs = assign_error(p, err, lhs);
21450 return lhs;
21451}
21452#endif
21453
21454static int
21455is_private_local_id(ID name)
21456{
21457 VALUE s;
21458 if (name == idUScore) return 1;
21459 if (!is_local_id(name)) return 0;
21460 s = rb_id2str(name);
21461 if (!s) return 0;
21462 return RSTRING_PTR(s)[0] == '_';
21463}
21464
21465static int
21466shadowing_lvar_0(struct parser_params *p, ID name)
21467{
21468 if (dyna_in_block(p)) {
21469 if (dvar_curr(p, name)) {
21470 if (is_private_local_id(name)) return 1;
21471 yyerror0("duplicated argument name");
21472 }
21473 else if (dvar_defined(p, name) || local_id(p, name)) {
21474 vtable_add(p->lvtbl->vars, name);
21475 if (p->lvtbl->used) {
21476 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
21477 }
21478 return 0;
21479 }
21480 }
21481 else {
21482 if (local_id(p, name)) {
21483 if (is_private_local_id(name)) return 1;
21484 yyerror0("duplicated argument name");
21485 }
21486 }
21487 return 1;
21488}
21489
21490static ID
21491shadowing_lvar(struct parser_params *p, ID name)
21492{
21493 shadowing_lvar_0(p, name);
21494 return name;
21495}
21496
21497static void
21498new_bv(struct parser_params *p, ID name)
21499{
21500 if (!name) return;
21501 if (!is_local_id(name)) {
21502 compile_error(p, "invalid local variable - %"PRIsVALUE,
21503 rb_id2str(name));
21504 return;
21505 }
21506 if (!shadowing_lvar_0(p, name)) return;
21507 dyna_var(p, name);
21508}
21509
21510#ifndef RIPPER
21511static NODE *
21512aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
21513{
21514 return NEW_ATTRASGN(recv, tASET, idx, loc);
21515}
21516
21517static void
21518block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
21519{
21520 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
21521 compile_error(p, "both block arg and actual block given");
21522 }
21523}
21524
21525static NODE *
21526attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
21527{
21528 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
21529 return NEW_ATTRASGN(recv, id, 0, loc);
21530}
21531
21532static void
21533rb_backref_error(struct parser_params *p, NODE *node)
21534{
21535 switch (nd_type(node)) {
21536 case NODE_NTH_REF:
21537 compile_error(p, "Can't set variable $%ld", node->nd_nth);
21538 break;
21539 case NODE_BACK_REF:
21540 compile_error(p, "Can't set variable $%c", (int)node->nd_nth);
21541 break;
21542 }
21543}
21544#else
21545static VALUE
21546backref_error(struct parser_params *p, NODE *ref, VALUE expr)
21547{
21548 VALUE mesg = rb_str_new_cstr("Can't set variable ");
21549 rb_str_append(mesg, ref->nd_cval);
21550 return dispatch2(assign_error, mesg, expr);
21551}
21552#endif
21553
21554#ifndef RIPPER
21555static NODE *
21556arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
21557{
21558 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
21559 switch (nd_type(node1)) {
21560 case NODE_LIST:
21561 return list_append(p, node1, node2);
21562 case NODE_BLOCK_PASS:
21563 node1->nd_head = arg_append(p, node1->nd_head, node2, loc);
21564 node1->nd_loc.end_pos = node1->nd_head->nd_loc.end_pos;
21565 return node1;
21566 case NODE_ARGSPUSH:
21567 node1->nd_body = list_append(p, NEW_LIST(node1->nd_body, &node1->nd_body->nd_loc), node2);
21568 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
21569 nd_set_type(node1, NODE_ARGSCAT);
21570 return node1;
21571 case NODE_ARGSCAT:
21572 if (!nd_type_p(node1->nd_body, NODE_LIST)) break;
21573 node1->nd_body = list_append(p, node1->nd_body, node2);
21574 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
21575 return node1;
21576 }
21577 return NEW_ARGSPUSH(node1, node2, loc);
21578}
21579
21580static NODE *
21581arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
21582{
21583 if (!node2) return node1;
21584 switch (nd_type(node1)) {
21585 case NODE_BLOCK_PASS:
21586 if (node1->nd_head)
21587 node1->nd_head = arg_concat(p, node1->nd_head, node2, loc);
21588 else
21589 node1->nd_head = NEW_LIST(node2, loc);
21590 return node1;
21591 case NODE_ARGSPUSH:
21592 if (!nd_type_p(node2, NODE_LIST)) break;
21593 node1->nd_body = list_concat(NEW_LIST(node1->nd_body, loc), node2);
21594 nd_set_type(node1, NODE_ARGSCAT);
21595 return node1;
21596 case NODE_ARGSCAT:
21597 if (!nd_type_p(node2, NODE_LIST) ||
21598 !nd_type_p(node1->nd_body, NODE_LIST)) break;
21599 node1->nd_body = list_concat(node1->nd_body, node2);
21600 return node1;
21601 }
21602 return NEW_ARGSCAT(node1, node2, loc);
21603}
21604
21605static NODE *
21606last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
21607{
21608 NODE *n1;
21609 if ((n1 = splat_array(args)) != 0) {
21610 return list_append(p, n1, last_arg);
21611 }
21612 return arg_append(p, args, last_arg, loc);
21613}
21614
21615static NODE *
21616rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
21617{
21618 NODE *n1;
21619 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
21620 return list_concat(n1, rest_arg);
21621 }
21622 return arg_concat(p, args, rest_arg, loc);
21623}
21624
21625static NODE *
21626splat_array(NODE* node)
21627{
21628 if (nd_type_p(node, NODE_SPLAT)) node = node->nd_head;
21629 if (nd_type_p(node, NODE_LIST)) return node;
21630 return 0;
21631}
21632
21633static void
21634mark_lvar_used(struct parser_params *p, NODE *rhs)
21635{
21636 ID *vidp = NULL;
21637 if (!rhs) return;
21638 switch (nd_type(rhs)) {
21639 case NODE_LASGN:
21640 if (local_id_ref(p, rhs->nd_vid, &vidp)) {
21641 if (vidp) *vidp |= LVAR_USED;
21642 }
21643 break;
21644 case NODE_DASGN:
21645 if (dvar_defined_ref(p, rhs->nd_vid, &vidp)) {
21646 if (vidp) *vidp |= LVAR_USED;
21647 }
21648 break;
21649#if 0
21650 case NODE_MASGN:
21651 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
21652 mark_lvar_used(p, rhs->nd_head);
21653 }
21654 break;
21655#endif
21656 }
21657}
21658
21659static NODE *
21660const_decl_path(struct parser_params *p, NODE **dest)
21661{
21662 NODE *n = *dest;
21663 if (!nd_type_p(n, NODE_CALL)) {
21664 const YYLTYPE *loc = &n->nd_loc;
21665 VALUE path;
21666 if (n->nd_vid) {
21667 path = rb_id2str(n->nd_vid);
21668 }
21669 else {
21670 n = n->nd_else;
21671 path = rb_ary_new();
21672 for (; n && nd_type_p(n, NODE_COLON2); n = n->nd_head) {
21673 rb_ary_push(path, rb_id2str(n->nd_mid));
21674 }
21675 if (n && nd_type_p(n, NODE_CONST)) {
21676 // Const::Name
21677 rb_ary_push(path, rb_id2str(n->nd_vid));
21678 }
21679 else if (n && nd_type_p(n, NODE_COLON3)) {
21680 // ::Const::Name
21681 rb_ary_push(path, rb_str_new(0, 0));
21682 }
21683 else {
21684 // expression::Name
21685 rb_ary_push(path, rb_str_new_cstr("..."));
21686 }
21687 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
21688 path = rb_fstring(path);
21689 }
21690 *dest = n = NEW_LIT(path, loc);
21691 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
21692 }
21693 return n;
21694}
21695
21696extern VALUE rb_mRubyVMFrozenCore;
21697
21698static NODE *
21699make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
21700{
21701 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
21702
21703 if (copy) {
21704 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
21705 NEW_LIST(value, loc), loc);
21706 }
21707 else {
21708 return NEW_CALL(fcore, rb_intern("make_shareable"),
21709 NEW_LIST(value, loc), loc);
21710 }
21711}
21712
21713static NODE *
21714ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
21715{
21716 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
21717 NODE *args = NEW_LIST(value, loc);
21718 args = list_append(p, args, const_decl_path(p, dest));
21719 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
21720}
21721
21722static int is_static_content(NODE *node);
21723
21724static VALUE
21725shareable_literal_value(NODE *node)
21726{
21727 if (!node) return Qnil;
21728 enum node_type type = nd_type(node);
21729 switch (type) {
21730 case NODE_TRUE:
21731 return Qtrue;
21732 case NODE_FALSE:
21733 return Qfalse;
21734 case NODE_NIL:
21735 return Qnil;
21736 case NODE_LIT:
21737 return node->nd_lit;
21738 default:
21739 return Qundef;
21740 }
21741}
21742
21743#ifndef SHAREABLE_BARE_EXPRESSION
21744#define SHAREABLE_BARE_EXPRESSION 1
21745#endif
21746
21747static NODE *
21748shareable_literal_constant(struct parser_params *p, enum shareability shareable,
21749 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
21750{
21751# define shareable_literal_constant_next(n) \
21752 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
21753 VALUE lit = Qnil;
21754
21755 if (!value) return 0;
21756 enum node_type type = nd_type(value);
21757 switch (type) {
21758 case NODE_TRUE:
21759 case NODE_FALSE:
21760 case NODE_NIL:
21761 case NODE_LIT:
21762 return value;
21763
21764 case NODE_DSTR:
21765 if (shareable == shareable_literal) {
21766 value = NEW_CALL(value, idUMinus, 0, loc);
21767 }
21768 return value;
21769
21770 case NODE_STR:
21771 lit = rb_fstring(value->nd_lit);
21772 nd_set_type(value, NODE_LIT);
21773 RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
21774 return value;
21775
21776 case NODE_ZLIST:
21777 lit = rb_ary_new();
21778 OBJ_FREEZE_RAW(lit);
21779 NODE *n = NEW_LIT(lit, loc);
21780 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
21781 return n;
21782
21783 case NODE_LIST:
21784 lit = rb_ary_new();
21785 for (NODE *n = value; n; n = n->nd_next) {
21786 NODE *elt = n->nd_head;
21787 if (elt) {
21788 elt = shareable_literal_constant_next(elt);
21789 if (elt) {
21790 n->nd_head = elt;
21791 }
21792 else if (RTEST(lit)) {
21793 rb_ary_clear(lit);
21794 lit = Qfalse;
21795 }
21796 }
21797 if (RTEST(lit)) {
21798 VALUE e = shareable_literal_value(elt);
21799 if (!UNDEF_P(e)) {
21800 rb_ary_push(lit, e);
21801 }
21802 else {
21803 rb_ary_clear(lit);
21804 lit = Qnil; /* make shareable at runtime */
21805 }
21806 }
21807 }
21808 break;
21809
21810 case NODE_HASH:
21811 if (!value->nd_brace) return 0;
21812 lit = rb_hash_new();
21813 for (NODE *n = value->nd_head; n; n = n->nd_next->nd_next) {
21814 NODE *key = n->nd_head;
21815 NODE *val = n->nd_next->nd_head;
21816 if (key) {
21817 key = shareable_literal_constant_next(key);
21818 if (key) {
21819 n->nd_head = key;
21820 }
21821 else if (RTEST(lit)) {
21822 rb_hash_clear(lit);
21823 lit = Qfalse;
21824 }
21825 }
21826 if (val) {
21827 val = shareable_literal_constant_next(val);
21828 if (val) {
21829 n->nd_next->nd_head = val;
21830 }
21831 else if (RTEST(lit)) {
21832 rb_hash_clear(lit);
21833 lit = Qfalse;
21834 }
21835 }
21836 if (RTEST(lit)) {
21837 VALUE k = shareable_literal_value(key);
21838 VALUE v = shareable_literal_value(val);
21839 if (!UNDEF_P(k) && !UNDEF_P(v)) {
21840 rb_hash_aset(lit, k, v);
21841 }
21842 else {
21843 rb_hash_clear(lit);
21844 lit = Qnil; /* make shareable at runtime */
21845 }
21846 }
21847 }
21848 break;
21849
21850 default:
21851 if (shareable == shareable_literal &&
21852 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
21853 return ensure_shareable_node(p, dest, value, loc);
21854 }
21855 return 0;
21856 }
21857
21858 /* Array or Hash */
21859 if (!lit) return 0;
21860 if (NIL_P(lit)) {
21861 // if shareable_literal, all elements should have been ensured
21862 // as shareable
21863 value = make_shareable_node(p, value, false, loc);
21864 }
21865 else {
21866 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
21867 RB_OBJ_WRITTEN(p->ast, Qnil, value->nd_lit);
21868 }
21869
21870 return value;
21871# undef shareable_literal_constant_next
21872}
21873
21874static NODE *
21875shareable_constant_value(struct parser_params *p, enum shareability shareable,
21876 NODE *lhs, NODE *value, const YYLTYPE *loc)
21877{
21878 if (!value) return 0;
21879 switch (shareable) {
21880 case shareable_none:
21881 return value;
21882
21883 case shareable_literal:
21884 {
21885 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
21886 if (lit) return lit;
21887 return value;
21888 }
21889 break;
21890
21891 case shareable_copy:
21892 case shareable_everything:
21893 {
21894 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
21895 if (lit) return lit;
21896 return make_shareable_node(p, value, shareable == shareable_copy, loc);
21897 }
21898 break;
21899
21900 default:
21902 }
21903}
21904
21905static NODE *
21906node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
21907{
21908 if (!lhs) return 0;
21909
21910 switch (nd_type(lhs)) {
21911 case NODE_CDECL:
21912 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
21913 /* fallthru */
21914
21915 case NODE_GASGN:
21916 case NODE_IASGN:
21917 case NODE_LASGN:
21918 case NODE_DASGN:
21919 case NODE_MASGN:
21920 case NODE_CVASGN:
21921 lhs->nd_value = rhs;
21922 nd_set_loc(lhs, loc);
21923 break;
21924
21925 case NODE_ATTRASGN:
21926 lhs->nd_args = arg_append(p, lhs->nd_args, rhs, loc);
21927 nd_set_loc(lhs, loc);
21928 break;
21929
21930 default:
21931 /* should not happen */
21932 break;
21933 }
21934
21935 return lhs;
21936}
21937
21938static NODE *
21939value_expr_check(struct parser_params *p, NODE *node)
21940{
21941 NODE *void_node = 0, *vn;
21942
21943 if (!node) {
21944 rb_warning0("empty expression");
21945 }
21946 while (node) {
21947 switch (nd_type(node)) {
21948 case NODE_RETURN:
21949 case NODE_BREAK:
21950 case NODE_NEXT:
21951 case NODE_REDO:
21952 case NODE_RETRY:
21953 return void_node ? void_node : node;
21954
21955 case NODE_CASE3:
21956 if (!node->nd_body || !nd_type_p(node->nd_body, NODE_IN)) {
21957 compile_error(p, "unexpected node");
21958 return NULL;
21959 }
21960 if (node->nd_body->nd_body) {
21961 return NULL;
21962 }
21963 /* single line pattern matching */
21964 return void_node ? void_node : node;
21965
21966 case NODE_BLOCK:
21967 while (node->nd_next) {
21968 node = node->nd_next;
21969 }
21970 node = node->nd_head;
21971 break;
21972
21973 case NODE_BEGIN:
21974 node = node->nd_body;
21975 break;
21976
21977 case NODE_IF:
21978 case NODE_UNLESS:
21979 if (!node->nd_body) {
21980 return NULL;
21981 }
21982 else if (!node->nd_else) {
21983 return NULL;
21984 }
21985 vn = value_expr_check(p, node->nd_body);
21986 if (!vn) return NULL;
21987 if (!void_node) void_node = vn;
21988 node = node->nd_else;
21989 break;
21990
21991 case NODE_AND:
21992 case NODE_OR:
21993 node = node->nd_1st;
21994 break;
21995
21996 case NODE_LASGN:
21997 case NODE_DASGN:
21998 case NODE_MASGN:
21999 mark_lvar_used(p, node);
22000 return NULL;
22001
22002 default:
22003 return NULL;
22004 }
22005 }
22006
22007 return NULL;
22008}
22009
22010static int
22011value_expr_gen(struct parser_params *p, NODE *node)
22012{
22013 NODE *void_node = value_expr_check(p, node);
22014 if (void_node) {
22015 yyerror1(&void_node->nd_loc, "void value expression");
22016 /* or "control never reach"? */
22017 return FALSE;
22018 }
22019 return TRUE;
22020}
22021static void
22022void_expr(struct parser_params *p, NODE *node)
22023{
22024 const char *useless = 0;
22025
22026 if (!RTEST(ruby_verbose)) return;
22027
22028 if (!node || !(node = nd_once_body(node))) return;
22029 switch (nd_type(node)) {
22030 case NODE_OPCALL:
22031 switch (node->nd_mid) {
22032 case '+':
22033 case '-':
22034 case '*':
22035 case '/':
22036 case '%':
22037 case tPOW:
22038 case tUPLUS:
22039 case tUMINUS:
22040 case '|':
22041 case '^':
22042 case '&':
22043 case tCMP:
22044 case '>':
22045 case tGEQ:
22046 case '<':
22047 case tLEQ:
22048 case tEQ:
22049 case tNEQ:
22050 useless = rb_id2name(node->nd_mid);
22051 break;
22052 }
22053 break;
22054
22055 case NODE_LVAR:
22056 case NODE_DVAR:
22057 case NODE_GVAR:
22058 case NODE_IVAR:
22059 case NODE_CVAR:
22060 case NODE_NTH_REF:
22061 case NODE_BACK_REF:
22062 useless = "a variable";
22063 break;
22064 case NODE_CONST:
22065 useless = "a constant";
22066 break;
22067 case NODE_LIT:
22068 case NODE_STR:
22069 case NODE_DSTR:
22070 case NODE_DREGX:
22071 useless = "a literal";
22072 break;
22073 case NODE_COLON2:
22074 case NODE_COLON3:
22075 useless = "::";
22076 break;
22077 case NODE_DOT2:
22078 useless = "..";
22079 break;
22080 case NODE_DOT3:
22081 useless = "...";
22082 break;
22083 case NODE_SELF:
22084 useless = "self";
22085 break;
22086 case NODE_NIL:
22087 useless = "nil";
22088 break;
22089 case NODE_TRUE:
22090 useless = "true";
22091 break;
22092 case NODE_FALSE:
22093 useless = "false";
22094 break;
22095 case NODE_DEFINED:
22096 useless = "defined?";
22097 break;
22098 }
22099
22100 if (useless) {
22101 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
22102 }
22103}
22104
22105static NODE *
22106void_stmts(struct parser_params *p, NODE *node)
22107{
22108 NODE *const n = node;
22109 if (!RTEST(ruby_verbose)) return n;
22110 if (!node) return n;
22111 if (!nd_type_p(node, NODE_BLOCK)) return n;
22112
22113 while (node->nd_next) {
22114 void_expr(p, node->nd_head);
22115 node = node->nd_next;
22116 }
22117 return n;
22118}
22119
22120static NODE *
22121remove_begin(NODE *node)
22122{
22123 NODE **n = &node, *n1 = node;
22124 while (n1 && nd_type_p(n1, NODE_BEGIN) && n1->nd_body) {
22125 *n = n1 = n1->nd_body;
22126 }
22127 return node;
22128}
22129
22130static NODE *
22131remove_begin_all(NODE *node)
22132{
22133 NODE **n = &node, *n1 = node;
22134 while (n1 && nd_type_p(n1, NODE_BEGIN)) {
22135 *n = n1 = n1->nd_body;
22136 }
22137 return node;
22138}
22139
22140static void
22141reduce_nodes(struct parser_params *p, NODE **body)
22142{
22143 NODE *node = *body;
22144
22145 if (!node) {
22146 *body = NEW_NIL(&NULL_LOC);
22147 return;
22148 }
22149#define subnodes(n1, n2) \
22150 ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
22151 (!node->n2) ? (body = &node->n1, 1) : \
22152 (reduce_nodes(p, &node->n1), body = &node->n2, 1))
22153
22154 while (node) {
22155 int newline = (int)(node->flags & NODE_FL_NEWLINE);
22156 switch (nd_type(node)) {
22157 end:
22158 case NODE_NIL:
22159 *body = 0;
22160 return;
22161 case NODE_RETURN:
22162 *body = node = node->nd_stts;
22163 if (newline && node) node->flags |= NODE_FL_NEWLINE;
22164 continue;
22165 case NODE_BEGIN:
22166 *body = node = node->nd_body;
22167 if (newline && node) node->flags |= NODE_FL_NEWLINE;
22168 continue;
22169 case NODE_BLOCK:
22170 body = &node->nd_end->nd_head;
22171 break;
22172 case NODE_IF:
22173 case NODE_UNLESS:
22174 if (subnodes(nd_body, nd_else)) break;
22175 return;
22176 case NODE_CASE:
22177 body = &node->nd_body;
22178 break;
22179 case NODE_WHEN:
22180 if (!subnodes(nd_body, nd_next)) goto end;
22181 break;
22182 case NODE_ENSURE:
22183 if (!subnodes(nd_head, nd_resq)) goto end;
22184 break;
22185 case NODE_RESCUE:
22186 if (node->nd_else) {
22187 body = &node->nd_resq;
22188 break;
22189 }
22190 if (!subnodes(nd_head, nd_resq)) goto end;
22191 break;
22192 default:
22193 return;
22194 }
22195 node = *body;
22196 if (newline && node) node->flags |= NODE_FL_NEWLINE;
22197 }
22198
22199#undef subnodes
22200}
22201
22202static int
22203is_static_content(NODE *node)
22204{
22205 if (!node) return 1;
22206 switch (nd_type(node)) {
22207 case NODE_HASH:
22208 if (!(node = node->nd_head)) break;
22209 case NODE_LIST:
22210 do {
22211 if (!is_static_content(node->nd_head)) return 0;
22212 } while ((node = node->nd_next) != 0);
22213 case NODE_LIT:
22214 case NODE_STR:
22215 case NODE_NIL:
22216 case NODE_TRUE:
22217 case NODE_FALSE:
22218 case NODE_ZLIST:
22219 break;
22220 default:
22221 return 0;
22222 }
22223 return 1;
22224}
22225
22226static int
22227assign_in_cond(struct parser_params *p, NODE *node)
22228{
22229 switch (nd_type(node)) {
22230 case NODE_MASGN:
22231 case NODE_LASGN:
22232 case NODE_DASGN:
22233 case NODE_GASGN:
22234 case NODE_IASGN:
22235 break;
22236
22237 default:
22238 return 0;
22239 }
22240
22241 if (!node->nd_value) return 1;
22242 if (is_static_content(node->nd_value)) {
22243 /* reports always */
22244 parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
22245 }
22246 return 1;
22247}
22248
22249enum cond_type {
22250 COND_IN_OP,
22251 COND_IN_COND,
22252 COND_IN_FF
22253};
22254
22255#define SWITCH_BY_COND_TYPE(t, w, arg) \
22256 switch (t) { \
22257 case COND_IN_OP: break; \
22258 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
22259 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
22260 }
22261
22262static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
22263
22264static NODE*
22265range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22266{
22267 enum node_type type;
22268
22269 if (node == 0) return 0;
22270
22271 type = nd_type(node);
22272 value_expr(node);
22273 if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
22274 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
22275 ID lineno = rb_intern("$.");
22276 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
22277 }
22278 return cond0(p, node, COND_IN_FF, loc);
22279}
22280
22281static NODE*
22282cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc)
22283{
22284 if (node == 0) return 0;
22285 if (!(node = nd_once_body(node))) return 0;
22286 assign_in_cond(p, node);
22287
22288 switch (nd_type(node)) {
22289 case NODE_DSTR:
22290 case NODE_EVSTR:
22291 case NODE_STR:
22292 SWITCH_BY_COND_TYPE(type, warn, "string ")
22293 break;
22294
22295 case NODE_DREGX:
22296 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
22297
22298 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
22299
22300 case NODE_AND:
22301 case NODE_OR:
22302 node->nd_1st = cond0(p, node->nd_1st, COND_IN_COND, loc);
22303 node->nd_2nd = cond0(p, node->nd_2nd, COND_IN_COND, loc);
22304 break;
22305
22306 case NODE_DOT2:
22307 case NODE_DOT3:
22308 node->nd_beg = range_op(p, node->nd_beg, loc);
22309 node->nd_end = range_op(p, node->nd_end, loc);
22310 if (nd_type_p(node, NODE_DOT2)) nd_set_type(node,NODE_FLIP2);
22311 else if (nd_type_p(node, NODE_DOT3)) nd_set_type(node, NODE_FLIP3);
22312 break;
22313
22314 case NODE_DSYM:
22315 warn_symbol:
22316 SWITCH_BY_COND_TYPE(type, warning, "symbol ")
22317 break;
22318
22319 case NODE_LIT:
22320 if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
22321 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
22322 nd_set_type(node, NODE_MATCH);
22323 }
22324 else if (node->nd_lit == Qtrue ||
22325 node->nd_lit == Qfalse) {
22326 /* booleans are OK, e.g., while true */
22327 }
22328 else if (SYMBOL_P(node->nd_lit)) {
22329 goto warn_symbol;
22330 }
22331 else {
22332 SWITCH_BY_COND_TYPE(type, warning, "")
22333 }
22334 default:
22335 break;
22336 }
22337 return node;
22338}
22339
22340static NODE*
22341cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22342{
22343 if (node == 0) return 0;
22344 return cond0(p, node, COND_IN_COND, loc);
22345}
22346
22347static NODE*
22348method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22349{
22350 if (node == 0) return 0;
22351 return cond0(p, node, COND_IN_OP, loc);
22352}
22353
22354static NODE*
22355new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
22356{
22357 YYLTYPE loc = {*pos, *pos};
22358 return NEW_NIL(&loc);
22359}
22360
22361static NODE*
22362new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
22363{
22364 if (!cc) return right;
22365 cc = cond0(p, cc, COND_IN_COND, loc);
22366 return newline_node(NEW_IF(cc, left, right, loc));
22367}
22368
22369static NODE*
22370new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
22371{
22372 if (!cc) return right;
22373 cc = cond0(p, cc, COND_IN_COND, loc);
22374 return newline_node(NEW_UNLESS(cc, left, right, loc));
22375}
22376
22377static NODE*
22378logop(struct parser_params *p, ID id, NODE *left, NODE *right,
22379 const YYLTYPE *op_loc, const YYLTYPE *loc)
22380{
22381 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
22382 NODE *op;
22383 value_expr(left);
22384 if (left && nd_type_p(left, type)) {
22385 NODE *node = left, *second;
22386 while ((second = node->nd_2nd) != 0 && nd_type_p(second, type)) {
22387 node = second;
22388 }
22389 node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
22390 nd_set_line(node->nd_2nd, op_loc->beg_pos.lineno);
22391 left->nd_loc.end_pos = loc->end_pos;
22392 return left;
22393 }
22394 op = NEW_NODE(type, left, right, 0, loc);
22395 nd_set_line(op, op_loc->beg_pos.lineno);
22396 return op;
22397}
22398
22399static void
22400no_blockarg(struct parser_params *p, NODE *node)
22401{
22402 if (nd_type_p(node, NODE_BLOCK_PASS)) {
22403 compile_error(p, "block argument should not be given");
22404 }
22405}
22406
22407static NODE *
22408ret_args(struct parser_params *p, NODE *node)
22409{
22410 if (node) {
22411 no_blockarg(p, node);
22412 if (nd_type_p(node, NODE_LIST)) {
22413 if (node->nd_next == 0) {
22414 node = node->nd_head;
22415 }
22416 else {
22417 nd_set_type(node, NODE_VALUES);
22418 }
22419 }
22420 }
22421 return node;
22422}
22423
22424static NODE *
22425new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22426{
22427 if (node) no_blockarg(p, node);
22428
22429 return NEW_YIELD(node, loc);
22430}
22431
22432static VALUE
22433negate_lit(struct parser_params *p, VALUE lit)
22434{
22435 if (FIXNUM_P(lit)) {
22436 return LONG2FIX(-FIX2LONG(lit));
22437 }
22438 if (SPECIAL_CONST_P(lit)) {
22439#if USE_FLONUM
22440 if (FLONUM_P(lit)) {
22441 return DBL2NUM(-RFLOAT_VALUE(lit));
22442 }
22443#endif
22444 goto unknown;
22445 }
22446 switch (BUILTIN_TYPE(lit)) {
22447 case T_BIGNUM:
22448 BIGNUM_NEGATE(lit);
22449 lit = rb_big_norm(lit);
22450 break;
22451 case T_RATIONAL:
22452 RATIONAL_SET_NUM(lit, negate_lit(p, RRATIONAL(lit)->num));
22453 break;
22454 case T_COMPLEX:
22455 RCOMPLEX_SET_REAL(lit, negate_lit(p, RCOMPLEX(lit)->real));
22456 RCOMPLEX_SET_IMAG(lit, negate_lit(p, RCOMPLEX(lit)->imag));
22457 break;
22458 case T_FLOAT:
22459 lit = DBL2NUM(-RFLOAT_VALUE(lit));
22460 break;
22461 unknown:
22462 default:
22463 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
22464 rb_builtin_class_name(lit));
22465 break;
22466 }
22467 return lit;
22468}
22469
22470static NODE *
22471arg_blk_pass(NODE *node1, NODE *node2)
22472{
22473 if (node2) {
22474 if (!node1) return node2;
22475 node2->nd_head = node1;
22476 nd_set_first_lineno(node2, nd_first_lineno(node1));
22477 nd_set_first_column(node2, nd_first_column(node1));
22478 return node2;
22479 }
22480 return node1;
22481}
22482
22483static bool
22484args_info_empty_p(struct rb_args_info *args)
22485{
22486 if (args->pre_args_num) return false;
22487 if (args->post_args_num) return false;
22488 if (args->rest_arg) return false;
22489 if (args->opt_args) return false;
22490 if (args->block_arg) return false;
22491 if (args->kw_args) return false;
22492 if (args->kw_rest_arg) return false;
22493 return true;
22494}
22495
22496static NODE*
22497new_args(struct parser_params *p, NODE *pre_args, NODE *opt_args, ID rest_arg, NODE *post_args, NODE *tail, const YYLTYPE *loc)
22498{
22499 int saved_line = p->ruby_sourceline;
22500 struct rb_args_info *args = tail->nd_ainfo;
22501
22502 if (args->forwarding) {
22503 if (rest_arg) {
22504 yyerror1(&tail->nd_loc, "... after rest argument");
22505 return tail;
22506 }
22507 rest_arg = idFWD_REST;
22508 }
22509
22510 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
22511 args->pre_init = pre_args ? pre_args->nd_next : 0;
22512
22513 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
22514 args->post_init = post_args ? post_args->nd_next : 0;
22515 args->first_post_arg = post_args ? post_args->nd_pid : 0;
22516
22517 args->rest_arg = rest_arg;
22518
22519 args->opt_args = opt_args;
22520
22521#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
22522 args->ruby2_keywords = args->forwarding;
22523#else
22524 args->ruby2_keywords = 0;
22525#endif
22526
22527 p->ruby_sourceline = saved_line;
22528 nd_set_loc(tail, loc);
22529
22530 return tail;
22531}
22532
22533static NODE*
22534new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
22535{
22536 int saved_line = p->ruby_sourceline;
22537 NODE *node;
22538 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
22539 struct rb_args_info *args = ZALLOC(struct rb_args_info);
22540 rb_imemo_tmpbuf_set_ptr(tmpbuf, args);
22541 args->imemo = tmpbuf;
22542 node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
22543 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
22544 if (p->error_p) return node;
22545
22546 args->block_arg = block;
22547 args->kw_args = kw_args;
22548
22549 if (kw_args) {
22550 /*
22551 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
22552 * variable order: k1, kr1, k2, &b, internal_id, krest
22553 * #=> <reorder>
22554 * variable order: kr1, k1, k2, internal_id, krest, &b
22555 */
22556 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
22557 struct vtable *vtargs = p->lvtbl->args;
22558 NODE *kwn = kw_args;
22559
22560 if (block) block = vtargs->tbl[vtargs->pos-1];
22561 vtable_pop(vtargs, !!block + !!kw_rest_arg);
22562 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
22563 while (kwn) {
22564 if (!NODE_REQUIRED_KEYWORD_P(kwn->nd_body))
22565 --kw_vars;
22566 --required_kw_vars;
22567 kwn = kwn->nd_next;
22568 }
22569
22570 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
22571 ID vid = kwn->nd_body->nd_vid;
22572 if (NODE_REQUIRED_KEYWORD_P(kwn->nd_body)) {
22573 *required_kw_vars++ = vid;
22574 }
22575 else {
22576 *kw_vars++ = vid;
22577 }
22578 }
22579
22580 arg_var(p, kw_bits);
22581 if (kw_rest_arg) arg_var(p, kw_rest_arg);
22582 if (block) arg_var(p, block);
22583
22584 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
22585 args->kw_rest_arg->nd_cflag = kw_bits;
22586 }
22587 else if (kw_rest_arg == idNil) {
22588 args->no_kwarg = 1;
22589 }
22590 else if (kw_rest_arg) {
22591 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
22592 }
22593
22594 p->ruby_sourceline = saved_line;
22595 return node;
22596}
22597
22598static NODE *
22599args_with_numbered(struct parser_params *p, NODE *args, int max_numparam)
22600{
22601 if (max_numparam > NO_PARAM) {
22602 if (!args) {
22603 YYLTYPE loc = RUBY_INIT_YYLLOC();
22604 args = new_args_tail(p, 0, 0, 0, 0);
22605 nd_set_loc(args, &loc);
22606 }
22607 args->nd_ainfo->pre_args_num = max_numparam;
22608 }
22609 return args;
22610}
22611
22612static NODE*
22613new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
22614{
22615 struct rb_ary_pattern_info *apinfo = aryptn->nd_apinfo;
22616
22617 aryptn->nd_pconst = constant;
22618
22619 if (pre_arg) {
22620 NODE *pre_args = NEW_LIST(pre_arg, loc);
22621 if (apinfo->pre_args) {
22622 apinfo->pre_args = list_concat(pre_args, apinfo->pre_args);
22623 }
22624 else {
22625 apinfo->pre_args = pre_args;
22626 }
22627 }
22628 return aryptn;
22629}
22630
22631static NODE*
22632new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc)
22633{
22634 int saved_line = p->ruby_sourceline;
22635 NODE *node;
22636 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
22637 struct rb_ary_pattern_info *apinfo = ZALLOC(struct rb_ary_pattern_info);
22638 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
22639 node = NEW_NODE(NODE_ARYPTN, 0, tmpbuf, apinfo, loc);
22640 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
22641
22642 apinfo->pre_args = pre_args;
22643
22644 if (has_rest) {
22645 if (rest_arg) {
22646 apinfo->rest_arg = assignable(p, rest_arg, 0, loc);
22647 }
22648 else {
22649 apinfo->rest_arg = NODE_SPECIAL_NO_NAME_REST;
22650 }
22651 }
22652 else {
22653 apinfo->rest_arg = NULL;
22654 }
22655
22656 apinfo->post_args = post_args;
22657
22658 p->ruby_sourceline = saved_line;
22659 return node;
22660}
22661
22662static NODE*
22663new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
22664{
22665 fndptn->nd_pconst = constant;
22666
22667 return fndptn;
22668}
22669
22670static NODE*
22671new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc)
22672{
22673 int saved_line = p->ruby_sourceline;
22674 NODE *node;
22675 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
22676 struct rb_fnd_pattern_info *fpinfo = ZALLOC(struct rb_fnd_pattern_info);
22677 rb_imemo_tmpbuf_set_ptr(tmpbuf, fpinfo);
22678 node = NEW_NODE(NODE_FNDPTN, 0, tmpbuf, fpinfo, loc);
22679 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
22680
22681 fpinfo->pre_rest_arg = pre_rest_arg ? assignable(p, pre_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
22682 fpinfo->args = args;
22683 fpinfo->post_rest_arg = post_rest_arg ? assignable(p, post_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
22684
22685 p->ruby_sourceline = saved_line;
22686 return node;
22687}
22688
22689static NODE*
22690new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
22691{
22692 hshptn->nd_pconst = constant;
22693 return hshptn;
22694}
22695
22696static NODE*
22697new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
22698{
22699 int saved_line = p->ruby_sourceline;
22700 NODE *node, *kw_rest_arg_node;
22701
22702 if (kw_rest_arg == idNil) {
22703 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
22704 }
22705 else if (kw_rest_arg) {
22706 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
22707 }
22708 else {
22709 kw_rest_arg_node = NULL;
22710 }
22711
22712 node = NEW_NODE(NODE_HSHPTN, 0, kw_args, kw_rest_arg_node, loc);
22713
22714 p->ruby_sourceline = saved_line;
22715 return node;
22716}
22717
22718static NODE*
22719dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22720{
22721 VALUE lit;
22722
22723 if (!node) {
22724 return NEW_LIT(ID2SYM(idNULL), loc);
22725 }
22726
22727 switch (nd_type(node)) {
22728 case NODE_DSTR:
22729 nd_set_type(node, NODE_DSYM);
22730 nd_set_loc(node, loc);
22731 break;
22732 case NODE_STR:
22733 lit = node->nd_lit;
22734 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = ID2SYM(rb_intern_str(lit)));
22735 nd_set_type(node, NODE_LIT);
22736 nd_set_loc(node, loc);
22737 break;
22738 default:
22739 node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node, loc), loc);
22740 break;
22741 }
22742 return node;
22743}
22744
22745static int
22746append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
22747{
22748 NODE *node = (NODE *)v;
22749 NODE **result = (NODE **)h;
22750 node->nd_alen = 2;
22751 node->nd_next->nd_end = node->nd_next;
22752 node->nd_next->nd_next = 0;
22753 if (*result)
22754 list_concat(*result, node);
22755 else
22756 *result = node;
22757 return ST_CONTINUE;
22758}
22759
22760static bool
22761hash_literal_key_p(VALUE k)
22762{
22763 switch (OBJ_BUILTIN_TYPE(k)) {
22764 case T_NODE:
22765 return false;
22766 default:
22767 return true;
22768 }
22769}
22770
22771static int
22772literal_cmp(VALUE val, VALUE lit)
22773{
22774 if (val == lit) return 0;
22775 if (!hash_literal_key_p(val) || !hash_literal_key_p(lit)) return -1;
22776 return rb_iseq_cdhash_cmp(val, lit);
22777}
22778
22779static st_index_t
22780literal_hash(VALUE a)
22781{
22782 if (!hash_literal_key_p(a)) return (st_index_t)a;
22783 return rb_iseq_cdhash_hash(a);
22784}
22785
22786static const struct st_hash_type literal_type = {
22787 literal_cmp,
22788 literal_hash,
22789};
22790
22791static NODE *
22792remove_duplicate_keys(struct parser_params *p, NODE *hash)
22793{
22794 st_table *literal_keys = st_init_table_with_size(&literal_type, hash->nd_alen / 2);
22795 NODE *result = 0;
22796 NODE *last_expr = 0;
22797 rb_code_location_t loc = hash->nd_loc;
22798 while (hash && hash->nd_head && hash->nd_next) {
22799 NODE *head = hash->nd_head;
22800 NODE *value = hash->nd_next;
22801 NODE *next = value->nd_next;
22802 st_data_t key = (st_data_t)head;
22803 st_data_t data;
22804 value->nd_next = 0;
22805 if (nd_type_p(head, NODE_LIT) &&
22806 st_delete(literal_keys, (key = (st_data_t)head->nd_lit, &key), &data)) {
22807 NODE *dup_value = ((NODE *)data)->nd_next;
22808 rb_compile_warn(p->ruby_sourcefile, nd_line((NODE *)data),
22809 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
22810 head->nd_lit, nd_line(head));
22811 if (dup_value == last_expr) {
22812 value->nd_head = block_append(p, dup_value->nd_head, value->nd_head);
22813 }
22814 else {
22815 last_expr->nd_head = block_append(p, dup_value->nd_head, last_expr->nd_head);
22816 }
22817 }
22818 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
22819 last_expr = nd_type_p(head, NODE_LIT) ? value : head;
22820 hash = next;
22821 }
22822 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
22823 st_free_table(literal_keys);
22824 if (hash) {
22825 if (!result) result = hash;
22826 else list_concat(result, hash);
22827 }
22828 result->nd_loc = loc;
22829 return result;
22830}
22831
22832static NODE *
22833new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
22834{
22835 if (hash) hash = remove_duplicate_keys(p, hash);
22836 return NEW_HASH(hash, loc);
22837}
22838#endif
22839
22840static void
22841error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
22842{
22843 if (is_private_local_id(id)) {
22844 return;
22845 }
22846 if (st_is_member(p->pvtbl, id)) {
22847 yyerror1(loc, "duplicated variable name");
22848 }
22849 else {
22850 st_insert(p->pvtbl, (st_data_t)id, 0);
22851 }
22852}
22853
22854static void
22855error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
22856{
22857 if (!p->pktbl) {
22858 p->pktbl = st_init_numtable();
22859 }
22860 else if (st_is_member(p->pktbl, key)) {
22861 yyerror1(loc, "duplicated key name");
22862 return;
22863 }
22864 st_insert(p->pktbl, (st_data_t)key, 0);
22865}
22866
22867#ifndef RIPPER
22868static NODE *
22869new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
22870{
22871 return NEW_HASH(hash, loc);
22872}
22873#endif /* !RIPPER */
22874
22875#ifndef RIPPER
22876static NODE *
22877new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
22878{
22879 NODE *asgn;
22880
22881 if (lhs) {
22882 ID vid = lhs->nd_vid;
22883 YYLTYPE lhs_loc = lhs->nd_loc;
22884 int shareable = ctxt.shareable_constant_value;
22885 if (shareable) {
22886 switch (nd_type(lhs)) {
22887 case NODE_CDECL:
22888 case NODE_COLON2:
22889 case NODE_COLON3:
22890 break;
22891 default:
22892 shareable = 0;
22893 break;
22894 }
22895 }
22896 if (op == tOROP) {
22897 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
22898 lhs->nd_value = rhs;
22899 nd_set_loc(lhs, loc);
22900 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
22901 if (is_notop_id(vid)) {
22902 switch (id_type(vid)) {
22903 case ID_GLOBAL:
22904 case ID_INSTANCE:
22905 case ID_CLASS:
22906 asgn->nd_aid = vid;
22907 }
22908 }
22909 }
22910 else if (op == tANDOP) {
22911 if (shareable) {
22912 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
22913 }
22914 lhs->nd_value = rhs;
22915 nd_set_loc(lhs, loc);
22916 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
22917 }
22918 else {
22919 asgn = lhs;
22920 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
22921 if (shareable) {
22922 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
22923 }
22924 asgn->nd_value = rhs;
22925 nd_set_loc(asgn, loc);
22926 }
22927 }
22928 else {
22929 asgn = NEW_BEGIN(0, loc);
22930 }
22931 return asgn;
22932}
22933
22934static NODE *
22935new_ary_op_assign(struct parser_params *p, NODE *ary,
22936 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
22937{
22938 NODE *asgn;
22939
22940 args = make_list(args, args_loc);
22941 if (nd_type_p(args, NODE_BLOCK_PASS)) {
22942 args = NEW_ARGSCAT(args, rhs, loc);
22943 }
22944 else {
22945 args = arg_concat(p, args, rhs, loc);
22946 }
22947 asgn = NEW_OP_ASGN1(ary, op, args, loc);
22948 fixpos(asgn, ary);
22949 return asgn;
22950}
22951
22952static NODE *
22953new_attr_op_assign(struct parser_params *p, NODE *lhs,
22954 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
22955{
22956 NODE *asgn;
22957
22958 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
22959 fixpos(asgn, lhs);
22960 return asgn;
22961}
22962
22963static NODE *
22964new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
22965{
22966 NODE *asgn;
22967
22968 if (lhs) {
22969 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
22970 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
22971 }
22972 else {
22973 asgn = NEW_BEGIN(0, loc);
22974 }
22975 fixpos(asgn, lhs);
22976 return asgn;
22977}
22978
22979static NODE *
22980const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
22981{
22982 if (p->ctxt.in_def) {
22983 yyerror1(loc, "dynamic constant assignment");
22984 }
22985 return NEW_CDECL(0, 0, (path), loc);
22986}
22987#else
22988static VALUE
22989const_decl(struct parser_params *p, VALUE path)
22990{
22991 if (p->ctxt.in_def) {
22992 path = assign_error(p, "dynamic constant assignment", path);
22993 }
22994 return path;
22995}
22996
22997static VALUE
22998assign_error(struct parser_params *p, const char *mesg, VALUE a)
22999{
23000 a = dispatch2(assign_error, ERR_MESG(), a);
23001 ripper_error(p);
23002 return a;
23003}
23004
23005static VALUE
23006var_field(struct parser_params *p, VALUE a)
23007{
23008 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
23009}
23010#endif
23011
23012#ifndef RIPPER
23013static NODE *
23014new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
23015{
23016 NODE *result = head;
23017 if (rescue) {
23018 NODE *tmp = rescue_else ? rescue_else : rescue;
23019 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
23020
23021 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
23022 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
23023 }
23024 else if (rescue_else) {
23025 result = block_append(p, result, rescue_else);
23026 }
23027 if (ensure) {
23028 result = NEW_ENSURE(result, ensure, loc);
23029 }
23030 fixpos(result, head);
23031 return result;
23032}
23033#endif
23034
23035static void
23036warn_unused_var(struct parser_params *p, struct local_vars *local)
23037{
23038 int cnt;
23039
23040 if (!local->used) return;
23041 cnt = local->used->pos;
23042 if (cnt != local->vars->pos) {
23043 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
23044 }
23045#ifndef RIPPER
23046 ID *v = local->vars->tbl;
23047 ID *u = local->used->tbl;
23048 for (int i = 0; i < cnt; ++i) {
23049 if (!v[i] || (u[i] & LVAR_USED)) continue;
23050 if (is_private_local_id(v[i])) continue;
23051 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
23052 }
23053#endif
23054}
23055
23056static void
23057local_push(struct parser_params *p, int toplevel_scope)
23058{
23059 struct local_vars *local;
23060 int inherits_dvars = toplevel_scope && compile_for_eval;
23061 int warn_unused_vars = RTEST(ruby_verbose);
23062
23063 local = ALLOC(struct local_vars);
23064 local->prev = p->lvtbl;
23065 local->args = vtable_alloc(0);
23066 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
23067#ifndef RIPPER
23068 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
23069 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
23070 local->numparam.outer = 0;
23071 local->numparam.inner = 0;
23072 local->numparam.current = 0;
23073#endif
23074 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
23075
23076# if WARN_PAST_SCOPE
23077 local->past = 0;
23078# endif
23079 CMDARG_PUSH(0);
23080 COND_PUSH(0);
23081 p->lvtbl = local;
23082}
23083
23084static void
23085vtable_chain_free(struct parser_params *p, struct vtable *table)
23086{
23087 while (!DVARS_TERMINAL_P(table)) {
23088 struct vtable *cur_table = table;
23089 table = cur_table->prev;
23090 vtable_free(cur_table);
23091 }
23092}
23093
23094static void
23095local_free(struct parser_params *p, struct local_vars *local)
23096{
23097 vtable_chain_free(p, local->used);
23098
23099# if WARN_PAST_SCOPE
23100 vtable_chain_free(p, local->past);
23101# endif
23102
23103 vtable_chain_free(p, local->args);
23104 vtable_chain_free(p, local->vars);
23105
23106 ruby_sized_xfree(local, sizeof(struct local_vars));
23107}
23108
23109static void
23110local_pop(struct parser_params *p)
23111{
23112 struct local_vars *local = p->lvtbl->prev;
23113 if (p->lvtbl->used) {
23114 warn_unused_var(p, p->lvtbl);
23115 }
23116
23117 local_free(p, p->lvtbl);
23118 p->lvtbl = local;
23119
23120 CMDARG_POP();
23121 COND_POP();
23122}
23123
23124#ifndef RIPPER
23125static rb_ast_id_table_t *
23126local_tbl(struct parser_params *p)
23127{
23128 int cnt_args = vtable_size(p->lvtbl->args);
23129 int cnt_vars = vtable_size(p->lvtbl->vars);
23130 int cnt = cnt_args + cnt_vars;
23131 int i, j;
23132 rb_ast_id_table_t *tbl;
23133
23134 if (cnt <= 0) return 0;
23135 tbl = rb_ast_new_local_table(p->ast, cnt);
23136 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
23137 /* remove IDs duplicated to warn shadowing */
23138 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
23139 ID id = p->lvtbl->vars->tbl[i];
23140 if (!vtable_included(p->lvtbl->args, id)) {
23141 tbl->ids[j++] = id;
23142 }
23143 }
23144 if (j < cnt) {
23145 tbl = rb_ast_resize_latest_local_table(p->ast, j);
23146 }
23147
23148 return tbl;
23149}
23150
23151static NODE*
23152node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc)
23153{
23155 NODE *n;
23156
23157 a0 = local_tbl(p);
23158 n = NEW_NODE(type, a0, a1, a2, loc);
23159 return n;
23160}
23161
23162#endif
23163
23164static void
23165numparam_name(struct parser_params *p, ID id)
23166{
23167 if (!NUMPARAM_ID_P(id)) return;
23168 compile_error(p, "_%d is reserved for numbered parameter",
23169 NUMPARAM_ID_TO_IDX(id));
23170}
23171
23172static void
23173arg_var(struct parser_params *p, ID id)
23174{
23175 numparam_name(p, id);
23176 vtable_add(p->lvtbl->args, id);
23177}
23178
23179static void
23180local_var(struct parser_params *p, ID id)
23181{
23182 numparam_name(p, id);
23183 vtable_add(p->lvtbl->vars, id);
23184 if (p->lvtbl->used) {
23185 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
23186 }
23187}
23188
23189static int
23190local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
23191{
23192 struct vtable *vars, *args, *used;
23193
23194 vars = p->lvtbl->vars;
23195 args = p->lvtbl->args;
23196 used = p->lvtbl->used;
23197
23198 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
23199 vars = vars->prev;
23200 args = args->prev;
23201 if (used) used = used->prev;
23202 }
23203
23204 if (vars && vars->prev == DVARS_INHERIT) {
23205 return rb_local_defined(id, p->parent_iseq);
23206 }
23207 else if (vtable_included(args, id)) {
23208 return 1;
23209 }
23210 else {
23211 int i = vtable_included(vars, id);
23212 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
23213 return i != 0;
23214 }
23215}
23216
23217static int
23218local_id(struct parser_params *p, ID id)
23219{
23220 return local_id_ref(p, id, NULL);
23221}
23222
23223static int
23224check_forwarding_args(struct parser_params *p)
23225{
23226 if (local_id(p, idFWD_ALL)) return TRUE;
23227 compile_error(p, "unexpected ...");
23228 return FALSE;
23229}
23230
23231static void
23232add_forwarding_args(struct parser_params *p)
23233{
23234 arg_var(p, idFWD_REST);
23235#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
23236 arg_var(p, idFWD_KWREST);
23237#endif
23238 arg_var(p, idFWD_BLOCK);
23239 arg_var(p, idFWD_ALL);
23240}
23241
23242#ifndef RIPPER
23243static NODE *
23244new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
23245{
23246 NODE *rest = NEW_LVAR(idFWD_REST, loc);
23247#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
23248 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
23249#endif
23250 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
23251 NODE *args = leading ? rest_arg_append(p, leading, rest, argsloc) : NEW_SPLAT(rest, loc);
23252#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
23253 args = arg_append(p, args, new_hash(p, kwrest, loc), loc);
23254#endif
23255 return arg_blk_pass(args, block);
23256}
23257#endif
23258
23259static NODE *
23260numparam_push(struct parser_params *p)
23261{
23262#ifndef RIPPER
23263 struct local_vars *local = p->lvtbl;
23264 NODE *inner = local->numparam.inner;
23265 if (!local->numparam.outer) {
23266 local->numparam.outer = local->numparam.current;
23267 }
23268 local->numparam.inner = 0;
23269 local->numparam.current = 0;
23270 return inner;
23271#else
23272 return 0;
23273#endif
23274}
23275
23276static void
23277numparam_pop(struct parser_params *p, NODE *prev_inner)
23278{
23279#ifndef RIPPER
23280 struct local_vars *local = p->lvtbl;
23281 if (prev_inner) {
23282 /* prefer first one */
23283 local->numparam.inner = prev_inner;
23284 }
23285 else if (local->numparam.current) {
23286 /* current and inner are exclusive */
23287 local->numparam.inner = local->numparam.current;
23288 }
23289 if (p->max_numparam > NO_PARAM) {
23290 /* current and outer are exclusive */
23291 local->numparam.current = local->numparam.outer;
23292 local->numparam.outer = 0;
23293 }
23294 else {
23295 /* no numbered parameter */
23296 local->numparam.current = 0;
23297 }
23298#endif
23299}
23300
23301static const struct vtable *
23302dyna_push(struct parser_params *p)
23303{
23304 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
23305 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
23306 if (p->lvtbl->used) {
23307 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
23308 }
23309 return p->lvtbl->args;
23310}
23311
23312static void
23313dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
23314{
23315 struct vtable *tmp = *vtblp;
23316 *vtblp = tmp->prev;
23317# if WARN_PAST_SCOPE
23318 if (p->past_scope_enabled) {
23319 tmp->prev = p->lvtbl->past;
23320 p->lvtbl->past = tmp;
23321 return;
23322 }
23323# endif
23324 vtable_free(tmp);
23325}
23326
23327static void
23328dyna_pop_1(struct parser_params *p)
23329{
23330 struct vtable *tmp;
23331
23332 if ((tmp = p->lvtbl->used) != 0) {
23333 warn_unused_var(p, p->lvtbl);
23334 p->lvtbl->used = p->lvtbl->used->prev;
23335 vtable_free(tmp);
23336 }
23337 dyna_pop_vtable(p, &p->lvtbl->args);
23338 dyna_pop_vtable(p, &p->lvtbl->vars);
23339}
23340
23341static void
23342dyna_pop(struct parser_params *p, const struct vtable *lvargs)
23343{
23344 while (p->lvtbl->args != lvargs) {
23345 dyna_pop_1(p);
23346 if (!p->lvtbl->args) {
23347 struct local_vars *local = p->lvtbl->prev;
23348 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
23349 p->lvtbl = local;
23350 }
23351 }
23352 dyna_pop_1(p);
23353}
23354
23355static int
23356dyna_in_block(struct parser_params *p)
23357{
23358 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
23359}
23360
23361static int
23362dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
23363{
23364 struct vtable *vars, *args, *used;
23365 int i;
23366
23367 args = p->lvtbl->args;
23368 vars = p->lvtbl->vars;
23369 used = p->lvtbl->used;
23370
23371 while (!DVARS_TERMINAL_P(vars)) {
23372 if (vtable_included(args, id)) {
23373 return 1;
23374 }
23375 if ((i = vtable_included(vars, id)) != 0) {
23376 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
23377 return 1;
23378 }
23379 args = args->prev;
23380 vars = vars->prev;
23381 if (!vidrefp) used = 0;
23382 if (used) used = used->prev;
23383 }
23384
23385 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
23386 return rb_dvar_defined(id, p->parent_iseq);
23387 }
23388
23389 return 0;
23390}
23391
23392static int
23393dvar_defined(struct parser_params *p, ID id)
23394{
23395 return dvar_defined_ref(p, id, NULL);
23396}
23397
23398static int
23399dvar_curr(struct parser_params *p, ID id)
23400{
23401 return (vtable_included(p->lvtbl->args, id) ||
23402 vtable_included(p->lvtbl->vars, id));
23403}
23404
23405static void
23406reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
23407{
23408 compile_error(p,
23409 "regexp encoding option '%c' differs from source encoding '%s'",
23410 c, rb_enc_name(rb_enc_get(str)));
23411}
23412
23413#ifndef RIPPER
23414int
23415rb_reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
23416{
23417 int c = RE_OPTION_ENCODING_IDX(options);
23418
23419 if (c) {
23420 int opt, idx;
23421 rb_char_to_option_kcode(c, &opt, &idx);
23422 if (idx != ENCODING_GET(str) &&
23423 !is_ascii_string(str)) {
23424 goto error;
23425 }
23426 ENCODING_SET(str, idx);
23427 }
23428 else if (RE_OPTION_ENCODING_NONE(options)) {
23429 if (!ENCODING_IS_ASCII8BIT(str) &&
23430 !is_ascii_string(str)) {
23431 c = 'n';
23432 goto error;
23433 }
23434 rb_enc_associate(str, rb_ascii8bit_encoding());
23435 }
23436 else if (rb_is_usascii_enc(p->enc)) {
23437 if (!is_ascii_string(str)) {
23438 /* raise in re.c */
23439 rb_enc_associate(str, rb_usascii_encoding());
23440 }
23441 else {
23442 rb_enc_associate(str, rb_ascii8bit_encoding());
23443 }
23444 }
23445 return 0;
23446
23447 error:
23448 return c;
23449}
23450
23451static void
23452reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
23453{
23454 int c = rb_reg_fragment_setenc(p, str, options);
23455 if (c) reg_fragment_enc_error(p, str, c);
23456}
23457
23458static int
23459reg_fragment_check(struct parser_params* p, VALUE str, int options)
23460{
23461 VALUE err;
23462 reg_fragment_setenc(p, str, options);
23463 err = rb_reg_check_preprocess(str);
23464 if (err != Qnil) {
23465 err = rb_obj_as_string(err);
23466 compile_error(p, "%"PRIsVALUE, err);
23467 return 0;
23468 }
23469 return 1;
23470}
23471
23472typedef struct {
23473 struct parser_params* parser;
23474 rb_encoding *enc;
23475 NODE *succ_block;
23476 const YYLTYPE *loc;
23478
23479static int
23480reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
23481 int back_num, int *back_refs, OnigRegex regex, void *arg0)
23482{
23484 struct parser_params* p = arg->parser;
23485 rb_encoding *enc = arg->enc;
23486 long len = name_end - name;
23487 const char *s = (const char *)name;
23488 ID var;
23489 NODE *node, *succ;
23490
23491 if (!len) return ST_CONTINUE;
23492 if (rb_enc_symname_type(s, len, enc, (1U<<ID_LOCAL)) != ID_LOCAL)
23493 return ST_CONTINUE;
23494
23495 var = intern_cstr(s, len, enc);
23496 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
23497 if (!lvar_defined(p, var)) return ST_CONTINUE;
23498 }
23499 node = node_assign(p, assignable(p, var, 0, arg->loc), NEW_LIT(ID2SYM(var), arg->loc), NO_LEX_CTXT, arg->loc);
23500 succ = arg->succ_block;
23501 if (!succ) succ = NEW_BEGIN(0, arg->loc);
23502 succ = block_append(p, succ, node);
23503 arg->succ_block = succ;
23504 return ST_CONTINUE;
23505}
23506
23507static NODE *
23508reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
23509{
23511
23512 arg.parser = p;
23513 arg.enc = rb_enc_get(regexp);
23514 arg.succ_block = 0;
23515 arg.loc = loc;
23516 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
23517
23518 if (!arg.succ_block) return 0;
23519 return arg.succ_block->nd_next;
23520}
23521
23522static VALUE
23523parser_reg_compile(struct parser_params* p, VALUE str, int options)
23524{
23525 reg_fragment_setenc(p, str, options);
23526 return rb_parser_reg_compile(p, str, options);
23527}
23528
23529VALUE
23530rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
23531{
23532 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
23533}
23534
23535static VALUE
23536reg_compile(struct parser_params* p, VALUE str, int options)
23537{
23538 VALUE re;
23539 VALUE err;
23540
23541 err = rb_errinfo();
23542 re = parser_reg_compile(p, str, options);
23543 if (NIL_P(re)) {
23544 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
23545 rb_set_errinfo(err);
23546 compile_error(p, "%"PRIsVALUE, m);
23547 return Qnil;
23548 }
23549 return re;
23550}
23551#else
23552static VALUE
23553parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
23554{
23555 VALUE err = rb_errinfo();
23556 VALUE re;
23557 str = ripper_is_node_yylval(str) ? RNODE(str)->nd_cval : str;
23558 int c = rb_reg_fragment_setenc(p, str, options);
23559 if (c) reg_fragment_enc_error(p, str, c);
23560 re = rb_parser_reg_compile(p, str, options);
23561 if (NIL_P(re)) {
23562 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
23563 rb_set_errinfo(err);
23564 }
23565 return re;
23566}
23567#endif
23568
23569#ifndef RIPPER
23570void
23571rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
23572{
23573 struct parser_params *p;
23574 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23575 p->do_print = print;
23576 p->do_loop = loop;
23577 p->do_chomp = chomp;
23578 p->do_split = split;
23579}
23580
23581static NODE *
23582parser_append_options(struct parser_params *p, NODE *node)
23583{
23584 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
23585 const YYLTYPE *const LOC = &default_location;
23586
23587 if (p->do_print) {
23588 NODE *print = NEW_FCALL(rb_intern("print"),
23589 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
23590 LOC);
23591 node = block_append(p, node, print);
23592 }
23593
23594 if (p->do_loop) {
23595 NODE *irs = NEW_LIST(NEW_GVAR(rb_intern("$/"), LOC), LOC);
23596
23597 if (p->do_split) {
23598 ID ifs = rb_intern("$;");
23599 ID fields = rb_intern("$F");
23600 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
23601 NODE *split = NEW_GASGN(fields,
23602 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
23603 rb_intern("split"), args, LOC),
23604 LOC);
23605 node = block_append(p, split, node);
23606 }
23607 if (p->do_chomp) {
23608 NODE *chomp = NEW_LIT(ID2SYM(rb_intern("chomp")), LOC);
23609 chomp = list_append(p, NEW_LIST(chomp, LOC), NEW_TRUE(LOC));
23610 irs = list_append(p, irs, NEW_HASH(chomp, LOC));
23611 }
23612
23613 node = NEW_WHILE(NEW_FCALL(idGets, irs, LOC), node, 1, LOC);
23614 }
23615
23616 return node;
23617}
23618
23619void
23620rb_init_parse(void)
23621{
23622 /* just to suppress unused-function warnings */
23623 (void)nodetype;
23624 (void)nodeline;
23625}
23626
23627static ID
23628internal_id(struct parser_params *p)
23629{
23630 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
23631}
23632#endif /* !RIPPER */
23633
23634static void
23635parser_initialize(struct parser_params *p)
23636{
23637 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
23638 p->command_start = TRUE;
23639 p->ruby_sourcefile_string = Qnil;
23640 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
23641 p->node_id = 0;
23642 p->delayed.token = Qnil;
23643#ifdef RIPPER
23644 p->result = Qnil;
23645 p->parsing_thread = Qnil;
23646#else
23647 p->error_buffer = Qfalse;
23648 p->end_expect_token_locations = Qnil;
23649 p->token_id = 0;
23650 p->tokens = Qnil;
23651#endif
23652 p->debug_buffer = Qnil;
23653 p->debug_output = rb_ractor_stdout();
23654 p->enc = rb_utf8_encoding();
23655}
23656
23657#ifdef RIPPER
23658#define parser_mark ripper_parser_mark
23659#define parser_free ripper_parser_free
23660#endif
23661
23662static void
23663parser_mark(void *ptr)
23664{
23665 struct parser_params *p = (struct parser_params*)ptr;
23666
23667 rb_gc_mark(p->lex.input);
23668 rb_gc_mark(p->lex.lastline);
23669 rb_gc_mark(p->lex.nextline);
23670 rb_gc_mark(p->ruby_sourcefile_string);
23671 rb_gc_mark((VALUE)p->lex.strterm);
23672 rb_gc_mark((VALUE)p->ast);
23673 rb_gc_mark(p->case_labels);
23674 rb_gc_mark(p->delayed.token);
23675#ifndef RIPPER
23676 rb_gc_mark(p->debug_lines);
23677 rb_gc_mark(p->compile_option);
23678 rb_gc_mark(p->error_buffer);
23679 rb_gc_mark(p->end_expect_token_locations);
23680 rb_gc_mark(p->tokens);
23681#else
23682 rb_gc_mark(p->value);
23683 rb_gc_mark(p->result);
23684 rb_gc_mark(p->parsing_thread);
23685#endif
23686 rb_gc_mark(p->debug_buffer);
23687 rb_gc_mark(p->debug_output);
23688#ifdef YYMALLOC
23689 rb_gc_mark((VALUE)p->heap);
23690#endif
23691}
23692
23693static void
23694parser_free(void *ptr)
23695{
23696 struct parser_params *p = (struct parser_params*)ptr;
23697 struct local_vars *local, *prev;
23698
23699 if (p->tokenbuf) {
23700 ruby_sized_xfree(p->tokenbuf, p->toksiz);
23701 }
23702
23703 for (local = p->lvtbl; local; local = prev) {
23704 prev = local->prev;
23705 local_free(p, local);
23706 }
23707
23708 {
23709 token_info *ptinfo;
23710 while ((ptinfo = p->token_info) != 0) {
23711 p->token_info = ptinfo->next;
23712 xfree(ptinfo);
23713 }
23714 }
23715 xfree(ptr);
23716}
23717
23718static size_t
23719parser_memsize(const void *ptr)
23720{
23721 struct parser_params *p = (struct parser_params*)ptr;
23722 struct local_vars *local;
23723 size_t size = sizeof(*p);
23724
23725 size += p->toksiz;
23726 for (local = p->lvtbl; local; local = local->prev) {
23727 size += sizeof(*local);
23728 if (local->vars) size += local->vars->capa * sizeof(ID);
23729 }
23730 return size;
23731}
23732
23733static const rb_data_type_t parser_data_type = {
23734#ifndef RIPPER
23735 "parser",
23736#else
23737 "ripper",
23738#endif
23739 {
23740 parser_mark,
23741 parser_free,
23742 parser_memsize,
23743 },
23744 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
23745};
23746
23747#ifndef RIPPER
23748#undef rb_reserved_word
23749
23750const struct kwtable *
23751rb_reserved_word(const char *str, unsigned int len)
23752{
23753 return reserved_word(str, len);
23754}
23755
23756VALUE
23757rb_parser_new(void)
23758{
23759 struct parser_params *p;
23760 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
23761 &parser_data_type, p);
23762 parser_initialize(p);
23763 return parser;
23764}
23765
23766VALUE
23767rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
23768{
23769 struct parser_params *p;
23770
23771 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23772 p->error_buffer = main ? Qfalse : Qnil;
23773 p->parent_iseq = base;
23774 return vparser;
23775}
23776
23777void
23778rb_parser_keep_script_lines(VALUE vparser)
23779{
23780 struct parser_params *p;
23781
23782 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23783 p->keep_script_lines = 1;
23784}
23785
23786void
23787rb_parser_error_tolerant(VALUE vparser)
23788{
23789 struct parser_params *p;
23790
23791 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23792 p->error_tolerant = 1;
23793 p->end_expect_token_locations = rb_ary_new();
23794}
23795
23796void
23797rb_parser_keep_tokens(VALUE vparser)
23798{
23799 struct parser_params *p;
23800
23801 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23802 p->keep_tokens = 1;
23803 p->tokens = rb_ary_new();
23804}
23805
23806#endif
23807
23808#ifdef RIPPER
23809#define rb_parser_end_seen_p ripper_parser_end_seen_p
23810#define rb_parser_encoding ripper_parser_encoding
23811#define rb_parser_get_yydebug ripper_parser_get_yydebug
23812#define rb_parser_set_yydebug ripper_parser_set_yydebug
23813#define rb_parser_get_debug_output ripper_parser_get_debug_output
23814#define rb_parser_set_debug_output ripper_parser_set_debug_output
23815static VALUE ripper_parser_end_seen_p(VALUE vparser);
23816static VALUE ripper_parser_encoding(VALUE vparser);
23817static VALUE ripper_parser_get_yydebug(VALUE self);
23818static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
23819static VALUE ripper_parser_get_debug_output(VALUE self);
23820static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output);
23821
23822/*
23823 * call-seq:
23824 * ripper.error? -> Boolean
23825 *
23826 * Return true if parsed source has errors.
23827 */
23828static VALUE
23829ripper_error_p(VALUE vparser)
23830{
23831 struct parser_params *p;
23832
23833 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23834 return RBOOL(p->error_p);
23835}
23836#endif
23837
23838/*
23839 * call-seq:
23840 * ripper.end_seen? -> Boolean
23841 *
23842 * Return true if parsed source ended by +\_\_END\_\_+.
23843 */
23844VALUE
23845rb_parser_end_seen_p(VALUE vparser)
23846{
23847 struct parser_params *p;
23848
23849 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23850 return RBOOL(p->ruby__end__seen);
23851}
23852
23853/*
23854 * call-seq:
23855 * ripper.encoding -> encoding
23856 *
23857 * Return encoding of the source.
23858 */
23859VALUE
23860rb_parser_encoding(VALUE vparser)
23861{
23862 struct parser_params *p;
23863
23864 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23865 return rb_enc_from_encoding(p->enc);
23866}
23867
23868#ifdef RIPPER
23869/*
23870 * call-seq:
23871 * ripper.yydebug -> true or false
23872 *
23873 * Get yydebug.
23874 */
23875VALUE
23876rb_parser_get_yydebug(VALUE self)
23877{
23878 struct parser_params *p;
23879
23880 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23881 return RBOOL(p->debug);
23882}
23883#endif
23884
23885/*
23886 * call-seq:
23887 * ripper.yydebug = flag
23888 *
23889 * Set yydebug.
23890 */
23891VALUE
23892rb_parser_set_yydebug(VALUE self, VALUE flag)
23893{
23894 struct parser_params *p;
23895
23896 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23897 p->debug = RTEST(flag);
23898 return flag;
23899}
23900
23901/*
23902 * call-seq:
23903 * ripper.debug_output -> obj
23904 *
23905 * Get debug output.
23906 */
23907VALUE
23908rb_parser_get_debug_output(VALUE self)
23909{
23910 struct parser_params *p;
23911
23912 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23913 return p->debug_output;
23914}
23915
23916/*
23917 * call-seq:
23918 * ripper.debug_output = obj
23919 *
23920 * Set debug output.
23921 */
23922VALUE
23923rb_parser_set_debug_output(VALUE self, VALUE output)
23924{
23925 struct parser_params *p;
23926
23927 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23928 return p->debug_output = output;
23929}
23930
23931#ifndef RIPPER
23932#ifdef YYMALLOC
23933#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
23934/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
23935 * potential memory leak */
23936#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
23937#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
23938 (new)->cnt = (cnt), (ptr))
23939
23940void *
23941rb_parser_malloc(struct parser_params *p, size_t size)
23942{
23943 size_t cnt = HEAPCNT(1, size);
23944 rb_imemo_tmpbuf_t *n = NEWHEAP();
23945 void *ptr = xmalloc(size);
23946
23947 return ADD2HEAP(n, cnt, ptr);
23948}
23949
23950void *
23951rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
23952{
23953 size_t cnt = HEAPCNT(nelem, size);
23954 rb_imemo_tmpbuf_t *n = NEWHEAP();
23955 void *ptr = xcalloc(nelem, size);
23956
23957 return ADD2HEAP(n, cnt, ptr);
23958}
23959
23960void *
23961rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
23962{
23964 size_t cnt = HEAPCNT(1, size);
23965
23966 if (ptr && (n = p->heap) != NULL) {
23967 do {
23968 if (n->ptr == ptr) {
23969 n->ptr = ptr = xrealloc(ptr, size);
23970 if (n->cnt) n->cnt = cnt;
23971 return ptr;
23972 }
23973 } while ((n = n->next) != NULL);
23974 }
23975 n = NEWHEAP();
23976 ptr = xrealloc(ptr, size);
23977 return ADD2HEAP(n, cnt, ptr);
23978}
23979
23980void
23981rb_parser_free(struct parser_params *p, void *ptr)
23982{
23983 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
23984
23985 while ((n = *prev) != NULL) {
23986 if (n->ptr == ptr) {
23987 *prev = n->next;
23988 break;
23989 }
23990 prev = &n->next;
23991 }
23992}
23993#endif
23994
23995void
23996rb_parser_printf(struct parser_params *p, const char *fmt, ...)
23997{
23998 va_list ap;
23999 VALUE mesg = p->debug_buffer;
24000
24001 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
24002 va_start(ap, fmt);
24003 rb_str_vcatf(mesg, fmt, ap);
24004 va_end(ap);
24005 if (RSTRING_END(mesg)[-1] == '\n') {
24006 rb_io_write(p->debug_output, mesg);
24007 p->debug_buffer = Qnil;
24008 }
24009}
24010
24011static void
24012parser_compile_error(struct parser_params *p, const char *fmt, ...)
24013{
24014 va_list ap;
24015
24016 rb_io_flush(p->debug_output);
24017 p->error_p = 1;
24018 va_start(ap, fmt);
24019 p->error_buffer =
24020 rb_syntax_error_append(p->error_buffer,
24021 p->ruby_sourcefile_string,
24022 p->ruby_sourceline,
24023 rb_long2int(p->lex.pcur - p->lex.pbeg),
24024 p->enc, fmt, ap);
24025 va_end(ap);
24026}
24027
24028static size_t
24029count_char(const char *str, int c)
24030{
24031 int n = 0;
24032 while (str[n] == c) ++n;
24033 return n;
24034}
24035
24036/*
24037 * strip enclosing double-quotes, same as the default yytnamerr except
24038 * for that single-quotes matching back-quotes do not stop stripping.
24039 *
24040 * "\"`class' keyword\"" => "`class' keyword"
24041 */
24042RUBY_FUNC_EXPORTED size_t
24043rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
24044{
24045 if (*yystr == '"') {
24046 size_t yyn = 0, bquote = 0;
24047 const char *yyp = yystr;
24048
24049 while (*++yyp) {
24050 switch (*yyp) {
24051 case '`':
24052 if (!bquote) {
24053 bquote = count_char(yyp+1, '`') + 1;
24054 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
24055 yyn += bquote;
24056 yyp += bquote - 1;
24057 break;
24058 }
24059 goto default_char;
24060
24061 case '\'':
24062 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
24063 if (yyres) memcpy(yyres + yyn, yyp, bquote);
24064 yyn += bquote;
24065 yyp += bquote - 1;
24066 bquote = 0;
24067 break;
24068 }
24069 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
24070 if (yyres) memcpy(yyres + yyn, yyp, 3);
24071 yyn += 3;
24072 yyp += 2;
24073 break;
24074 }
24075 goto do_not_strip_quotes;
24076
24077 case ',':
24078 goto do_not_strip_quotes;
24079
24080 case '\\':
24081 if (*++yyp != '\\')
24082 goto do_not_strip_quotes;
24083 /* Fall through. */
24084 default_char:
24085 default:
24086 if (yyres)
24087 yyres[yyn] = *yyp;
24088 yyn++;
24089 break;
24090
24091 case '"':
24092 case '\0':
24093 if (yyres)
24094 yyres[yyn] = '\0';
24095 return yyn;
24096 }
24097 }
24098 do_not_strip_quotes: ;
24099 }
24100
24101 if (!yyres) return strlen(yystr);
24102
24103 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
24104}
24105#endif
24106
24107#ifdef RIPPER
24108#ifdef RIPPER_DEBUG
24109/* :nodoc: */
24110static VALUE
24111ripper_validate_object(VALUE self, VALUE x)
24112{
24113 if (x == Qfalse) return x;
24114 if (x == Qtrue) return x;
24115 if (NIL_P(x)) return x;
24116 if (UNDEF_P(x))
24117 rb_raise(rb_eArgError, "Qundef given");
24118 if (FIXNUM_P(x)) return x;
24119 if (SYMBOL_P(x)) return x;
24120 switch (BUILTIN_TYPE(x)) {
24121 case T_STRING:
24122 case T_OBJECT:
24123 case T_ARRAY:
24124 case T_BIGNUM:
24125 case T_FLOAT:
24126 case T_COMPLEX:
24127 case T_RATIONAL:
24128 break;
24129 case T_NODE:
24130 if (!nd_type_p((NODE *)x, NODE_RIPPER)) {
24131 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
24132 }
24133 x = ((NODE *)x)->nd_rval;
24134 break;
24135 default:
24136 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
24137 (void *)x, rb_obj_classname(x));
24138 }
24139 if (!RBASIC_CLASS(x)) {
24140 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
24141 (void *)x, rb_builtin_type_name(TYPE(x)));
24142 }
24143 return x;
24144}
24145#endif
24146
24147#define validate(x) ((x) = get_value(x))
24148
24149static VALUE
24150ripper_dispatch0(struct parser_params *p, ID mid)
24151{
24152 return rb_funcall(p->value, mid, 0);
24153}
24154
24155static VALUE
24156ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
24157{
24158 validate(a);
24159 return rb_funcall(p->value, mid, 1, a);
24160}
24161
24162static VALUE
24163ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
24164{
24165 validate(a);
24166 validate(b);
24167 return rb_funcall(p->value, mid, 2, a, b);
24168}
24169
24170static VALUE
24171ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
24172{
24173 validate(a);
24174 validate(b);
24175 validate(c);
24176 return rb_funcall(p->value, mid, 3, a, b, c);
24177}
24178
24179static VALUE
24180ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
24181{
24182 validate(a);
24183 validate(b);
24184 validate(c);
24185 validate(d);
24186 return rb_funcall(p->value, mid, 4, a, b, c, d);
24187}
24188
24189static VALUE
24190ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
24191{
24192 validate(a);
24193 validate(b);
24194 validate(c);
24195 validate(d);
24196 validate(e);
24197 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
24198}
24199
24200static VALUE
24201ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
24202{
24203 validate(a);
24204 validate(b);
24205 validate(c);
24206 validate(d);
24207 validate(e);
24208 validate(f);
24209 validate(g);
24210 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
24211}
24212
24213static ID
24214ripper_get_id(VALUE v)
24215{
24216 NODE *nd;
24217 if (!RB_TYPE_P(v, T_NODE)) return 0;
24218 nd = (NODE *)v;
24219 if (!nd_type_p(nd, NODE_RIPPER)) return 0;
24220 return nd->nd_vid;
24221}
24222
24223static VALUE
24224ripper_get_value(VALUE v)
24225{
24226 NODE *nd;
24227 if (UNDEF_P(v)) return Qnil;
24228 if (!RB_TYPE_P(v, T_NODE)) return v;
24229 nd = (NODE *)v;
24230 if (!nd_type_p(nd, NODE_RIPPER)) return Qnil;
24231 return nd->nd_rval;
24232}
24233
24234static void
24235ripper_error(struct parser_params *p)
24236{
24237 p->error_p = TRUE;
24238}
24239
24240static void
24241ripper_compile_error(struct parser_params *p, const char *fmt, ...)
24242{
24243 VALUE str;
24244 va_list args;
24245
24246 va_start(args, fmt);
24247 str = rb_vsprintf(fmt, args);
24248 va_end(args);
24249 rb_funcall(p->value, rb_intern("compile_error"), 1, str);
24250 ripper_error(p);
24251}
24252
24253static VALUE
24254ripper_lex_get_generic(struct parser_params *p, VALUE src)
24255{
24256 VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
24257 if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
24259 "gets returned %"PRIsVALUE" (expected String or nil)",
24260 rb_obj_class(line));
24261 }
24262 return line;
24263}
24264
24265static VALUE
24266ripper_lex_io_get(struct parser_params *p, VALUE src)
24267{
24268 return rb_io_gets(src);
24269}
24270
24271static VALUE
24272ripper_s_allocate(VALUE klass)
24273{
24274 struct parser_params *p;
24275 VALUE self = TypedData_Make_Struct(klass, struct parser_params,
24276 &parser_data_type, p);
24277 p->value = self;
24278 return self;
24279}
24280
24281#define ripper_initialized_p(r) ((r)->lex.input != 0)
24282
24283/*
24284 * call-seq:
24285 * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
24286 *
24287 * Create a new Ripper object.
24288 * _src_ must be a String, an IO, or an Object which has #gets method.
24289 *
24290 * This method does not starts parsing.
24291 * See also Ripper#parse and Ripper.parse.
24292 */
24293static VALUE
24294ripper_initialize(int argc, VALUE *argv, VALUE self)
24295{
24296 struct parser_params *p;
24297 VALUE src, fname, lineno;
24298
24299 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24300 rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
24301 if (RB_TYPE_P(src, T_FILE)) {
24302 p->lex.gets = ripper_lex_io_get;
24303 }
24304 else if (rb_respond_to(src, id_gets)) {
24305 p->lex.gets = ripper_lex_get_generic;
24306 }
24307 else {
24308 StringValue(src);
24309 p->lex.gets = lex_get_str;
24310 }
24311 p->lex.input = src;
24312 p->eofp = 0;
24313 if (NIL_P(fname)) {
24314 fname = STR_NEW2("(ripper)");
24315 OBJ_FREEZE(fname);
24316 }
24317 else {
24318 StringValueCStr(fname);
24319 fname = rb_str_new_frozen(fname);
24320 }
24321 parser_initialize(p);
24322
24323 p->ruby_sourcefile_string = fname;
24324 p->ruby_sourcefile = RSTRING_PTR(fname);
24325 p->ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
24326
24327 return Qnil;
24328}
24329
24330static VALUE
24331ripper_parse0(VALUE parser_v)
24332{
24333 struct parser_params *p;
24334
24335 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
24336 parser_prepare(p);
24337 p->ast = rb_ast_new();
24338 ripper_yyparse((void*)p);
24339 rb_ast_dispose(p->ast);
24340 p->ast = 0;
24341 return p->result;
24342}
24343
24344static VALUE
24345ripper_ensure(VALUE parser_v)
24346{
24347 struct parser_params *p;
24348
24349 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
24350 p->parsing_thread = Qnil;
24351 return Qnil;
24352}
24353
24354/*
24355 * call-seq:
24356 * ripper.parse
24357 *
24358 * Start parsing and returns the value of the root action.
24359 */
24360static VALUE
24361ripper_parse(VALUE self)
24362{
24363 struct parser_params *p;
24364
24365 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24366 if (!ripper_initialized_p(p)) {
24367 rb_raise(rb_eArgError, "method called for uninitialized object");
24368 }
24369 if (!NIL_P(p->parsing_thread)) {
24370 if (p->parsing_thread == rb_thread_current())
24371 rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
24372 else
24373 rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
24374 }
24375 p->parsing_thread = rb_thread_current();
24376 rb_ensure(ripper_parse0, self, ripper_ensure, self);
24377
24378 return p->result;
24379}
24380
24381/*
24382 * call-seq:
24383 * ripper.column -> Integer
24384 *
24385 * Return column number of current parsing line.
24386 * This number starts from 0.
24387 */
24388static VALUE
24389ripper_column(VALUE self)
24390{
24391 struct parser_params *p;
24392 long col;
24393
24394 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24395 if (!ripper_initialized_p(p)) {
24396 rb_raise(rb_eArgError, "method called for uninitialized object");
24397 }
24398 if (NIL_P(p->parsing_thread)) return Qnil;
24399 col = p->lex.ptok - p->lex.pbeg;
24400 return LONG2NUM(col);
24401}
24402
24403/*
24404 * call-seq:
24405 * ripper.filename -> String
24406 *
24407 * Return current parsing filename.
24408 */
24409static VALUE
24410ripper_filename(VALUE self)
24411{
24412 struct parser_params *p;
24413
24414 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24415 if (!ripper_initialized_p(p)) {
24416 rb_raise(rb_eArgError, "method called for uninitialized object");
24417 }
24418 return p->ruby_sourcefile_string;
24419}
24420
24421/*
24422 * call-seq:
24423 * ripper.lineno -> Integer
24424 *
24425 * Return line number of current parsing line.
24426 * This number starts from 1.
24427 */
24428static VALUE
24429ripper_lineno(VALUE self)
24430{
24431 struct parser_params *p;
24432
24433 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24434 if (!ripper_initialized_p(p)) {
24435 rb_raise(rb_eArgError, "method called for uninitialized object");
24436 }
24437 if (NIL_P(p->parsing_thread)) return Qnil;
24438 return INT2NUM(p->ruby_sourceline);
24439}
24440
24441/*
24442 * call-seq:
24443 * ripper.state -> Integer
24444 *
24445 * Return scanner state of current token.
24446 */
24447static VALUE
24448ripper_state(VALUE self)
24449{
24450 struct parser_params *p;
24451
24452 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24453 if (!ripper_initialized_p(p)) {
24454 rb_raise(rb_eArgError, "method called for uninitialized object");
24455 }
24456 if (NIL_P(p->parsing_thread)) return Qnil;
24457 return INT2NUM(p->lex.state);
24458}
24459
24460/*
24461 * call-seq:
24462 * ripper.token -> String
24463 *
24464 * Return the current token string.
24465 */
24466static VALUE
24467ripper_token(VALUE self)
24468{
24469 struct parser_params *p;
24470 long pos, len;
24471
24472 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24473 if (!ripper_initialized_p(p)) {
24474 rb_raise(rb_eArgError, "method called for uninitialized object");
24475 }
24476 if (NIL_P(p->parsing_thread)) return Qnil;
24477 pos = p->lex.ptok - p->lex.pbeg;
24478 len = p->lex.pcur - p->lex.ptok;
24479 return rb_str_subseq(p->lex.lastline, pos, len);
24480}
24481
24482#ifdef RIPPER_DEBUG
24483/* :nodoc: */
24484static VALUE
24485ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
24486{
24487 StringValue(msg);
24488 if (UNDEF_P(obj)) {
24489 rb_raise(rb_eArgError, "%"PRIsVALUE, msg);
24490 }
24491 return Qnil;
24492}
24493
24494/* :nodoc: */
24495static VALUE
24496ripper_value(VALUE self, VALUE obj)
24497{
24498 return ULONG2NUM(obj);
24499}
24500#endif
24501
24502/*
24503 * call-seq:
24504 * Ripper.lex_state_name(integer) -> string
24505 *
24506 * Returns a string representation of lex_state.
24507 */
24508static VALUE
24509ripper_lex_state_name(VALUE self, VALUE state)
24510{
24511 return rb_parser_lex_state_name(NUM2INT(state));
24512}
24513
24514void
24515Init_ripper(void)
24516{
24517 ripper_init_eventids1();
24518 ripper_init_eventids2();
24519 id_warn = rb_intern_const("warn");
24520 id_warning = rb_intern_const("warning");
24521 id_gets = rb_intern_const("gets");
24522 id_assoc = rb_intern_const("=>");
24523
24524 (void)yystpcpy; /* may not used in newer bison */
24525
24526 InitVM(ripper);
24527}
24528
24529void
24530InitVM_ripper(void)
24531{
24532 VALUE Ripper;
24533
24534 Ripper = rb_define_class("Ripper", rb_cObject);
24535 /* version of Ripper */
24536 rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
24537 rb_define_alloc_func(Ripper, ripper_s_allocate);
24538 rb_define_method(Ripper, "initialize", ripper_initialize, -1);
24539 rb_define_method(Ripper, "parse", ripper_parse, 0);
24540 rb_define_method(Ripper, "column", ripper_column, 0);
24541 rb_define_method(Ripper, "filename", ripper_filename, 0);
24542 rb_define_method(Ripper, "lineno", ripper_lineno, 0);
24543 rb_define_method(Ripper, "state", ripper_state, 0);
24544 rb_define_method(Ripper, "token", ripper_token, 0);
24545 rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
24546 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
24547 rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
24548 rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
24549 rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0);
24550 rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1);
24551 rb_define_method(Ripper, "error?", ripper_error_p, 0);
24552#ifdef RIPPER_DEBUG
24553 rb_define_method(Ripper, "assert_Qundef", ripper_assert_Qundef, 2);
24554 rb_define_method(Ripper, "rawVALUE", ripper_value, 1);
24555 rb_define_method(Ripper, "validate_object", ripper_validate_object, 1);
24556#endif
24557
24558 rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
24559 rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
24560
24561 rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
24562
24563<% @exprs.each do |expr, desc| -%>
24564 /* <%=desc%> */
24565 rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
24566<% end %>
24567 ripper_init_eventids1_table(Ripper);
24568 ripper_init_eventids2_table(Ripper);
24569
24570# if 0
24571 /* Hack to let RDoc document SCRIPT_LINES__ */
24572
24573 /*
24574 * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
24575 * after the assignment will be added as an Array of lines with the file
24576 * name as the key.
24577 */
24578 rb_define_global_const("SCRIPT_LINES__", Qnil);
24579#endif
24580
24581}
24582#endif /* RIPPER */
24583
24584/*
24585 * Local variables:
24586 * mode: c
24587 * c-file-style: "ruby"
24588 * End:
24589 */
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
static bool rb_enc_isspace(OnigCodePoint c, rb_encoding *enc)
Identical to rb_isspace(), except it additionally takes an encoding.
Definition ctype.h:194
static bool rb_enc_isalnum(OnigCodePoint c, rb_encoding *enc)
Identical to rb_isalnum(), except it additionally takes an encoding.
Definition ctype.h:166
static bool RB_OBJ_FROZEN(VALUE obj)
Checks if an object is frozen.
Definition fl_type.h:921
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
Definition class.c:923
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
Retrieves argument from argc and argv to given VALUE references according to the format string.
Definition class.c:2579
#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 T_FILE
Old name of RUBY_T_FILE.
Definition value_type.h:62
#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:144
#define OBJ_FREEZE
Old name of RB_OBJ_FREEZE.
Definition fl_type.h:143
#define ULONG2NUM
Old name of RB_ULONG2NUM.
Definition long.h:60
#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 NUM2UINT
Old name of RB_NUM2UINT.
Definition int.h:45
#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 T_HASH
Old name of RUBY_T_HASH.
Definition value_type.h:65
#define ALLOC_N
Old name of RB_ALLOC_N.
Definition memory.h:393
#define LONG2NUM
Old name of RB_LONG2NUM.
Definition long.h:50
#define STRCASECMP
Old name of st_locale_insensitive_strcasecmp.
Definition ctype.h:102
#define rb_usascii_str_new2
Old name of rb_usascii_str_new_cstr.
Definition string.h:1680
#define ISALPHA
Old name of rb_isalpha.
Definition ctype.h:92
#define STRNCASECMP
Old name of st_locale_insensitive_strncasecmp.
Definition ctype.h:103
#define ISASCII
Old name of rb_isascii.
Definition ctype.h:85
#define FLONUM_P
Old name of RB_FLONUM_P.
#define Qtrue
Old name of RUBY_Qtrue.
#define FIXNUM_MAX
Old name of RUBY_FIXNUM_MAX.
Definition fixnum.h:26
#define NUM2INT
Old name of RB_NUM2INT.
Definition int.h:44
#define INT2NUM
Old name of RB_INT2NUM.
Definition int.h:43
#define Qnil
Old name of RUBY_Qnil.
#define Qfalse
Old name of RUBY_Qfalse.
#define FIX2LONG
Old name of RB_FIX2LONG.
Definition long.h:46
#define T_ARRAY
Old name of RUBY_T_ARRAY.
Definition value_type.h:56
#define scan_hex(s, l, e)
Old name of ruby_scan_hex.
Definition util.h:97
#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:532
#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 scan_oct(s, l, e)
Old name of ruby_scan_oct.
Definition util.h:74
#define CONST_ID
Old name of RUBY_CONST_ID.
Definition symbol.h:47
#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
void rb_raise(VALUE exc, const char *fmt,...)
Exception entry point.
Definition error.c:3150
void rb_compile_warn(const char *file, int line, const char *fmt,...)
Identical to rb_compile_warning(), except it reports always regardless of runtime -W flag.
Definition error.c:363
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
Definition eval.c:688
void rb_bug(const char *fmt,...)
Interpreter panic switch.
Definition error.c:794
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
Definition eval.c:1884
#define ruby_verbose
This variable controls whether the interpreter is in debug mode.
Definition error.h:459
VALUE rb_eTypeError
TypeError exception.
Definition error.c:1091
void rb_fatal(const char *fmt,...)
Raises the unsung "fatal" exception.
Definition error.c:3201
VALUE rb_eRuntimeError
RuntimeError exception.
Definition error.c:1089
VALUE rb_eArgError
ArgumentError exception.
Definition error.c:1092
void rb_compile_warning(const char *file, int line, const char *fmt,...)
Issues a compile-time warning that happens at __file__:__line__.
Definition error.c:374
VALUE rb_errinfo(void)
This is the same as $! in Ruby.
Definition eval.c:1878
VALUE rb_eSyntaxError
SyntaxError exception.
Definition error.c:1108
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates, then initialises an instance of the given class.
Definition object.c:1981
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
Definition object.c:84
VALUE rb_obj_class(VALUE obj)
Queries the class of an object.
Definition object.c:191
VALUE rb_obj_freeze(VALUE obj)
Just calls rb_obj_freeze_inline() inside.
Definition object.c:1183
#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 rgengc.h:232
#define RB_OBJ_WRITE(old, slot, young)
Declaration of a "back" pointer.
Definition rgengc.h:220
Encoding relates APIs.
static const char * rb_enc_name(rb_encoding *enc)
Queries the (canonical) name of the passed encoding.
Definition encoding.h:433
static char * rb_enc_prev_char(const char *s, const char *p, const char *e, rb_encoding *enc)
Queries the previous (left) character.
Definition encoding.h:678
static bool rb_enc_asciicompat(rb_encoding *enc)
Queries if the passed encoding is in some sense compatible with ASCII.
Definition encoding.h:784
static int rb_enc_mbcput(unsigned int c, void *buf, rb_encoding *enc)
Identical to rb_enc_uint_chr(), except it writes back to the passed buffer instead of allocating one.
Definition encoding.h:659
int rb_char_to_option_kcode(int c, int *option, int *kcode)
Converts a character option to its encoding.
Definition re.c:331
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc)
Identical to rb_str_cat(), except it additionally takes an encoding.
Definition string.c:3288
VALUE rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
Identical to rb_enc_str_new(), except it additionally takes an encoding.
Definition string.c:981
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:719
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
Definition vm_eval.c:1102
VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv)
Identical to rb_funcallv(), except it only takes public methods into account.
Definition vm_eval.c:1153
VALUE rb_io_gets(VALUE io)
Reads a "line" from the given IO.
Definition io.c:4219
VALUE rb_io_puts(int argc, const VALUE *argv, VALUE io)
Iterates over the passed array to apply rb_io_write() individually.
Definition io.c:8902
VALUE rb_io_write(VALUE io, VALUE str)
Writes the given string to the given IO.
Definition io.c:2267
VALUE rb_io_flush(VALUE io)
Flushes any buffered data within the passed IO to the underlying operating system.
Definition io.c:2371
VALUE rb_default_rs
This is the default value of rb_rs, i.e.
Definition io.c:200
VALUE rb_int_positive_pow(long x, unsigned long y)
Raises the passed x to the power of y.
Definition numeric.c:4492
ID rb_id_attrset(ID id)
Calculates an ID of attribute writer.
Definition symbol.c:118
VALUE rb_rational_new(VALUE num, VALUE den)
Constructs a Rational, with reduction.
Definition rational.c:1969
#define rb_rational_raw1(x)
Shorthand of (x/1)r.
Definition rational.h:51
int rb_memcicmp(const void *s1, const void *s2, long n)
Identical to st_locale_insensitive_strcasecmp(), except it is timing safe and returns something diffe...
Definition re.c:92
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:3353
VALUE rb_str_subseq(VALUE str, long beg, long len)
Identical to rb_str_substr(), except the numbers are interpreted as byte offsets instead of character...
Definition string.c:2826
#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
VALUE rb_str_new_frozen(VALUE str)
Creates a frozen copy of the string, if necessary.
Definition string.c:1382
VALUE rb_str_dup(VALUE str)
Duplicates a string.
Definition string.c:1834
void rb_str_modify(VALUE str)
Declares that the string is about to be modified.
Definition string.c:2437
VALUE rb_str_cat(VALUE dst, const char *src, long srclen)
Destructively appends the passed contents to the string.
Definition string.c:3177
VALUE rb_filesystem_str_new_cstr(const char *ptr)
Identical to rb_filesystem_str_new(), except it assumes the passed pointer is a pointer to a C string...
Definition string.c:1295
VALUE rb_str_buf_append(VALUE dst, VALUE src)
Identical to rb_str_cat_cstr(), except it takes Ruby's string instead of C's.
Definition string.c:3319
void rb_str_set_len(VALUE str, long len)
Overwrites the length of the string.
Definition string.c:3020
#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
VALUE rb_str_resize(VALUE str, long len)
Overwrites the length of the string.
Definition string.c:3064
VALUE rb_str_buf_new(long capa)
Allocates a "string buffer".
Definition string.c:1532
#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
VALUE rb_str_intern(VALUE str)
Identical to rb_to_symbol(), except it assumes the receiver being an instance of RString.
Definition symbol.c:851
VALUE rb_obj_as_string(VALUE obj)
Try converting an object to its stringised representation using its to_s method, if any.
Definition string.c:1682
VALUE rb_thread_current(void)
Obtains the "current" thread.
Definition thread.c:2808
VALUE rb_attr_get(VALUE obj, ID name)
Identical to rb_ivar_get()
Definition variable.c:1226
VALUE rb_const_get_at(VALUE space, ID name)
Identical to rb_const_defined_at(), except it returns the actual defined value.
Definition variable.c:2902
int rb_const_defined_at(VALUE space, ID name)
Identical to rb_const_defined(), except it doesn't look for parent classes.
Definition variable.c:3210
int rb_respond_to(VALUE obj, ID mid)
Queries if the object responds to the method.
Definition vm_method.c:2805
void rb_define_alloc_func(VALUE klass, rb_alloc_func_t func)
Sets the allocator function of a class.
VALUE rb_make_backtrace(void)
Creates the good old fashioned array-of-strings style backtrace info.
ID rb_intern2(const char *name, long len)
Identical to rb_intern(), except it additionally takes the length of the string.
Definition symbol.c:789
static ID rb_intern_const(const char *str)
This is a "tiny optimisation" over rb_intern().
Definition symbol.h:276
ID rb_intern(const char *name)
Finds or creates a symbol of the given name.
Definition symbol.c:796
const char * rb_id2name(ID id)
Retrieves the name mapped to the given id.
Definition symbol.c:960
ID rb_intern_str(VALUE str)
Identical to rb_intern(), except it takes an instance of rb_cString.
Definition symbol.c:802
void rb_define_global_const(const char *name, VALUE val)
Identical to rb_define_const(), except it defines that of "global", i.e.
Definition variable.c:3452
void rb_define_const(VALUE klass, const char *name, VALUE val)
Defines a Ruby level constant under a namespace.
Definition variable.c:3440
VALUE rb_ractor_stderr(void)
Queries the standard error of the current Ractor that is calling this function.
Definition ractor.c:2148
VALUE rb_ractor_stdout(void)
Queries the standard output of the current Ractor that is calling this function.
Definition ractor.c:2136
VALUE rb_ractor_make_shareable(VALUE obj)
Destructively transforms the passed object so that multiple Ractors can share it.
Definition ractor.c:2522
#define strtod(s, e)
Just another name of ruby_strtod.
Definition util.h:212
unsigned long ruby_scan_oct(const char *str, size_t len, size_t *consumed)
Interprets the passed string as an octal unsigned integer.
Definition util.c:38
unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
Scans the passed string, assuming the string is a textual representation of an integer.
Definition util.c:98
VALUE rb_sprintf(const char *fmt,...)
Ruby's extended sprintf(3).
Definition sprintf.c:1219
VALUE rb_str_vcatf(VALUE dst, const char *fmt, va_list ap)
Identical to rb_str_catf(), except it takes a va_list.
Definition sprintf.c:1232
VALUE rb_vsprintf(const char *fmt, va_list ap)
Identical to rb_sprintf(), except it takes a va_list.
Definition sprintf.c:1213
VALUE rb_str_catf(VALUE dst, const char *fmt,...)
Identical to rb_sprintf(), except it renders the output to the specified object rather than creating ...
Definition sprintf.c:1242
#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 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.
VALUE rb_ensure(type *q, VALUE w, type *e, VALUE r)
An equivalent of ensure clause.
#define RARRAY_LEN
Just another name of rb_array_len.
Definition rarray.h:68
#define RARRAY_AREF(a, i)
Definition rarray.h:583
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 StringValue(v)
Ensures that the parameter object is a String.
Definition rstring.h:72
static char * RSTRING_END(VALUE str)
Queries the end of the contents pointer of the string.
Definition rstring.h:528
#define RSTRING_GETMEM(str, ptrvar, lenvar)
Convenient macro to obtain the contents and length at once.
Definition rstring.h:574
static long RSTRING_LEN(VALUE str)
Queries the length of the string.
Definition rstring.h:484
static char * RSTRING_PTR(VALUE str)
Queries the contents pointer of the string.
Definition rstring.h:498
#define StringValueCStr(v)
Identical to StringValuePtr, except it additionally checks for the contents for viability as a C stri...
Definition rstring.h:95
#define TypedData_Get_Struct(obj, type, data_type, sval)
Obtains a C struct from inside of a wrapper Ruby object.
Definition rtypeddata.h:507
#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:489
const char * rb_obj_classname(VALUE obj)
Queries the name of the class of the passed object.
Definition variable.c:325
#define InitVM(ext)
This macro is for internal use.
Definition ruby.h:230
#define RTEST
This is an old name of RB_TEST.
Definition node.h:156
Definition lex.c:34
This is the struct that holds necessary info for a struct.
Definition rtypeddata.h:190
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 bool RB_TYPE_P(VALUE obj, enum ruby_value_type t)
Queries if the given object is of given type.
Definition value_type.h:375
#define RBIMPL_WARNING_IGNORED(flag)
Suppresses a warning.
#define RBIMPL_WARNING_PUSH()
Pushes compiler warning state.
#define RBIMPL_WARNING_POP()
Pops compiler warning state.