Ruby 3.2.1p31 (2023-02-08 revision 31819e82c88c6f8ecfaeb162519bfa26a14b21fd)
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
754static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
755
756static int
757parser_get_node_id(struct parser_params *p)
758{
759 int node_id = p->node_id;
760 p->node_id++;
761 return node_id;
762}
763
764#ifndef RIPPER
765static inline void
766set_line_body(NODE *body, int line)
767{
768 if (!body) return;
769 switch (nd_type(body)) {
770 case NODE_RESCUE:
771 case NODE_ENSURE:
772 nd_set_line(body, line);
773 }
774}
775
776#define yyparse ruby_yyparse
777
778static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
779static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
780#define new_nil(loc) NEW_NIL(loc)
781static NODE *new_nil_at(struct parser_params *p, const rb_code_position_t *pos);
782static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
783static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
784static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
785
786static NODE *newline_node(NODE*);
787static void fixpos(NODE*,NODE*);
788
789static int value_expr_gen(struct parser_params*,NODE*);
790static void void_expr(struct parser_params*,NODE*);
791static NODE *remove_begin(NODE*);
792static NODE *remove_begin_all(NODE*);
793#define value_expr(node) value_expr_gen(p, (node))
794static NODE *void_stmts(struct parser_params*,NODE*);
795static void reduce_nodes(struct parser_params*,NODE**);
796static void block_dup_check(struct parser_params*,NODE*,NODE*);
797
798static NODE *block_append(struct parser_params*,NODE*,NODE*);
799static NODE *list_append(struct parser_params*,NODE*,NODE*);
800static NODE *list_concat(NODE*,NODE*);
801static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
802static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
803static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
804static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
805static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
806static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
807static NODE *evstr2dstr(struct parser_params*,NODE*);
808static NODE *splat_array(NODE*);
809static void mark_lvar_used(struct parser_params *p, NODE *rhs);
810
811static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
812static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
813static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
814static 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);
815static 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;}
816
817static bool args_info_empty_p(struct rb_args_info *args);
818static NODE *new_args(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*,const YYLTYPE*);
819static NODE *new_args_tail(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
820static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
821static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc);
822static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
823static NODE *new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc);
824static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
825static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
826
827static NODE *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
828static NODE *args_with_numbered(struct parser_params*,NODE*,int);
829
830static VALUE negate_lit(struct parser_params*, VALUE);
831static NODE *ret_args(struct parser_params*,NODE*);
832static NODE *arg_blk_pass(NODE*,NODE*);
833static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
834static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
835
836static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
837static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
838
839static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
840static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
841
842static void rb_backref_error(struct parser_params*,NODE*);
843static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
844
845static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
846static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
847static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
848static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
849static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
850
851static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
852
853static NODE *opt_arg_append(NODE*, NODE*);
854static NODE *kwd_append(NODE*, NODE*);
855
856static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
857static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
858
859static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
860
861static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
862
863#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
864
865static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
866
867static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
868
869static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
870
871static rb_ast_id_table_t *local_tbl(struct parser_params*);
872
873static VALUE reg_compile(struct parser_params*, VALUE, int);
874static void reg_fragment_setenc(struct parser_params*, VALUE, int);
875static int reg_fragment_check(struct parser_params*, VALUE, int);
876static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
877
878static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
879static NODE *heredoc_dedent(struct parser_params*,NODE*);
880
881static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
882
883#define get_id(id) (id)
884#define get_value(val) (val)
885#define get_num(num) (num)
886#else /* RIPPER */
887#define NODE_RIPPER NODE_CDECL
888#define NEW_RIPPER(a,b,c,loc) (VALUE)NEW_CDECL(a,b,c,loc)
889
890static inline int ripper_is_node_yylval(VALUE n);
891
892static inline VALUE
893ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
894{
895 if (ripper_is_node_yylval(c)) c = RNODE(c)->nd_cval;
896 add_mark_object(p, b);
897 add_mark_object(p, c);
898 return NEW_RIPPER(a, b, c, &NULL_LOC);
899}
900
901static inline int
902ripper_is_node_yylval(VALUE n)
903{
904 return RB_TYPE_P(n, T_NODE) && nd_type_p(RNODE(n), NODE_RIPPER);
905}
906
907#define value_expr(node) ((void)(node))
908#define remove_begin(node) (node)
909#define void_stmts(p,x) (x)
910#define rb_dvar_defined(id, base) 0
911#define rb_local_defined(id, base) 0
912static ID ripper_get_id(VALUE);
913#define get_id(id) ripper_get_id(id)
914static VALUE ripper_get_value(VALUE);
915#define get_value(val) ripper_get_value(val)
916#define get_num(num) (int)get_id(num)
917static VALUE assignable(struct parser_params*,VALUE);
918static int id_is_var(struct parser_params *p, ID id);
919
920#define method_cond(p,node,loc) (node)
921#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
922#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
923#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
924#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
925
926#define new_nil(loc) Qnil
927
928static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
929
930static VALUE const_decl(struct parser_params *p, VALUE path);
931
932static VALUE var_field(struct parser_params *p, VALUE a);
933static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
934
935static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
936
937static VALUE backref_error(struct parser_params*, NODE *, VALUE);
938#endif /* !RIPPER */
939
940/* forward declaration */
941typedef struct rb_strterm_heredoc_struct rb_strterm_heredoc_t;
942
943RUBY_SYMBOL_EXPORT_BEGIN
944VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
945int rb_reg_fragment_setenc(struct parser_params*, VALUE, int);
946enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
947VALUE rb_parser_lex_state_name(enum lex_state_e state);
948void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
949PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
950YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
951YYLTYPE *rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc);
952YYLTYPE *rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc);
953YYLTYPE *rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc);
954YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
955YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
956RUBY_SYMBOL_EXPORT_END
957
958static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
959static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
960#ifndef RIPPER
961static ID formal_argument(struct parser_params*, ID);
962#else
963static ID formal_argument(struct parser_params*, VALUE);
964#endif
965static ID shadowing_lvar(struct parser_params*,ID);
966static void new_bv(struct parser_params*,ID);
967
968static void local_push(struct parser_params*,int);
969static void local_pop(struct parser_params*);
970static void local_var(struct parser_params*, ID);
971static void arg_var(struct parser_params*, ID);
972static int local_id(struct parser_params *p, ID id);
973static int local_id_ref(struct parser_params*, ID, ID **);
974#ifndef RIPPER
975static ID internal_id(struct parser_params*);
976static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
977#endif
978static int check_forwarding_args(struct parser_params*);
979static void add_forwarding_args(struct parser_params *p);
980
981static const struct vtable *dyna_push(struct parser_params *);
982static void dyna_pop(struct parser_params*, const struct vtable *);
983static int dyna_in_block(struct parser_params*);
984#define dyna_var(p, id) local_var(p, id)
985static int dvar_defined(struct parser_params*, ID);
986static int dvar_defined_ref(struct parser_params*, ID, ID**);
987static int dvar_curr(struct parser_params*,ID);
988
989static int lvar_defined(struct parser_params*, ID);
990
991static NODE *numparam_push(struct parser_params *p);
992static void numparam_pop(struct parser_params *p, NODE *prev_inner);
993
994#ifdef RIPPER
995# define METHOD_NOT idNOT
996#else
997# define METHOD_NOT '!'
998#endif
999
1000#define idFWD_REST '*'
1001#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
1002#define idFWD_BLOCK '&'
1003#define idFWD_ALL idDot3
1004#define FORWARD_ARGS_WITH_RUBY2_KEYWORDS
1005
1006#define RE_OPTION_ONCE (1<<16)
1007#define RE_OPTION_ENCODING_SHIFT 8
1008#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
1009#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
1010#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
1011#define RE_OPTION_MASK 0xff
1012#define RE_OPTION_ARG_ENCODING_NONE 32
1013
1014/* structs for managing terminator of string literal and heredocment */
1015typedef struct rb_strterm_literal_struct {
1016 union {
1017 VALUE dummy;
1018 long nest;
1019 } u0;
1020 union {
1021 VALUE dummy;
1022 long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
1023 } u1;
1024 union {
1025 VALUE dummy;
1026 long paren; /* '(' of `%q(...)` */
1027 } u2;
1028 union {
1029 VALUE dummy;
1030 long term; /* ')' of `%q(...)` */
1031 } u3;
1032} rb_strterm_literal_t;
1033
1034#define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
1035
1036struct rb_strterm_heredoc_struct {
1037 VALUE lastline; /* the string of line that contains `<<"END"` */
1038 long offset; /* the column of END in `<<"END"` */
1039 int sourceline; /* lineno of the line that contains `<<"END"` */
1040 unsigned length /* the length of END in `<<"END"` */
1041#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
1042 : HERETERM_LENGTH_BITS
1043# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
1044#else
1045# define HERETERM_LENGTH_MAX UINT_MAX
1046#endif
1047 ;
1048#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
1049 unsigned quote: 1;
1050 unsigned func: 8;
1051#else
1052 uint8_t quote;
1053 uint8_t func;
1054#endif
1055};
1056STATIC_ASSERT(rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t) <= 4 * SIZEOF_VALUE);
1057
1058#define STRTERM_HEREDOC IMEMO_FL_USER0
1059
1060struct rb_strterm_struct {
1061 VALUE flags;
1062 union {
1063 rb_strterm_literal_t literal;
1064 rb_strterm_heredoc_t heredoc;
1065 } u;
1066};
1067
1068#ifndef RIPPER
1069void
1070rb_strterm_mark(VALUE obj)
1071{
1072 rb_strterm_t *strterm = (rb_strterm_t*)obj;
1073 if (RBASIC(obj)->flags & STRTERM_HEREDOC) {
1074 rb_strterm_heredoc_t *heredoc = &strterm->u.heredoc;
1075 rb_gc_mark(heredoc->lastline);
1076 }
1077}
1078#endif
1079
1080#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
1081size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
1082
1083#define TOKEN2ID(tok) ( \
1084 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
1085 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
1086 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
1087 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
1088 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
1089 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
1090 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
1091
1092/****** Ripper *******/
1093
1094#ifdef RIPPER
1095#define RIPPER_VERSION "0.1.0"
1096
1097static inline VALUE intern_sym(const char *name);
1098
1099#include "eventids1.c"
1100#include "eventids2.c"
1101
1102static VALUE ripper_dispatch0(struct parser_params*,ID);
1103static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
1104static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
1105static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
1106static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
1107static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
1108static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
1109static void ripper_error(struct parser_params *p);
1110
1111#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
1112#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
1113#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
1114#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
1115#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
1116#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
1117#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))
1118
1119#define yyparse ripper_yyparse
1120
1121#define ID2VAL(id) STATIC_ID2SYM(id)
1122#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
1123#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
1124
1125#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
1126 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
1127
1128#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
1129
1130static inline VALUE
1131new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
1132{
1133 NODE *t = (NODE *)tail;
1134 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value, block = t->u3.value;
1135 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, escape_Qundef(block));
1136}
1137
1138static inline VALUE
1139new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
1140{
1141 NODE *t = rb_node_newnode(NODE_ARGS_AUX, kw_args, kw_rest_arg, block, &NULL_LOC);
1142 add_mark_object(p, kw_args);
1143 add_mark_object(p, kw_rest_arg);
1144 add_mark_object(p, block);
1145 return (VALUE)t;
1146}
1147
1148static inline VALUE
1149args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
1150{
1151 return args;
1152}
1153
1154static VALUE
1155new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
1156{
1157 NODE *t = (NODE *)aryptn;
1158 VALUE pre_args = t->u1.value, rest_arg = t->u2.value, post_args = t->u3.value;
1159
1160 if (!NIL_P(pre_arg)) {
1161 if (!NIL_P(pre_args)) {
1162 rb_ary_unshift(pre_args, pre_arg);
1163 }
1164 else {
1165 pre_args = rb_ary_new_from_args(1, pre_arg);
1166 }
1167 }
1168 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
1169}
1170
1171static VALUE
1172new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
1173{
1174 NODE *t;
1175
1176 if (has_rest) {
1177 rest_arg = dispatch1(var_field, rest_arg ? rest_arg : Qnil);
1178 }
1179 else {
1180 rest_arg = Qnil;
1181 }
1182
1183 t = rb_node_newnode(NODE_ARYPTN, pre_args, rest_arg, post_args, &NULL_LOC);
1184 add_mark_object(p, pre_args);
1185 add_mark_object(p, rest_arg);
1186 add_mark_object(p, post_args);
1187 return (VALUE)t;
1188}
1189
1190static VALUE
1191new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YYLTYPE *loc)
1192{
1193 NODE *t = (NODE *)fndptn;
1194 VALUE pre_rest_arg = t->u1.value, args = t->u2.value, post_rest_arg = t->u3.value;
1195
1196 return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg);
1197}
1198
1199static VALUE
1200new_find_pattern_tail(struct parser_params *p, VALUE pre_rest_arg, VALUE args, VALUE post_rest_arg, const YYLTYPE *loc)
1201{
1202 NODE *t;
1203
1204 pre_rest_arg = dispatch1(var_field, pre_rest_arg ? pre_rest_arg : Qnil);
1205 post_rest_arg = dispatch1(var_field, post_rest_arg ? post_rest_arg : Qnil);
1206
1207 t = rb_node_newnode(NODE_FNDPTN, pre_rest_arg, args, post_rest_arg, &NULL_LOC);
1208 add_mark_object(p, pre_rest_arg);
1209 add_mark_object(p, args);
1210 add_mark_object(p, post_rest_arg);
1211 return (VALUE)t;
1212}
1213
1214#define new_hash(p,h,l) rb_ary_new_from_args(0)
1215
1216static VALUE
1217new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
1218{
1219 return ary;
1220}
1221
1222static VALUE
1223new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
1224{
1225 NODE *t = (NODE *)hshptn;
1226 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value;
1227 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
1228}
1229
1230static VALUE
1231new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
1232{
1233 NODE *t;
1234 if (kw_rest_arg) {
1235 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
1236 }
1237 else {
1238 kw_rest_arg = Qnil;
1239 }
1240 t = rb_node_newnode(NODE_HSHPTN, kw_args, kw_rest_arg, 0, &NULL_LOC);
1241
1242 add_mark_object(p, kw_args);
1243 add_mark_object(p, kw_rest_arg);
1244 return (VALUE)t;
1245}
1246
1247#define new_defined(p,expr,loc) dispatch1(defined, (expr))
1248
1249static VALUE heredoc_dedent(struct parser_params*,VALUE);
1250
1251#else
1252#define ID2VAL(id) (id)
1253#define TOKEN2VAL(t) ID2VAL(t)
1254#define KWD2EID(t, v) keyword_##t
1255
1256static NODE *
1257set_defun_body(struct parser_params *p, NODE *n, NODE *args, NODE *body, const YYLTYPE *loc)
1258{
1259 body = remove_begin(body);
1260 reduce_nodes(p, &body);
1261 n->nd_defn = NEW_SCOPE(args, body, loc);
1262 n->nd_loc = *loc;
1263 nd_set_line(n->nd_defn, loc->end_pos.lineno);
1264 set_line_body(body, loc->beg_pos.lineno);
1265 return n;
1266}
1267
1268static NODE *
1269rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1270 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1271{
1272 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1273 rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1274 loc.beg_pos = arg_loc->beg_pos;
1275 return NEW_RESCUE(arg, rescue, 0, &loc);
1276}
1277
1278#endif /* RIPPER */
1279
1280static void
1281restore_defun(struct parser_params *p, NODE *name)
1282{
1283 YYSTYPE c = {.val = name->nd_cval};
1284 p->cur_arg = name->nd_vid;
1285 p->ctxt.in_def = c.ctxt.in_def;
1286 p->ctxt.shareable_constant_value = c.ctxt.shareable_constant_value;
1287}
1288
1289static void
1290endless_method_name(struct parser_params *p, NODE *defn, const YYLTYPE *loc)
1291{
1292#ifdef RIPPER
1293 defn = defn->nd_defn;
1294#endif
1295 ID mid = defn->nd_mid;
1296 if (is_attrset_id(mid)) {
1297 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1298 }
1299 token_info_drop(p, "def", loc->beg_pos);
1300}
1301
1302#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)
1303
1304#ifndef RIPPER
1305# define Qnone 0
1306# define Qnull 0
1307# define ifndef_ripper(x) (x)
1308#else
1309# define Qnone Qnil
1310# define Qnull Qundef
1311# define ifndef_ripper(x)
1312#endif
1313
1314# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1315# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1316# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1317# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1318# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1319# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1320# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1321# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1322# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1323# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1324# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1325# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1326# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1327# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1328# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1329# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1330# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1331# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1332# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1333# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1334#ifdef RIPPER
1335static ID id_warn, id_warning, id_gets, id_assoc;
1336# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1337# define WARN_S_L(s,l) STR_NEW(s,l)
1338# define WARN_S(s) STR_NEW2(s)
1339# define WARN_I(i) INT2NUM(i)
1340# define WARN_ID(i) rb_id2str(i)
1341# define WARN_IVAL(i) i
1342# define PRIsWARN "s"
1343# define rb_warn0L_experimental(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1344# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1345# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1346# ifdef HAVE_VA_ARGS_MACRO
1347# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1348# else
1349# define WARN_CALL rb_funcall
1350# endif
1351# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1352# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1353# ifdef HAVE_VA_ARGS_MACRO
1354# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1355# else
1356# define WARNING_CALL rb_funcall
1357# endif
1358PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1359# define compile_error ripper_compile_error
1360#else
1361# define WARN_S_L(s,l) s
1362# define WARN_S(s) s
1363# define WARN_I(i) i
1364# define WARN_ID(i) rb_id2name(i)
1365# define WARN_IVAL(i) NUM2INT(i)
1366# define PRIsWARN PRIsVALUE
1367# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1368# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1369# define WARN_CALL rb_compile_warn
1370# define rb_warn0L_experimental(l,fmt) rb_category_compile_warn(RB_WARN_CATEGORY_EXPERIMENTAL, WARN_ARGS_L(l, fmt, 1))
1371# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1372# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1373# define WARNING_CALL rb_compile_warning
1374PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1375# define compile_error parser_compile_error
1376#endif
1377
1378#define WARN_EOL(tok) \
1379 (looking_at_eol_p(p) ? \
1380 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1381 (void)0)
1382static int looking_at_eol_p(struct parser_params *p);
1383
1384#line 1385 "parse.c"
1385
1386# ifndef YY_CAST
1387# ifdef __cplusplus
1388# define YY_CAST(Type, Val) static_cast<Type> (Val)
1389# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1390# else
1391# define YY_CAST(Type, Val) ((Type) (Val))
1392# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1393# endif
1394# endif
1395# ifndef YY_NULLPTR
1396# if defined __cplusplus
1397# if 201103L <= __cplusplus
1398# define YY_NULLPTR nullptr
1399# else
1400# define YY_NULLPTR 0
1401# endif
1402# else
1403# define YY_NULLPTR ((void*)0)
1404# endif
1405# endif
1406
1407/* Use api.header.include to #include this header
1408 instead of duplicating it here. */
1409#ifndef YY_YY_Y_TAB_H_INCLUDED
1410# define YY_YY_Y_TAB_H_INCLUDED
1411/* Debug traces. */
1412#ifndef YYDEBUG
1413# define YYDEBUG 0
1414#endif
1415#if YYDEBUG
1416#ifndef yydebug
1417extern int yydebug;
1418#endif
1419#endif
1420
1421/* Token kinds. */
1422#ifndef YYTOKENTYPE
1423# define YYTOKENTYPE
1424 enum yytokentype
1425 {
1426 YYEMPTY = -2,
1427 END_OF_INPUT = 0, /* "end-of-input" */
1428 YYerror = 256, /* error */
1429 YYUNDEF = 257, /* "invalid token" */
1430 keyword_class = 258, /* "`class'" */
1431 keyword_module = 259, /* "`module'" */
1432 keyword_def = 260, /* "`def'" */
1433 keyword_undef = 261, /* "`undef'" */
1434 keyword_begin = 262, /* "`begin'" */
1435 keyword_rescue = 263, /* "`rescue'" */
1436 keyword_ensure = 264, /* "`ensure'" */
1437 keyword_end = 265, /* "`end'" */
1438 keyword_if = 266, /* "`if'" */
1439 keyword_unless = 267, /* "`unless'" */
1440 keyword_then = 268, /* "`then'" */
1441 keyword_elsif = 269, /* "`elsif'" */
1442 keyword_else = 270, /* "`else'" */
1443 keyword_case = 271, /* "`case'" */
1444 keyword_when = 272, /* "`when'" */
1445 keyword_while = 273, /* "`while'" */
1446 keyword_until = 274, /* "`until'" */
1447 keyword_for = 275, /* "`for'" */
1448 keyword_break = 276, /* "`break'" */
1449 keyword_next = 277, /* "`next'" */
1450 keyword_redo = 278, /* "`redo'" */
1451 keyword_retry = 279, /* "`retry'" */
1452 keyword_in = 280, /* "`in'" */
1453 keyword_do = 281, /* "`do'" */
1454 keyword_do_cond = 282, /* "`do' for condition" */
1455 keyword_do_block = 283, /* "`do' for block" */
1456 keyword_do_LAMBDA = 284, /* "`do' for lambda" */
1457 keyword_return = 285, /* "`return'" */
1458 keyword_yield = 286, /* "`yield'" */
1459 keyword_super = 287, /* "`super'" */
1460 keyword_self = 288, /* "`self'" */
1461 keyword_nil = 289, /* "`nil'" */
1462 keyword_true = 290, /* "`true'" */
1463 keyword_false = 291, /* "`false'" */
1464 keyword_and = 292, /* "`and'" */
1465 keyword_or = 293, /* "`or'" */
1466 keyword_not = 294, /* "`not'" */
1467 modifier_if = 295, /* "`if' modifier" */
1468 modifier_unless = 296, /* "`unless' modifier" */
1469 modifier_while = 297, /* "`while' modifier" */
1470 modifier_until = 298, /* "`until' modifier" */
1471 modifier_rescue = 299, /* "`rescue' modifier" */
1472 keyword_alias = 300, /* "`alias'" */
1473 keyword_defined = 301, /* "`defined?'" */
1474 keyword_BEGIN = 302, /* "`BEGIN'" */
1475 keyword_END = 303, /* "`END'" */
1476 keyword__LINE__ = 304, /* "`__LINE__'" */
1477 keyword__FILE__ = 305, /* "`__FILE__'" */
1478 keyword__ENCODING__ = 306, /* "`__ENCODING__'" */
1479 tIDENTIFIER = 307, /* "local variable or method" */
1480 tFID = 308, /* "method" */
1481 tGVAR = 309, /* "global variable" */
1482 tIVAR = 310, /* "instance variable" */
1483 tCONSTANT = 311, /* "constant" */
1484 tCVAR = 312, /* "class variable" */
1485 tLABEL = 313, /* "label" */
1486 tINTEGER = 314, /* "integer literal" */
1487 tFLOAT = 315, /* "float literal" */
1488 tRATIONAL = 316, /* "rational literal" */
1489 tIMAGINARY = 317, /* "imaginary literal" */
1490 tCHAR = 318, /* "char literal" */
1491 tNTH_REF = 319, /* "numbered reference" */
1492 tBACK_REF = 320, /* "back reference" */
1493 tSTRING_CONTENT = 321, /* "literal content" */
1494 tREGEXP_END = 322, /* tREGEXP_END */
1495 tDUMNY_END = 323, /* "dummy end" */
1496 tSP = 324, /* "escaped space" */
1497 tUPLUS = 132, /* "unary+" */
1498 tUMINUS = 133, /* "unary-" */
1499 tPOW = 134, /* "**" */
1500 tCMP = 135, /* "<=>" */
1501 tEQ = 140, /* "==" */
1502 tEQQ = 141, /* "===" */
1503 tNEQ = 142, /* "!=" */
1504 tGEQ = 139, /* ">=" */
1505 tLEQ = 138, /* "<=" */
1506 tANDOP = 148, /* "&&" */
1507 tOROP = 149, /* "||" */
1508 tMATCH = 143, /* "=~" */
1509 tNMATCH = 144, /* "!~" */
1510 tDOT2 = 128, /* ".." */
1511 tDOT3 = 129, /* "..." */
1512 tBDOT2 = 130, /* "(.." */
1513 tBDOT3 = 131, /* "(..." */
1514 tAREF = 145, /* "[]" */
1515 tASET = 146, /* "[]=" */
1516 tLSHFT = 136, /* "<<" */
1517 tRSHFT = 137, /* ">>" */
1518 tANDDOT = 150, /* "&." */
1519 tCOLON2 = 147, /* "::" */
1520 tCOLON3 = 325, /* ":: at EXPR_BEG" */
1521 tOP_ASGN = 326, /* "operator-assignment" */
1522 tASSOC = 327, /* "=>" */
1523 tLPAREN = 328, /* "(" */
1524 tLPAREN_ARG = 329, /* "( arg" */
1525 tRPAREN = 330, /* ")" */
1526 tLBRACK = 331, /* "[" */
1527 tLBRACE = 332, /* "{" */
1528 tLBRACE_ARG = 333, /* "{ arg" */
1529 tSTAR = 334, /* "*" */
1530 tDSTAR = 335, /* "**arg" */
1531 tAMPER = 336, /* "&" */
1532 tLAMBDA = 337, /* "->" */
1533 tSYMBEG = 338, /* "symbol literal" */
1534 tSTRING_BEG = 339, /* "string literal" */
1535 tXSTRING_BEG = 340, /* "backtick literal" */
1536 tREGEXP_BEG = 341, /* "regexp literal" */
1537 tWORDS_BEG = 342, /* "word list" */
1538 tQWORDS_BEG = 343, /* "verbatim word list" */
1539 tSYMBOLS_BEG = 344, /* "symbol list" */
1540 tQSYMBOLS_BEG = 345, /* "verbatim symbol list" */
1541 tSTRING_END = 346, /* "terminator" */
1542 tSTRING_DEND = 347, /* "'}'" */
1543 tSTRING_DBEG = 348, /* tSTRING_DBEG */
1544 tSTRING_DVAR = 349, /* tSTRING_DVAR */
1545 tLAMBEG = 350, /* tLAMBEG */
1546 tLABEL_END = 351, /* tLABEL_END */
1547 tIGNORED_NL = 352, /* tIGNORED_NL */
1548 tCOMMENT = 353, /* tCOMMENT */
1549 tEMBDOC_BEG = 354, /* tEMBDOC_BEG */
1550 tEMBDOC = 355, /* tEMBDOC */
1551 tEMBDOC_END = 356, /* tEMBDOC_END */
1552 tHEREDOC_BEG = 357, /* tHEREDOC_BEG */
1553 tHEREDOC_END = 358, /* tHEREDOC_END */
1554 k__END__ = 359, /* k__END__ */
1555 tLOWEST = 360, /* tLOWEST */
1556 tUMINUS_NUM = 361, /* tUMINUS_NUM */
1557 tLAST_TOKEN = 362 /* tLAST_TOKEN */
1558 };
1559 typedef enum yytokentype yytoken_kind_t;
1560#endif
1561
1562/* Value type. */
1563#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1564union YYSTYPE
1565{
1566#line 1375 "parse.y"
1567
1568 VALUE val;
1569 NODE *node;
1570 ID id;
1571 int num;
1572 st_table *tbl;
1573 const struct vtable *vars;
1574 struct rb_strterm_struct *strterm;
1575 struct lex_context ctxt;
1576
1577#line 1576 "parse.c"
1578
1579};
1580typedef union YYSTYPE YYSTYPE;
1581# define YYSTYPE_IS_TRIVIAL 1
1582# define YYSTYPE_IS_DECLARED 1
1583#endif
1584
1585/* Location type. */
1586#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
1587typedef struct YYLTYPE YYLTYPE;
1588struct YYLTYPE
1589{
1590 int first_line;
1591 int first_column;
1592 int last_line;
1593 int last_column;
1594};
1595# define YYLTYPE_IS_DECLARED 1
1596# define YYLTYPE_IS_TRIVIAL 1
1597#endif
1598
1599
1600
1601
1602int yyparse (struct parser_params *p);
1603
1604
1605#endif /* !YY_YY_Y_TAB_H_INCLUDED */
1606/* Symbol kind. */
1607enum yysymbol_kind_t
1608{
1609 YYSYMBOL_YYEMPTY = -2,
1610 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1611 YYSYMBOL_YYerror = 1, /* error */
1612 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1613 YYSYMBOL_keyword_class = 3, /* "`class'" */
1614 YYSYMBOL_keyword_module = 4, /* "`module'" */
1615 YYSYMBOL_keyword_def = 5, /* "`def'" */
1616 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
1617 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
1618 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
1619 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
1620 YYSYMBOL_keyword_end = 10, /* "`end'" */
1621 YYSYMBOL_keyword_if = 11, /* "`if'" */
1622 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
1623 YYSYMBOL_keyword_then = 13, /* "`then'" */
1624 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
1625 YYSYMBOL_keyword_else = 15, /* "`else'" */
1626 YYSYMBOL_keyword_case = 16, /* "`case'" */
1627 YYSYMBOL_keyword_when = 17, /* "`when'" */
1628 YYSYMBOL_keyword_while = 18, /* "`while'" */
1629 YYSYMBOL_keyword_until = 19, /* "`until'" */
1630 YYSYMBOL_keyword_for = 20, /* "`for'" */
1631 YYSYMBOL_keyword_break = 21, /* "`break'" */
1632 YYSYMBOL_keyword_next = 22, /* "`next'" */
1633 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
1634 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
1635 YYSYMBOL_keyword_in = 25, /* "`in'" */
1636 YYSYMBOL_keyword_do = 26, /* "`do'" */
1637 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
1638 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
1639 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
1640 YYSYMBOL_keyword_return = 30, /* "`return'" */
1641 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
1642 YYSYMBOL_keyword_super = 32, /* "`super'" */
1643 YYSYMBOL_keyword_self = 33, /* "`self'" */
1644 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
1645 YYSYMBOL_keyword_true = 35, /* "`true'" */
1646 YYSYMBOL_keyword_false = 36, /* "`false'" */
1647 YYSYMBOL_keyword_and = 37, /* "`and'" */
1648 YYSYMBOL_keyword_or = 38, /* "`or'" */
1649 YYSYMBOL_keyword_not = 39, /* "`not'" */
1650 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
1651 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
1652 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
1653 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
1654 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
1655 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
1656 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
1657 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
1658 YYSYMBOL_keyword_END = 48, /* "`END'" */
1659 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
1660 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
1661 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
1662 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
1663 YYSYMBOL_tFID = 53, /* "method" */
1664 YYSYMBOL_tGVAR = 54, /* "global variable" */
1665 YYSYMBOL_tIVAR = 55, /* "instance variable" */
1666 YYSYMBOL_tCONSTANT = 56, /* "constant" */
1667 YYSYMBOL_tCVAR = 57, /* "class variable" */
1668 YYSYMBOL_tLABEL = 58, /* "label" */
1669 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
1670 YYSYMBOL_tFLOAT = 60, /* "float literal" */
1671 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
1672 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
1673 YYSYMBOL_tCHAR = 63, /* "char literal" */
1674 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
1675 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
1676 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
1677 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
1678 YYSYMBOL_tDUMNY_END = 68, /* "dummy end" */
1679 YYSYMBOL_69_ = 69, /* '.' */
1680 YYSYMBOL_70_backslash_ = 70, /* "backslash" */
1681 YYSYMBOL_tSP = 71, /* "escaped space" */
1682 YYSYMBOL_72_escaped_horizontal_tab_ = 72, /* "escaped horizontal tab" */
1683 YYSYMBOL_73_escaped_form_feed_ = 73, /* "escaped form feed" */
1684 YYSYMBOL_74_escaped_carriage_return_ = 74, /* "escaped carriage return" */
1685 YYSYMBOL_75_escaped_vertical_tab_ = 75, /* "escaped vertical tab" */
1686 YYSYMBOL_tUPLUS = 76, /* "unary+" */
1687 YYSYMBOL_tUMINUS = 77, /* "unary-" */
1688 YYSYMBOL_tPOW = 78, /* "**" */
1689 YYSYMBOL_tCMP = 79, /* "<=>" */
1690 YYSYMBOL_tEQ = 80, /* "==" */
1691 YYSYMBOL_tEQQ = 81, /* "===" */
1692 YYSYMBOL_tNEQ = 82, /* "!=" */
1693 YYSYMBOL_tGEQ = 83, /* ">=" */
1694 YYSYMBOL_tLEQ = 84, /* "<=" */
1695 YYSYMBOL_tANDOP = 85, /* "&&" */
1696 YYSYMBOL_tOROP = 86, /* "||" */
1697 YYSYMBOL_tMATCH = 87, /* "=~" */
1698 YYSYMBOL_tNMATCH = 88, /* "!~" */
1699 YYSYMBOL_tDOT2 = 89, /* ".." */
1700 YYSYMBOL_tDOT3 = 90, /* "..." */
1701 YYSYMBOL_tBDOT2 = 91, /* "(.." */
1702 YYSYMBOL_tBDOT3 = 92, /* "(..." */
1703 YYSYMBOL_tAREF = 93, /* "[]" */
1704 YYSYMBOL_tASET = 94, /* "[]=" */
1705 YYSYMBOL_tLSHFT = 95, /* "<<" */
1706 YYSYMBOL_tRSHFT = 96, /* ">>" */
1707 YYSYMBOL_tANDDOT = 97, /* "&." */
1708 YYSYMBOL_tCOLON2 = 98, /* "::" */
1709 YYSYMBOL_tCOLON3 = 99, /* ":: at EXPR_BEG" */
1710 YYSYMBOL_tOP_ASGN = 100, /* "operator-assignment" */
1711 YYSYMBOL_tASSOC = 101, /* "=>" */
1712 YYSYMBOL_tLPAREN = 102, /* "(" */
1713 YYSYMBOL_tLPAREN_ARG = 103, /* "( arg" */
1714 YYSYMBOL_tRPAREN = 104, /* ")" */
1715 YYSYMBOL_tLBRACK = 105, /* "[" */
1716 YYSYMBOL_tLBRACE = 106, /* "{" */
1717 YYSYMBOL_tLBRACE_ARG = 107, /* "{ arg" */
1718 YYSYMBOL_tSTAR = 108, /* "*" */
1719 YYSYMBOL_tDSTAR = 109, /* "**arg" */
1720 YYSYMBOL_tAMPER = 110, /* "&" */
1721 YYSYMBOL_tLAMBDA = 111, /* "->" */
1722 YYSYMBOL_tSYMBEG = 112, /* "symbol literal" */
1723 YYSYMBOL_tSTRING_BEG = 113, /* "string literal" */
1724 YYSYMBOL_tXSTRING_BEG = 114, /* "backtick literal" */
1725 YYSYMBOL_tREGEXP_BEG = 115, /* "regexp literal" */
1726 YYSYMBOL_tWORDS_BEG = 116, /* "word list" */
1727 YYSYMBOL_tQWORDS_BEG = 117, /* "verbatim word list" */
1728 YYSYMBOL_tSYMBOLS_BEG = 118, /* "symbol list" */
1729 YYSYMBOL_tQSYMBOLS_BEG = 119, /* "verbatim symbol list" */
1730 YYSYMBOL_tSTRING_END = 120, /* "terminator" */
1731 YYSYMBOL_tSTRING_DEND = 121, /* "'}'" */
1732 YYSYMBOL_tSTRING_DBEG = 122, /* tSTRING_DBEG */
1733 YYSYMBOL_tSTRING_DVAR = 123, /* tSTRING_DVAR */
1734 YYSYMBOL_tLAMBEG = 124, /* tLAMBEG */
1735 YYSYMBOL_tLABEL_END = 125, /* tLABEL_END */
1736 YYSYMBOL_tIGNORED_NL = 126, /* tIGNORED_NL */
1737 YYSYMBOL_tCOMMENT = 127, /* tCOMMENT */
1738 YYSYMBOL_tEMBDOC_BEG = 128, /* tEMBDOC_BEG */
1739 YYSYMBOL_tEMBDOC = 129, /* tEMBDOC */
1740 YYSYMBOL_tEMBDOC_END = 130, /* tEMBDOC_END */
1741 YYSYMBOL_tHEREDOC_BEG = 131, /* tHEREDOC_BEG */
1742 YYSYMBOL_tHEREDOC_END = 132, /* tHEREDOC_END */
1743 YYSYMBOL_k__END__ = 133, /* k__END__ */
1744 YYSYMBOL_tLOWEST = 134, /* tLOWEST */
1745 YYSYMBOL_135_ = 135, /* '=' */
1746 YYSYMBOL_136_ = 136, /* '?' */
1747 YYSYMBOL_137_ = 137, /* ':' */
1748 YYSYMBOL_138_ = 138, /* '>' */
1749 YYSYMBOL_139_ = 139, /* '<' */
1750 YYSYMBOL_140_ = 140, /* '|' */
1751 YYSYMBOL_141_ = 141, /* '^' */
1752 YYSYMBOL_142_ = 142, /* '&' */
1753 YYSYMBOL_143_ = 143, /* '+' */
1754 YYSYMBOL_144_ = 144, /* '-' */
1755 YYSYMBOL_145_ = 145, /* '*' */
1756 YYSYMBOL_146_ = 146, /* '/' */
1757 YYSYMBOL_147_ = 147, /* '%' */
1758 YYSYMBOL_tUMINUS_NUM = 148, /* tUMINUS_NUM */
1759 YYSYMBOL_149_ = 149, /* '!' */
1760 YYSYMBOL_150_ = 150, /* '~' */
1761 YYSYMBOL_tLAST_TOKEN = 151, /* tLAST_TOKEN */
1762 YYSYMBOL_152_ = 152, /* '{' */
1763 YYSYMBOL_153_ = 153, /* '}' */
1764 YYSYMBOL_154_ = 154, /* '[' */
1765 YYSYMBOL_155_ = 155, /* ',' */
1766 YYSYMBOL_156_ = 156, /* '`' */
1767 YYSYMBOL_157_ = 157, /* '(' */
1768 YYSYMBOL_158_ = 158, /* ')' */
1769 YYSYMBOL_159_ = 159, /* ']' */
1770 YYSYMBOL_160_ = 160, /* ';' */
1771 YYSYMBOL_161_ = 161, /* ' ' */
1772 YYSYMBOL_162_n_ = 162, /* '\n' */
1773 YYSYMBOL_YYACCEPT = 163, /* $accept */
1774 YYSYMBOL_program = 164, /* program */
1775 YYSYMBOL_165_1 = 165, /* $@1 */
1776 YYSYMBOL_top_compstmt = 166, /* top_compstmt */
1777 YYSYMBOL_top_stmts = 167, /* top_stmts */
1778 YYSYMBOL_top_stmt = 168, /* top_stmt */
1779 YYSYMBOL_begin_block = 169, /* begin_block */
1780 YYSYMBOL_bodystmt = 170, /* bodystmt */
1781 YYSYMBOL_171_2 = 171, /* $@2 */
1782 YYSYMBOL_compstmt = 172, /* compstmt */
1783 YYSYMBOL_stmts = 173, /* stmts */
1784 YYSYMBOL_stmt_or_begin = 174, /* stmt_or_begin */
1785 YYSYMBOL_175_3 = 175, /* $@3 */
1786 YYSYMBOL_stmt = 176, /* stmt */
1787 YYSYMBOL_177_4 = 177, /* $@4 */
1788 YYSYMBOL_command_asgn = 178, /* command_asgn */
1789 YYSYMBOL_command_rhs = 179, /* command_rhs */
1790 YYSYMBOL_expr = 180, /* expr */
1791 YYSYMBOL_181_5 = 181, /* @5 */
1792 YYSYMBOL_182_6 = 182, /* @6 */
1793 YYSYMBOL_183_7 = 183, /* @7 */
1794 YYSYMBOL_184_8 = 184, /* @8 */
1795 YYSYMBOL_def_name = 185, /* def_name */
1796 YYSYMBOL_defn_head = 186, /* defn_head */
1797 YYSYMBOL_defs_head = 187, /* defs_head */
1798 YYSYMBOL_188_9 = 188, /* $@9 */
1799 YYSYMBOL_expr_value = 189, /* expr_value */
1800 YYSYMBOL_expr_value_do = 190, /* expr_value_do */
1801 YYSYMBOL_191_10 = 191, /* $@10 */
1802 YYSYMBOL_192_11 = 192, /* $@11 */
1803 YYSYMBOL_command_call = 193, /* command_call */
1804 YYSYMBOL_block_command = 194, /* block_command */
1805 YYSYMBOL_cmd_brace_block = 195, /* cmd_brace_block */
1806 YYSYMBOL_fcall = 196, /* fcall */
1807 YYSYMBOL_command = 197, /* command */
1808 YYSYMBOL_mlhs = 198, /* mlhs */
1809 YYSYMBOL_mlhs_inner = 199, /* mlhs_inner */
1810 YYSYMBOL_mlhs_basic = 200, /* mlhs_basic */
1811 YYSYMBOL_mlhs_item = 201, /* mlhs_item */
1812 YYSYMBOL_mlhs_head = 202, /* mlhs_head */
1813 YYSYMBOL_mlhs_post = 203, /* mlhs_post */
1814 YYSYMBOL_mlhs_node = 204, /* mlhs_node */
1815 YYSYMBOL_lhs = 205, /* lhs */
1816 YYSYMBOL_cname = 206, /* cname */
1817 YYSYMBOL_cpath = 207, /* cpath */
1818 YYSYMBOL_fname = 208, /* fname */
1819 YYSYMBOL_fitem = 209, /* fitem */
1820 YYSYMBOL_undef_list = 210, /* undef_list */
1821 YYSYMBOL_211_12 = 211, /* $@12 */
1822 YYSYMBOL_op = 212, /* op */
1823 YYSYMBOL_reswords = 213, /* reswords */
1824 YYSYMBOL_arg = 214, /* arg */
1825 YYSYMBOL_215_13 = 215, /* $@13 */
1826 YYSYMBOL_relop = 216, /* relop */
1827 YYSYMBOL_rel_expr = 217, /* rel_expr */
1828 YYSYMBOL_lex_ctxt = 218, /* lex_ctxt */
1829 YYSYMBOL_arg_value = 219, /* arg_value */
1830 YYSYMBOL_aref_args = 220, /* aref_args */
1831 YYSYMBOL_arg_rhs = 221, /* arg_rhs */
1832 YYSYMBOL_paren_args = 222, /* paren_args */
1833 YYSYMBOL_opt_paren_args = 223, /* opt_paren_args */
1834 YYSYMBOL_opt_call_args = 224, /* opt_call_args */
1835 YYSYMBOL_call_args = 225, /* call_args */
1836 YYSYMBOL_command_args = 226, /* command_args */
1837 YYSYMBOL_227_14 = 227, /* $@14 */
1838 YYSYMBOL_block_arg = 228, /* block_arg */
1839 YYSYMBOL_opt_block_arg = 229, /* opt_block_arg */
1840 YYSYMBOL_args = 230, /* args */
1841 YYSYMBOL_mrhs_arg = 231, /* mrhs_arg */
1842 YYSYMBOL_mrhs = 232, /* mrhs */
1843 YYSYMBOL_primary = 233, /* primary */
1844 YYSYMBOL_234_15 = 234, /* $@15 */
1845 YYSYMBOL_235_16 = 235, /* $@16 */
1846 YYSYMBOL_236_17 = 236, /* $@17 */
1847 YYSYMBOL_237_18 = 237, /* $@18 */
1848 YYSYMBOL_238_19 = 238, /* @19 */
1849 YYSYMBOL_239_20 = 239, /* @20 */
1850 YYSYMBOL_240_21 = 240, /* $@21 */
1851 YYSYMBOL_241_22 = 241, /* $@22 */
1852 YYSYMBOL_242_23 = 242, /* $@23 */
1853 YYSYMBOL_243_24 = 243, /* $@24 */
1854 YYSYMBOL_244_25 = 244, /* $@25 */
1855 YYSYMBOL_primary_value = 245, /* primary_value */
1856 YYSYMBOL_k_begin = 246, /* k_begin */
1857 YYSYMBOL_k_if = 247, /* k_if */
1858 YYSYMBOL_k_unless = 248, /* k_unless */
1859 YYSYMBOL_k_while = 249, /* k_while */
1860 YYSYMBOL_k_until = 250, /* k_until */
1861 YYSYMBOL_k_case = 251, /* k_case */
1862 YYSYMBOL_k_for = 252, /* k_for */
1863 YYSYMBOL_k_class = 253, /* k_class */
1864 YYSYMBOL_k_module = 254, /* k_module */
1865 YYSYMBOL_k_def = 255, /* k_def */
1866 YYSYMBOL_k_do = 256, /* k_do */
1867 YYSYMBOL_k_do_block = 257, /* k_do_block */
1868 YYSYMBOL_k_rescue = 258, /* k_rescue */
1869 YYSYMBOL_k_ensure = 259, /* k_ensure */
1870 YYSYMBOL_k_when = 260, /* k_when */
1871 YYSYMBOL_k_else = 261, /* k_else */
1872 YYSYMBOL_k_elsif = 262, /* k_elsif */
1873 YYSYMBOL_k_end = 263, /* k_end */
1874 YYSYMBOL_k_return = 264, /* k_return */
1875 YYSYMBOL_then = 265, /* then */
1876 YYSYMBOL_do = 266, /* do */
1877 YYSYMBOL_if_tail = 267, /* if_tail */
1878 YYSYMBOL_opt_else = 268, /* opt_else */
1879 YYSYMBOL_for_var = 269, /* for_var */
1880 YYSYMBOL_f_marg = 270, /* f_marg */
1881 YYSYMBOL_f_marg_list = 271, /* f_marg_list */
1882 YYSYMBOL_f_margs = 272, /* f_margs */
1883 YYSYMBOL_f_rest_marg = 273, /* f_rest_marg */
1884 YYSYMBOL_f_any_kwrest = 274, /* f_any_kwrest */
1885 YYSYMBOL_f_eq = 275, /* f_eq */
1886 YYSYMBOL_276_26 = 276, /* $@26 */
1887 YYSYMBOL_block_args_tail = 277, /* block_args_tail */
1888 YYSYMBOL_opt_block_args_tail = 278, /* opt_block_args_tail */
1889 YYSYMBOL_excessed_comma = 279, /* excessed_comma */
1890 YYSYMBOL_block_param = 280, /* block_param */
1891 YYSYMBOL_opt_block_param = 281, /* opt_block_param */
1892 YYSYMBOL_block_param_def = 282, /* block_param_def */
1893 YYSYMBOL_opt_bv_decl = 283, /* opt_bv_decl */
1894 YYSYMBOL_bv_decls = 284, /* bv_decls */
1895 YYSYMBOL_bvar = 285, /* bvar */
1896 YYSYMBOL_lambda = 286, /* lambda */
1897 YYSYMBOL_287_27 = 287, /* @27 */
1898 YYSYMBOL_288_28 = 288, /* @28 */
1899 YYSYMBOL_289_29 = 289, /* @29 */
1900 YYSYMBOL_290_30 = 290, /* $@30 */
1901 YYSYMBOL_f_larglist = 291, /* f_larglist */
1902 YYSYMBOL_lambda_body = 292, /* lambda_body */
1903 YYSYMBOL_293_31 = 293, /* $@31 */
1904 YYSYMBOL_do_block = 294, /* do_block */
1905 YYSYMBOL_block_call = 295, /* block_call */
1906 YYSYMBOL_method_call = 296, /* method_call */
1907 YYSYMBOL_brace_block = 297, /* brace_block */
1908 YYSYMBOL_brace_body = 298, /* brace_body */
1909 YYSYMBOL_299_32 = 299, /* @32 */
1910 YYSYMBOL_300_33 = 300, /* @33 */
1911 YYSYMBOL_301_34 = 301, /* @34 */
1912 YYSYMBOL_do_body = 302, /* do_body */
1913 YYSYMBOL_303_35 = 303, /* @35 */
1914 YYSYMBOL_304_36 = 304, /* @36 */
1915 YYSYMBOL_305_37 = 305, /* @37 */
1916 YYSYMBOL_case_args = 306, /* case_args */
1917 YYSYMBOL_case_body = 307, /* case_body */
1918 YYSYMBOL_cases = 308, /* cases */
1919 YYSYMBOL_p_case_body = 309, /* p_case_body */
1920 YYSYMBOL_310_38 = 310, /* @38 */
1921 YYSYMBOL_311_39 = 311, /* @39 */
1922 YYSYMBOL_312_40 = 312, /* $@40 */
1923 YYSYMBOL_p_cases = 313, /* p_cases */
1924 YYSYMBOL_p_top_expr = 314, /* p_top_expr */
1925 YYSYMBOL_p_top_expr_body = 315, /* p_top_expr_body */
1926 YYSYMBOL_p_expr = 316, /* p_expr */
1927 YYSYMBOL_p_as = 317, /* p_as */
1928 YYSYMBOL_p_alt = 318, /* p_alt */
1929 YYSYMBOL_p_lparen = 319, /* p_lparen */
1930 YYSYMBOL_p_lbracket = 320, /* p_lbracket */
1931 YYSYMBOL_p_expr_basic = 321, /* p_expr_basic */
1932 YYSYMBOL_322_41 = 322, /* @41 */
1933 YYSYMBOL_323_42 = 323, /* @42 */
1934 YYSYMBOL_p_args = 324, /* p_args */
1935 YYSYMBOL_p_args_head = 325, /* p_args_head */
1936 YYSYMBOL_p_args_tail = 326, /* p_args_tail */
1937 YYSYMBOL_p_find = 327, /* p_find */
1938 YYSYMBOL_p_rest = 328, /* p_rest */
1939 YYSYMBOL_p_args_post = 329, /* p_args_post */
1940 YYSYMBOL_p_arg = 330, /* p_arg */
1941 YYSYMBOL_p_kwargs = 331, /* p_kwargs */
1942 YYSYMBOL_p_kwarg = 332, /* p_kwarg */
1943 YYSYMBOL_p_kw = 333, /* p_kw */
1944 YYSYMBOL_p_kw_label = 334, /* p_kw_label */
1945 YYSYMBOL_p_kwrest = 335, /* p_kwrest */
1946 YYSYMBOL_p_kwnorest = 336, /* p_kwnorest */
1947 YYSYMBOL_p_any_kwrest = 337, /* p_any_kwrest */
1948 YYSYMBOL_p_value = 338, /* p_value */
1949 YYSYMBOL_p_primitive = 339, /* p_primitive */
1950 YYSYMBOL_p_variable = 340, /* p_variable */
1951 YYSYMBOL_p_var_ref = 341, /* p_var_ref */
1952 YYSYMBOL_p_expr_ref = 342, /* p_expr_ref */
1953 YYSYMBOL_p_const = 343, /* p_const */
1954 YYSYMBOL_opt_rescue = 344, /* opt_rescue */
1955 YYSYMBOL_exc_list = 345, /* exc_list */
1956 YYSYMBOL_exc_var = 346, /* exc_var */
1957 YYSYMBOL_opt_ensure = 347, /* opt_ensure */
1958 YYSYMBOL_literal = 348, /* literal */
1959 YYSYMBOL_strings = 349, /* strings */
1960 YYSYMBOL_string = 350, /* string */
1961 YYSYMBOL_string1 = 351, /* string1 */
1962 YYSYMBOL_xstring = 352, /* xstring */
1963 YYSYMBOL_regexp = 353, /* regexp */
1964 YYSYMBOL_words = 354, /* words */
1965 YYSYMBOL_word_list = 355, /* word_list */
1966 YYSYMBOL_word = 356, /* word */
1967 YYSYMBOL_symbols = 357, /* symbols */
1968 YYSYMBOL_symbol_list = 358, /* symbol_list */
1969 YYSYMBOL_qwords = 359, /* qwords */
1970 YYSYMBOL_qsymbols = 360, /* qsymbols */
1971 YYSYMBOL_qword_list = 361, /* qword_list */
1972 YYSYMBOL_qsym_list = 362, /* qsym_list */
1973 YYSYMBOL_string_contents = 363, /* string_contents */
1974 YYSYMBOL_xstring_contents = 364, /* xstring_contents */
1975 YYSYMBOL_regexp_contents = 365, /* regexp_contents */
1976 YYSYMBOL_string_content = 366, /* string_content */
1977 YYSYMBOL_367_43 = 367, /* @43 */
1978 YYSYMBOL_368_44 = 368, /* $@44 */
1979 YYSYMBOL_369_45 = 369, /* @45 */
1980 YYSYMBOL_370_46 = 370, /* @46 */
1981 YYSYMBOL_371_47 = 371, /* @47 */
1982 YYSYMBOL_372_48 = 372, /* @48 */
1983 YYSYMBOL_string_dvar = 373, /* string_dvar */
1984 YYSYMBOL_symbol = 374, /* symbol */
1985 YYSYMBOL_ssym = 375, /* ssym */
1986 YYSYMBOL_sym = 376, /* sym */
1987 YYSYMBOL_dsym = 377, /* dsym */
1988 YYSYMBOL_numeric = 378, /* numeric */
1989 YYSYMBOL_simple_numeric = 379, /* simple_numeric */
1990 YYSYMBOL_nonlocal_var = 380, /* nonlocal_var */
1991 YYSYMBOL_user_variable = 381, /* user_variable */
1992 YYSYMBOL_keyword_variable = 382, /* keyword_variable */
1993 YYSYMBOL_var_ref = 383, /* var_ref */
1994 YYSYMBOL_var_lhs = 384, /* var_lhs */
1995 YYSYMBOL_backref = 385, /* backref */
1996 YYSYMBOL_superclass = 386, /* superclass */
1997 YYSYMBOL_387_49 = 387, /* $@49 */
1998 YYSYMBOL_f_opt_paren_args = 388, /* f_opt_paren_args */
1999 YYSYMBOL_f_paren_args = 389, /* f_paren_args */
2000 YYSYMBOL_f_arglist = 390, /* f_arglist */
2001 YYSYMBOL_391_50 = 391, /* @50 */
2002 YYSYMBOL_args_tail = 392, /* args_tail */
2003 YYSYMBOL_opt_args_tail = 393, /* opt_args_tail */
2004 YYSYMBOL_f_args = 394, /* f_args */
2005 YYSYMBOL_args_forward = 395, /* args_forward */
2006 YYSYMBOL_f_bad_arg = 396, /* f_bad_arg */
2007 YYSYMBOL_f_norm_arg = 397, /* f_norm_arg */
2008 YYSYMBOL_f_arg_asgn = 398, /* f_arg_asgn */
2009 YYSYMBOL_f_arg_item = 399, /* f_arg_item */
2010 YYSYMBOL_f_arg = 400, /* f_arg */
2011 YYSYMBOL_f_label = 401, /* f_label */
2012 YYSYMBOL_f_kw = 402, /* f_kw */
2013 YYSYMBOL_f_block_kw = 403, /* f_block_kw */
2014 YYSYMBOL_f_block_kwarg = 404, /* f_block_kwarg */
2015 YYSYMBOL_f_kwarg = 405, /* f_kwarg */
2016 YYSYMBOL_kwrest_mark = 406, /* kwrest_mark */
2017 YYSYMBOL_f_no_kwarg = 407, /* f_no_kwarg */
2018 YYSYMBOL_f_kwrest = 408, /* f_kwrest */
2019 YYSYMBOL_f_opt = 409, /* f_opt */
2020 YYSYMBOL_f_block_opt = 410, /* f_block_opt */
2021 YYSYMBOL_f_block_optarg = 411, /* f_block_optarg */
2022 YYSYMBOL_f_optarg = 412, /* f_optarg */
2023 YYSYMBOL_restarg_mark = 413, /* restarg_mark */
2024 YYSYMBOL_f_rest_arg = 414, /* f_rest_arg */
2025 YYSYMBOL_blkarg_mark = 415, /* blkarg_mark */
2026 YYSYMBOL_f_block_arg = 416, /* f_block_arg */
2027 YYSYMBOL_opt_f_block_arg = 417, /* opt_f_block_arg */
2028 YYSYMBOL_singleton = 418, /* singleton */
2029 YYSYMBOL_419_51 = 419, /* $@51 */
2030 YYSYMBOL_assoc_list = 420, /* assoc_list */
2031 YYSYMBOL_assocs = 421, /* assocs */
2032 YYSYMBOL_assoc = 422, /* assoc */
2033 YYSYMBOL_operation = 423, /* operation */
2034 YYSYMBOL_operation2 = 424, /* operation2 */
2035 YYSYMBOL_operation3 = 425, /* operation3 */
2036 YYSYMBOL_dot_or_colon = 426, /* dot_or_colon */
2037 YYSYMBOL_call_op = 427, /* call_op */
2038 YYSYMBOL_call_op2 = 428, /* call_op2 */
2039 YYSYMBOL_opt_terms = 429, /* opt_terms */
2040 YYSYMBOL_opt_nl = 430, /* opt_nl */
2041 YYSYMBOL_rparen = 431, /* rparen */
2042 YYSYMBOL_rbracket = 432, /* rbracket */
2043 YYSYMBOL_rbrace = 433, /* rbrace */
2044 YYSYMBOL_trailer = 434, /* trailer */
2045 YYSYMBOL_term = 435, /* term */
2046 YYSYMBOL_terms = 436, /* terms */
2047 YYSYMBOL_none = 437 /* none */
2048};
2049typedef enum yysymbol_kind_t yysymbol_kind_t;
2050
2051
2052
2053
2054#ifdef short
2055# undef short
2056#endif
2057
2058/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
2059 <limits.h> and (if available) <stdint.h> are included
2060 so that the code can choose integer types of a good width. */
2061
2062#ifndef __PTRDIFF_MAX__
2063# include <limits.h> /* INFRINGES ON USER NAME SPACE */
2064# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2065# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
2066# define YY_STDINT_H
2067# endif
2068#endif
2069
2070/* Narrow types that promote to a signed type and that can represent a
2071 signed or unsigned integer of at least N bits. In tables they can
2072 save space and decrease cache pressure. Promoting to a signed type
2073 helps avoid bugs in integer arithmetic. */
2074
2075#ifdef __INT_LEAST8_MAX__
2076typedef __INT_LEAST8_TYPE__ yytype_int8;
2077#elif defined YY_STDINT_H
2078typedef int_least8_t yytype_int8;
2079#else
2080typedef signed char yytype_int8;
2081#endif
2082
2083#ifdef __INT_LEAST16_MAX__
2084typedef __INT_LEAST16_TYPE__ yytype_int16;
2085#elif defined YY_STDINT_H
2086typedef int_least16_t yytype_int16;
2087#else
2088typedef short yytype_int16;
2089#endif
2090
2091/* Work around bug in HP-UX 11.23, which defines these macros
2092 incorrectly for preprocessor constants. This workaround can likely
2093 be removed in 2023, as HPE has promised support for HP-UX 11.23
2094 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
2095 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
2096#ifdef __hpux
2097# undef UINT_LEAST8_MAX
2098# undef UINT_LEAST16_MAX
2099# define UINT_LEAST8_MAX 255
2100# define UINT_LEAST16_MAX 65535
2101#endif
2102
2103#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
2104typedef __UINT_LEAST8_TYPE__ yytype_uint8;
2105#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
2106 && UINT_LEAST8_MAX <= INT_MAX)
2107typedef uint_least8_t yytype_uint8;
2108#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
2109typedef unsigned char yytype_uint8;
2110#else
2111typedef short yytype_uint8;
2112#endif
2113
2114#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
2115typedef __UINT_LEAST16_TYPE__ yytype_uint16;
2116#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
2117 && UINT_LEAST16_MAX <= INT_MAX)
2118typedef uint_least16_t yytype_uint16;
2119#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
2120typedef unsigned short yytype_uint16;
2121#else
2122typedef int yytype_uint16;
2123#endif
2124
2125#ifndef YYPTRDIFF_T
2126# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
2127# define YYPTRDIFF_T __PTRDIFF_TYPE__
2128# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
2129# elif defined PTRDIFF_MAX
2130# ifndef ptrdiff_t
2131# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2132# endif
2133# define YYPTRDIFF_T ptrdiff_t
2134# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
2135# else
2136# define YYPTRDIFF_T long
2137# define YYPTRDIFF_MAXIMUM LONG_MAX
2138# endif
2139#endif
2140
2141#ifndef YYSIZE_T
2142# ifdef __SIZE_TYPE__
2143# define YYSIZE_T __SIZE_TYPE__
2144# elif defined size_t
2145# define YYSIZE_T size_t
2146# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
2147# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2148# define YYSIZE_T size_t
2149# else
2150# define YYSIZE_T unsigned
2151# endif
2152#endif
2153
2154#define YYSIZE_MAXIMUM \
2155 YY_CAST (YYPTRDIFF_T, \
2156 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
2157 ? YYPTRDIFF_MAXIMUM \
2158 : YY_CAST (YYSIZE_T, -1)))
2159
2160#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
2161
2162
2163/* Stored state numbers (used for stacks). */
2164typedef yytype_int16 yy_state_t;
2165
2166/* State numbers in computations. */
2167typedef int yy_state_fast_t;
2168
2169#ifndef YY_
2170# if defined YYENABLE_NLS && YYENABLE_NLS
2171# if ENABLE_NLS
2172# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2173# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
2174# endif
2175# endif
2176# ifndef YY_
2177# define YY_(Msgid) Msgid
2178# endif
2179#endif
2180
2181
2182#ifndef YY_ATTRIBUTE_PURE
2183# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
2184# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
2185# else
2186# define YY_ATTRIBUTE_PURE
2187# endif
2188#endif
2189
2190#ifndef YY_ATTRIBUTE_UNUSED
2191# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
2192# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
2193# else
2194# define YY_ATTRIBUTE_UNUSED
2195# endif
2196#endif
2197
2198/* Suppress unused-variable warnings by "using" E. */
2199#if ! defined lint || defined __GNUC__
2200# define YY_USE(E) ((void) (E))
2201#else
2202# define YY_USE(E) /* empty */
2203#endif
2204
2205/* Suppress an incorrect diagnostic about yylval being uninitialized. */
2206#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
2207# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
2208# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2209 _Pragma ("GCC diagnostic push") \
2210 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
2211# else
2212# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2213 _Pragma ("GCC diagnostic push") \
2214 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
2215 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
2216# endif
2217# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
2218 _Pragma ("GCC diagnostic pop")
2219#else
2220# define YY_INITIAL_VALUE(Value) Value
2221#endif
2222#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2223# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2224# define YY_IGNORE_MAYBE_UNINITIALIZED_END
2225#endif
2226#ifndef YY_INITIAL_VALUE
2227# define YY_INITIAL_VALUE(Value) /* Nothing. */
2228#endif
2229
2230#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
2231# define YY_IGNORE_USELESS_CAST_BEGIN \
2232 _Pragma ("GCC diagnostic push") \
2233 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
2234# define YY_IGNORE_USELESS_CAST_END \
2235 _Pragma ("GCC diagnostic pop")
2236#endif
2237#ifndef YY_IGNORE_USELESS_CAST_BEGIN
2238# define YY_IGNORE_USELESS_CAST_BEGIN
2239# define YY_IGNORE_USELESS_CAST_END
2240#endif
2241
2242
2243#define YY_ASSERT(E) ((void) (0 && (E)))
2244
2245#if 1
2246
2247/* The parser invokes alloca or malloc; define the necessary symbols. */
2248
2249# ifdef YYSTACK_USE_ALLOCA
2250# if YYSTACK_USE_ALLOCA
2251# ifdef __GNUC__
2252# define YYSTACK_ALLOC __builtin_alloca
2253# elif defined __BUILTIN_VA_ARG_INCR
2254# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2255# elif defined _AIX
2256# define YYSTACK_ALLOC __alloca
2257# elif defined _MSC_VER
2258# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2259# define alloca _alloca
2260# else
2261# define YYSTACK_ALLOC alloca
2262# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
2263# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2264 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
2265# ifndef EXIT_SUCCESS
2266# define EXIT_SUCCESS 0
2267# endif
2268# endif
2269# endif
2270# endif
2271# endif
2272
2273# ifdef YYSTACK_ALLOC
2274 /* Pacify GCC's 'empty if-body' warning. */
2275# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
2276# ifndef YYSTACK_ALLOC_MAXIMUM
2277 /* The OS might guarantee only one guard page at the bottom of the stack,
2278 and a page size can be as small as 4096 bytes. So we cannot safely
2279 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2280 to allow for a few compiler-allocated temporary stack slots. */
2281# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2282# endif
2283# else
2284# define YYSTACK_ALLOC YYMALLOC
2285# define YYSTACK_FREE YYFREE
2286# ifndef YYSTACK_ALLOC_MAXIMUM
2287# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2288# endif
2289# if (defined __cplusplus && ! defined EXIT_SUCCESS \
2290 && ! ((defined YYMALLOC || defined malloc) \
2291 && (defined YYFREE || defined free)))
2292# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2293# ifndef EXIT_SUCCESS
2294# define EXIT_SUCCESS 0
2295# endif
2296# endif
2297# ifndef YYMALLOC
2298# define YYMALLOC malloc
2299# if ! defined malloc && ! defined EXIT_SUCCESS
2300void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2301# endif
2302# endif
2303# ifndef YYFREE
2304# define YYFREE free
2305# if ! defined free && ! defined EXIT_SUCCESS
2306void free (void *); /* INFRINGES ON USER NAME SPACE */
2307# endif
2308# endif
2309# endif
2310#endif /* 1 */
2311
2312#if (! defined yyoverflow \
2313 && (! defined __cplusplus \
2314 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
2315 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2316
2317/* A type that is properly aligned for any stack member. */
2318union yyalloc
2319{
2320 yy_state_t yyss_alloc;
2321 YYSTYPE yyvs_alloc;
2322 YYLTYPE yyls_alloc;
2323};
2324
2325/* The size of the maximum gap between one aligned stack and the next. */
2326# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
2327
2328/* The size of an array large to enough to hold all stacks, each with
2329 N elements. */
2330# define YYSTACK_BYTES(N) \
2331 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
2332 + YYSIZEOF (YYLTYPE)) \
2333 + 2 * YYSTACK_GAP_MAXIMUM)
2334
2335# define YYCOPY_NEEDED 1
2336
2337/* Relocate STACK from its old location to the new one. The
2338 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2339 elements in the stack, and YYPTR gives the new location of the
2340 stack. Advance YYPTR to a properly aligned location for the next
2341 stack. */
2342# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2343 do \
2344 { \
2345 YYPTRDIFF_T yynewbytes; \
2346 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2347 Stack = &yyptr->Stack_alloc; \
2348 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
2349 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
2350 } \
2351 while (0)
2352
2353#endif
2354
2355#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
2356/* Copy COUNT objects from SRC to DST. The source and destination do
2357 not overlap. */
2358# ifndef YYCOPY
2359# if defined __GNUC__ && 1 < __GNUC__
2360# define YYCOPY(Dst, Src, Count) \
2361 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
2362# else
2363# define YYCOPY(Dst, Src, Count) \
2364 do \
2365 { \
2366 YYPTRDIFF_T yyi; \
2367 for (yyi = 0; yyi < (Count); yyi++) \
2368 (Dst)[yyi] = (Src)[yyi]; \
2369 } \
2370 while (0)
2371# endif
2372# endif
2373#endif /* !YYCOPY_NEEDED */
2374
2375/* YYFINAL -- State number of the termination state. */
2376#define YYFINAL 3
2377/* YYLAST -- Last index in YYTABLE. */
2378#define YYLAST 15194
2379
2380/* YYNTOKENS -- Number of terminals. */
2381#define YYNTOKENS 163
2382/* YYNNTS -- Number of nonterminals. */
2383#define YYNNTS 275
2384/* YYNRULES -- Number of rules. */
2385#define YYNRULES 782
2386/* YYNSTATES -- Number of states. */
2387#define YYNSTATES 1304
2388
2389/* YYMAXUTOK -- Last valid token kind. */
2390#define YYMAXUTOK 362
2391
2392
2393/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2394 as returned by yylex, with out-of-bounds checking. */
2395#define YYTRANSLATE(YYX) \
2396 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2397 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2398 : YYSYMBOL_YYUNDEF)
2399
2400/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2401 as returned by yylex. */
2402static const yytype_uint8 yytranslate[] =
2403{
2404 0, 2, 2, 2, 2, 2, 2, 2, 2, 72,
2405 162, 75, 73, 74, 2, 2, 2, 2, 2, 2,
2406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2407 2, 2, 161, 149, 2, 2, 2, 147, 142, 2,
2408 157, 158, 145, 143, 155, 144, 69, 146, 2, 2,
2409 2, 2, 2, 2, 2, 2, 2, 2, 137, 160,
2410 139, 135, 138, 136, 2, 2, 2, 2, 2, 2,
2411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2413 2, 154, 70, 159, 141, 2, 156, 2, 2, 2,
2414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2416 2, 2, 2, 152, 140, 153, 150, 2, 89, 90,
2417 91, 92, 76, 77, 78, 79, 95, 96, 84, 83,
2418 80, 81, 82, 87, 88, 93, 94, 98, 85, 86,
2419 97, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2421 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2,
2425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2427 2, 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, 1, 2, 3, 4,
2430 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2431 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2432 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2433 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2434 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2435 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2436 65, 66, 67, 68, 71, 99, 100, 101, 102, 103,
2437 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2438 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2439 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2440 134, 148, 151
2441};
2442
2443#if YYDEBUG
2444/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2445static const yytype_int16 yyrline[] =
2446{
2447 0, 1580, 1580, 1580, 1606, 1612, 1619, 1626, 1635, 1636,
2448 1642, 1655, 1653, 1664, 1675, 1681, 1688, 1695, 1704, 1709,
2449 1708, 1718, 1718, 1725, 1732, 1742, 1751, 1758, 1766, 1774,
2450 1786, 1798, 1808, 1822, 1823, 1831, 1838, 1846, 1853, 1854,
2451 1862, 1869, 1876, 1884, 1891, 1898, 1906, 1913, 1924, 1936,
2452 1949, 1963, 1973, 1978, 1987, 1990, 1991, 1995, 1999, 2003,
2453 2008, 2016, 2007, 2030, 2038, 2029, 2051, 2054, 2071, 2081,
2454 2080, 2099, 2104, 2112, 2112, 2112, 2118, 2119, 2122, 2123,
2455 2132, 2142, 2152, 2161, 2172, 2179, 2186, 2193, 2200, 2208,
2456 2216, 2223, 2230, 2239, 2240, 2249, 2250, 2259, 2266, 2273,
2457 2280, 2287, 2294, 2301, 2308, 2315, 2322, 2331, 2332, 2341,
2458 2348, 2357, 2364, 2373, 2380, 2387, 2394, 2404, 2411, 2421,
2459 2428, 2435, 2445, 2452, 2459, 2466, 2473, 2480, 2487, 2494,
2460 2501, 2511, 2519, 2522, 2529, 2536, 2545, 2546, 2547, 2548,
2461 2553, 2556, 2563, 2566, 2573, 2573, 2583, 2584, 2585, 2586,
2462 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596,
2463 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606,
2464 2607, 2608, 2609, 2610, 2611, 2612, 2615, 2615, 2615, 2616,
2465 2616, 2617, 2617, 2617, 2618, 2618, 2618, 2618, 2619, 2619,
2466 2619, 2619, 2620, 2620, 2620, 2621, 2621, 2621, 2621, 2622,
2467 2622, 2622, 2622, 2623, 2623, 2623, 2623, 2624, 2624, 2624,
2468 2624, 2625, 2625, 2625, 2625, 2626, 2626, 2629, 2636, 2643,
2469 2650, 2657, 2664, 2671, 2679, 2687, 2695, 2704, 2713, 2721,
2470 2729, 2737, 2745, 2749, 2753, 2757, 2761, 2765, 2769, 2773,
2471 2777, 2781, 2785, 2789, 2793, 2797, 2798, 2802, 2806, 2810,
2472 2814, 2818, 2822, 2826, 2830, 2834, 2838, 2842, 2842, 2847,
2473 2856, 2867, 2879, 2892, 2906, 2912, 2913, 2914, 2915, 2918,
2474 2922, 2929, 2935, 2942, 2943, 2947, 2954, 2963, 2968, 2978,
2475 2985, 2997, 3011, 3012, 3015, 3016, 3017, 3021, 3028, 3037,
2476 3045, 3052, 3060, 3068, 3072, 3072, 3109, 3116, 3128, 3132,
2477 3139, 3146, 3153, 3164, 3171, 3178, 3192, 3193, 3197, 3204,
2478 3211, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228,
2479 3229, 3230, 3238, 3237, 3252, 3252, 3259, 3259, 3267, 3275,
2480 3282, 3289, 3296, 3304, 3311, 3318, 3325, 3332, 3332, 3337,
2481 3341, 3345, 3352, 3353, 3361, 3362, 3373, 3384, 3394, 3405,
2482 3404, 3421, 3420, 3435, 3444, 3487, 3486, 3510, 3509, 3532,
2483 3531, 3556, 3554, 3573, 3571, 3590, 3597, 3604, 3611, 3620,
2484 3627, 3636, 3656, 3665, 3674, 3683, 3692, 3701, 3711, 3721,
2485 3728, 3738, 3747, 3753, 3759, 3765, 3780, 3787, 3794, 3800,
2486 3807, 3808, 3809, 3812, 3813, 3816, 3817, 3829, 3830, 3839,
2487 3840, 3843, 3851, 3860, 3867, 3876, 3883, 3890, 3897, 3904,
2488 3913, 3921, 3930, 3931, 3934, 3934, 3936, 3940, 3944, 3948,
2489 3954, 3959, 3964, 3974, 3978, 3982, 3986, 3990, 3994, 3999,
2490 4003, 4007, 4011, 4015, 4019, 4023, 4027, 4031, 4037, 4038,
2491 4044, 4054, 4067, 4071, 4080, 4082, 4086, 4091, 4098, 4104,
2492 4108, 4112, 4097, 4137, 4146, 4157, 4163, 4162, 4174, 4184,
2493 4198, 4205, 4212, 4221, 4230, 4238, 4246, 4253, 4261, 4269,
2494 4276, 4283, 4296, 4304, 4314, 4315, 4319, 4314, 4336, 4337,
2495 4341, 4336, 4360, 4368, 4375, 4383, 4392, 4404, 4405, 4409,
2496 4416, 4420, 4408, 4435, 4436, 4439, 4440, 4448, 4458, 4459,
2497 4464, 4472, 4476, 4480, 4486, 4489, 4498, 4501, 4508, 4511,
2498 4512, 4514, 4515, 4516, 4525, 4534, 4543, 4548, 4557, 4566,
2499 4575, 4580, 4584, 4588, 4594, 4593, 4605, 4610, 4610, 4617,
2500 4626, 4630, 4639, 4643, 4647, 4650, 4654, 4663, 4667, 4673,
2501 4680, 4684, 4690, 4691, 4700, 4709, 4713, 4717, 4721, 4727,
2502 4729, 4738, 4746, 4760, 4761, 4784, 4788, 4794, 4800, 4801,
2503 4804, 4805, 4814, 4823, 4831, 4839, 4840, 4841, 4842, 4850,
2504 4860, 4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4875,
2505 4878, 4888, 4899, 4908, 4917, 4924, 4931, 4940, 4961, 4964,
2506 4971, 4978, 4981, 4985, 4988, 4995, 4998, 4999, 5002, 5019,
2507 5020, 5021, 5030, 5040, 5049, 5055, 5065, 5071, 5080, 5082,
2508 5091, 5101, 5107, 5116, 5125, 5135, 5141, 5151, 5157, 5167,
2509 5177, 5196, 5202, 5212, 5222, 5263, 5266, 5265, 5282, 5286,
2510 5291, 5295, 5299, 5281, 5320, 5327, 5334, 5341, 5344, 5345,
2511 5348, 5358, 5359, 5362, 5372, 5373, 5383, 5384, 5385, 5386,
2512 5389, 5390, 5391, 5394, 5395, 5396, 5399, 5400, 5401, 5402,
2513 5403, 5404, 5405, 5408, 5421, 5430, 5437, 5446, 5447, 5451,
2514 5450, 5460, 5468, 5469, 5477, 5489, 5490, 5490, 5506, 5510,
2515 5514, 5518, 5522, 5532, 5537, 5542, 5546, 5550, 5554, 5558,
2516 5562, 5566, 5570, 5574, 5578, 5582, 5586, 5590, 5594, 5599,
2517 5605, 5618, 5627, 5636, 5645, 5656, 5657, 5665, 5674, 5682,
2518 5703, 5705, 5718, 5728, 5737, 5748, 5756, 5766, 5773, 5783,
2519 5790, 5799, 5800, 5803, 5811, 5819, 5829, 5840, 5851, 5858,
2520 5867, 5874, 5883, 5884, 5887, 5895, 5905, 5906, 5909, 5917,
2521 5927, 5931, 5937, 5942, 5942, 5966, 5967, 5976, 5978, 6001,
2522 6012, 6019, 6028, 6036, 6053, 6067, 6068, 6069, 6072, 6073,
2523 6076, 6077, 6078, 6081, 6082, 6085, 6086, 6089, 6090, 6093,
2524 6094, 6097, 6098, 6101, 6104, 6107, 6110, 6111, 6114, 6115,
2525 6122, 6123, 6127
2526};
2527#endif
2528
2530#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2531
2532#if 1
2533/* The user-facing name of the symbol whose (internal) number is
2534 YYSYMBOL. No bounds checking. */
2535static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2536
2537/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2538 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2539static const char *const yytname[] =
2540{
2541 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2542 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2543 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2544 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2545 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2546 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2547 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2548 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2549 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2550 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2551 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2552 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2553 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2554 "\"method\"", "\"global variable\"", "\"instance variable\"",
2555 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
2556 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2557 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2558 "\"literal content\"", "tREGEXP_END", "\"dummy end\"", "'.'",
2559 "\"backslash\"", "\"escaped space\"", "\"escaped horizontal tab\"",
2560 "\"escaped form feed\"", "\"escaped carriage return\"",
2561 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2562 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2563 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2564 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2565 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2566 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2567 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2568 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2569 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2570 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2571 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tIGNORED_NL", "tCOMMENT",
2572 "tEMBDOC_BEG", "tEMBDOC", "tEMBDOC_END", "tHEREDOC_BEG", "tHEREDOC_END",
2573 "k__END__", "tLOWEST", "'='", "'?'", "':'", "'>'", "'<'", "'|'", "'^'",
2574 "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "tUMINUS_NUM", "'!'", "'~'",
2575 "tLAST_TOKEN", "'{'", "'}'", "'['", "','", "'`'", "'('", "')'", "']'",
2576 "';'", "' '", "'\\n'", "$accept", "program", "$@1", "top_compstmt",
2577 "top_stmts", "top_stmt", "begin_block", "bodystmt", "$@2", "compstmt",
2578 "stmts", "stmt_or_begin", "$@3", "stmt", "$@4", "command_asgn",
2579 "command_rhs", "expr", "@5", "@6", "@7", "@8", "def_name", "defn_head",
2580 "defs_head", "$@9", "expr_value", "expr_value_do", "$@10", "$@11",
2581 "command_call", "block_command", "cmd_brace_block", "fcall", "command",
2582 "mlhs", "mlhs_inner", "mlhs_basic", "mlhs_item", "mlhs_head",
2583 "mlhs_post", "mlhs_node", "lhs", "cname", "cpath", "fname", "fitem",
2584 "undef_list", "$@12", "op", "reswords", "arg", "$@13", "relop",
2585 "rel_expr", "lex_ctxt", "arg_value", "aref_args", "arg_rhs",
2586 "paren_args", "opt_paren_args", "opt_call_args", "call_args",
2587 "command_args", "$@14", "block_arg", "opt_block_arg", "args", "mrhs_arg",
2588 "mrhs", "primary", "$@15", "$@16", "$@17", "$@18", "@19", "@20", "$@21",
2589 "$@22", "$@23", "$@24", "$@25", "primary_value", "k_begin", "k_if",
2590 "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
2591 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
2592 "k_when", "k_else", "k_elsif", "k_end", "k_return", "then", "do",
2593 "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list", "f_margs",
2594 "f_rest_marg", "f_any_kwrest", "f_eq", "$@26", "block_args_tail",
2595 "opt_block_args_tail", "excessed_comma", "block_param",
2596 "opt_block_param", "block_param_def", "opt_bv_decl", "bv_decls", "bvar",
2597 "lambda", "@27", "@28", "@29", "$@30", "f_larglist", "lambda_body",
2598 "$@31", "do_block", "block_call", "method_call", "brace_block",
2599 "brace_body", "@32", "@33", "@34", "do_body", "@35", "@36", "@37",
2600 "case_args", "case_body", "cases", "p_case_body", "@38", "@39", "$@40",
2601 "p_cases", "p_top_expr", "p_top_expr_body", "p_expr", "p_as", "p_alt",
2602 "p_lparen", "p_lbracket", "p_expr_basic", "@41", "@42", "p_args",
2603 "p_args_head", "p_args_tail", "p_find", "p_rest", "p_args_post", "p_arg",
2604 "p_kwargs", "p_kwarg", "p_kw", "p_kw_label", "p_kwrest", "p_kwnorest",
2605 "p_any_kwrest", "p_value", "p_primitive", "p_variable", "p_var_ref",
2606 "p_expr_ref", "p_const", "opt_rescue", "exc_list", "exc_var",
2607 "opt_ensure", "literal", "strings", "string", "string1", "xstring",
2608 "regexp", "words", "word_list", "word", "symbols", "symbol_list",
2609 "qwords", "qsymbols", "qword_list", "qsym_list", "string_contents",
2610 "xstring_contents", "regexp_contents", "string_content", "@43", "$@44",
2611 "@45", "@46", "@47", "@48", "string_dvar", "symbol", "ssym", "sym",
2612 "dsym", "numeric", "simple_numeric", "nonlocal_var", "user_variable",
2613 "keyword_variable", "var_ref", "var_lhs", "backref", "superclass",
2614 "$@49", "f_opt_paren_args", "f_paren_args", "f_arglist", "@50",
2615 "args_tail", "opt_args_tail", "f_args", "args_forward", "f_bad_arg",
2616 "f_norm_arg", "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw",
2617 "f_block_kw", "f_block_kwarg", "f_kwarg", "kwrest_mark", "f_no_kwarg",
2618 "f_kwrest", "f_opt", "f_block_opt", "f_block_optarg", "f_optarg",
2619 "restarg_mark", "f_rest_arg", "blkarg_mark", "f_block_arg",
2620 "opt_f_block_arg", "singleton", "$@51", "assoc_list", "assocs", "assoc",
2621 "operation", "operation2", "operation3", "dot_or_colon", "call_op",
2622 "call_op2", "opt_terms", "opt_nl", "rparen", "rbracket", "rbrace",
2623 "trailer", "term", "terms", "none", YY_NULLPTR
2624};
2625
2626static const char *
2627yysymbol_name (yysymbol_kind_t yysymbol)
2628{
2629 return yytname[yysymbol];
2630}
2631#endif
2632
2633#define YYPACT_NINF (-1065)
2634
2635#define yypact_value_is_default(Yyn) \
2636 ((Yyn) == YYPACT_NINF)
2637
2638#define YYTABLE_NINF (-783)
2639
2640#define yytable_value_is_error(Yyn) \
2641 ((Yyn) == YYTABLE_NINF)
2642
2643/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2644 STATE-NUM. */
2645static const yytype_int16 yypact[] =
2646{
2647 -1065, 144, 4385, -1065, -1065, -1065, -1065, -1065, 9742, -1065,
2648 -1065, -1065, -1065, -1065, -1065, -1065, 10562, 10562, -1065, -1065,
2649 -1065, 6084, 5616, -1065, -1065, -1065, -1065, 32, 9588, 11,
2650 92, 197, -1065, -1065, -1065, 4824, 5772, -1065, -1065, 4992,
2651 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, 12135, 12135,
2652 12135, 12135, 351, 7722, 8484, 11046, 11409, 10044, -1065, 9434,
2653 -1065, -1065, -1065, 272, 284, 359, 362, 1229, 12256, 12135,
2654 -1065, 340, -1065, 1436, -1065, 551, 20, 20, -1065, -1065,
2655 194, 432, 406, -1065, 308, 12498, -1065, 442, 2224, 819,
2656 622, 676, -1065, 10441, 10441, -1065, -1065, 8605, 12617, 12736,
2657 12855, 9279, 10562, -1065, 582, 249, -1065, -1065, 373, -1065,
2658 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2659 -1065, -1065, 37, 299, -1065, 509, 342, -1065, -1065, -1065,
2660 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2661 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2662 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2663 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2664 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2665 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2666 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2667 -1065, -1065, -1065, -1065, -1065, 507, -1065, -1065, -1065, 528,
2668 12135, 637, 7882, 12135, 12135, 12135, -1065, 12135, 20, 20,
2669 -1065, 563, 4625, 603, -1065, -1065, 552, 754, 80, 302,
2670 615, 306, 569, -1065, -1065, 9037, -1065, 10562, 10683, -1065,
2671 -1065, 9158, -1065, 12377, 751, -1065, 575, 8042, -1065, 8202,
2672 -1065, -1065, 589, 602, 194, -1065, 758, -1065, 687, 4962,
2673 4962, 389, -1065, 7722, 612, 340, -1065, 1436, 11, 643,
2674 -1065, 1436, 11, 639, 601, 609, -1065, 603, 638, 609,
2675 -1065, 11, 744, 1229, 12974, 646, 646, 664, -1065, 774,
2676 858, 866, 871, -1065, -1065, 855, -1065, -1065, 1196, 1209,
2677 450, -1065, -1065, -1065, -1065, 753, -1065, -1065, -1065, -1065,
2678 -1065, -1065, -1065, 8727, 10441, 10441, 10441, 10441, 10320, 12377,
2679 12377, 2298, 705, 713, -1065, 2298, -1065, 718, -1065, -1065,
2680 -1065, -1065, 715, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2681 7722, 10182, 706, -1065, -1065, 12135, 12135, 12135, 12135, 12135,
2682 -1065, -1065, 12135, 12135, 12135, 12135, 12135, 12135, 12135, 12135,
2683 -1065, 12135, -1065, -1065, 12135, 12135, 12135, 12135, 12135, 12135,
2684 12135, 12135, 12135, 12135, -1065, -1065, 13553, 10562, 13652, 6868,
2685 -1065, 551, 185, 185, 7600, 10441, 7600, 340, -1065, 703,
2686 814, -1065, -1065, 935, 874, 77, 128, 132, 851, 883,
2687 12377, 119, -1065, 741, 1039, -1065, -1065, -1065, -1065, 83,
2688 325, 529, 534, 561, 568, 632, 633, 670, -1065, -1065,
2689 -1065, -1065, 679, -1065, -1065, -1065, 15038, -1065, -1065, -1065,
2690 -1065, -1065, -1065, 390, -1065, -1065, -1065, 1072, 748, 761,
2691 -1065, 12135, 10804, -1065, -1065, 13751, 10562, 13850, -1065, -1065,
2692 11167, -1065, 11, 733, -1065, -1065, 12135, 11, -1065, 750,
2693 11, 776, -1065, 352, -1065, -1065, -1065, -1065, -1065, 9742,
2694 -1065, 12135, 757, 786, 13751, 13850, -1065, 92, 11, -1065,
2695 -1065, 8885, 789, 11, -1065, -1065, 11288, -1065, -1065, 11409,
2696 -1065, -1065, -1065, 575, 1071, -1065, -1065, 805, -1065, 12974,
2697 13949, 10562, 14048, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2698 -1065, -1065, -1065, -1065, 1215, 85, 1233, 88, 12135, -1065,
2699 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2700 -1065, -1065, -1065, -1065, -1065, -1065, 1404, -1065, -1065, -1065,
2701 -1065, -1065, 817, -1065, -1065, 11, -1065, -1065, -1065, 806,
2702 -1065, 831, 12135, -1065, 833, 134, -1065, -1065, -1065, 834,
2703 938, 838, 942, -1065, 12256, 6868, 340, 12256, 6868, 843,
2704 -1065, -1065, -1065, 138, -1065, 138, 11530, -1065, 11, 12974,
2705 844, -1065, 11530, -1065, 687, 3311, 3311, 3311, 3311, 3382,
2706 2366, 3311, 3311, 4962, 4962, 771, 771, -1065, 4036, 1358,
2707 1358, 1227, 266, 266, 687, 687, 687, 1300, 1300, 6240,
2708 5148, 6552, 5304, -1065, -1065, 602, -1065, 11, 852, 412,
2709 -1065, 539, -1065, -1065, 5928, 138, 990, -1065, 6990, 993,
2710 7356, 138, 109, 138, 984, 1004, 175, 14147, 10562, 14246,
2711 -1065, 551, -1065, 1071, -1065, -1065, -1065, 14345, 10562, 14444,
2712 6868, 12377, -1065, -1065, -1065, -1065, -1065, 3687, 12256, 12256,
2713 9742, 12135, 12135, 12135, 12135, -1065, 12135, 603, -1065, 569,
2714 4540, 5460, 11, 451, 456, 12135, 12135, -1065, -1065, -1065,
2715 -1065, 10925, -1065, 11167, -1065, -1065, 12377, 4625, -1065, -1065,
2716 602, 602, 12135, -1065, 315, -1065, -1065, 609, 12974, 805,
2717 76, 660, 11, 300, 391, 2980, -1065, 1189, -1065, 526,
2718 -1065, 862, -1065, -1065, 535, 863, -1065, 687, 1404, 1062,
2719 -1065, 875, 11, 881, -1065, 40, -1065, -1065, -1065, 12135,
2720 878, 2298, -1065, -1065, 339, -1065, -1065, -1065, 2298, -1065,
2721 -1065, 1709, -1065, -1065, 982, 3514, 138, -1065, 994, 3654,
2722 138, -1065, -1065, 888, -1065, -1065, -1065, -1065, -1065, 12135,
2723 -1065, 889, 892, 999, -1065, -1065, 805, 12974, -1065, -1065,
2724 1005, 913, 3176, -1065, -1065, -1065, 1075, 461, 13379, 13379,
2725 914, -1065, -1065, -1065, 715, 896, 599, 10804, -1065, -1065,
2726 -1065, -1065, 715, -1065, -1065, -1065, 11651, 662, -1065, 723,
2727 -1065, 1047, -1065, -1065, -1065, -1065, -1065, -1065, 1004, 138,
2728 -1065, 11772, 138, 99, 139, 11, 179, 204, 7600, 340,
2729 10441, 6868, 996, 660, -1065, 11, 138, 352, 9896, 249,
2730 432, -1065, 3731, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2731 -1065, -1065, 480, -1065, -1065, 11, 911, 352, -1065, -1065,
2732 -1065, 471, 2298, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2733 -1065, -1065, -1065, -1065, -1065, -1065, 11, -1065, 1404, -1065,
2734 1333, -1065, -1065, -1065, -1065, -1065, 912, 919, -1065, 1016,
2735 817, 924, -1065, 932, -1065, 924, 12135, 12135, -1065, 12135,
2736 12135, -1065, 951, -1065, 951, 937, 11893, 10320, 805, 10320,
2737 -1065, 12135, 14543, 10562, 14642, -1065, -1065, -1065, 1928, 1928,
2738 565, -1065, 13286, 314, 1043, -1065, 1002, -1065, -1065, 28,
2739 -1065, 960, -1065, -1065, -1065, 969, -1065, 970, -1065, 13565,
2740 -1065, -1065, -1065, -1065, 756, -1065, -1065, -1065, 328, -1065,
2741 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, 136, -1065,
2742 12135, 12256, 12256, -1065, -1065, -1065, 12256, 12256, -1065, 889,
2743 -1065, 1026, -1065, -1065, -1065, 7600, -1065, -1065, -1065, -1065,
2744 7600, 10441, 138, -1065, -1065, 138, -1065, -1065, 138, -1065,
2745 12135, -1065, 146, -1065, 214, 138, 6868, 340, 138, -1065,
2746 -1065, -1065, -1065, -1065, -1065, 12135, 12135, -1065, 12135, 12135,
2747 -1065, 11167, -1065, 11, 75, -1065, -1065, -1065, 973, 975,
2748 2298, -1065, 1709, -1065, -1065, 1709, -1065, 1709, -1065, -1065,
2749 4625, 4625, 4625, 4625, 2064, 8202, -1065, -1065, 6868, 12135,
2750 977, -1065, -1065, 12256, 4625, 6396, 6708, 11, 485, 490,
2751 -1065, -1065, -1065, -1065, 13565, 41, 11, 13472, -1065, 11,
2752 978, -1065, 394, 953, -1065, -1065, 1162, -1065, 10441, -1065,
2753 1082, 13472, 13565, 13565, 394, 1038, 1928, 1928, 565, 60,
2754 696, 13379, 13379, -1065, 4625, -1065, -1065, -1065, -1065, 12256,
2755 -1065, -1065, -1065, -1065, 13093, 185, -1065, -1065, 7478, -1065,
2756 185, -1065, -1065, 13379, -1065, -1065, 12014, 7112, -1065, 138,
2757 -1065, -1065, 12135, 983, 986, -1065, 8202, -1065, -1065, 1333,
2758 1333, 924, 987, 924, 924, 817, -1065, 11, 1007, 806,
2759 1008, 13212, -1065, 1010, -1065, 1012, 1020, -1065, -1065, -1065,
2760 1022, 499, 29, -1065, 1038, 1023, 1024, -1065, -1065, -1065,
2761 11, -1065, -1065, 11, -1065, -1065, 1028, -1065, 1033, -1065,
2762 -1065, -1065, -1065, -1065, -1065, -1065, -1065, 11, 11, 11,
2763 11, 11, 11, -1065, -1065, 1093, -1065, 1102, 210, 224,
2764 259, 6868, 1142, 6990, 185, 884, 12135, -1065, 768, -1065,
2765 -1065, 1325, 6868, 1006, 8362, 975, -1065, 1709, -1065, -1065,
2766 -1065, -1065, 1017, -1065, 13212, 1252, -1065, -1065, 1125, 1117,
2767 339, -1065, 1252, -1065, 755, -1065, -1065, 13565, -1065, 472,
2768 -1065, -1065, 13565, 13472, -1065, -1065, -1065, -1065, -1065, -1065,
2769 291, 14741, 10562, 14840, 990, -1065, 723, -1065, 10441, 10441,
2770 -1065, -1065, -1065, -1065, -1065, 627, -1065, -1065, 138, -1065,
2771 1069, 924, -1065, 1117, -1065, 1052, 1054, -1065, 14939, -1065,
2772 817, 1055, -1065, 1056, 1055, 1058, 1058, -1065, -1065, 105,
2773 166, 11, 318, 367, -1065, -1065, 7234, -1065, -1065, 1325,
2774 -1065, -1065, -1065, -1065, 1252, -1065, 755, -1065, 1059, 1060,
2775 -1065, 755, -1065, 755, -1065, -1065, 13565, 374, 725, -1065,
2776 1055, 1063, 1055, 1055, -1065, -1065, -1065, -1065, 755, -1065,
2777 -1065, -1065, 1055, -1065
2778};
2779
2780/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2781 Performed when YYTABLE does not specify something else to do. Zero
2782 means the default is an error. */
2783static const yytype_int16 yydefact[] =
2784{
2785 2, 0, 0, 1, 39, 377, 378, 379, 0, 370,
2786 371, 372, 375, 373, 374, 376, 365, 366, 367, 368,
2787 389, 294, 294, 657, 656, 658, 659, 771, 0, 771,
2788 0, 0, 661, 660, 662, 755, 757, 651, 650, 756,
2789 652, 646, 647, 648, 649, 599, 667, 668, 0, 0,
2790 0, 0, 0, 0, 0, 782, 782, 105, 448, 619,
2791 619, 621, 623, 0, 0, 0, 0, 0, 0, 0,
2792 3, 769, 6, 8, 33, 38, 676, 676, 55, 77,
2793 294, 76, 0, 93, 0, 97, 107, 0, 66, 245,
2794 264, 0, 322, 0, 0, 73, 73, 0, 0, 0,
2795 0, 0, 333, 344, 78, 342, 311, 312, 598, 600,
2796 313, 314, 315, 317, 316, 318, 597, 638, 639, 596,
2797 644, 655, 663, 664, 319, 0, 320, 81, 5, 186,
2798 197, 187, 210, 183, 203, 193, 192, 213, 214, 208,
2799 191, 190, 185, 211, 215, 216, 195, 184, 198, 202,
2800 204, 196, 189, 205, 212, 207, 206, 199, 209, 194,
2801 182, 201, 200, 181, 188, 179, 180, 176, 177, 178,
2802 136, 138, 137, 171, 172, 167, 149, 150, 151, 158,
2803 155, 157, 152, 153, 173, 174, 159, 160, 164, 168,
2804 154, 156, 146, 147, 148, 161, 162, 163, 165, 166,
2805 169, 170, 175, 141, 143, 26, 139, 140, 142, 0,
2806 751, 0, 0, 302, 754, 297, 619, 0, 676, 676,
2807 289, 0, 272, 300, 91, 293, 782, 0, 663, 664,
2808 0, 320, 782, 747, 92, 771, 89, 0, 782, 469,
2809 88, 771, 772, 0, 0, 21, 257, 0, 9, 0,
2810 365, 366, 336, 470, 0, 239, 0, 333, 240, 230,
2811 231, 330, 19, 0, 0, 769, 16, 18, 771, 95,
2812 15, 326, 771, 0, 771, 771, 273, 0, 0, 771,
2813 745, 771, 0, 0, 0, 676, 676, 103, 369, 0,
2814 113, 114, 121, 449, 641, 0, 640, 642, 0, 0,
2815 0, 606, 615, 611, 617, 645, 59, 251, 252, 778,
2816 779, 4, 780, 0, 0, 0, 0, 0, 0, 0,
2817 0, 699, 0, 675, 361, 699, 673, 0, 363, 380,
2818 474, 463, 82, 478, 341, 381, 478, 459, 782, 109,
2819 0, 101, 98, 782, 63, 0, 0, 0, 0, 0,
2820 267, 268, 0, 0, 0, 0, 228, 229, 0, 0,
2821 60, 0, 265, 266, 0, 0, 0, 0, 0, 0,
2822 0, 0, 0, 0, 765, 766, 0, 782, 0, 0,
2823 72, 71, 0, 0, 0, 0, 0, 769, 351, 770,
2824 0, 400, 399, 0, 0, 663, 664, 320, 131, 132,
2825 0, 0, 134, 671, 0, 663, 664, 320, 359, 206,
2826 199, 209, 194, 176, 177, 178, 136, 137, 743, 68,
2827 67, 742, 0, 90, 768, 767, 0, 343, 601, 782,
2828 782, 144, 750, 330, 301, 753, 296, 0, 0, 0,
2829 782, 0, 0, 290, 299, 0, 782, 0, 782, 782,
2830 0, 291, 771, 0, 335, 295, 700, 771, 285, 782,
2831 771, 782, 284, 771, 340, 58, 23, 25, 24, 0,
2832 337, 0, 0, 0, 0, 0, 782, 0, 771, 328,
2833 14, 0, 94, 771, 325, 331, 777, 776, 274, 777,
2834 276, 332, 746, 0, 120, 645, 111, 106, 675, 0,
2835 0, 782, 0, 450, 625, 643, 628, 626, 620, 602,
2836 603, 622, 604, 624, 0, 0, 0, 0, 0, 781,
2837 7, 27, 28, 29, 30, 31, 56, 57, 706, 703,
2838 702, 701, 704, 712, 721, 700, 0, 733, 722, 737,
2839 736, 732, 782, 723, 698, 771, 682, 705, 707, 708,
2840 710, 684, 714, 719, 782, 725, 413, 412, 730, 684,
2841 735, 684, 739, 681, 0, 0, 0, 0, 0, 0,
2842 475, 474, 83, 0, 479, 0, 0, 271, 771, 0,
2843 99, 110, 0, 64, 237, 244, 246, 247, 248, 255,
2844 256, 249, 250, 226, 227, 253, 254, 61, 771, 241,
2845 242, 243, 232, 233, 234, 235, 236, 269, 270, 755,
2846 757, 756, 759, 468, 758, 294, 466, 771, 782, 755,
2847 757, 756, 759, 467, 294, 0, 782, 391, 0, 390,
2848 0, 0, 0, 0, 349, 0, 330, 0, 782, 0,
2849 73, 357, 131, 132, 133, 669, 355, 0, 782, 0,
2850 0, 0, 763, 764, 69, 755, 756, 294, 0, 0,
2851 0, 0, 0, 0, 0, 749, 305, 303, 298, 782,
2852 755, 756, 771, 755, 756, 0, 0, 748, 334, 773,
2853 279, 286, 281, 288, 339, 22, 0, 258, 10, 32,
2854 0, 782, 0, 20, 96, 17, 327, 771, 0, 104,
2855 760, 119, 771, 755, 756, 699, 629, 0, 605, 0,
2856 608, 0, 613, 610, 0, 0, 614, 238, 0, 411,
2857 403, 405, 771, 408, 401, 0, 680, 741, 674, 0,
2858 0, 0, 691, 713, 0, 679, 557, 724, 0, 694,
2859 734, 0, 696, 738, 47, 260, 0, 677, 49, 262,
2860 0, 472, 476, 0, 387, 388, 473, 480, 458, 302,
2861 34, 307, 0, 37, 306, 108, 102, 0, 54, 40,
2862 52, 0, 277, 300, 217, 35, 0, 320, 0, 0,
2863 0, 782, 782, 465, 86, 0, 471, 286, 782, 782,
2864 283, 464, 84, 282, 323, 382, 782, 782, 588, 782,
2865 392, 782, 347, 394, 74, 393, 348, 489, 0, 0,
2866 384, 0, 0, 760, 329, 771, 755, 756, 0, 0,
2867 0, 0, 131, 132, 135, 771, 0, 771, 0, 460,
2868 79, 41, 277, 218, 51, 225, 145, 752, 304, 292,
2869 782, 782, 471, 782, 782, 771, 782, 771, 224, 275,
2870 112, 471, 699, 451, 454, 630, 634, 635, 636, 627,
2871 637, 607, 609, 616, 612, 618, 771, 410, 0, 709,
2872 0, 740, 726, 415, 683, 711, 684, 684, 720, 725,
2873 782, 684, 731, 684, 708, 684, 0, 0, 362, 0,
2874 0, 364, 782, 80, 782, 310, 0, 0, 100, 0,
2875 782, 0, 0, 782, 0, 580, 586, 553, 0, 0,
2876 0, 527, 771, 524, 541, 619, 0, 579, 65, 498,
2877 504, 506, 508, 502, 501, 537, 503, 546, 549, 552,
2878 558, 559, 548, 511, 560, 512, 565, 566, 567, 570,
2879 571, 572, 573, 574, 576, 575, 577, 578, 556, 62,
2880 0, 0, 0, 87, 774, 782, 0, 0, 85, 589,
2881 590, 782, 591, 383, 385, 0, 11, 13, 595, 386,
2882 0, 0, 0, 395, 397, 0, 75, 490, 0, 353,
2883 0, 482, 0, 352, 471, 0, 0, 0, 0, 471,
2884 360, 744, 70, 461, 462, 0, 0, 782, 0, 0,
2885 280, 287, 338, 771, 0, 631, 402, 404, 406, 409,
2886 0, 687, 0, 689, 678, 0, 695, 0, 692, 697,
2887 48, 261, 50, 263, 771, 0, 439, 438, 0, 305,
2888 308, 36, 53, 0, 278, 755, 756, 771, 755, 756,
2889 568, 569, 132, 584, 0, 529, 771, 530, 534, 771,
2890 0, 523, 0, 0, 526, 540, 0, 581, 0, 582,
2891 0, 499, 0, 0, 547, 551, 563, 564, 0, 510,
2892 509, 0, 0, 555, 259, 46, 222, 45, 223, 0,
2893 43, 220, 44, 221, 0, 0, 593, 594, 0, 398,
2894 0, 345, 346, 0, 350, 483, 0, 0, 354, 0,
2895 670, 356, 0, 0, 442, 456, 0, 452, 632, 0,
2896 0, 684, 684, 684, 684, 782, 437, 771, 0, 708,
2897 421, 716, 717, 782, 728, 421, 421, 419, 477, 481,
2898 309, 471, 771, 521, 544, 532, 531, 522, 535, 619,
2899 771, 775, 554, 771, 505, 500, 537, 507, 538, 542,
2900 550, 545, 561, 562, 585, 520, 516, 771, 771, 771,
2901 771, 771, 771, 42, 219, 0, 592, 0, 663, 664,
2902 320, 0, 782, 0, 0, 495, 0, 484, 782, 358,
2903 453, 0, 0, 0, 0, 407, 688, 0, 685, 690,
2904 693, 418, 0, 440, 0, 422, 430, 428, 0, 715,
2905 0, 417, 0, 433, 0, 435, 528, 0, 536, 0,
2906 525, 583, 0, 0, 513, 514, 515, 517, 518, 519,
2907 330, 0, 782, 0, 782, 12, 782, 491, 0, 0,
2908 485, 487, 488, 486, 446, 771, 444, 447, 0, 455,
2909 0, 684, 441, 727, 420, 421, 421, 330, 0, 718,
2910 782, 421, 729, 421, 421, 533, 538, 539, 543, 760,
2911 329, 771, 755, 756, 587, 396, 0, 496, 497, 0,
2912 443, 457, 633, 686, 0, 425, 0, 427, 760, 329,
2913 416, 0, 434, 0, 431, 436, 0, 471, 782, 445,
2914 421, 421, 421, 421, 493, 494, 492, 426, 0, 423,
2915 429, 432, 421, 424
2916};
2917
2918/* YYPGOTO[NTERM-NUM]. */
2919static const yytype_int16 yypgoto[] =
2920{
2921 -1065, -1065, -1065, 976, -1065, 926, 763, -522, -1065, -28,
2922 -1065, 769, -1065, 39, -1065, -229, -542, -67, -1065, -1065,
2923 -1065, -1065, 414, 2325, 2587, -1065, -24, -77, -1065, -1065,
2924 -6, -1065, -424, 1029, -10, 1153, -153, 10, -75, -1065,
2925 -401, 7, 2986, -392, 1155, -56, -13, -1065, -1065, -4,
2926 -1065, 3847, -1065, 1171, -1065, 623, 2014, -1065, 675, 26,
2927 604, -360, 65, 16, -1065, -319, -203, 5, -1065, -457,
2928 -20, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2929 -1065, -1065, 917, -1065, -1065, -1065, -1065, -1065, -1065, -1065,
2930 -1065, -1065, -1065, -1065, -1065, -1065, -1065, -1065, 466, -1065,
2931 -430, 1837, -372, -1065, 42, -783, -1065, -799, -785, 547,
2932 401, -92, 154, -1065, 250, -417, -1065, -1065, 383, -1065,
2933 -905, -1065, 43, 519, -1065, -1065, -1065, -1065, -1065, -1065,
2934 -1065, 449, -1065, -1065, -104, 712, -1065, -1065, -1065, 959,
2935 -1065, -1065, -1065, -1065, -773, -1065, 23, -1065, -1065, -1065,
2936 -1065, -1065, -722, -43, -1065, -1065, -1065, -1065, 253, -1065,
2937 -1065, -177, -1065, -702, -812, -939, -966, -898, -909, -1065,
2938 256, -1065, -1065, -632, 257, -1065, -782, 264, -1065, -1065,
2939 -1065, 101, -1065, -1065, 156, 562, 631, -1065, 1218, 736,
2940 1173, 1370, -1065, 836, 1486, -1065, 1719, 1813, -1065, -1065,
2941 -55, -1065, -1065, -179, -1065, -1065, -1065, -1065, -1065, -1065,
2942 -1065, 24, -1065, -1065, -1065, -1065, 27, -57, 2864, 14,
2943 1256, 3061, 1912, -1065, -1065, 63, 697, 57, -1065, -274,
2944 -500, -302, -194, -1012, -505, -313, -673, 235, -514, 624,
2945 164, -1065, -1065, -246, -1065, -706, -672, -1064, 170, 635,
2946 -1065, -541, -1065, -532, -540, -1065, -1065, -1065, 33, -394,
2947 -342, -336, -1065, -1065, -71, -1065, -14, 290, 243, -294,
2948 228, -188, -58, 1, -2
2949};
2950
2951/* YYDEFGOTO[NTERM-NUM]. */
2952static const yytype_int16 yydefgoto[] =
2953{
2954 0, 1, 2, 70, 71, 72, 248, 625, 1088, 626,
2955 265, 266, 477, 267, 469, 74, 769, 75, 597, 779,
2956 583, 778, 419, 218, 219, 828, 382, 384, 385, 976,
2957 78, 79, 572, 254, 81, 82, 268, 83, 84, 85,
2958 497, 86, 221, 402, 403, 203, 204, 205, 660, 612,
2959 207, 88, 471, 372, 89, 576, 223, 273, 774, 613,
2960 791, 457, 458, 236, 237, 225, 443, 618, 763, 764,
2961 90, 379, 272, 483, 686, 808, 635, 821, 819, 650,
2962 565, 568, 256, 92, 93, 94, 95, 96, 97, 98,
2963 99, 100, 101, 333, 336, 796, 965, 811, 970, 971,
2964 756, 257, 628, 804, 972, 973, 394, 720, 721, 722,
2965 723, 542, 729, 730, 1244, 1196, 1197, 1117, 1025, 1026,
2966 1103, 1235, 1236, 103, 293, 503, 705, 1004, 853, 1107,
2967 1182, 337, 104, 105, 334, 569, 570, 752, 892, 573,
2968 574, 757, 894, 982, 812, 1233, 809, 977, 1093, 1266,
2969 1296, 1174, 918, 1134, 920, 921, 1071, 1072, 922, 1052,
2970 1044, 1046, 1047, 1048, 924, 925, 1148, 1050, 926, 927,
2971 928, 929, 930, 543, 932, 933, 934, 935, 936, 937,
2972 938, 797, 961, 1085, 967, 106, 107, 108, 109, 110,
2973 111, 112, 514, 709, 113, 516, 114, 115, 515, 517,
2974 295, 299, 300, 508, 707, 706, 855, 1005, 1108, 1184,
2975 859, 116, 117, 296, 118, 119, 120, 121, 228, 229,
2976 124, 230, 231, 646, 820, 322, 323, 324, 325, 874,
2977 732, 545, 546, 547, 548, 884, 550, 551, 552, 553,
2978 1122, 1123, 554, 555, 556, 557, 558, 1124, 1125, 559,
2979 560, 561, 562, 563, 726, 422, 651, 278, 461, 233,
2980 127, 690, 616, 654, 649, 426, 311, 453, 454, 786,
2981 1054, 488, 629, 389, 270
2982};
2983
2984/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2985 positive, shift that token. If negative, reduce the rule whose
2986 number is the opposite. If YYTABLE_NINF, syntax error. */
2987static const yytype_int16 yytable[] =
2988{
2989 128, 427, 297, 294, 206, 298, 220, 220, 549, 644,
2990 342, 630, 549, 312, 735, 245, 123, 617, 975, 386,
2991 378, 226, 226, 566, 206, 264, 381, 381, 880, 451,
2992 381, 724, 208, 425, 614, 978, 614, 288, 240, 312,
2993 615, 73, 624, 746, 460, 420, 750, 544, 239, 232,
2994 232, 544, 208, 276, 280, 206, 677, 949, 875, 739,
2995 274, 742, 306, 269, 287, 288, 882, 123, 123, 1007,
2996 383, 291, 313, 387, 326, 326, 923, 923, 288, 288,
2997 288, 224, 234, 388, 614, 1009, 672, 490, 275, 279,
2998 657, 492, 220, 271, 305, 677, 332, 206, 699, 291,
2999 1049, -117, -122, 614, 1105, 614, 331, 226, 1135, 615,
3000 478, 624, 396, 406, 406, 406, 831, 834, -126, 1118,
3001 511, 513, 1146, 668, -126, 775, 1040, 1041, 826, 1060,
3002 1060, 668, 614, 614, 328, 232, 803, -665, 1252, 691,
3003 327, 702, 1060, 1140, 3, 758, 931, 931, 754, 1136,
3004 539, 711, -657, -123, 715, -782, 447, -130, 614, 627,
3005 614, 437, 1159, 1162, -128, 1149, 691, 423, 736, 1237,
3006 736, 642, -122, 242, 463, 643, 465, 321, 766, -128,
3007 -665, -657, 540, 1061, 264, 475, 737, 578, 1073, 241,
3008 877, 242, -113, 871, 242, 794, -544, 883, 627, 1106,
3009 -129, 802, 871, 806, -125, 712, 755, 312, 716, 496,
3010 1252, -117, 1192, 724, 867, -122, 326, 326, 502, -771,
3011 329, 473, 242, -122, 444, 220, 123, 220, 220, -127,
3012 444, -117, -113, -755, -117, 264, 462, -123, -117, -124,
3013 226, 1255, 226, 459, 247, 128, 1256, 381, 381, 381,
3014 381, 480, 526, 527, -117, 824, -755, 1237, 451, 1158,
3015 1161, 123, -755, 123, 288, -126, 481, -126, 232, 309,
3016 232, 310, -130, 269, 1257, 329, 328, 123, 815, 239,
3017 331, 438, 439, -114, 1152, 1153, 73, -121, 825, 677,
3018 521, 522, 523, 524, -119, 614, -756, 614, 291, 988,
3019 452, 1096, 455, 691, -129, 614, 309, 614, 310, 1149,
3020 495, 1007, 264, 691, 1149, 1258, 888, 243, 381, 246,
3021 891, 288, 639, -756, 1185, -116, -128, 123, -128, 312,
3022 -120, -125, 123, 641, -116, 710, 577, 710, 882, 960,
3023 1014, 577, 875, 328, 345, 309, 330, 310, 580, 249,
3024 269, 238, 73, 768, 123, 291, 631, 525, 633, -118,
3025 953, 632, 668, 724, 668, 724, 898, 220, 958, -115,
3026 -122, 1175, -122, 634, 622, 462, 1011, 1013, 842, 979,
3027 -127, 1016, 983, 1018, -123, 1019, -123, -124, 1258, 319,
3028 320, 923, 549, 123, -656, 1231, 990, 533, 123, -666,
3029 123, 330, -666, 854, 623, 1232, 449, 261, 851, 1075,
3030 1077, 369, 370, 371, 1080, 1082, -118, 534, 549, -130,
3031 931, -130, 622, -656, 496, 549, 1068, 577, 577, 768,
3032 768, 544, 931, 301, -123, -116, 220, -123, 577, 931,
3033 931, -130, 430, 622, 462, 302, 577, 577, 538, 539,
3034 -94, -129, 907, -129, -114, -116, 685, 444, -116, 444,
3035 335, 931, -116, 339, 1099, 206, 839, -771, 668, 1112,
3036 -108, 622, 534, 623, 577, 669, 242, -130, -125, 288,
3037 -125, 540, 1069, 1126, 464, 1070, 60, 845, 879, 476,
3038 476, 220, 1127, 208, 1250, 123, -115, -121, 622, 462,
3039 309, 623, 310, 538, 496, 1294, 1129, 1139, 747, 849,
3040 1121, 482, 788, 291, 242, 484, 504, 512, 1043, 697,
3041 303, 984, 875, 304, -129, -129, -118, -127, 623, -127,
3042 862, 989, 948, 948, -124, 862, -124, 1163, 504, 549,
3043 727, 338, 1091, 1037, -120, 1092, -118, -125, 1094, -118,
3044 1003, 843, 727, -118, 744, 1098, 844, 748, 1101, 288,
3045 614, 430, 614, 818, 487, 487, 615, -116, 624, 487,
3046 760, 493, 506, 507, 805, 1191, 770, 343, 544, 123,
3047 997, 762, 123, 1201, 827, 788, -125, 762, 319, 320,
3048 789, -127, 504, 291, 506, 507, -130, 1142, -658, 955,
3049 799, 504, 801, -659, 724, 724, -115, 677, 875, 429,
3050 1097, 1186, 1188, 1189, 1190, -124, 444, 642, 1051, 847,
3051 -125, 1042, 793, 850, 798, -127, -115, -658, 220, -115,
3052 -661, 784, -659, -115, -124, 622, 462, -660, 220, 789,
3053 792, 783, 123, 839, 123, 622, 462, 836, 506, 507,
3054 790, 374, 770, 770, 1246, 793, 206, 506, 507, -661,
3055 1238, 1253, 431, 1127, 123, 623, -660, 444, 871, 1179,
3056 1127, 963, 1127, 830, -127, 623, 1154, 964, 288, 375,
3057 424, 1121, 668, 790, 208, 241, 1121, 861, 1121, 793,
3058 1121, -369, 496, 433, -118, 678, 864, 549, 440, 955,
3059 680, -662, -653, 682, 441, 904, 684, 442, 1203, 1205,
3060 1280, 1119, 291, 1171, 846, 448, 783, 790, 1173, -369,
3061 -369, 694, 768, 768, 450, 993, 696, 768, 768, -329,
3062 -662, -653, 470, 1291, -124, 919, 919, 969, 964, -654,
3063 964, 1273, 1127, 1131, 1127, 374, 235, 288, 652, 1127,
3064 807, 1127, 1133, 381, -115, 1137, 486, -329, -329, 238,
3065 1121, 986, 1121, 242, 489, 345, 1127, 1121, -654, 1121,
3066 479, 242, 420, 375, 376, 1155, -369, 653, -93, 577,
3067 577, 291, 1269, 964, 1121, 810, 577, 577, 728, 242,
3068 985, 491, 947, 947, 962, 968, 987, 974, 485, 974,
3069 494, 762, 1227, 321, 768, 466, 948, 528, 1271, 529,
3070 530, 531, 532, 533, -329, 467, 468, -756, 948, 499,
3071 846, 765, 571, 374, 206, 948, 948, 374, 1275, 1277,
3072 377, 518, 123, 534, 1282, 123, 1284, 1285, 577, 577,
3073 564, 577, 577, 374, 444, 1066, 1067, 948, -672, 345,
3074 768, 375, 445, 567, -771, 375, 474, 536, 242, 1059,
3075 1056, 581, 1261, 519, 538, 539, 1217, 1218, 1219, 1045,
3076 636, 375, 500, 1297, 1299, 1300, 1301, -755, 727, 614,
3077 645, 614, 1119, 662, 1145, 1303, 1065, 691, 780, 1119,
3078 1027, 679, 1027, 220, 1157, 1160, 663, 540, 577, 640,
3079 622, 462, 350, 351, 381, 681, 614, 785, 446, -756,
3080 688, 123, 446, 123, 367, 368, 369, 370, 371, 91,
3081 -653, 504, 947, 947, 1228, 1229, 947, -663, 501, 1100,
3082 623, 683, 1115, 227, 227, -664, 1031, 1087, 1032, 689,
3083 -320, -414, 1089, 947, -108, 770, 770, 1090, -653, -653,
3084 770, 770, -654, 577, 879, -663, -663, 362, 363, 1086,
3085 698, 1119, 785, -664, -664, 869, 582, 1287, -320, -320,
3086 91, 91, 725, 881, 289, 505, 885, 506, 507, 123,
3087 -654, -654, 498, 498, 123, 227, 731, 487, 734, 738,
3088 740, 381, 785, 741, 743, 577, 751, 1128, 795, 767,
3089 123, 1132, 289, -755, 374, -653, 800, 787, -755, 807,
3090 227, 227, -663, 873, 227, 393, 404, 404, 1045, 227,
3091 -664, 810, -760, 863, 865, -320, 886, 770, 1045, 1045,
3092 868, 80, 375, 637, 1143, -756, 870, -654, 889, 123,
3093 -756, 893, 123, 897, -300, 80, 80, 896, 900, 899,
3094 919, 950, 658, 659, 1057, 954, 37, 38, 947, 40,
3095 1172, 947, 964, 664, 288, -760, 1001, 1010, 737, 1178,
3096 991, 675, 676, 770, 1012, 947, 947, 947, 1183, 1015,
3097 947, 947, 80, 80, 1209, 947, 947, 1017, 1000, 638,
3098 1002, 1024, -301, -760, -760, 1055, 1223, 80, 1169, 692,
3099 1062, 288, 123, 1115, 1058, 785, 1141, 947, 374, 1006,
3100 1115, 123, 1115, 727, 528, 785, 529, 530, 531, 532,
3101 123, 727, 80, 80, 1063, 1064, 80, 1084, 1109, 91,
3102 1110, 80, -303, 1138, 905, 406, 375, 647, 504, 1060,
3103 -330, 1180, 1187, 1224, 374, 1226, 1181, 1193, -760, 1220,
3104 -760, 963, 227, -755, 227, 227, 1240, 1242, 227, 1239,
3105 227, 381, 381, 1195, 91, 1200, 91, 1202, -330, -330,
3106 968, 374, 375, 902, 288, 1204, 974, -304, 1207, 1208,
3107 91, 1247, 1115, 1212, 1115, 123, 374, 123, 1213, 1115,
3108 1272, 1115, 509, 648, 506, 507, 123, 661, 123, 375,
3109 1221, 289, 785, 1053, 1267, 1268, 1115, 1274, 406, 1276,
3110 1281, 1283, 220, 1286, 375, 1248, -755, -756, 1298, 622,
3111 462, 947, 798, 472, 974, -330, 947, 947, 504, 903,
3112 91, 227, 227, 227, 227, 91, 227, 227, 1288, 520,
3113 693, 80, 992, 856, 857, 1111, 858, 1113, 727, 623,
3114 695, 391, 1114, 46, 47, 408, 1222, 91, 289, 1120,
3115 373, 829, 504, 966, 80, 866, 80, 80, 1265, 1008,
3116 80, 648, 80, 1194, 1116, 504, 80, 1028, 80, 994,
3117 123, 504, 509, 753, 506, 507, 974, 1142, 41, 42,
3118 43, 44, 80, 1104, 227, 575, 91, 917, 917, 504,
3119 947, 91, 227, 91, 528, 345, 529, 530, 531, 532,
3120 533, 1295, 1289, 1156, 1104, 1147, 509, 227, 506, 507,
3121 1150, 1151, 358, 359, 1144, 1264, 428, 785, 1225, 510,
3122 534, 506, 507, 833, 835, 708, 785, 506, 507, 785,
3123 939, 939, 80, 80, 80, 80, 80, 80, 80, 80,
3124 833, 835, 714, 713, 536, 506, 507, 421, 878, 785,
3125 537, 538, 539, 227, 1249, 1245, 876, 848, 1210, 80,
3126 367, 368, 369, 370, 371, 1206, 0, 1234, 345, 529,
3127 530, 531, 532, 0, 0, 528, 1211, 529, 530, 531,
3128 532, 0, 0, 0, 540, 358, 359, 541, 91, 0,
3129 1214, 1215, 1216, 0, 951, 952, 80, 1104, 80, 940,
3130 940, 956, 957, 80, 80, 80, 289, 0, 227, 0,
3131 0, 0, 1241, 0, 0, 0, 0, 917, 917, 80,
3132 1053, 917, 0, 0, 0, 718, 345, 1251, 0, 1254,
3133 364, 365, 366, 367, 368, 369, 370, 371, 917, 0,
3134 785, 785, 785, 358, 359, 0, 528, 0, 529, 530,
3135 531, 532, 0, 995, 996, 0, 998, 999, 0, 0,
3136 939, 939, 0, 0, 939, 80, 314, 315, 316, 317,
3137 318, 227, 91, 0, 227, 91, 0, 0, 0, 0,
3138 0, 939, 0, 227, 0, 0, 289, 0, 0, 776,
3139 366, 367, 368, 369, 370, 371, 718, 0, 0, 1290,
3140 80, 1292, 719, 0, 941, 941, 0, 0, 1293, 0,
3141 0, 0, 0, 1033, 0, 1270, 0, 0, 0, 0,
3142 80, 0, 0, 1302, 0, 0, 0, 0, 0, 940,
3143 940, 0, 0, 940, 0, 91, 0, 91, 0, 0,
3144 0, 785, 0, 0, 0, 227, 0, 0, 0, 0,
3145 940, 0, 0, 917, 0, 227, 917, 91, 227, 0,
3146 0, 0, 0, 0, 0, 776, 776, 0, 1079, 0,
3147 917, 917, 917, 0, 0, 917, 917, 0, 0, 0,
3148 917, 917, 0, 80, 80, 0, 80, 80, 0, 0,
3149 0, 0, 0, 227, 0, 80, 939, 0, 0, 939,
3150 0, 80, 917, 0, 0, 289, 0, 0, 0, 0,
3151 1102, 0, 0, 939, 939, 939, 1076, 1078, 939, 939,
3152 0, 1081, 1083, 939, 939, 0, 0, 0, 0, 0,
3153 0, 0, 0, 0, 941, 941, 0, 0, 941, 0,
3154 0, 0, 0, 0, 0, 939, 0, 80, 0, 80,
3155 0, 0, 0, 0, 0, 941, 0, 80, 0, 0,
3156 1076, 1078, 0, 1081, 1083, 940, 0, 80, 940, 80,
3157 80, 0, 0, 0, 289, 0, 0, 80, 80, 0,
3158 0, 0, 940, 940, 940, 0, 0, 940, 940, 0,
3159 0, 0, 940, 940, 0, 0, 0, 0, 0, 0,
3160 0, 0, 0, 0, 0, 80, 0, 0, 0, 0,
3161 0, 0, 0, 0, 940, 0, 917, 0, 0, 0,
3162 0, 917, 917, 0, 0, 91, 0, 227, 91, 0,
3163 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3164 0, 0, 0, 0, 1164, 0, 0, 0, 0, 0,
3165 0, 528, 0, 529, 530, 531, 532, 533, 0, 939,
3166 0, 0, 0, 0, 939, 939, 0, 1164, 0, 0,
3167 941, 0, 0, 941, 0, 0, 0, 534, 0, 0,
3168 0, 0, 0, 0, 0, 0, 0, 941, 941, 941,
3169 0, 535, 941, 941, 0, 917, 0, 941, 941, 0,
3170 0, 536, 0, 0, 91, 0, 91, 0, 538, 539,
3171 227, 0, 0, 0, 0, 0, 0, 0, 0, 941,
3172 0, 0, 0, 0, 0, 0, 0, 0, 940, 102,
3173 0, 0, 0, 940, 940, 0, 0, 80, 939, 80,
3174 80, 540, 0, 102, 102, 0, 0, 0, 0, 0,
3175 0, 0, 0, 0, 0, 0, 0, 0, 776, 776,
3176 0, 0, 0, 776, 776, 0, 0, 0, 0, 0,
3177 0, 0, 91, 0, 0, 0, 0, 91, 227, 0,
3178 102, 102, 0, 0, 0, 0, 0, 0, 0, 0,
3179 0, 0, 0, 91, 0, 102, 0, 0, 0, 0,
3180 0, 0, 0, 0, 126, 0, 0, 940, 0, 0,
3181 0, 0, 0, 0, 0, 0, 80, 0, 80, 0,
3182 102, 102, 80, 0, 102, 0, 0, 0, 0, 102,
3183 0, 0, 91, 941, 0, 91, 0, 0, 941, 941,
3184 776, 942, 942, 0, 0, 0, 0, 0, 0, 0,
3185 0, 23, 24, 25, 26, 126, 126, 0, 0, 292,
3186 0, 0, 0, 0, 0, 227, 0, 32, 33, 34,
3187 80, 80, 0, 0, 0, 80, 80, 41, 42, 43,
3188 44, 45, 0, 0, 80, 0, 776, 292, 0, 80,
3189 80, 1167, 0, 0, 0, 91, 0, 0, 0, 0,
3190 397, 407, 407, 0, 91, 80, 0, 0, 0, 0,
3191 0, 0, 941, 91, 0, 0, 0, 0, 0, 0,
3192 0, 0, 0, 0, 0, 0, 0, 0, 1199, 58,
3193 59, 60, 61, 62, 63, 64, 65, 66, 0, 102,
3194 0, 0, 0, 0, 80, 0, 0, 80, 0, 0,
3195 0, 0, 80, 0, 0, 0, 0, 0, 0, 0,
3196 277, 0, 102, 0, 102, 102, 283, 0, 102, 0,
3197 102, 942, 942, 0, 102, 942, 102, 80, 91, 0,
3198 91, 0, 0, 0, 0, 0, 0, 0, 0, 91,
3199 102, 91, 942, 0, 0, 0, 0, 0, 80, 0,
3200 0, 1243, 0, 0, 0, 0, 528, 80, 529, 530,
3201 531, 532, 533, 0, 126, 0, 80, 0, 0, 0,
3202 0, 0, 0, 0, 0, 80, 0, 0, 0, 227,
3203 0, 0, 534, 0, 0, 227, 227, 0, 943, 943,
3204 102, 102, 102, 102, 102, 102, 102, 102, 0, 126,
3205 0, 126, 0, 0, 0, 0, 536, 0, 0, 0,
3206 0, 0, 537, 538, 539, 126, 0, 102, 0, 0,
3207 0, 0, 0, 91, 0, 0, 0, 0, 0, 0,
3208 0, 0, 0, 0, 0, 0, 292, 0, 0, 0,
3209 80, 0, 80, 0, 0, 0, 540, 0, 0, 541,
3210 0, 80, 0, 80, 102, 0, 102, 942, 0, 0,
3211 942, 102, 102, 102, 432, 126, 242, 434, 435, 436,
3212 126, 0, 0, 0, 942, 942, 942, 102, 0, 942,
3213 942, 0, 0, 0, 942, 942, 0, 0, 0, 344,
3214 0, 80, 126, 292, 0, 0, 0, 80, 80, 0,
3215 0, 0, 0, 0, 944, 944, 942, 0, 0, 0,
3216 0, 0, 0, 0, 0, 0, 0, 0, 943, 943,
3217 0, 0, 943, 102, 0, 0, 0, 0, 0, 0,
3218 0, 126, 0, 0, 0, 80, 126, 0, 126, 943,
3219 0, 0, 345, 346, 347, 348, 349, 350, 351, 352,
3220 353, 354, 355, 356, 357, 0, 0, 0, 102, 358,
3221 359, 0, 0, 0, 0, 360, 0, 76, 0, 0,
3222 0, 0, 0, 0, 0, 0, 0, 0, 102, 0,
3223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3224 528, 0, 529, 530, 531, 532, 533, 0, 0, 0,
3225 361, 0, 362, 363, 364, 365, 366, 367, 368, 369,
3226 370, 371, 0, 0, 0, 0, 534, 0, 76, 76,
3227 942, 0, 285, 0, 0, 942, 942, 0, 0, 0,
3228 535, 0, 0, 126, 944, 944, 0, 0, 944, 0,
3229 536, 102, 102, 0, 102, 102, 537, 538, 539, 0,
3230 285, 292, 0, 102, 943, 944, 0, 943, 0, 102,
3231 0, 0, 0, 285, 285, 285, 0, 0, 0, 0,
3232 0, 943, 943, 943, 0, 0, 943, 943, 0, 0,
3233 540, 943, 943, 541, 345, 346, 347, 348, 349, 350,
3234 351, 352, 0, 354, 355, 665, 667, 0, 0, 942,
3235 0, 358, 359, 943, 277, 102, 0, 102, 0, 0,
3236 0, 0, 0, 0, 0, 102, 0, 126, 0, 0,
3237 126, 0, 0, 0, 0, 102, 0, 102, 102, 0,
3238 0, 292, 0, 0, 777, 102, 102, 945, 945, 0,
3239 667, 0, 0, 277, 362, 363, 364, 365, 366, 367,
3240 368, 369, 370, 371, 0, 0, 0, 0, 0, 0,
3241 0, 0, 0, 102, 0, 0, 0, 0, 0, 0,
3242 944, 0, 0, 944, 0, 0, 0, 76, 0, 0,
3243 126, 0, 126, 0, 0, 0, 0, 944, 944, 944,
3244 0, 0, 944, 944, 0, 0, 0, 944, 944, 0,
3245 0, 0, 126, 0, 0, 0, 733, 0, 0, 0,
3246 777, 777, 76, 0, 76, 0, 0, 943, 0, 944,
3247 0, 0, 943, 943, 0, 0, 0, 0, 76, 77,
3248 761, 946, 946, 0, 0, 0, 773, 0, 0, 0,
3249 0, 0, 0, 0, 0, 0, 0, 0, 0, 285,
3250 292, 0, 0, 0, 0, 0, 0, 0, 0, 860,
3251 0, 0, 0, 0, 0, 0, 0, 945, 945, 0,
3252 0, 945, 0, 0, 0, 0, 0, 0, 76, 0,
3253 77, 77, 0, 76, 286, 0, 0, 0, 945, 0,
3254 0, 0, 0, 0, 0, 102, 943, 102, 102, 0,
3255 0, 0, 0, 0, 0, 76, 285, 0, 0, 0,
3256 0, 0, 286, 0, 0, 837, 0, 0, 0, 292,
3257 838, 0, 0, 0, 0, 286, 286, 286, 0, 0,
3258 0, 0, 0, 944, 0, 667, 0, 277, 944, 944,
3259 0, 0, 0, 0, 76, 0, 0, 0, 0, 76,
3260 0, 76, 0, 0, 0, 0, 0, 0, 0, 0,
3261 0, 946, 946, 0, 0, 946, 0, 0, 0, 0,
3262 126, 0, 0, 126, 102, 0, 102, 0, 0, 0,
3263 102, 0, 946, 872, 0, 0, 0, 0, 0, 0,
3264 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3265 0, 0, 0, 945, 0, 0, 945, 0, 0, 0,
3266 0, 0, 944, 895, 0, 0, 0, 0, 0, 0,
3267 945, 945, 945, 0, 0, 945, 945, 0, 102, 102,
3268 945, 945, 0, 102, 102, 0, 0, 0, 0, 77,
3269 0, 667, 102, 0, 0, 0, 76, 102, 102, 126,
3270 959, 126, 945, 0, 0, 0, 0, 0, 0, 0,
3271 0, 0, 0, 102, 285, 981, 0, 0, 0, 0,
3272 0, 0, 0, 0, 77, 0, 77, 0, 0, 0,
3273 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3274 77, 0, 0, 0, 0, 0, 0, 946, 0, 0,
3275 946, 0, 102, 777, 777, 102, 122, 0, 777, 777,
3276 102, 286, 0, 0, 946, 946, 946, 126, 0, 946,
3277 946, 0, 126, 0, 946, 946, 0, 0, 0, 0,
3278 76, 0, 0, 76, 0, 102, 0, 0, 126, 0,
3279 77, 0, 0, 0, 285, 77, 946, 76, 0, 0,
3280 1030, 0, 0, 0, 0, 0, 102, 122, 122, 0,
3281 0, 290, 0, 0, 0, 102, 945, 77, 286, 0,
3282 0, 945, 945, 0, 102, 0, 0, 126, 0, 0,
3283 126, 0, 0, 102, 0, 777, 0, 0, 0, 290,
3284 0, 0, 0, 76, 0, 76, 0, 0, 0, 0,
3285 0, 0, 395, 405, 405, 405, 77, 0, 0, 0,
3286 0, 77, 0, 77, 0, 76, 0, 0, 0, 0,
3287 0, 0, 0, 76, 76, 0, 0, 0, 87, 0,
3288 0, 777, 0, 0, 1095, 0, 1170, 0, 0, 0,
3289 126, 0, 0, 0, 0, 945, 0, 0, 102, 126,
3290 102, 0, 0, 0, 0, 277, 0, 0, 126, 102,
3291 946, 102, 0, 285, 0, 946, 946, 0, 0, 0,
3292 0, 0, 528, 407, 529, 530, 531, 532, 533, 87,
3293 87, 0, 0, 1130, 0, 0, 0, 0, 0, 0,
3294 0, 0, 0, 0, 0, 0, 0, 0, 534, 102,
3295 0, 0, 0, 125, 0, 102, 102, 0, 77, 0,
3296 0, 0, 535, 0, 0, 0, 122, 0, 0, 0,
3297 0, 0, 536, 126, 392, 126, 286, 0, 537, 538,
3298 539, 0, 285, 0, 126, 0, 126, 0, 0, 946,
3299 0, 0, 0, 102, 0, 0, 407, 0, 0, 0,
3300 1177, 122, 0, 122, 125, 125, 0, 0, 0, 0,
3301 0, 0, 540, 0, 0, 541, 0, 122, 0, 0,
3302 0, 0, 0, 0, 0, 0, 0, 852, 0, 0,
3303 0, 0, 0, 76, 0, 0, 76, 0, 290, 0,
3304 0, 0, 77, 0, 0, 77, 0, 0, 0, 0,
3305 0, 0, 0, 0, 0, 0, 286, 0, 0, 77,
3306 0, 0, 0, 0, 0, 0, 0, 122, 126, 0,
3307 0, 0, 122, 0, 0, 0, 0, 0, 0, 0,
3308 1230, 0, 0, 0, 0, 0, 0, 0, 87, 0,
3309 0, 0, 0, 0, 122, 290, 0, 0, 0, 0,
3310 0, 0, 0, 0, 0, 77, 0, 77, 0, 0,
3311 901, 0, 76, 0, 76, 0, 0, 0, 0, 0,
3312 0, 0, 0, 87, 0, 87, 0, 77, 0, 0,
3313 0, 0, 0, 122, 0, 77, 77, 0, 122, 87,
3314 122, 0, 0, 0, 345, 346, 347, 348, 349, 350,
3315 351, 352, 353, 354, 355, 356, 357, 0, 0, 0,
3316 0, 358, 359, 125, 0, 0, 76, 76, 0, 0,
3317 0, 76, 76, 0, 0, 286, 0, 0, 0, 0,
3318 76, 0, 0, 0, 0, 76, 0, 0, 0, 87,
3319 0, 0, 0, 0, 87, 0, 0, 0, 125, 0,
3320 125, 76, 361, 0, 362, 363, 364, 365, 366, 367,
3321 368, 369, 370, 371, 125, 0, 87, 0, 0, 0,
3322 0, -272, 0, 0, 0, 0, 0, 0, 0, 0,
3323 0, 0, 0, 0, 0, 122, 0, 0, 0, 0,
3324 76, 0, 0, 76, 286, 0, 0, 0, 76, 0,
3325 0, 0, 0, 290, 0, 87, 0, 0, 0, 0,
3326 87, 0, 87, 0, 125, 0, 0, 0, 0, 125,
3327 0, 0, 0, 0, 0, 0, 0, 0, 0, 345,
3328 -783, -783, -783, -783, 350, 351, 0, 0, -783, -783,
3329 0, 125, 0, 0, 76, 77, 358, 359, 77, 285,
3330 0, 0, 0, 76, 0, 0, 0, 0, 0, 0,
3331 0, 0, 76, 0, 0, 0, 0, 0, 0, 122,
3332 0, 76, 122, 0, 0, 0, 0, 0, 0, 0,
3333 125, 0, 0, 290, 0, 125, 285, 125, 0, 362,
3334 363, 364, 365, 366, 367, 368, 369, 370, 371, 0,
3335 345, 346, 347, 348, 349, 350, 351, 87, 0, 354,
3336 355, 0, 0, 0, 0, 0, 0, 358, 359, 0,
3337 0, 0, 0, 0, 77, 0, 77, 0, 0, 0,
3338 0, 0, 122, 0, 122, 0, 76, 0, 76, 0,
3339 0, 0, 0, 0, 0, 0, 0, 76, 0, 76,
3340 0, 0, 0, 0, 122, 0, 0, 0, 0, 285,
3341 362, 363, 364, 365, 366, 367, 368, 369, 370, 371,
3342 0, 0, 0, 0, 0, 0, 0, 0, 77, 77,
3343 0, 0, 125, 77, 77, 0, 0, 0, 0, 0,
3344 0, 87, 77, 0, 87, 0, 0, 77, 887, 0,
3345 0, 0, 290, 0, 0, 0, 0, 0, 771, 0,
3346 0, 0, 0, 77, 0, 0, 0, 0, 0, 0,
3347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3348 0, 76, 345, 346, 347, 348, 349, 350, 351, 352,
3349 353, 354, 355, 356, 357, 0, 0, 0, 0, 358,
3350 359, 0, 77, 0, 87, 77, 87, 0, 0, 0,
3351 77, 0, 0, 0, 0, 0, 125, 0, 0, 125,
3352 0, 290, 0, 0, 0, 0, 87, 0, 0, 0,
3353 0, 0, 0, 125, 771, 771, 0, 0, 0, 0,
3354 361, 0, 362, 363, 364, 365, 366, 367, 368, 369,
3355 370, 371, 0, 0, 0, 0, 77, 0, 0, 0,
3356 0, 286, 0, 0, 0, 77, 0, 0, 0, 0,
3357 0, 0, 122, 0, 77, 122, 0, -782, 0, 125,
3358 0, 125, 0, 77, 0, -782, -782, -782, 890, 0,
3359 -782, -782, -782, 0, -782, 0, 0, 0, 286, 0,
3360 0, 125, -782, -782, -782, 0, 0, 0, 0, 125,
3361 125, 0, 0, 0, -782, -782, 0, -782, -782, -782,
3362 -782, -782, 345, 346, 347, 348, 349, 350, 351, 352,
3363 353, 354, 355, 356, 357, 0, 0, 0, 0, 358,
3364 359, 0, 0, 0, 0, -782, -782, 0, 77, 0,
3365 77, 122, 0, 122, 0, 0, 0, 0, 0, 77,
3366 0, 77, 0, 0, 0, 901, 0, 0, 0, 0,
3367 0, 286, 0, 0, -782, -782, 0, 0, 0, 0,
3368 361, 0, 362, 363, 364, 365, 366, 367, 368, 369,
3369 370, 371, 0, 0, 87, 0, 0, 87, -782, 345,
3370 346, 347, 348, 349, 350, 351, 352, 353, 354, 355,
3371 356, 357, 0, 0, 0, 0, 358, 359, 0, 122,
3372 0, 0, 0, 0, 122, 0, 0, 0, 0, -782,
3373 -782, 0, 0, 0, 238, -782, 0, -782, 0, -782,
3374 122, 0, 0, 77, 0, 0, 0, 0, 0, 0,
3375 0, 0, 0, 222, 222, 0, 0, 361, 0, 362,
3376 363, 364, 365, 366, 367, 368, 369, 370, 371, 125,
3377 0, 0, 125, 87, 0, 87, 0, 0, 0, 122,
3378 0, 0, 122, 0, 0, 255, 258, 259, 260, 0,
3379 0, 0, 222, 222, 0, 0, 0, 0, 0, 0,
3380 0, 0, 0, 0, 0, 307, 308, 0, 0, 0,
3381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3382 0, 0, 0, 0, 0, 0, 0, 771, 771, 0,
3383 0, 0, 771, 771, 0, 0, 0, 0, 1168, 222,
3384 0, 87, 122, 0, 0, 0, 87, 0, 125, 0,
3385 125, 122, 0, 0, 0, 0, 0, 0, 0, 0,
3386 122, 0, 87, 0, 0, 0, 0, 0, 0, 0,
3387 0, 0, 0, 0, 0, 405, 0, 0, 0, 0,
3388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3390 0, 87, 125, 125, 87, 0, 0, 125, 125, 771,
3391 0, 0, 0, 0, 0, 0, 125, 0, 0, 0,
3392 0, 125, 0, 0, 0, 122, 0, 122, 0, 0,
3393 0, 0, 0, 0, 0, 0, 122, 125, 122, 0,
3394 0, 0, 0, 0, 0, 0, 0, 222, 405, 0,
3395 222, 222, 222, 0, 307, 771, 0, 0, 0, 0,
3396 1166, 0, 0, 0, 87, 0, 0, 0, 0, 0,
3397 0, 0, 222, 87, 222, 222, 125, 0, 0, 125,
3398 0, 0, 87, 0, 125, 0, 0, 0, 0, 0,
3399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3400 0, 0, 0, 0, 345, 346, 347, 348, 349, 350,
3401 351, 352, 353, 354, 355, 356, 357, 0, 0, 0,
3402 122, 358, 359, 0, 0, 0, 0, 0, 0, 0,
3403 125, 0, 0, 0, 0, 0, 0, 0, 0, 125,
3404 0, 0, 0, 0, 0, 0, 0, 87, 125, 87,
3405 0, 0, 0, 0, 0, 0, 0, 125, 87, 0,
3406 87, 0, 361, 0, 362, 363, 364, 365, 366, 367,
3407 368, 369, 370, 371, 0, 0, 0, 0, 0, 0,
3408 0, 0, 584, 585, 586, 587, 588, 0, 242, 589,
3409 590, 591, 592, 593, 594, 595, 596, 0, 598, 0,
3410 0, 599, 600, 601, 602, 603, 604, 605, 606, 607,
3411 608, 0, 0, 0, 222, 0, 0, 0, 0, 0,
3412 0, 0, 125, 0, 125, 0, 0, 0, 0, 0,
3413 0, 0, 0, 125, 0, 125, 0, 0, 0, 0,
3414 0, 0, 87, 0, 0, 0, 0, 0, 0, 0,
3415 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3417 0, 0, 0, 0, 0, 0, 0, 0, 222, 222,
3418 0, 0, 0, 222, 0, 0, 0, 222, 0, 0,
3419 0, 0, 0, 260, 0, 0, 0, 0, 0, 0,
3420 0, 0, 0, 0, 0, 0, 0, 0, 687, 0,
3421 0, 0, 0, 0, 0, 0, 0, 125, 0, 0,
3422 0, 0, 0, 222, 0, 0, 222, 0, 0, 0,
3423 0, 0, 0, 0, 0, 0, 0, 0, 222, 0,
3424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3425 0, 0, 0, 0, 0, 717, 0, 0, 0, 0,
3426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3427 0, 0, 0, 0, 0, -782, 4, 0, 5, 6,
3428 7, 8, 9, 0, 0, 0, 10, 11, 0, 222,
3429 0, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3430 0, 745, 0, 0, 749, 20, 21, 22, 23, 24,
3431 25, 26, 0, 222, 27, 0, 0, 0, 0, 772,
3432 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
3433 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3434 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3435 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3436 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3437 0, 0, 0, 0, 52, 222, 0, 53, 54, 0,
3438 55, 56, 0, 57, 0, 222, 58, 59, 60, 61,
3439 62, 63, 64, 65, 66, 832, 832, 0, 222, 745,
3440 749, 832, 0, 222, 0, 0, 0, 0, 0, 0,
3441 0, 0, 832, 832, 0, 0, 0, 0, 222, 0,
3442 222, 0, 0, 67, 68, 69, 0, 0, 0, 832,
3443 -760, 0, 0, 0, 0, -782, 0, -782, -760, -760,
3444 -760, 0, 0, -760, -760, -760, 0, -760, 0, 0,
3445 0, 0, 0, 0, 0, -760, -760, -760, -760, -760,
3446 0, 0, 0, 0, 0, 0, 222, -760, -760, 0,
3447 -760, -760, -760, -760, -760, 0, 0, 0, 0, 0,
3448 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3449 0, 0, 0, 0, 0, 0, 222, 0, -760, -760,
3450 0, 0, 0, 0, 0, 0, 0, 0, -760, -760,
3451 -760, -760, -760, -760, -760, -760, -760, -760, -760, -760,
3452 -760, 0, 0, 0, 222, -760, -760, -760, -760, 0,
3453 840, -760, 0, 222, 0, 0, 0, -760, 0, 0,
3454 0, 0, 0, 0, 0, 0, 0, 0, 222, 0,
3455 0, -760, 0, 0, -760, 0, 0, 0, 0, 0,
3456 0, 0, 0, 0, 0, -126, -760, -760, -760, -760,
3457 -760, -760, -760, -760, -760, -760, -760, -760, 0, 0,
3458 0, 0, -760, -760, -760, -760, 0, 0, -760, -760,
3459 -760, 0, -760, 345, 346, 347, 348, 349, 350, 351,
3460 352, 353, 354, 355, 356, 357, 0, 0, 0, 0,
3461 358, 359, 0, 0, 0, 0, 0, 0, 0, 0,
3462 0, 0, 0, 1020, 1021, 0, 1022, 1023, 0, 0,
3463 0, 0, 0, 222, 0, 0, 0, 0, 1034, 0,
3464 222, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3465 0, 361, 0, 362, 363, 364, 365, 366, 367, 368,
3466 369, 370, 371, 0, 0, 0, 0, 0, 0, 0,
3467 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3468 0, 0, 0, 0, 0, 0, 0, 1074, 832, 832,
3469 0, 0, 0, 832, 832, 0, 0, 0, 0, 0,
3470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3471 0, 0, 0, 0, -653, 0, 0, 222, 0, 0,
3472 0, 0, -653, -653, -653, 0, 0, -653, -653, -653,
3473 0, -653, 832, 832, 0, 832, 832, 0, 222, -653,
3474 0, -653, -653, -653, 0, 0, 0, 0, 0, 0,
3475 0, -653, -653, 0, -653, -653, -653, -653, -653, 0,
3476 0, 0, 0, 0, 0, 0, 222, 0, 0, 0,
3477 832, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3478 0, 0, -653, -653, 0, 0, 0, 0, 0, 0,
3479 0, 0, -653, -653, -653, -653, -653, -653, -653, -653,
3480 -653, -653, -653, -653, -653, 0, 0, 0, 0, -653,
3481 -653, -653, -653, 0, -653, -653, 832, 0, 0, 0,
3482 0, -653, 0, 0, 0, 0, 0, 0, 0, 0,
3483 0, 0, 0, 222, 0, -653, 0, 0, -653, 832,
3484 0, 0, 0, 0, 0, 0, 0, 0, 0, -653,
3485 -653, -653, -653, -653, -653, -653, -653, -653, -653, -653,
3486 -653, -653, 0, 0, 0, 0, 0, -653, -653, -653,
3487 0, 0, -653, -653, -653, 0, -653, 0, 0, 0,
3488 0, 0, -654, 0, 0, 0, 0, 0, 0, 0,
3489 -654, -654, -654, 0, 0, -654, -654, -654, 0, -654,
3490 0, 0, 0, 0, 0, 0, 0, -654, 0, -654,
3491 -654, -654, 0, 222, 0, 0, 0, 0, 0, -654,
3492 -654, 0, -654, -654, -654, -654, -654, 0, 0, 0,
3493 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
3494 355, -783, -783, 0, 0, 0, 0, 358, 359, 0,
3495 -654, -654, 0, 0, 0, 0, 0, 0, 0, 222,
3496 -654, -654, -654, -654, -654, -654, -654, -654, -654, -654,
3497 -654, -654, -654, 0, 0, 0, 0, -654, -654, -654,
3498 -654, 0, -654, -654, 0, 0, 0, 0, 0, -654,
3499 362, 363, 364, 365, 366, 367, 368, 369, 370, 371,
3500 0, 0, 0, -654, 0, 0, -654, 0, 0, 0,
3501 0, 0, 0, 0, 0, 0, 0, -654, -654, -654,
3502 -654, -654, -654, -654, -654, -654, -654, -654, -654, -654,
3503 0, 0, 0, 0, 0, -654, -654, -654, -761, 0,
3504 -654, -654, -654, 0, -654, 0, -761, -761, -761, 0,
3505 0, -761, -761, -761, 0, -761, 0, 0, 0, 0,
3506 0, 0, 0, -761, -761, -761, -761, -761, 0, 0,
3507 0, 0, 0, 0, 0, -761, -761, 0, -761, -761,
3508 -761, -761, -761, 0, 0, 0, 0, 0, 0, 0,
3509 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3510 0, 0, 0, 0, 0, 0, -761, -761, 0, 0,
3511 0, 0, 0, 0, 0, 0, -761, -761, -761, -761,
3512 -761, -761, -761, -761, -761, -761, -761, -761, -761, 0,
3513 0, 0, 0, -761, -761, -761, -761, 0, 0, -761,
3514 0, 0, 0, 0, 0, -761, 0, 0, 0, 0,
3515 0, 0, 0, 0, 0, 0, 0, 0, 0, -761,
3516 0, 0, -761, 0, 0, 0, 0, 0, 0, 0,
3517 0, 0, 0, 0, -761, -761, -761, -761, -761, -761,
3518 -761, -761, -761, -761, -761, -761, 0, 0, 0, 0,
3519 -761, -761, -761, -761, -762, 0, -761, -761, -761, 0,
3520 -761, 0, -762, -762, -762, 0, 0, -762, -762, -762,
3521 0, -762, 0, 0, 0, 0, 0, 0, 0, -762,
3522 -762, -762, -762, -762, 0, 0, 0, 0, 0, 0,
3523 0, -762, -762, 0, -762, -762, -762, -762, -762, 0,
3524 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3525 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3526 0, 0, -762, -762, 0, 0, 0, 0, 0, 0,
3527 0, 0, -762, -762, -762, -762, -762, -762, -762, -762,
3528 -762, -762, -762, -762, -762, 0, 0, 0, 0, -762,
3529 -762, -762, -762, 0, 0, -762, 0, 0, 0, 0,
3530 0, -762, 0, 0, 0, 0, 0, 0, 0, 0,
3531 0, 0, 0, 0, 0, -762, 0, 0, -762, 0,
3532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3533 -762, -762, -762, -762, -762, -762, -762, -762, -762, -762,
3534 -762, -762, 0, 0, 0, 0, -762, -762, -762, -762,
3535 -329, 0, -762, -762, -762, 0, -762, 0, -329, -329,
3536 -329, 0, 0, -329, -329, -329, 0, -329, 0, 0,
3537 0, 0, 0, 0, 0, -329, 0, -329, -329, -329,
3538 0, 0, 0, 0, 0, 0, 0, -329, -329, 0,
3539 -329, -329, -329, -329, -329, 0, 0, 0, 0, 0,
3540 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3541 0, 0, 0, 0, 0, 0, 0, 0, -329, -329,
3542 0, 0, 0, 0, 0, 0, 0, 0, -329, -329,
3543 -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
3544 -329, 0, 0, 0, 0, -329, -329, -329, -329, 0,
3545 841, -329, 0, 0, 0, 0, 0, -329, 0, 0,
3546 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3547 0, -329, 0, 0, -329, 0, 0, 0, 0, 0,
3548 0, 0, 0, 0, 0, -128, -329, -329, -329, -329,
3549 -329, -329, -329, -329, -329, -329, -329, -329, 0, 0,
3550 0, 0, 0, -329, -329, -329, -470, 0, -329, -329,
3551 -329, 0, -329, 0, -470, -470, -470, 0, 0, -470,
3552 -470, -470, 0, -470, 0, 0, 0, 0, 0, 0,
3553 0, -470, -470, -470, -470, 0, 0, 0, 0, 0,
3554 0, 0, 0, -470, -470, 0, -470, -470, -470, -470,
3555 -470, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3556 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3557 0, 0, 0, 0, -470, -470, 0, 0, 0, 0,
3558 0, 0, 0, 0, -470, -470, -470, -470, -470, -470,
3559 -470, -470, -470, -470, -470, -470, -470, 0, 0, 0,
3560 0, -470, -470, -470, -470, 0, 0, -470, 0, 0,
3561 0, 0, 0, -470, 0, 0, 0, 0, 0, 0,
3562 0, 0, 0, 0, 0, 0, 0, -470, 0, 0,
3563 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3564 0, 0, -470, 0, -470, -470, -470, -470, -470, -470,
3565 -470, -470, -470, -470, 0, 0, 0, 0, -470, -470,
3566 -470, -470, -321, 238, -470, -470, -470, 0, -470, 0,
3567 -321, -321, -321, 0, 0, -321, -321, -321, 0, -321,
3568 0, 0, 0, 0, 0, 0, 0, -321, 0, -321,
3569 -321, -321, 0, 0, 0, 0, 0, 0, 0, -321,
3570 -321, 0, -321, -321, -321, -321, -321, 0, 0, 0,
3571 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3573 -321, -321, 0, 0, 0, 0, 0, 0, 0, 0,
3574 -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
3575 -321, -321, -321, 0, 0, 0, 0, -321, -321, -321,
3576 -321, 0, 0, -321, 0, 0, 0, 0, 0, -321,
3577 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3578 0, 0, 0, -321, 0, 0, -321, 0, 0, 0,
3579 0, 0, 0, 0, 0, 0, 0, 0, -321, -321,
3580 -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
3581 0, 0, 0, 0, 0, -321, -321, -321, -782, 0,
3582 -321, -321, -321, 0, -321, 0, -782, -782, -782, 0,
3583 0, -782, -782, -782, 0, -782, 0, 0, 0, 0,
3584 0, 0, 0, -782, -782, -782, -782, 0, 0, 0,
3585 0, 0, 0, 0, 0, -782, -782, 0, -782, -782,
3586 -782, -782, -782, 0, 0, 0, 0, 0, 0, 0,
3587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3588 0, 0, 0, 0, 0, 0, -782, -782, 0, 0,
3589 0, 0, 0, 0, 0, 0, -782, -782, -782, -782,
3590 -782, -782, -782, -782, -782, -782, -782, -782, -782, 0,
3591 0, 0, 0, -782, -782, -782, -782, 0, 0, -782,
3592 0, 0, 0, 0, 0, -782, 0, 0, 0, 0,
3593 0, 0, 0, 0, 0, 0, 0, 0, 0, -782,
3594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3595 0, 0, 0, 0, -782, 0, -782, -782, -782, -782,
3596 -782, -782, -782, -782, -782, -782, 0, 0, 0, 0,
3597 -782, -782, -782, -782, -336, 238, -782, -782, -782, 0,
3598 -782, 0, -336, -336, -336, 0, 0, -336, -336, -336,
3599 0, -336, 0, 0, 0, 0, 0, 0, 0, -336,
3600 0, -336, -336, 0, 0, 0, 0, 0, 0, 0,
3601 0, -336, -336, 0, -336, -336, -336, -336, -336, 0,
3602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3604 0, 0, -336, -336, 0, 0, 0, 0, 0, 0,
3605 0, 0, -336, -336, -336, -336, -336, -336, -336, -336,
3606 -336, -336, -336, -336, -336, 0, 0, 0, 0, -336,
3607 -336, -336, -336, 0, 0, -336, 0, 0, 0, 0,
3608 0, -336, 0, 0, 0, 0, 0, 0, 0, 0,
3609 0, 0, 0, 0, 0, -336, 0, 0, 0, 0,
3610 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3611 -336, 0, -336, -336, -336, -336, -336, -336, -336, -336,
3612 -336, -336, 0, 0, 0, 0, 0, -336, -336, -336,
3613 -760, 235, -336, -336, -336, 0, -336, 0, -760, -760,
3614 -760, 0, 0, 0, -760, -760, 0, -760, 0, 0,
3615 0, 0, 0, 0, 0, -760, -760, 0, 0, 0,
3616 0, 0, 0, 0, 0, 0, 0, -760, -760, 0,
3617 -760, -760, -760, -760, -760, 0, 0, 0, 0, 0,
3618 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3619 0, 0, 0, 0, 0, 0, 0, 0, -760, -760,
3620 0, 0, 0, 0, 0, 0, 0, 0, -760, -760,
3621 -760, -760, -760, -760, -760, -760, -760, -760, -760, -760,
3622 -760, 0, 0, 0, 0, -760, -760, -760, -760, 0,
3623 781, -760, 0, 0, 0, 0, 0, 0, 0, 0,
3624 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3625 0, -760, 0, 0, 0, 0, 0, 0, 0, 0,
3626 0, 0, 0, 0, 0, -126, -760, 0, -760, -760,
3627 -760, -760, -760, -760, -760, -760, -760, -760, 0, 0,
3628 0, 0, -760, -760, -760, -117, -760, 0, -760, 0,
3629 -760, 0, -760, 0, -760, -760, -760, 0, 0, 0,
3630 -760, -760, 0, -760, 0, 0, 0, 0, 0, 0,
3631 0, -760, -760, 0, 0, 0, 0, 0, 0, 0,
3632 0, 0, 0, -760, -760, 0, -760, -760, -760, -760,
3633 -760, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3634 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3635 0, 0, 0, 0, -760, -760, 0, 0, 0, 0,
3636 0, 0, 0, 0, -760, -760, -760, -760, -760, -760,
3637 -760, -760, -760, -760, -760, -760, -760, 0, 0, 0,
3638 0, -760, -760, -760, -760, 0, 781, -760, 0, 0,
3639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3640 0, 0, 0, 0, 0, 0, 0, -760, 0, 0,
3641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3642 0, -126, -760, 0, -760, -760, -760, -760, -760, -760,
3643 -760, -760, -760, -760, 0, 0, 0, 0, -760, -760,
3644 -760, -760, -329, 0, -760, 0, -760, 0, -760, 0,
3645 -329, -329, -329, 0, 0, 0, -329, -329, 0, -329,
3646 0, 0, 0, 0, 0, 0, 0, -329, 0, 0,
3647 0, 0, 0, 0, 0, 0, 0, 0, 0, -329,
3648 -329, 0, -329, -329, -329, -329, -329, 0, 0, 0,
3649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3651 -329, -329, 0, 0, 0, 0, 0, 0, 0, 0,
3652 -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
3653 -329, -329, -329, 0, 0, 0, 0, -329, -329, -329,
3654 -329, 0, 782, -329, 0, 0, 0, 0, 0, 0,
3655 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3656 0, 0, 0, -329, 0, 0, 0, 0, 0, 0,
3657 0, 0, 0, 0, 0, 0, 0, -128, -329, 0,
3658 -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
3659 0, 0, 0, 0, 0, -329, -329, -119, -329, 0,
3660 -329, 0, -329, 0, -329, 0, -329, -329, -329, 0,
3661 0, 0, -329, -329, 0, -329, 0, 0, 0, 0,
3662 0, 0, 0, -329, 0, 0, 0, 0, 0, 0,
3663 0, 0, 0, 0, 0, -329, -329, 0, -329, -329,
3664 -329, -329, -329, 0, 0, 0, 0, 0, 0, 0,
3665 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3666 0, 0, 0, 0, 0, 0, -329, -329, 0, 0,
3667 0, 0, 0, 0, 0, 0, -329, -329, -329, -329,
3668 -329, -329, -329, -329, -329, -329, -329, -329, -329, 0,
3669 0, 0, 0, -329, -329, -329, -329, 0, 782, -329,
3670 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3671 0, 0, 0, 0, 0, 0, 0, 0, 0, -329,
3672 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3673 0, 0, 0, -128, -329, 0, -329, -329, -329, -329,
3674 -329, -329, -329, -329, -329, -329, 0, 0, 0, 0,
3675 0, -329, -329, -329, 0, 0, -329, 0, -329, 4,
3676 -329, 5, 6, 7, 8, 9, -782, -782, -782, 10,
3677 11, 0, 0, -782, 12, 0, 13, 14, 15, 16,
3678 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
3679 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3680 0, 0, 0, 28, 29, 262, 31, 32, 33, 34,
3681 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3682 44, 45, 46, 47, 0, 0, -782, 0, 0, 0,
3683 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3684 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3685 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3686 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3687 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3688 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
3689 -782, 10, 11, 0, -782, -782, 12, 0, 13, 14,
3690 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
3691 20, 21, 22, 23, 24, 25, 26, 0, -782, 27,
3692 -782, 0, 0, 0, 0, 28, 29, 262, 31, 32,
3693 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3694 42, 43, 44, 45, 46, 47, 0, 0, -782, 0,
3695 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3696 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3697 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3698 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3699 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3700 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
3701 0, 0, -782, 10, 11, 0, 0, -782, 12, -782,
3702 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
3703 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3704 -782, 27, -782, 0, 0, 0, 0, 28, 29, 262,
3705 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3706 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3707 -782, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3708 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3709 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3710 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3711 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3712 65, 66, 0, 0, 0, 4, 0, 5, 6, 7,
3713 8, 9, 0, 0, -782, 10, 11, 0, 0, -782,
3714 12, 0, 13, 14, 15, 16, 17, 18, 19, -782,
3715 67, 68, 69, 0, 20, 21, 22, 23, 24, 25,
3716 26, 0, -782, 27, -782, 0, 0, 0, 0, 28,
3717 29, 262, 31, 32, 33, 34, 35, 36, 37, 38,
3718 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3719 0, 0, -782, 0, 0, 0, 0, 0, 0, 0,
3720 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3721 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3722 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3723 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3724 63, 64, 65, 66, 0, 0, 0, 4, 0, 5,
3725 6, 7, 8, 9, 0, 0, -782, 10, 11, 0,
3726 0, -782, 12, 0, 13, 14, 15, 16, 17, 18,
3727 19, 0, 67, 68, 69, 0, 20, 21, 22, 23,
3728 24, 25, 26, 0, -782, 27, -782, 0, 0, 0,
3729 0, 28, 29, 262, 31, 32, 33, 34, 35, 36,
3730 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3731 46, 47, 0, 0, -782, 0, 0, 0, 0, 0,
3732 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3733 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3734 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
3735 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3736 61, 62, 63, 64, 65, 66, 0, 0, 0, 4,
3737 0, 5, 6, 7, 8, 9, 0, -782, -782, 10,
3738 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
3739 17, 18, 19, 0, 67, 68, 69, 0, 20, 21,
3740 22, 23, 24, 25, 26, 0, -782, 27, -782, 0,
3741 0, 0, 0, 28, 29, 262, 31, 32, 33, 34,
3742 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3743 44, 45, 46, 47, 0, 0, -782, 0, 0, 0,
3744 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3745 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3746 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3747 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3748 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3749 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
3750 -782, 10, 11, 0, 0, 0, 12, 0, 13, 14,
3751 15, 16, 17, 18, 19, 0, 67, 68, 69, 0,
3752 20, 21, 22, 23, 24, 25, 26, 0, -782, 27,
3753 -782, 0, 0, 0, 0, 28, 29, 262, 31, 32,
3754 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3755 42, 43, 44, 45, 46, 47, 0, 0, -782, 0,
3756 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3757 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3758 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3759 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3760 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3761 0, 0, 0, 4, 0, 5, 6, 7, 8, 9,
3762 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3763 13, 14, 15, 16, 17, 18, 19, 0, 67, 68,
3764 69, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3765 -782, 27, -782, 0, 0, 0, 0, 28, 29, 262,
3766 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3767 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3768 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3769 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3770 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3771 0, 52, 0, 0, 263, 54, 0, 55, 56, 0,
3772 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3773 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3774 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3775 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3776 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
3777 -782, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3778 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3779 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3780 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3781 0, 27, 0, 0, 0, 0, 0, 28, 29, 262,
3782 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3783 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3784 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3786 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3787 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3788 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3789 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3790 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3791 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3792 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
3793 -782, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3794 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3795 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3796 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3797 0, 27, 0, 0, 0, 0, 0, 28, 29, 30,
3798 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3799 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3800 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3801 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3802 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3803 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3804 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3805 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3806 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3808 67, 68, 69, 0, 0, -782, 0, 0, 0, 0,
3809 0, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3810 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3811 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3812 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3813 0, 27, 0, 0, 0, 0, 0, 28, 29, 262,
3814 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3815 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3816 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3817 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3818 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3819 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3820 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3821 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3822 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3823 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3824 67, 68, 69, 0, 0, -782, 0, 0, 0, 0,
3825 0, 0, -782, 4, -782, 5, 6, 7, 8, 9,
3826 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3827 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3828 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3829 0, 27, 0, 0, 0, 0, 0, 28, 29, 262,
3830 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3831 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3832 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3833 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3834 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3835 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3836 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3837 65, 66, 0, -782, 0, 4, 0, 5, 6, 7,
3838 8, 9, 0, 0, 0, 10, 11, 0, 0, 0,
3839 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3840 67, 68, 69, 0, 20, 21, 22, 23, 24, 25,
3841 26, 0, -782, 27, -782, 0, 0, 0, 0, 28,
3842 29, 0, 31, 32, 33, 34, 35, 36, 37, 38,
3843 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3844 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3845 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3846 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3847 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3848 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3849 63, 64, 65, 66, 0, 0, 380, 0, 5, 6,
3850 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
3851 0, 12, -769, 13, 14, 15, 16, 17, 18, 19,
3852 0, 0, 67, 68, 69, 20, 21, 22, 23, 24,
3853 25, 26, -324, 0, 27, 0, -324, 0, 0, 0,
3854 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3855 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3856 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3857 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3858 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3859 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
3860 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
3861 62, 63, 64, 65, 66, 0, 0, -770, 4, 0,
3862 5, 6, 7, 8, 9, 0, 0, 0, 10, 11,
3863 0, 0, 0, 12, 0, 13, 14, 15, 16, 17,
3864 18, 19, 0, 67, 68, 69, 0, 20, 21, 22,
3865 23, 24, 25, 26, 0, 309, 27, 310, 0, 0,
3866 0, 0, 28, 29, 30, 31, 32, 33, 34, 35,
3867 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3868 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3869 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3870 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3871 0, 0, 0, 0, 0, 0, 52, 0, 0, 53,
3872 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3873 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3874 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3876 0, 0, 0, 0, 0, 67, 68, 69, 0, 0,
3877 -770, 0, 0, 0, 0, 0, 4, 519, 5, 6,
3878 7, 8, 9, -770, -770, -770, 10, 11, 0, -770,
3879 -770, 12, -770, 13, 14, 15, 16, 17, 18, 19,
3880 -770, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3881 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
3882 28, 29, 262, 31, 32, 33, 34, 35, 36, 37,
3883 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3884 47, 0, 0, -770, 0, 0, 0, 0, 0, 0,
3885 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3886 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3887 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3888 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3889 62, 63, 64, 65, 66, 0, -770, 0, 0, 0,
3890 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3891 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3892 0, 0, 0, 67, 68, 69, 0, 0, -770, 0,
3893 5, 6, 7, -770, 9, 519, 0, 0, 10, 11,
3894 0, 0, 0, 12, 0, 13, 14, 15, 16, 17,
3895 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3896 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3897 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3898 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
3899 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3900 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3901 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3902 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
3903 54, 0, 55, 56, 0, 213, 214, 215, 58, 59,
3904 216, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3905 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
3906 11, 0, 0, 0, 12, 0, 13, 14, 15, 16,
3907 17, 18, 19, 0, 0, 67, 217, 69, 20, 21,
3908 22, 23, 24, 25, 26, 0, 0, 27, 0, 242,
3909 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
3910 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3911 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3912 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3913 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3914 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3915 212, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3916 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3917 0, 0, 129, 130, 131, 132, 133, 134, 135, 136,
3918 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
3919 147, 148, 149, 150, 151, 152, 67, 68, 69, 153,
3920 154, 155, 409, 410, 411, 412, 160, 161, 162, 0,
3921 242, 0, 0, 0, 163, 164, 165, 166, 413, 414,
3922 415, 416, 171, 37, 38, 417, 40, 0, 0, 0,
3923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3924 0, 0, 0, 0, 0, 173, 174, 175, 176, 177,
3925 178, 179, 180, 181, 0, 0, 182, 183, 0, 0,
3926 0, 0, 184, 185, 186, 187, 0, 0, 0, 0,
3927 0, 0, 0, 0, 0, 0, 0, 188, 189, 0,
3928 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3930 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
3931 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
3932 0, 0, 0, 0, 0, 202, 418, 129, 130, 131,
3933 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
3934 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
3935 152, 0, 0, 0, 153, 154, 155, 156, 157, 158,
3936 159, 160, 161, 162, 0, 0, 0, 0, 0, 163,
3937 164, 165, 166, 167, 168, 169, 170, 171, 37, 38,
3938 172, 40, 0, 0, 0, 0, 0, 0, 0, 0,
3939 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3940 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
3941 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
3942 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3943 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
3944 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3946 0, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3947 198, 199, 0, 200, 201, 0, 0, 0, 0, 0,
3948 202, 129, 130, 131, 132, 133, 134, 135, 136, 137,
3949 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
3950 148, 149, 150, 151, 152, 0, 0, 0, 153, 154,
3951 155, 156, 157, 158, 159, 160, 161, 162, 0, 0,
3952 0, 0, 0, 163, 164, 165, 166, 167, 168, 169,
3953 170, 171, 244, 0, 172, 0, 0, 0, 0, 0,
3954 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3955 0, 0, 0, 0, 173, 174, 175, 176, 177, 178,
3956 179, 180, 181, 0, 0, 182, 183, 0, 0, 0,
3957 0, 184, 185, 186, 187, 0, 0, 0, 0, 0,
3958 0, 0, 0, 0, 0, 0, 188, 189, 0, 0,
3959 59, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3960 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3961 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
3962 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
3963 0, 0, 0, 0, 202, 129, 130, 131, 132, 133,
3964 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
3965 144, 145, 146, 147, 148, 149, 150, 151, 152, 0,
3966 0, 0, 153, 154, 155, 156, 157, 158, 159, 160,
3967 161, 162, 0, 0, 0, 0, 0, 163, 164, 165,
3968 166, 167, 168, 169, 170, 171, 0, 0, 172, 0,
3969 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3970 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
3971 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
3972 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
3973 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3974 188, 189, 0, 0, 59, 0, 0, 0, 0, 0,
3975 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3976 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3977 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3978 0, 200, 201, 0, 0, 0, 0, 0, 202, 129,
3979 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
3980 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
3981 150, 151, 152, 0, 0, 0, 153, 154, 155, 156,
3982 157, 158, 159, 160, 161, 162, 0, 0, 0, 0,
3983 0, 163, 164, 165, 166, 167, 168, 169, 170, 171,
3984 0, 0, 172, 0, 0, 0, 0, 0, 0, 0,
3985 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3986 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
3987 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
3988 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
3989 0, 0, 0, 0, 188, 189, 0, 0, 0, 0,
3990 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3991 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3992 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
3993 196, 197, 198, 199, 0, 200, 201, 5, 6, 7,
3994 0, 9, 202, 0, 0, 10, 11, 0, 0, 0,
3995 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
3996 0, 0, 0, 0, 20, 252, 253, 23, 24, 25,
3997 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
3998 281, 0, 0, 32, 33, 34, 35, 36, 37, 38,
3999 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4000 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4001 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4003 0, 0, 0, 282, 0, 0, 212, 54, 0, 55,
4004 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4005 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
4006 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4007 0, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4008 0, 0, 283, 10, 11, 0, 0, 0, 12, 284,
4009 13, 14, 15, 250, 251, 18, 19, 0, 0, 0,
4010 0, 0, 20, 252, 253, 23, 24, 25, 26, 0,
4011 0, 209, 0, 0, 0, 0, 0, 0, 281, 0,
4012 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4013 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4014 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4015 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4016 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4017 0, 282, 0, 0, 212, 54, 0, 55, 56, 0,
4018 0, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4019 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
4020 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4021 0, 4, 0, 5, 6, 7, 8, 9, 0, 0,
4022 283, 10, 11, 0, 0, 0, 12, 579, 13, 14,
4023 15, 16, 17, 18, 19, 0, 0, 0, 0, 0,
4024 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
4025 0, 0, 0, 0, 0, 28, 29, 0, 31, 32,
4026 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4027 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4028 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4030 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
4031 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
4032 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4033 0, 0, 380, 0, 5, 6, 7, 0, 9, 0,
4034 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4035 14, 15, 16, 17, 18, 19, 0, 0, 67, 68,
4036 69, 20, 21, 22, 23, 24, 25, 26, 0, 0,
4037 27, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4038 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4039 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4040 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4041 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4042 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4043 211, 0, 0, 212, 54, 0, 55, 56, 0, 0,
4044 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4045 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4046 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4047 13, 14, 15, 16, 17, 18, 19, 0, 0, 67,
4048 68, 69, 20, 21, 22, 23, 24, 25, 26, 0,
4049 0, 209, 0, 0, 0, 0, 0, 0, 29, 0,
4050 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4051 210, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4052 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4054 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4055 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
4056 213, 214, 215, 58, 59, 216, 61, 62, 63, 64,
4057 65, 66, 0, 0, 0, 0, 5, 6, 7, 0,
4058 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4059 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
4060 67, 217, 69, 20, 21, 22, 23, 24, 25, 26,
4061 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
4062 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4063 40, 210, 41, 42, 43, 44, 45, 46, 47, 0,
4064 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4065 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4066 0, 0, 0, 0, 50, 456, 0, 0, 0, 0,
4067 0, 0, 211, 0, 0, 212, 54, 0, 55, 56,
4068 0, 213, 214, 215, 58, 59, 216, 61, 62, 63,
4069 64, 65, 66, 0, 0, 0, 0, 5, 6, 7,
4070 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4071 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4072 0, 67, 217, 69, 20, 252, 253, 23, 24, 25,
4073 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4074 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4075 39, 40, 210, 41, 42, 43, 44, 45, 46, 47,
4076 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4077 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4078 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4079 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
4080 56, 0, 666, 214, 215, 58, 59, 216, 61, 62,
4081 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4082 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4083 0, 12, 0, 13, 14, 15, 250, 251, 18, 19,
4084 0, 0, 67, 217, 69, 20, 252, 253, 23, 24,
4085 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4086 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4087 38, 39, 40, 210, 41, 42, 43, 44, 45, 46,
4088 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4089 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4090 0, 0, 0, 0, 0, 0, 50, 456, 0, 0,
4091 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
4092 55, 56, 0, 666, 214, 215, 58, 59, 216, 61,
4093 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4094 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4095 0, 0, 12, 0, 13, 14, 15, 250, 251, 18,
4096 19, 0, 0, 67, 217, 69, 20, 252, 253, 23,
4097 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
4098 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4099 37, 38, 39, 40, 210, 41, 42, 43, 44, 45,
4100 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4101 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4102 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4103 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
4104 0, 55, 56, 0, 213, 214, 0, 58, 59, 216,
4105 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4106 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4107 0, 0, 0, 12, 0, 13, 14, 15, 250, 251,
4108 18, 19, 0, 0, 67, 217, 69, 20, 252, 253,
4109 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
4110 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4111 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
4112 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4113 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4114 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4115 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
4116 54, 0, 55, 56, 0, 0, 214, 215, 58, 59,
4117 216, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4118 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4119 11, 0, 0, 0, 12, 0, 13, 14, 15, 250,
4120 251, 18, 19, 0, 0, 67, 217, 69, 20, 252,
4121 253, 23, 24, 25, 26, 0, 0, 209, 0, 0,
4122 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
4123 35, 36, 37, 38, 39, 40, 210, 41, 42, 43,
4124 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4125 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
4126 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
4127 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
4128 212, 54, 0, 55, 56, 0, 666, 214, 0, 58,
4129 59, 216, 61, 62, 63, 64, 65, 66, 0, 0,
4130 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4131 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
4132 250, 251, 18, 19, 0, 0, 67, 217, 69, 20,
4133 252, 253, 23, 24, 25, 26, 0, 0, 209, 0,
4134 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
4135 34, 35, 36, 37, 38, 39, 40, 210, 41, 42,
4136 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4137 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
4138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4139 50, 51, 0, 0, 0, 0, 0, 0, 211, 0,
4140 0, 212, 54, 0, 55, 56, 0, 0, 214, 0,
4141 58, 59, 216, 61, 62, 63, 64, 65, 66, 0,
4142 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
4143 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
4144 15, 16, 17, 18, 19, 0, 0, 67, 217, 69,
4145 20, 21, 22, 23, 24, 25, 26, 0, 0, 209,
4146 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
4147 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
4148 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
4149 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
4150 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4151 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
4152 0, 0, 212, 54, 0, 55, 56, 0, 759, 0,
4153 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4154 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4155 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
4156 14, 15, 250, 251, 18, 19, 0, 0, 67, 217,
4157 69, 20, 252, 253, 23, 24, 25, 26, 0, 0,
4158 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
4159 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4160 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4161 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
4162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4163 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
4164 211, 0, 0, 212, 54, 0, 55, 56, 0, 759,
4165 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
4166 66, 0, 0, 0, 0, 5, 6, 7, 0, 9,
4167 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4168 13, 14, 15, 250, 251, 18, 19, 0, 0, 67,
4169 217, 69, 20, 252, 253, 23, 24, 25, 26, 0,
4170 0, 209, 0, 0, 0, 0, 0, 0, 29, 0,
4171 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4172 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4173 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
4174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4175 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
4176 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
4177 980, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4178 65, 66, 0, 0, 0, 0, 5, 6, 7, 0,
4179 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4180 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
4181 67, 217, 69, 20, 252, 253, 23, 24, 25, 26,
4182 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
4183 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4184 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4185 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
4186 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4187 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
4188 0, 0, 211, 0, 0, 212, 54, 0, 55, 56,
4189 0, 1029, 0, 0, 58, 59, 60, 61, 62, 63,
4190 64, 65, 66, 0, 0, 0, 0, 5, 6, 7,
4191 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4192 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4193 0, 67, 217, 69, 20, 252, 253, 23, 24, 25,
4194 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4195 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4196 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4197 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4198 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
4199 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
4200 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
4201 56, 0, 1176, 0, 0, 58, 59, 60, 61, 62,
4202 63, 64, 65, 66, 0, 0, 0, 0, 5, 6,
4203 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4204 0, 12, 0, 13, 14, 15, 250, 251, 18, 19,
4205 0, 0, 67, 217, 69, 20, 252, 253, 23, 24,
4206 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4207 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
4208 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4209 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4210 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
4211 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
4212 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
4213 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
4214 62, 63, 64, 65, 66, 0, 0, 0, 0, 5,
4215 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4216 0, 0, 12, 0, 13, 14, 15, 16, 17, 18,
4217 19, 0, 0, 67, 217, 69, 20, 21, 22, 23,
4218 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
4219 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
4220 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
4221 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4222 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
4223 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
4224 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
4225 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4226 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4227 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4228 0, 0, 0, 12, 0, 13, 14, 15, 16, 17,
4229 18, 19, 0, 0, 67, 217, 69, 20, 21, 22,
4230 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
4231 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
4232 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4233 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4234 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
4235 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
4236 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
4237 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
4238 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
4239 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
4240 11, 0, 0, 0, 12, 0, 13, 14, 15, 250,
4241 251, 18, 19, 0, 0, 67, 68, 69, 20, 252,
4242 253, 23, 24, 25, 26, 0, 0, 209, 0, 0,
4243 0, 0, 0, 0, 281, 0, 0, 32, 33, 34,
4244 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
4245 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
4246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4248 0, 0, 0, 0, 0, 0, 0, 282, 0, 0,
4249 340, 54, 0, 55, 56, 0, 341, 0, 0, 58,
4250 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4251 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4252 0, 0, 0, 12, 0, 13, 14, 15, 250, 251,
4253 18, 19, 0, 0, 0, 0, 283, 20, 252, 253,
4254 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
4255 0, 0, 0, 281, 0, 0, 32, 33, 34, 35,
4256 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
4257 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4260 0, 0, 0, 0, 0, 0, 390, 0, 0, 53,
4261 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
4262 60, 61, 62, 63, 64, 65, 66, 0, 0, 5,
4263 6, 7, 0, 9, 0, 0, 0, 10, 11, 0,
4264 0, 0, 12, 0, 13, 14, 15, 250, 251, 18,
4265 19, 0, 0, 0, 0, 283, 20, 252, 253, 23,
4266 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
4267 0, 0, 281, 0, 0, 32, 33, 34, 398, 36,
4268 37, 38, 399, 40, 0, 41, 42, 43, 44, 45,
4269 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
4270 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4271 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4272 0, 400, 0, 0, 0, 401, 0, 0, 212, 54,
4273 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4274 61, 62, 63, 64, 65, 66, 0, 0, 5, 6,
4275 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4276 0, 12, 0, 13, 14, 15, 250, 251, 18, 19,
4277 0, 0, 0, 0, 283, 20, 252, 253, 23, 24,
4278 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4279 0, 281, 0, 0, 32, 33, 34, 398, 36, 37,
4280 38, 399, 40, 0, 41, 42, 43, 44, 45, 46,
4281 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4284 0, 0, 0, 0, 401, 0, 0, 212, 54, 0,
4285 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
4286 62, 63, 64, 65, 66, 0, 0, 5, 6, 7,
4287 0, 9, 0, 0, 0, 10, 11, 0, 0, 0,
4288 12, 0, 13, 14, 15, 250, 251, 18, 19, 0,
4289 0, 0, 0, 283, 20, 252, 253, 23, 24, 25,
4290 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
4291 281, 0, 0, 32, 33, 34, 35, 36, 37, 38,
4292 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
4293 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4294 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4295 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4296 0, 0, 0, 282, 0, 0, 340, 54, 0, 55,
4297 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4298 63, 64, 65, 66, 0, 0, 5, 6, 7, 0,
4299 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4300 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
4301 0, 0, 283, 20, 252, 253, 23, 24, 25, 26,
4302 0, 0, 209, 0, 0, 0, 0, 0, 0, 281,
4303 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4304 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4306 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4308 0, 0, 1165, 0, 0, 212, 54, 0, 55, 56,
4309 0, 0, 0, 0, 58, 59, 60, 61, 62, 63,
4310 64, 65, 66, 0, 0, 5, 6, 7, 0, 9,
4311 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
4312 13, 14, 15, 250, 251, 18, 19, 0, 0, 0,
4313 0, 283, 20, 252, 253, 23, 24, 25, 26, 0,
4314 0, 209, 0, 0, 0, 0, 0, 0, 281, 0,
4315 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
4316 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
4317 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4318 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4320 0, 1198, 0, 0, 212, 54, 0, 55, 56, 23,
4321 24, 25, 26, 58, 59, 60, 61, 62, 63, 64,
4322 65, 66, 0, 0, 0, 32, 33, 34, 905, 0,
4323 0, 0, 906, 0, 0, 41, 42, 43, 44, 45,
4324 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4325 283, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4326 0, 0, 0, 0, 0, 0, 0, 908, 909, 0,
4327 0, 0, 0, 0, 0, 910, 0, 0, 911, 0,
4328 0, 912, 913, 0, 914, 0, 0, 58, 59, 60,
4329 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4330 0, 0, 23, 24, 25, 26, 0, 0, 0, 0,
4331 0, 0, 0, 0, 0, 0, 0, 916, 32, 33,
4332 34, 905, 0, 0, 283, 906, 0, 907, 41, 42,
4333 43, 44, 45, 0, 0, 0, 0, 0, 242, 0,
4334 0, 0, 0, 0, 0, 0, 0, 534, 0, 0,
4335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4336 908, 909, 0, 0, 0, 0, 0, 0, 910, 0,
4337 0, 911, 0, 0, 912, 913, 0, 914, 538, 0,
4338 58, 59, 915, 61, 62, 63, 64, 65, 66, 0,
4339 0, 0, 0, 0, 0, 23, 24, 25, 26, 0,
4340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4341 916, 32, 33, 34, 905, 0, 0, 283, 906, 0,
4342 0, 41, 42, 43, 44, 45, 0, 0, 0, 0,
4343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4344 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4345 0, 0, 0, 908, 909, 0, 0, 0, 0, 0,
4346 0, 910, 0, 0, 911, 0, 0, 912, 913, 0,
4347 914, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4348 65, 66, 0, 0, 0, 0, 0, 0, 23, 24,
4349 25, 26, 0, 0, 0, 609, 610, 0, 0, 611,
4350 0, 0, 0, 916, 32, 33, 34, 905, 0, 0,
4351 283, 906, 0, 0, 41, 42, 43, 44, 45, 173,
4352 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4353 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4354 0, 0, 0, 0, 0, 0, 908, 909, 0, 0,
4355 0, 188, 189, 0, 910, 0, 0, 911, 0, 0,
4356 912, 913, 0, 0, 0, 0, 58, 59, 60, 61,
4357 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
4358 0, 190, 191, 192, 193, 194, 195, 196, 197, 198,
4359 199, 0, 200, 201, 619, 620, 916, 0, 621, 202,
4360 238, 0, 0, 283, 0, 0, 0, 0, 0, 0,
4361 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
4362 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
4363 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
4364 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4365 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4366 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4367 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4368 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
4369 0, 200, 201, 670, 610, 0, 0, 671, 202, 238,
4370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4371 0, 0, 0, 0, 0, 0, 0, 173, 174, 175,
4372 176, 177, 178, 179, 180, 181, 0, 0, 182, 183,
4373 0, 0, 0, 0, 184, 185, 186, 187, 0, 0,
4374 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
4375 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4376 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4377 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4378 191, 192, 193, 194, 195, 196, 197, 198, 199, 0,
4379 200, 201, 673, 620, 0, 0, 674, 202, 238, 0,
4380 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4381 0, 0, 0, 0, 0, 0, 173, 174, 175, 176,
4382 177, 178, 179, 180, 181, 0, 0, 182, 183, 0,
4383 0, 0, 0, 184, 185, 186, 187, 0, 0, 0,
4384 0, 0, 0, 0, 0, 0, 0, 0, 188, 189,
4385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4387 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4388 192, 193, 194, 195, 196, 197, 198, 199, 0, 200,
4389 201, 700, 610, 0, 0, 701, 202, 238, 0, 0,
4390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4391 0, 0, 0, 0, 0, 173, 174, 175, 176, 177,
4392 178, 179, 180, 181, 0, 0, 182, 183, 0, 0,
4393 0, 0, 184, 185, 186, 187, 0, 0, 0, 0,
4394 0, 0, 0, 0, 0, 0, 0, 188, 189, 0,
4395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4396 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4397 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
4398 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
4399 703, 620, 0, 0, 704, 202, 238, 0, 0, 0,
4400 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4401 0, 0, 0, 0, 173, 174, 175, 176, 177, 178,
4402 179, 180, 181, 0, 0, 182, 183, 0, 0, 0,
4403 0, 184, 185, 186, 187, 0, 0, 0, 0, 0,
4404 0, 0, 0, 0, 0, 0, 188, 189, 0, 0,
4405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4407 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
4408 194, 195, 196, 197, 198, 199, 0, 200, 201, 813,
4409 610, 0, 0, 814, 202, 238, 0, 0, 0, 0,
4410 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4411 0, 0, 0, 173, 174, 175, 176, 177, 178, 179,
4412 180, 181, 0, 0, 182, 183, 0, 0, 0, 0,
4413 184, 185, 186, 187, 0, 0, 0, 0, 0, 0,
4414 0, 0, 0, 0, 0, 188, 189, 0, 0, 0,
4415 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4417 0, 0, 0, 0, 0, 190, 191, 192, 193, 194,
4418 195, 196, 197, 198, 199, 0, 200, 201, 816, 620,
4419 0, 0, 817, 202, 238, 0, 0, 0, 0, 0,
4420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4421 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
4422 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
4423 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
4424 0, 0, 0, 0, 188, 189, 0, 0, 0, 0,
4425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4427 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4428 196, 197, 198, 199, 0, 200, 201, 822, 610, 0,
4429 0, 823, 202, 238, 0, 0, 0, 0, 0, 0,
4430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4431 0, 173, 174, 175, 176, 177, 178, 179, 180, 181,
4432 0, 0, 182, 183, 0, 0, 0, 0, 184, 185,
4433 186, 187, 0, 0, 0, 0, 0, 0, 0, 0,
4434 0, 0, 0, 188, 189, 0, 0, 0, 0, 0,
4435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4437 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4438 197, 198, 199, 0, 200, 201, 655, 620, 0, 0,
4439 656, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4440 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4441 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4442 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4443 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4444 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4447 0, 0, 190, 191, 192, 193, 194, 195, 196, 197,
4448 198, 199, 0, 200, 201, 1035, 610, 0, 0, 1036,
4449 202, 238, 0, 0, 0, 0, 0, 0, 0, 0,
4450 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4451 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4452 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4454 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4455 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4457 0, 190, 191, 192, 193, 194, 195, 196, 197, 198,
4458 199, 0, 200, 201, 1038, 620, 0, 0, 1039, 202,
4459 238, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4460 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
4461 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
4462 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
4463 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4464 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
4465 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4467 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
4468 0, 200, 201, 1259, 610, 0, 0, 1260, 202, 238,
4469 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4470 0, 0, 0, 0, 0, 0, 0, 173, 174, 175,
4471 176, 177, 178, 179, 180, 181, 0, 0, 182, 183,
4472 0, 0, 0, 0, 184, 185, 186, 187, 0, 0,
4473 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
4474 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4475 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4476 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
4477 191, 192, 193, 194, 195, 196, 197, 198, 199, 0,
4478 200, 201, 1262, 620, 0, 0, 1263, 202, 238, 0,
4479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4480 0, 0, 0, 0, 0, 0, 173, 174, 175, 176,
4481 177, 178, 179, 180, 181, 0, 0, 182, 183, 0,
4482 0, 0, 0, 184, 185, 186, 187, 0, 0, 0,
4483 0, 0, 0, 0, 0, 0, 0, 0, 188, 189,
4484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4485 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4486 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
4487 192, 193, 194, 195, 196, 197, 198, 199, 0, 200,
4488 201, 1278, 610, 0, 0, 1279, 202, 238, 0, 0,
4489 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4490 0, 0, 0, 0, 0, 173, 174, 175, 176, 177,
4491 178, 179, 180, 181, 0, 0, 182, 183, 0, 0,
4492 0, 0, 184, 185, 186, 187, 0, 0, 0, 0,
4493 0, 0, 0, 0, 0, 0, 0, 188, 189, 0,
4494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4496 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
4497 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
4498 655, 620, 0, 0, 656, 202, 238, 0, 0, 0,
4499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4500 0, 0, 0, 0, 173, 174, 175, 176, 177, 178,
4501 179, 180, 181, 0, 0, 182, 183, 0, 0, 0,
4502 0, 184, 185, 186, 187, 0, 0, 0, 0, 0,
4503 0, 0, 0, 0, 0, 0, 188, 189, 0, 0,
4504 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4506 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
4507 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
4508 0, 0, 0, 0, 202
4509};
4510
4511static const yytype_int16 yycheck[] =
4512{
4513 2, 105, 59, 59, 8, 60, 16, 17, 321, 401,
4514 85, 383, 325, 71, 554, 28, 2, 377, 801, 96,
4515 91, 16, 17, 325, 28, 53, 93, 94, 734, 232,
4516 97, 536, 8, 104, 376, 808, 378, 57, 22, 97,
4517 376, 2, 378, 565, 238, 101, 568, 321, 22, 16,
4518 17, 325, 28, 55, 56, 59, 450, 779, 731, 559,
4519 55, 561, 68, 53, 57, 85, 738, 53, 54, 868,
4520 94, 57, 71, 97, 76, 77, 778, 779, 98, 99,
4521 100, 16, 17, 97, 426, 870, 446, 275, 55, 56,
4522 426, 279, 102, 54, 67, 489, 80, 101, 499, 85,
4523 912, 25, 25, 445, 29, 447, 80, 102, 1047, 445,
4524 263, 447, 98, 99, 100, 101, 658, 659, 13, 1024,
4525 299, 300, 1061, 442, 25, 582, 908, 909, 650, 101,
4526 101, 450, 474, 475, 77, 102, 27, 100, 1202, 475,
4527 77, 501, 101, 1052, 0, 575, 778, 779, 10, 1047,
4528 110, 66, 69, 25, 66, 135, 227, 25, 500, 13,
4529 502, 216, 1071, 1072, 25, 1063, 502, 102, 34, 1181,
4530 34, 52, 135, 162, 241, 56, 243, 157, 579, 13,
4531 100, 98, 142, 155, 212, 256, 52, 340, 52, 157,
4532 731, 162, 155, 725, 162, 625, 155, 738, 13, 124,
4533 25, 631, 734, 633, 25, 120, 68, 265, 120, 284,
4534 1274, 135, 1117, 718, 719, 135, 218, 219, 289, 159,
4535 26, 249, 162, 13, 226, 235, 212, 237, 238, 25,
4536 232, 155, 155, 157, 158, 263, 238, 13, 162, 25,
4537 235, 1207, 237, 238, 152, 247, 1212, 314, 315, 316,
4538 317, 265, 319, 320, 155, 647, 157, 1269, 461, 1071,
4539 1072, 247, 157, 249, 284, 160, 265, 162, 235, 160,
4540 237, 162, 13, 263, 1213, 26, 219, 263, 638, 253,
4541 254, 218, 219, 155, 1066, 1067, 247, 155, 648, 683,
4542 314, 315, 316, 317, 155, 637, 157, 639, 284, 821,
4543 235, 155, 237, 639, 13, 647, 160, 649, 162, 1207,
4544 283, 1110, 340, 649, 1212, 1213, 746, 27, 385, 29,
4545 750, 341, 393, 157, 1109, 25, 160, 313, 162, 387,
4546 155, 13, 318, 400, 155, 514, 338, 516, 1010, 796,
4547 880, 343, 1015, 286, 78, 160, 152, 162, 341, 152,
4548 340, 157, 313, 582, 340, 341, 384, 318, 386, 155,
4549 784, 385, 681, 868, 683, 870, 767, 377, 792, 155,
4550 160, 1093, 162, 387, 378, 377, 876, 877, 672, 809,
4551 13, 881, 812, 883, 160, 885, 162, 13, 1286, 37,
4552 38, 1093, 705, 379, 69, 1178, 826, 58, 384, 100,
4553 386, 152, 100, 705, 378, 1178, 100, 56, 702, 951,
4554 952, 145, 146, 147, 956, 957, 25, 78, 731, 160,
4555 1052, 162, 426, 98, 499, 738, 98, 429, 430, 658,
4556 659, 705, 1064, 161, 135, 135, 446, 135, 440, 1071,
4557 1072, 135, 100, 447, 446, 161, 448, 449, 109, 110,
4558 135, 160, 58, 162, 155, 155, 469, 459, 158, 461,
4559 28, 1093, 162, 155, 986, 469, 669, 153, 787, 1010,
4560 155, 475, 78, 447, 476, 442, 162, 135, 160, 499,
4561 162, 142, 154, 1024, 241, 157, 113, 681, 734, 100,
4562 100, 501, 1024, 469, 1200, 481, 25, 155, 502, 501,
4563 160, 475, 162, 109, 579, 1288, 1028, 113, 566, 697,
4564 1024, 268, 100, 499, 162, 272, 66, 67, 910, 486,
4565 161, 815, 1195, 161, 135, 135, 135, 160, 502, 162,
4566 709, 825, 778, 779, 160, 714, 162, 1079, 66, 852,
4567 542, 135, 972, 903, 155, 975, 155, 135, 978, 158,
4568 852, 100, 554, 162, 564, 985, 100, 567, 988, 579,
4569 902, 100, 904, 640, 274, 275, 902, 155, 904, 279,
4570 576, 281, 122, 123, 632, 1115, 582, 135, 852, 565,
4571 100, 576, 568, 1123, 651, 100, 135, 582, 37, 38,
4572 100, 135, 66, 579, 122, 123, 135, 125, 69, 100,
4573 628, 66, 630, 69, 1109, 1110, 135, 1001, 1281, 100,
4574 982, 1111, 1112, 1113, 1114, 135, 618, 52, 912, 686,
4575 135, 56, 624, 698, 626, 135, 155, 98, 638, 158,
4576 69, 615, 98, 162, 135, 639, 638, 69, 648, 100,
4577 624, 615, 628, 846, 630, 649, 648, 660, 122, 123,
4578 624, 69, 658, 659, 1195, 657, 660, 122, 123, 98,
4579 1182, 1202, 155, 1195, 650, 639, 98, 669, 1200, 1099,
4580 1202, 9, 1204, 657, 135, 649, 1068, 15, 698, 97,
4581 98, 1195, 1001, 657, 660, 157, 1200, 161, 1202, 691,
4582 1204, 69, 767, 56, 155, 452, 161, 1010, 135, 100,
4583 457, 69, 69, 460, 101, 776, 463, 155, 1125, 1126,
4584 1250, 1024, 698, 1085, 681, 100, 690, 691, 1090, 97,
4585 98, 478, 951, 952, 155, 829, 483, 956, 957, 69,
4586 98, 98, 157, 1274, 135, 778, 779, 14, 15, 69,
4587 15, 1241, 1274, 1037, 1276, 69, 157, 767, 69, 1281,
4588 25, 1283, 1046, 820, 155, 1049, 155, 97, 98, 157,
4589 1274, 819, 1276, 162, 155, 78, 1298, 1281, 98, 1283,
4590 158, 162, 828, 97, 98, 1069, 154, 98, 135, 781,
4591 782, 767, 155, 15, 1298, 17, 788, 789, 545, 162,
4592 818, 153, 778, 779, 796, 797, 820, 799, 159, 801,
4593 56, 796, 1174, 157, 1033, 54, 1052, 52, 1238, 54,
4594 55, 56, 57, 58, 154, 64, 65, 157, 1064, 155,
4595 787, 578, 107, 69, 828, 1071, 1072, 69, 1245, 1246,
4596 154, 78, 818, 78, 1251, 821, 1253, 1254, 840, 841,
4597 135, 843, 844, 69, 846, 89, 90, 1093, 135, 78,
4598 1079, 97, 98, 135, 158, 97, 98, 102, 162, 916,
4599 915, 155, 1222, 160, 109, 110, 1160, 1161, 1162, 912,
4600 56, 97, 98, 1290, 1291, 1292, 1293, 26, 880, 1221,
4601 139, 1223, 1195, 135, 1061, 1302, 929, 1223, 598, 1202,
4602 892, 158, 894, 903, 1071, 1072, 135, 142, 900, 25,
4603 904, 903, 83, 84, 971, 155, 1248, 617, 154, 26,
4604 153, 897, 154, 899, 143, 144, 145, 146, 147, 2,
4605 69, 66, 908, 909, 40, 41, 912, 69, 154, 987,
4606 904, 155, 1024, 16, 17, 69, 897, 965, 899, 153,
4607 69, 135, 970, 929, 155, 951, 952, 971, 97, 98,
4608 956, 957, 69, 955, 1200, 97, 98, 138, 139, 961,
4609 155, 1274, 672, 97, 98, 722, 343, 1261, 97, 98,
4610 53, 54, 155, 738, 57, 120, 741, 122, 123, 965,
4611 97, 98, 285, 286, 970, 68, 155, 697, 155, 155,
4612 52, 1058, 702, 155, 52, 997, 153, 1025, 8, 155,
4613 986, 1044, 85, 152, 69, 154, 13, 155, 157, 25,
4614 93, 94, 154, 135, 97, 98, 99, 100, 1061, 102,
4615 154, 17, 26, 161, 161, 154, 44, 1033, 1071, 1072,
4616 155, 2, 97, 98, 1058, 152, 155, 154, 44, 1025,
4617 157, 153, 1028, 44, 155, 16, 17, 155, 135, 44,
4618 1093, 137, 429, 430, 52, 159, 54, 55, 1044, 57,
4619 1088, 1047, 15, 440, 1084, 69, 155, 155, 52, 1097,
4620 827, 448, 449, 1079, 155, 1061, 1062, 1063, 1106, 155,
4621 1066, 1067, 53, 54, 1139, 1071, 1072, 155, 845, 154,
4622 847, 140, 155, 97, 98, 52, 1167, 68, 1084, 476,
4623 140, 1121, 1088, 1195, 102, 815, 153, 1093, 69, 866,
4624 1202, 1097, 1204, 1115, 52, 825, 54, 55, 56, 57,
4625 1106, 1123, 93, 94, 155, 155, 97, 101, 155, 212,
4626 155, 102, 155, 155, 52, 1121, 97, 98, 66, 101,
4627 69, 158, 155, 1171, 69, 1173, 160, 140, 152, 56,
4628 154, 9, 235, 157, 237, 238, 1184, 140, 241, 153,
4629 243, 1228, 1229, 155, 247, 155, 249, 155, 97, 98,
4630 1172, 69, 97, 98, 1194, 155, 1178, 155, 155, 155,
4631 263, 56, 1274, 155, 1276, 1171, 69, 1173, 155, 1281,
4632 121, 1283, 120, 154, 122, 123, 1182, 125, 1184, 97,
4633 98, 284, 912, 913, 1228, 1229, 1298, 155, 1194, 155,
4634 155, 155, 1222, 155, 97, 98, 157, 157, 155, 1223,
4635 1222, 1207, 1224, 247, 1226, 154, 1212, 1213, 66, 154,
4636 313, 314, 315, 316, 317, 318, 319, 320, 1266, 313,
4637 477, 212, 828, 54, 55, 1010, 57, 1012, 1250, 1223,
4638 481, 98, 1017, 64, 65, 100, 154, 340, 341, 1024,
4639 89, 657, 66, 797, 235, 718, 237, 238, 1226, 868,
4640 241, 154, 243, 1119, 1024, 66, 247, 894, 249, 830,
4641 1266, 66, 120, 571, 122, 123, 1288, 125, 59, 60,
4642 61, 62, 263, 1003, 377, 336, 379, 778, 779, 66,
4643 1286, 384, 385, 386, 52, 78, 54, 55, 56, 57,
4644 58, 1288, 1269, 1070, 1024, 1062, 120, 400, 122, 123,
4645 1064, 1064, 95, 96, 1060, 1224, 108, 1037, 1172, 120,
4646 78, 122, 123, 658, 659, 120, 1046, 122, 123, 1049,
4647 778, 779, 313, 314, 315, 316, 317, 318, 319, 320,
4648 675, 676, 516, 120, 102, 122, 123, 101, 734, 1069,
4649 108, 109, 110, 446, 1200, 1195, 731, 692, 1140, 340,
4650 143, 144, 145, 146, 147, 1132, -1, 52, 78, 54,
4651 55, 56, 57, -1, -1, 52, 1143, 54, 55, 56,
4652 57, -1, -1, -1, 142, 95, 96, 145, 481, -1,
4653 1157, 1158, 1159, -1, 781, 782, 377, 1117, 379, 778,
4654 779, 788, 789, 384, 385, 386, 499, -1, 501, -1,
4655 -1, -1, 1187, -1, -1, -1, -1, 908, 909, 400,
4656 1140, 912, -1, -1, -1, 102, 78, 1202, -1, 1204,
4657 140, 141, 142, 143, 144, 145, 146, 147, 929, -1,
4658 1160, 1161, 1162, 95, 96, -1, 52, -1, 54, 55,
4659 56, 57, -1, 840, 841, -1, 843, 844, -1, -1,
4660 908, 909, -1, -1, 912, 446, 40, 41, 42, 43,
4661 44, 564, 565, -1, 567, 568, -1, -1, -1, -1,
4662 -1, 929, -1, 576, -1, -1, 579, -1, -1, 582,
4663 142, 143, 144, 145, 146, 147, 102, -1, -1, 1274,
4664 481, 1276, 108, -1, 778, 779, -1, -1, 1283, -1,
4665 -1, -1, -1, 900, -1, 1235, -1, -1, -1, -1,
4666 501, -1, -1, 1298, -1, -1, -1, -1, -1, 908,
4667 909, -1, -1, 912, -1, 628, -1, 630, -1, -1,
4668 -1, 1261, -1, -1, -1, 638, -1, -1, -1, -1,
4669 929, -1, -1, 1044, -1, 648, 1047, 650, 651, -1,
4670 -1, -1, -1, -1, -1, 658, 659, -1, 955, -1,
4671 1061, 1062, 1063, -1, -1, 1066, 1067, -1, -1, -1,
4672 1071, 1072, -1, 564, 565, -1, 567, 568, -1, -1,
4673 -1, -1, -1, 686, -1, 576, 1044, -1, -1, 1047,
4674 -1, 582, 1093, -1, -1, 698, -1, -1, -1, -1,
4675 997, -1, -1, 1061, 1062, 1063, 951, 952, 1066, 1067,
4676 -1, 956, 957, 1071, 1072, -1, -1, -1, -1, -1,
4677 -1, -1, -1, -1, 908, 909, -1, -1, 912, -1,
4678 -1, -1, -1, -1, -1, 1093, -1, 628, -1, 630,
4679 -1, -1, -1, -1, -1, 929, -1, 638, -1, -1,
4680 995, 996, -1, 998, 999, 1044, -1, 648, 1047, 650,
4681 651, -1, -1, -1, 767, -1, -1, 658, 659, -1,
4682 -1, -1, 1061, 1062, 1063, -1, -1, 1066, 1067, -1,
4683 -1, -1, 1071, 1072, -1, -1, -1, -1, -1, -1,
4684 -1, -1, -1, -1, -1, 686, -1, -1, -1, -1,
4685 -1, -1, -1, -1, 1093, -1, 1207, -1, -1, -1,
4686 -1, 1212, 1213, -1, -1, 818, -1, 820, 821, -1,
4687 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4688 -1, -1, -1, -1, 1079, -1, -1, -1, -1, -1,
4689 -1, 52, -1, 54, 55, 56, 57, 58, -1, 1207,
4690 -1, -1, -1, -1, 1212, 1213, -1, 1102, -1, -1,
4691 1044, -1, -1, 1047, -1, -1, -1, 78, -1, -1,
4692 -1, -1, -1, -1, -1, -1, -1, 1061, 1062, 1063,
4693 -1, 92, 1066, 1067, -1, 1286, -1, 1071, 1072, -1,
4694 -1, 102, -1, -1, 897, -1, 899, -1, 109, 110,
4695 903, -1, -1, -1, -1, -1, -1, -1, -1, 1093,
4696 -1, -1, -1, -1, -1, -1, -1, -1, 1207, 2,
4697 -1, -1, -1, 1212, 1213, -1, -1, 818, 1286, 820,
4698 821, 142, -1, 16, 17, -1, -1, -1, -1, -1,
4699 -1, -1, -1, -1, -1, -1, -1, -1, 951, 952,
4700 -1, -1, -1, 956, 957, -1, -1, -1, -1, -1,
4701 -1, -1, 965, -1, -1, -1, -1, 970, 971, -1,
4702 53, 54, -1, -1, -1, -1, -1, -1, -1, -1,
4703 -1, -1, -1, 986, -1, 68, -1, -1, -1, -1,
4704 -1, -1, -1, -1, 2, -1, -1, 1286, -1, -1,
4705 -1, -1, -1, -1, -1, -1, 897, -1, 899, -1,
4706 93, 94, 903, -1, 97, -1, -1, -1, -1, 102,
4707 -1, -1, 1025, 1207, -1, 1028, -1, -1, 1212, 1213,
4708 1033, 778, 779, -1, -1, -1, -1, -1, -1, -1,
4709 -1, 33, 34, 35, 36, 53, 54, -1, -1, 57,
4710 -1, -1, -1, -1, -1, 1058, -1, 49, 50, 51,
4711 951, 952, -1, -1, -1, 956, 957, 59, 60, 61,
4712 62, 63, -1, -1, 965, -1, 1079, 85, -1, 970,
4713 971, 1084, -1, -1, -1, 1088, -1, -1, -1, -1,
4714 98, 99, 100, -1, 1097, 986, -1, -1, -1, -1,
4715 -1, -1, 1286, 1106, -1, -1, -1, -1, -1, -1,
4716 -1, -1, -1, -1, -1, -1, -1, -1, 1121, 111,
4717 112, 113, 114, 115, 116, 117, 118, 119, -1, 212,
4718 -1, -1, -1, -1, 1025, -1, -1, 1028, -1, -1,
4719 -1, -1, 1033, -1, -1, -1, -1, -1, -1, -1,
4720 56, -1, 235, -1, 237, 238, 148, -1, 241, -1,
4721 243, 908, 909, -1, 247, 912, 249, 1058, 1171, -1,
4722 1173, -1, -1, -1, -1, -1, -1, -1, -1, 1182,
4723 263, 1184, 929, -1, -1, -1, -1, -1, 1079, -1,
4724 -1, 1194, -1, -1, -1, -1, 52, 1088, 54, 55,
4725 56, 57, 58, -1, 212, -1, 1097, -1, -1, -1,
4726 -1, -1, -1, -1, -1, 1106, -1, -1, -1, 1222,
4727 -1, -1, 78, -1, -1, 1228, 1229, -1, 778, 779,
4728 313, 314, 315, 316, 317, 318, 319, 320, -1, 247,
4729 -1, 249, -1, -1, -1, -1, 102, -1, -1, -1,
4730 -1, -1, 108, 109, 110, 263, -1, 340, -1, -1,
4731 -1, -1, -1, 1266, -1, -1, -1, -1, -1, -1,
4732 -1, -1, -1, -1, -1, -1, 284, -1, -1, -1,
4733 1171, -1, 1173, -1, -1, -1, 142, -1, -1, 145,
4734 -1, 1182, -1, 1184, 377, -1, 379, 1044, -1, -1,
4735 1047, 384, 385, 386, 210, 313, 162, 213, 214, 215,
4736 318, -1, -1, -1, 1061, 1062, 1063, 400, -1, 1066,
4737 1067, -1, -1, -1, 1071, 1072, -1, -1, -1, 25,
4738 -1, 1222, 340, 341, -1, -1, -1, 1228, 1229, -1,
4739 -1, -1, -1, -1, 778, 779, 1093, -1, -1, -1,
4740 -1, -1, -1, -1, -1, -1, -1, -1, 908, 909,
4741 -1, -1, 912, 446, -1, -1, -1, -1, -1, -1,
4742 -1, 379, -1, -1, -1, 1266, 384, -1, 386, 929,
4743 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
4744 86, 87, 88, 89, 90, -1, -1, -1, 481, 95,
4745 96, -1, -1, -1, -1, 101, -1, 2, -1, -1,
4746 -1, -1, -1, -1, -1, -1, -1, -1, 501, -1,
4747 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4748 52, -1, 54, 55, 56, 57, 58, -1, -1, -1,
4749 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
4750 146, 147, -1, -1, -1, -1, 78, -1, 53, 54,
4751 1207, -1, 57, -1, -1, 1212, 1213, -1, -1, -1,
4752 92, -1, -1, 481, 908, 909, -1, -1, 912, -1,
4753 102, 564, 565, -1, 567, 568, 108, 109, 110, -1,
4754 85, 499, -1, 576, 1044, 929, -1, 1047, -1, 582,
4755 -1, -1, -1, 98, 99, 100, -1, -1, -1, -1,
4756 -1, 1061, 1062, 1063, -1, -1, 1066, 1067, -1, -1,
4757 142, 1071, 1072, 145, 78, 79, 80, 81, 82, 83,
4758 84, 85, -1, 87, 88, 441, 442, -1, -1, 1286,
4759 -1, 95, 96, 1093, 450, 628, -1, 630, -1, -1,
4760 -1, -1, -1, -1, -1, 638, -1, 565, -1, -1,
4761 568, -1, -1, -1, -1, 648, -1, 650, 651, -1,
4762 -1, 579, -1, -1, 582, 658, 659, 778, 779, -1,
4763 486, -1, -1, 489, 138, 139, 140, 141, 142, 143,
4764 144, 145, 146, 147, -1, -1, -1, -1, -1, -1,
4765 -1, -1, -1, 686, -1, -1, -1, -1, -1, -1,
4766 1044, -1, -1, 1047, -1, -1, -1, 212, -1, -1,
4767 628, -1, 630, -1, -1, -1, -1, 1061, 1062, 1063,
4768 -1, -1, 1066, 1067, -1, -1, -1, 1071, 1072, -1,
4769 -1, -1, 650, -1, -1, -1, 552, -1, -1, -1,
4770 658, 659, 247, -1, 249, -1, -1, 1207, -1, 1093,
4771 -1, -1, 1212, 1213, -1, -1, -1, -1, 263, 2,
4772 576, 778, 779, -1, -1, -1, 582, -1, -1, -1,
4773 -1, -1, -1, -1, -1, -1, -1, -1, -1, 284,
4774 698, -1, -1, -1, -1, -1, -1, -1, -1, 707,
4775 -1, -1, -1, -1, -1, -1, -1, 908, 909, -1,
4776 -1, 912, -1, -1, -1, -1, -1, -1, 313, -1,
4777 53, 54, -1, 318, 57, -1, -1, -1, 929, -1,
4778 -1, -1, -1, -1, -1, 818, 1286, 820, 821, -1,
4779 -1, -1, -1, -1, -1, 340, 341, -1, -1, -1,
4780 -1, -1, 85, -1, -1, 661, -1, -1, -1, 767,
4781 666, -1, -1, -1, -1, 98, 99, 100, -1, -1,
4782 -1, -1, -1, 1207, -1, 681, -1, 683, 1212, 1213,
4783 -1, -1, -1, -1, 379, -1, -1, -1, -1, 384,
4784 -1, 386, -1, -1, -1, -1, -1, -1, -1, -1,
4785 -1, 908, 909, -1, -1, 912, -1, -1, -1, -1,
4786 818, -1, -1, 821, 897, -1, 899, -1, -1, -1,
4787 903, -1, 929, 729, -1, -1, -1, -1, -1, -1,
4788 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4789 -1, -1, -1, 1044, -1, -1, 1047, -1, -1, -1,
4790 -1, -1, 1286, 759, -1, -1, -1, -1, -1, -1,
4791 1061, 1062, 1063, -1, -1, 1066, 1067, -1, 951, 952,
4792 1071, 1072, -1, 956, 957, -1, -1, -1, -1, 212,
4793 -1, 787, 965, -1, -1, -1, 481, 970, 971, 897,
4794 796, 899, 1093, -1, -1, -1, -1, -1, -1, -1,
4795 -1, -1, -1, 986, 499, 811, -1, -1, -1, -1,
4796 -1, -1, -1, -1, 247, -1, 249, -1, -1, -1,
4797 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4798 263, -1, -1, -1, -1, -1, -1, 1044, -1, -1,
4799 1047, -1, 1025, 951, 952, 1028, 2, -1, 956, 957,
4800 1033, 284, -1, -1, 1061, 1062, 1063, 965, -1, 1066,
4801 1067, -1, 970, -1, 1071, 1072, -1, -1, -1, -1,
4802 565, -1, -1, 568, -1, 1058, -1, -1, 986, -1,
4803 313, -1, -1, -1, 579, 318, 1093, 582, -1, -1,
4804 896, -1, -1, -1, -1, -1, 1079, 53, 54, -1,
4805 -1, 57, -1, -1, -1, 1088, 1207, 340, 341, -1,
4806 -1, 1212, 1213, -1, 1097, -1, -1, 1025, -1, -1,
4807 1028, -1, -1, 1106, -1, 1033, -1, -1, -1, 85,
4808 -1, -1, -1, 628, -1, 630, -1, -1, -1, -1,
4809 -1, -1, 98, 99, 100, 101, 379, -1, -1, -1,
4810 -1, 384, -1, 386, -1, 650, -1, -1, -1, -1,
4811 -1, -1, -1, 658, 659, -1, -1, -1, 2, -1,
4812 -1, 1079, -1, -1, 980, -1, 1084, -1, -1, -1,
4813 1088, -1, -1, -1, -1, 1286, -1, -1, 1171, 1097,
4814 1173, -1, -1, -1, -1, 1001, -1, -1, 1106, 1182,
4815 1207, 1184, -1, 698, -1, 1212, 1213, -1, -1, -1,
4816 -1, -1, 52, 1121, 54, 55, 56, 57, 58, 53,
4817 54, -1, -1, 1029, -1, -1, -1, -1, -1, -1,
4818 -1, -1, -1, -1, -1, -1, -1, -1, 78, 1222,
4819 -1, -1, -1, 2, -1, 1228, 1229, -1, 481, -1,
4820 -1, -1, 92, -1, -1, -1, 212, -1, -1, -1,
4821 -1, -1, 102, 1171, 98, 1173, 499, -1, 108, 109,
4822 110, -1, 767, -1, 1182, -1, 1184, -1, -1, 1286,
4823 -1, -1, -1, 1266, -1, -1, 1194, -1, -1, -1,
4824 1096, 247, -1, 249, 53, 54, -1, -1, -1, -1,
4825 -1, -1, 142, -1, -1, 145, -1, 263, -1, -1,
4826 -1, -1, -1, -1, -1, -1, -1, 157, -1, -1,
4827 -1, -1, -1, 818, -1, -1, 821, -1, 284, -1,
4828 -1, -1, 565, -1, -1, 568, -1, -1, -1, -1,
4829 -1, -1, -1, -1, -1, -1, 579, -1, -1, 582,
4830 -1, -1, -1, -1, -1, -1, -1, 313, 1266, -1,
4831 -1, -1, 318, -1, -1, -1, -1, -1, -1, -1,
4832 1176, -1, -1, -1, -1, -1, -1, -1, 212, -1,
4833 -1, -1, -1, -1, 340, 341, -1, -1, -1, -1,
4834 -1, -1, -1, -1, -1, 628, -1, 630, -1, -1,
4835 44, -1, 897, -1, 899, -1, -1, -1, -1, -1,
4836 -1, -1, -1, 247, -1, 249, -1, 650, -1, -1,
4837 -1, -1, -1, 379, -1, 658, 659, -1, 384, 263,
4838 386, -1, -1, -1, 78, 79, 80, 81, 82, 83,
4839 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
4840 -1, 95, 96, 212, -1, -1, 951, 952, -1, -1,
4841 -1, 956, 957, -1, -1, 698, -1, -1, -1, -1,
4842 965, -1, -1, -1, -1, 970, -1, -1, -1, 313,
4843 -1, -1, -1, -1, 318, -1, -1, -1, 247, -1,
4844 249, 986, 136, -1, 138, 139, 140, 141, 142, 143,
4845 144, 145, 146, 147, 263, -1, 340, -1, -1, -1,
4846 -1, 155, -1, -1, -1, -1, -1, -1, -1, -1,
4847 -1, -1, -1, -1, -1, 481, -1, -1, -1, -1,
4848 1025, -1, -1, 1028, 767, -1, -1, -1, 1033, -1,
4849 -1, -1, -1, 499, -1, 379, -1, -1, -1, -1,
4850 384, -1, 386, -1, 313, -1, -1, -1, -1, 318,
4851 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
4852 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
4853 -1, 340, -1, -1, 1079, 818, 95, 96, 821, 1084,
4854 -1, -1, -1, 1088, -1, -1, -1, -1, -1, -1,
4855 -1, -1, 1097, -1, -1, -1, -1, -1, -1, 565,
4856 -1, 1106, 568, -1, -1, -1, -1, -1, -1, -1,
4857 379, -1, -1, 579, -1, 384, 1121, 386, -1, 138,
4858 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
4859 78, 79, 80, 81, 82, 83, 84, 481, -1, 87,
4860 88, -1, -1, -1, -1, -1, -1, 95, 96, -1,
4861 -1, -1, -1, -1, 897, -1, 899, -1, -1, -1,
4862 -1, -1, 628, -1, 630, -1, 1171, -1, 1173, -1,
4863 -1, -1, -1, -1, -1, -1, -1, 1182, -1, 1184,
4864 -1, -1, -1, -1, 650, -1, -1, -1, -1, 1194,
4865 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
4866 -1, -1, -1, -1, -1, -1, -1, -1, 951, 952,
4867 -1, -1, 481, 956, 957, -1, -1, -1, -1, -1,
4868 -1, 565, 965, -1, 568, -1, -1, 970, 44, -1,
4869 -1, -1, 698, -1, -1, -1, -1, -1, 582, -1,
4870 -1, -1, -1, 986, -1, -1, -1, -1, -1, -1,
4871 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4872 -1, 1266, 78, 79, 80, 81, 82, 83, 84, 85,
4873 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
4874 96, -1, 1025, -1, 628, 1028, 630, -1, -1, -1,
4875 1033, -1, -1, -1, -1, -1, 565, -1, -1, 568,
4876 -1, 767, -1, -1, -1, -1, 650, -1, -1, -1,
4877 -1, -1, -1, 582, 658, 659, -1, -1, -1, -1,
4878 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
4879 146, 147, -1, -1, -1, -1, 1079, -1, -1, -1,
4880 -1, 1084, -1, -1, -1, 1088, -1, -1, -1, -1,
4881 -1, -1, 818, -1, 1097, 821, -1, 0, -1, 628,
4882 -1, 630, -1, 1106, -1, 8, 9, 10, 44, -1,
4883 13, 14, 15, -1, 17, -1, -1, -1, 1121, -1,
4884 -1, 650, 25, 26, 27, -1, -1, -1, -1, 658,
4885 659, -1, -1, -1, 37, 38, -1, 40, 41, 42,
4886 43, 44, 78, 79, 80, 81, 82, 83, 84, 85,
4887 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
4888 96, -1, -1, -1, -1, 68, 69, -1, 1171, -1,
4889 1173, 897, -1, 899, -1, -1, -1, -1, -1, 1182,
4890 -1, 1184, -1, -1, -1, 44, -1, -1, -1, -1,
4891 -1, 1194, -1, -1, 97, 98, -1, -1, -1, -1,
4892 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
4893 146, 147, -1, -1, 818, -1, -1, 821, 121, 78,
4894 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4895 89, 90, -1, -1, -1, -1, 95, 96, -1, 965,
4896 -1, -1, -1, -1, 970, -1, -1, -1, -1, 152,
4897 153, -1, -1, -1, 157, 158, -1, 160, -1, 162,
4898 986, -1, -1, 1266, -1, -1, -1, -1, -1, -1,
4899 -1, -1, -1, 16, 17, -1, -1, 136, -1, 138,
4900 139, 140, 141, 142, 143, 144, 145, 146, 147, 818,
4901 -1, -1, 821, 897, -1, 899, -1, -1, -1, 1025,
4902 -1, -1, 1028, -1, -1, 48, 49, 50, 51, -1,
4903 -1, -1, 55, 56, -1, -1, -1, -1, -1, -1,
4904 -1, -1, -1, -1, -1, 68, 69, -1, -1, -1,
4905 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4906 -1, -1, -1, -1, -1, -1, -1, 951, 952, -1,
4907 -1, -1, 956, 957, -1, -1, -1, -1, 1084, 102,
4908 -1, 965, 1088, -1, -1, -1, 970, -1, 897, -1,
4909 899, 1097, -1, -1, -1, -1, -1, -1, -1, -1,
4910 1106, -1, 986, -1, -1, -1, -1, -1, -1, -1,
4911 -1, -1, -1, -1, -1, 1121, -1, -1, -1, -1,
4912 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4913 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4914 -1, 1025, 951, 952, 1028, -1, -1, 956, 957, 1033,
4915 -1, -1, -1, -1, -1, -1, 965, -1, -1, -1,
4916 -1, 970, -1, -1, -1, 1171, -1, 1173, -1, -1,
4917 -1, -1, -1, -1, -1, -1, 1182, 986, 1184, -1,
4918 -1, -1, -1, -1, -1, -1, -1, 210, 1194, -1,
4919 213, 214, 215, -1, 217, 1079, -1, -1, -1, -1,
4920 1084, -1, -1, -1, 1088, -1, -1, -1, -1, -1,
4921 -1, -1, 235, 1097, 237, 238, 1025, -1, -1, 1028,
4922 -1, -1, 1106, -1, 1033, -1, -1, -1, -1, -1,
4923 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4924 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
4925 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
4926 1266, 95, 96, -1, -1, -1, -1, -1, -1, -1,
4927 1079, -1, -1, -1, -1, -1, -1, -1, -1, 1088,
4928 -1, -1, -1, -1, -1, -1, -1, 1171, 1097, 1173,
4929 -1, -1, -1, -1, -1, -1, -1, 1106, 1182, -1,
4930 1184, -1, 136, -1, 138, 139, 140, 141, 142, 143,
4931 144, 145, 146, 147, -1, -1, -1, -1, -1, -1,
4932 -1, -1, 345, 346, 347, 348, 349, -1, 162, 352,
4933 353, 354, 355, 356, 357, 358, 359, -1, 361, -1,
4934 -1, 364, 365, 366, 367, 368, 369, 370, 371, 372,
4935 373, -1, -1, -1, 377, -1, -1, -1, -1, -1,
4936 -1, -1, 1171, -1, 1173, -1, -1, -1, -1, -1,
4937 -1, -1, -1, 1182, -1, 1184, -1, -1, -1, -1,
4938 -1, -1, 1266, -1, -1, -1, -1, -1, -1, -1,
4939 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4940 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4941 -1, -1, -1, -1, -1, -1, -1, -1, 441, 442,
4942 -1, -1, -1, 446, -1, -1, -1, 450, -1, -1,
4943 -1, -1, -1, 456, -1, -1, -1, -1, -1, -1,
4944 -1, -1, -1, -1, -1, -1, -1, -1, 471, -1,
4945 -1, -1, -1, -1, -1, -1, -1, 1266, -1, -1,
4946 -1, -1, -1, 486, -1, -1, 489, -1, -1, -1,
4947 -1, -1, -1, -1, -1, -1, -1, -1, 501, -1,
4948 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4949 -1, -1, -1, -1, -1, 518, -1, -1, -1, -1,
4950 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4951 -1, -1, -1, -1, -1, 0, 1, -1, 3, 4,
4952 5, 6, 7, -1, -1, -1, 11, 12, -1, 552,
4953 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4954 -1, 564, -1, -1, 567, 30, 31, 32, 33, 34,
4955 35, 36, -1, 576, 39, -1, -1, -1, -1, 582,
4956 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
4957 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
4958 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4959 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
4960 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
4961 -1, -1, -1, -1, 99, 638, -1, 102, 103, -1,
4962 105, 106, -1, 108, -1, 648, 111, 112, 113, 114,
4963 115, 116, 117, 118, 119, 658, 659, -1, 661, 662,
4964 663, 664, -1, 666, -1, -1, -1, -1, -1, -1,
4965 -1, -1, 675, 676, -1, -1, -1, -1, 681, -1,
4966 683, -1, -1, 148, 149, 150, -1, -1, -1, 692,
4967 0, -1, -1, -1, -1, 160, -1, 162, 8, 9,
4968 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
4969 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
4970 -1, -1, -1, -1, -1, -1, 729, 37, 38, -1,
4971 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
4972 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4973 -1, -1, -1, -1, -1, -1, 759, -1, 68, 69,
4974 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
4975 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4976 90, -1, -1, -1, 787, 95, 96, 97, 98, -1,
4977 100, 101, -1, 796, -1, -1, -1, 107, -1, -1,
4978 -1, -1, -1, -1, -1, -1, -1, -1, 811, -1,
4979 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
4980 -1, -1, -1, -1, -1, 135, 136, 137, 138, 139,
4981 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
4982 -1, -1, 152, 153, 154, 155, -1, -1, 158, 159,
4983 160, -1, 162, 78, 79, 80, 81, 82, 83, 84,
4984 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
4985 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
4986 -1, -1, -1, 886, 887, -1, 889, 890, -1, -1,
4987 -1, -1, -1, 896, -1, -1, -1, -1, 901, -1,
4988 903, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4989 -1, 136, -1, 138, 139, 140, 141, 142, 143, 144,
4990 145, 146, 147, -1, -1, -1, -1, -1, -1, -1,
4991 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4992 -1, -1, -1, -1, -1, -1, -1, 950, 951, 952,
4993 -1, -1, -1, 956, 957, -1, -1, -1, -1, -1,
4994 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4995 -1, -1, -1, -1, 0, -1, -1, 980, -1, -1,
4996 -1, -1, 8, 9, 10, -1, -1, 13, 14, 15,
4997 -1, 17, 995, 996, -1, 998, 999, -1, 1001, 25,
4998 -1, 27, 28, 29, -1, -1, -1, -1, -1, -1,
4999 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5000 -1, -1, -1, -1, -1, -1, 1029, -1, -1, -1,
5001 1033, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5002 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5003 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5004 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5005 96, 97, 98, -1, 100, 101, 1079, -1, -1, -1,
5006 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5007 -1, -1, -1, 1096, -1, 121, -1, -1, 124, 1102,
5008 -1, -1, -1, -1, -1, -1, -1, -1, -1, 135,
5009 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5010 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
5011 -1, -1, 158, 159, 160, -1, 162, -1, -1, -1,
5012 -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
5013 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5014 -1, -1, -1, -1, -1, -1, -1, 25, -1, 27,
5015 28, 29, -1, 1176, -1, -1, -1, -1, -1, 37,
5016 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5017 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5018 88, 89, 90, -1, -1, -1, -1, 95, 96, -1,
5019 68, 69, -1, -1, -1, -1, -1, -1, -1, 1222,
5020 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5021 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5022 98, -1, 100, 101, -1, -1, -1, -1, -1, 107,
5023 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5024 -1, -1, -1, 121, -1, -1, 124, -1, -1, -1,
5025 -1, -1, -1, -1, -1, -1, -1, 135, 136, 137,
5026 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5027 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5028 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5029 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5030 -1, -1, -1, 25, 26, 27, 28, 29, -1, -1,
5031 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5032 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5033 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5034 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5035 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5036 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5037 -1, -1, -1, 95, 96, 97, 98, -1, -1, 101,
5038 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
5039 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5040 -1, -1, 124, -1, -1, -1, -1, -1, -1, -1,
5041 -1, -1, -1, -1, 136, 137, 138, 139, 140, 141,
5042 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5043 152, 153, 154, 155, 0, -1, 158, 159, 160, -1,
5044 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5045 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5046 26, 27, 28, 29, -1, -1, -1, -1, -1, -1,
5047 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5048 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5049 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5050 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5051 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5052 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5053 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5054 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5055 -1, -1, -1, -1, -1, 121, -1, -1, 124, -1,
5056 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5057 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
5058 146, 147, -1, -1, -1, -1, 152, 153, 154, 155,
5059 0, -1, 158, 159, 160, -1, 162, -1, 8, 9,
5060 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
5061 -1, -1, -1, -1, -1, 25, -1, 27, 28, 29,
5062 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5063 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
5064 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5065 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
5066 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5067 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5068 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5069 100, 101, -1, -1, -1, -1, -1, 107, -1, -1,
5070 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5071 -1, 121, -1, -1, 124, -1, -1, -1, -1, -1,
5072 -1, -1, -1, -1, -1, 135, 136, 137, 138, 139,
5073 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5074 -1, -1, -1, 153, 154, 155, 0, -1, 158, 159,
5075 160, -1, 162, -1, 8, 9, 10, -1, -1, 13,
5076 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5077 -1, 25, 26, 27, 28, -1, -1, -1, -1, -1,
5078 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5079 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5080 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5081 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5082 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5083 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5084 -1, 95, 96, 97, 98, -1, -1, 101, -1, -1,
5085 -1, -1, -1, 107, -1, -1, -1, -1, -1, -1,
5086 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5087 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5088 -1, -1, 136, -1, 138, 139, 140, 141, 142, 143,
5089 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
5090 154, 155, 0, 157, 158, 159, 160, -1, 162, -1,
5091 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
5092 -1, -1, -1, -1, -1, -1, -1, 25, -1, 27,
5093 28, 29, -1, -1, -1, -1, -1, -1, -1, 37,
5094 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5095 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5096 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5097 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5098 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5099 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5100 98, -1, -1, 101, -1, -1, -1, -1, -1, 107,
5101 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5102 -1, -1, -1, 121, -1, -1, 124, -1, -1, -1,
5103 -1, -1, -1, -1, -1, -1, -1, -1, 136, 137,
5104 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5105 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5106 158, 159, 160, -1, 162, -1, 8, 9, 10, -1,
5107 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
5108 -1, -1, -1, 25, 26, 27, 28, -1, -1, -1,
5109 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5110 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5111 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5112 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5113 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5114 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5115 -1, -1, -1, 95, 96, 97, 98, -1, -1, 101,
5116 -1, -1, -1, -1, -1, 107, -1, -1, -1, -1,
5117 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5118 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5119 -1, -1, -1, -1, 136, -1, 138, 139, 140, 141,
5120 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5121 152, 153, 154, 155, 0, 157, 158, 159, 160, -1,
5122 162, -1, 8, 9, 10, -1, -1, 13, 14, 15,
5123 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
5124 -1, 27, 28, -1, -1, -1, -1, -1, -1, -1,
5125 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
5126 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5127 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5128 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
5129 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
5130 86, 87, 88, 89, 90, -1, -1, -1, -1, 95,
5131 96, 97, 98, -1, -1, 101, -1, -1, -1, -1,
5132 -1, 107, -1, -1, -1, -1, -1, -1, -1, -1,
5133 -1, -1, -1, -1, -1, 121, -1, -1, -1, -1,
5134 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5135 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5136 146, 147, -1, -1, -1, -1, -1, 153, 154, 155,
5137 0, 157, 158, 159, 160, -1, 162, -1, 8, 9,
5138 10, -1, -1, -1, 14, 15, -1, 17, -1, -1,
5139 -1, -1, -1, -1, -1, 25, 26, -1, -1, -1,
5140 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
5141 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
5142 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5143 -1, -1, -1, -1, -1, -1, -1, -1, 68, 69,
5144 -1, -1, -1, -1, -1, -1, -1, -1, 78, 79,
5145 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
5146 90, -1, -1, -1, -1, 95, 96, 97, 98, -1,
5147 100, 101, -1, -1, -1, -1, -1, -1, -1, -1,
5148 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5149 -1, 121, -1, -1, -1, -1, -1, -1, -1, -1,
5150 -1, -1, -1, -1, -1, 135, 136, -1, 138, 139,
5151 140, 141, 142, 143, 144, 145, 146, 147, -1, -1,
5152 -1, -1, 152, 153, 154, 155, 0, -1, 158, -1,
5153 160, -1, 162, -1, 8, 9, 10, -1, -1, -1,
5154 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
5155 -1, 25, 26, -1, -1, -1, -1, -1, -1, -1,
5156 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
5157 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5158 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5159 -1, -1, -1, -1, 68, 69, -1, -1, -1, -1,
5160 -1, -1, -1, -1, 78, 79, 80, 81, 82, 83,
5161 84, 85, 86, 87, 88, 89, 90, -1, -1, -1,
5162 -1, 95, 96, 97, 98, -1, 100, 101, -1, -1,
5163 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5164 -1, -1, -1, -1, -1, -1, -1, 121, -1, -1,
5165 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5166 -1, 135, 136, -1, 138, 139, 140, 141, 142, 143,
5167 144, 145, 146, 147, -1, -1, -1, -1, 152, 153,
5168 154, 155, 0, -1, 158, -1, 160, -1, 162, -1,
5169 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
5170 -1, -1, -1, -1, -1, -1, -1, 25, -1, -1,
5171 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
5172 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
5173 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5174 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5175 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
5176 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
5177 88, 89, 90, -1, -1, -1, -1, 95, 96, 97,
5178 98, -1, 100, 101, -1, -1, -1, -1, -1, -1,
5179 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5180 -1, -1, -1, 121, -1, -1, -1, -1, -1, -1,
5181 -1, -1, -1, -1, -1, -1, -1, 135, 136, -1,
5182 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5183 -1, -1, -1, -1, -1, 153, 154, 155, 0, -1,
5184 158, -1, 160, -1, 162, -1, 8, 9, 10, -1,
5185 -1, -1, 14, 15, -1, 17, -1, -1, -1, -1,
5186 -1, -1, -1, 25, -1, -1, -1, -1, -1, -1,
5187 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
5188 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
5189 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5190 -1, -1, -1, -1, -1, -1, 68, 69, -1, -1,
5191 -1, -1, -1, -1, -1, -1, 78, 79, 80, 81,
5192 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
5193 -1, -1, -1, 95, 96, 97, 98, -1, 100, 101,
5194 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5195 -1, -1, -1, -1, -1, -1, -1, -1, -1, 121,
5196 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5197 -1, -1, -1, 135, 136, -1, 138, 139, 140, 141,
5198 142, 143, 144, 145, 146, 147, -1, -1, -1, -1,
5199 -1, 153, 154, 155, -1, -1, 158, -1, 160, 1,
5200 162, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5201 12, -1, -1, 15, 16, -1, 18, 19, 20, 21,
5202 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
5203 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5204 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5205 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5206 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5207 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5208 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5209 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5210 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5211 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5212 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5213 10, 11, 12, -1, 14, 15, 16, -1, 18, 19,
5214 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5215 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5216 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5217 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5218 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5219 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5220 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5221 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5222 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5223 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5224 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5225 -1, -1, 10, 11, 12, -1, -1, 15, 16, 17,
5226 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5227 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5228 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5229 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5230 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5231 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5232 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5233 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5234 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5235 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5236 118, 119, -1, -1, -1, 1, -1, 3, 4, 5,
5237 6, 7, -1, -1, 10, 11, 12, -1, -1, 15,
5238 16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
5239 148, 149, 150, -1, 30, 31, 32, 33, 34, 35,
5240 36, -1, 160, 39, 162, -1, -1, -1, -1, 45,
5241 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5242 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5243 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
5244 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5245 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5246 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5247 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5248 116, 117, 118, 119, -1, -1, -1, 1, -1, 3,
5249 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
5250 -1, 15, 16, -1, 18, 19, 20, 21, 22, 23,
5251 24, -1, 148, 149, 150, -1, 30, 31, 32, 33,
5252 34, 35, 36, -1, 160, 39, 162, -1, -1, -1,
5253 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5254 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5255 64, 65, -1, -1, 68, -1, -1, -1, -1, -1,
5256 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5257 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5258 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5259 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5260 114, 115, 116, 117, 118, 119, -1, -1, -1, 1,
5261 -1, 3, 4, 5, 6, 7, -1, 9, 10, 11,
5262 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5263 22, 23, 24, -1, 148, 149, 150, -1, 30, 31,
5264 32, 33, 34, 35, 36, -1, 160, 39, 162, -1,
5265 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5266 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5267 62, 63, 64, 65, -1, -1, 68, -1, -1, -1,
5268 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5269 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5270 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5271 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5272 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5273 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5274 10, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5275 20, 21, 22, 23, 24, -1, 148, 149, 150, -1,
5276 30, 31, 32, 33, 34, 35, 36, -1, 160, 39,
5277 162, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5278 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5279 60, 61, 62, 63, 64, 65, -1, -1, 68, -1,
5280 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5281 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5282 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5283 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5284 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5285 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5286 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5287 18, 19, 20, 21, 22, 23, 24, -1, 148, 149,
5288 150, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5289 160, 39, 162, -1, -1, -1, -1, 45, 46, 47,
5290 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5291 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5292 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5293 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5294 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5295 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5296 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5297 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5298 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5299 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5300 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5301 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5302 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5303 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5304 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5305 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5306 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5307 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5308 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5310 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5311 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5312 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5313 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5314 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5315 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5316 148, 149, 150, -1, -1, -1, -1, -1, -1, -1,
5317 158, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5318 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5319 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5320 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5321 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5322 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5323 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5324 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5326 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5327 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5328 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5329 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5330 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5332 148, 149, 150, -1, -1, 153, -1, -1, -1, -1,
5333 -1, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5334 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5335 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5336 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5337 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5338 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5339 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5340 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5341 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5342 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5343 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5344 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5345 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5346 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5347 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5348 148, 149, 150, -1, -1, 153, -1, -1, -1, -1,
5349 -1, -1, 160, 1, 162, 3, 4, 5, 6, 7,
5350 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5351 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5352 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5353 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5354 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5355 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5356 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5357 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5358 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5359 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5360 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5361 118, 119, -1, 121, -1, 1, -1, 3, 4, 5,
5362 6, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5363 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5364 148, 149, 150, -1, 30, 31, 32, 33, 34, 35,
5365 36, -1, 160, 39, 162, -1, -1, -1, -1, 45,
5366 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
5367 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5368 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5369 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5370 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5371 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5372 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5373 116, 117, 118, 119, -1, -1, 1, -1, 3, 4,
5374 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5375 -1, 16, 17, 18, 19, 20, 21, 22, 23, 24,
5376 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
5377 35, 36, 158, -1, 39, -1, 162, -1, -1, -1,
5378 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5379 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5380 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5381 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5382 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5383 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5384 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5385 115, 116, 117, 118, 119, -1, -1, 0, 1, -1,
5386 3, 4, 5, 6, 7, -1, -1, -1, 11, 12,
5387 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5388 23, 24, -1, 148, 149, 150, -1, 30, 31, 32,
5389 33, 34, 35, 36, -1, 160, 39, 162, -1, -1,
5390 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5391 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5392 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5393 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5394 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5395 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5396 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
5397 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5398 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5399 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5400 -1, -1, -1, -1, -1, 148, 149, 150, -1, -1,
5401 153, -1, -1, -1, -1, -1, 1, 160, 3, 4,
5402 5, 6, 7, 8, 9, 10, 11, 12, -1, 14,
5403 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
5404 25, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5405 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5406 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
5407 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5408 65, -1, -1, 68, -1, -1, -1, -1, -1, -1,
5409 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5410 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5411 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5412 105, 106, -1, 108, -1, -1, 111, 112, 113, 114,
5413 115, 116, 117, 118, 119, -1, 121, -1, -1, -1,
5414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5415 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5416 -1, -1, -1, 148, 149, 150, -1, -1, 153, -1,
5417 3, 4, 5, 158, 7, 160, -1, -1, 11, 12,
5418 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5419 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5420 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5421 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5422 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5423 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5424 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5425 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5426 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5427 103, -1, 105, 106, -1, 108, 109, 110, 111, 112,
5428 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5429 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
5430 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5431 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
5432 32, 33, 34, 35, 36, -1, -1, 39, -1, 162,
5433 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
5434 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5435 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5436 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5437 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5438 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5439 102, 103, -1, 105, 106, -1, -1, -1, -1, 111,
5440 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5441 -1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
5442 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
5443 21, 22, 23, 24, 25, 26, 148, 149, 150, 30,
5444 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
5445 162, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5446 51, 52, 53, 54, 55, 56, 57, -1, -1, -1,
5447 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5448 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
5449 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
5450 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
5451 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
5452 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5453 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5454 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
5455 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
5456 -1, -1, -1, -1, -1, 156, 157, 3, 4, 5,
5457 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
5458 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
5459 26, -1, -1, -1, 30, 31, 32, 33, 34, 35,
5460 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
5461 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
5462 56, 57, -1, -1, -1, -1, -1, -1, -1, -1,
5463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5464 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
5465 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
5466 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5467 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
5468 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5469 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5470 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5471 146, 147, -1, 149, 150, -1, -1, -1, -1, -1,
5472 156, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5473 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
5474 22, 23, 24, 25, 26, -1, -1, -1, 30, 31,
5475 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
5476 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5477 52, 53, 54, -1, 56, -1, -1, -1, -1, -1,
5478 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5479 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
5480 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
5481 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
5482 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
5483 112, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5484 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5485 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
5486 142, 143, 144, 145, 146, 147, -1, 149, 150, -1,
5487 -1, -1, -1, -1, 156, 3, 4, 5, 6, 7,
5488 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
5489 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
5490 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
5491 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5492 48, 49, 50, 51, 52, 53, -1, -1, 56, -1,
5493 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5494 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5495 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5496 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5497 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5498 108, 109, -1, -1, 112, -1, -1, -1, -1, -1,
5499 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5500 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5501 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5502 -1, 149, 150, -1, -1, -1, -1, -1, 156, 3,
5503 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
5504 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
5505 24, 25, 26, -1, -1, -1, 30, 31, 32, 33,
5506 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
5507 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5508 -1, -1, 56, -1, -1, -1, -1, -1, -1, -1,
5509 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5510 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
5511 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
5512 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
5513 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
5514 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5515 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5516 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
5517 144, 145, 146, 147, -1, 149, 150, 3, 4, 5,
5518 -1, 7, 156, -1, -1, 11, 12, -1, -1, -1,
5519 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5520 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
5521 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5522 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5523 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5524 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5525 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5526 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5527 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5528 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
5529 116, 117, 118, 119, -1, -1, -1, -1, -1, -1,
5530 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5531 -1, -1, -1, -1, -1, 3, 4, 5, -1, 7,
5532 -1, -1, 148, 11, 12, -1, -1, -1, 16, 155,
5533 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5534 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5535 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5536 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5537 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5538 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5540 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5541 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5542 -1, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5543 118, 119, -1, -1, -1, -1, -1, -1, -1, -1,
5544 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5545 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
5546 148, 11, 12, -1, -1, -1, 16, 155, 18, 19,
5547 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
5548 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5549 -1, -1, -1, -1, -1, 45, 46, -1, 48, 49,
5550 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5551 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5552 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5553 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5554 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5555 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5556 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5557 -1, -1, 1, -1, 3, 4, 5, -1, 7, -1,
5558 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5559 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
5560 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5561 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5562 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5563 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5564 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
5565 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5566 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
5567 99, -1, -1, 102, 103, -1, 105, 106, -1, -1,
5568 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
5569 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
5570 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5571 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
5572 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
5573 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5574 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5575 58, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5576 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5577 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5578 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5579 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5580 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
5581 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
5582 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5583 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5584 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
5585 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5586 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5587 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
5588 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
5589 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5590 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
5591 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
5592 -1, 108, 109, 110, 111, 112, 113, 114, 115, 116,
5593 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
5594 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5595 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5596 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
5597 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5598 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5599 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5600 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5601 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5602 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5603 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5604 106, -1, 108, 109, 110, 111, 112, 113, 114, 115,
5605 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
5606 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5607 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5608 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
5609 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5610 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5611 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
5612 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5613 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5614 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5615 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5616 105, 106, -1, 108, 109, 110, 111, 112, 113, 114,
5617 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
5618 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
5619 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
5620 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
5621 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5622 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5623 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
5624 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5625 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5626 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5627 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5628 -1, 105, 106, -1, 108, 109, -1, 111, 112, 113,
5629 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5630 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5631 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5632 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
5633 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5634 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5635 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5636 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5637 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5638 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5639 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5640 103, -1, 105, 106, -1, -1, 109, 110, 111, 112,
5641 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5642 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
5643 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5644 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
5645 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5646 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
5647 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
5648 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5649 -1, -1, -1, -1, 76, 77, -1, -1, -1, -1,
5650 -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
5651 92, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5652 102, 103, -1, 105, 106, -1, 108, 109, -1, 111,
5653 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5654 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5655 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
5656 21, 22, 23, 24, -1, -1, 148, 149, 150, 30,
5657 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5658 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5659 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
5660 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5661 -1, -1, -1, -1, -1, 76, 77, -1, -1, -1,
5662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5663 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
5664 -1, 102, 103, -1, 105, 106, -1, -1, 109, -1,
5665 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
5666 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
5667 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5668 20, 21, 22, 23, 24, -1, -1, 148, 149, 150,
5669 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5670 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
5671 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5672 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5673 -1, -1, -1, -1, -1, -1, 76, 77, -1, -1,
5674 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5675 -1, 91, 92, -1, -1, -1, -1, -1, -1, 99,
5676 -1, -1, 102, 103, -1, 105, 106, -1, 108, -1,
5677 -1, 111, 112, 113, 114, 115, 116, 117, 118, 119,
5678 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5679 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5680 19, 20, 21, 22, 23, 24, -1, -1, 148, 149,
5681 150, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5682 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5683 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5684 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5685 -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,
5686 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5687 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
5688 99, -1, -1, 102, 103, -1, 105, 106, -1, 108,
5689 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118,
5690 119, -1, -1, -1, -1, 3, 4, 5, -1, 7,
5691 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5692 18, 19, 20, 21, 22, 23, 24, -1, -1, 148,
5693 149, 150, 30, 31, 32, 33, 34, 35, 36, -1,
5694 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5695 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5696 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5697 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5698 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5699 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5700 -1, 99, -1, -1, 102, 103, -1, 105, 106, -1,
5701 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5702 118, 119, -1, -1, -1, -1, 3, 4, 5, -1,
5703 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5704 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5705 148, 149, 150, 30, 31, 32, 33, 34, 35, 36,
5706 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5707 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5708 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5709 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
5710 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5711 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
5712 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
5713 -1, 108, -1, -1, 111, 112, 113, 114, 115, 116,
5714 117, 118, 119, -1, -1, -1, -1, 3, 4, 5,
5715 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5716 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5717 -1, 148, 149, 150, 30, 31, 32, 33, 34, 35,
5718 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5719 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5720 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5721 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5722 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
5723 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
5724 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5725 106, -1, 108, -1, -1, 111, 112, 113, 114, 115,
5726 116, 117, 118, 119, -1, -1, -1, -1, 3, 4,
5727 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5728 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5729 -1, -1, 148, 149, 150, 30, 31, 32, 33, 34,
5730 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5731 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5732 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5733 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5734 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
5735 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5736 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5737 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5738 115, 116, 117, 118, 119, -1, -1, -1, -1, 3,
5739 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
5740 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
5741 24, -1, -1, 148, 149, 150, 30, 31, 32, 33,
5742 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5743 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5744 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5745 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5746 -1, -1, 76, 77, -1, -1, -1, -1, -1, -1,
5747 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5748 -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
5749 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
5750 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5751 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5752 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5753 23, 24, -1, -1, 148, 149, 150, 30, 31, 32,
5754 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5755 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5756 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5757 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5758 -1, -1, -1, 76, 77, -1, -1, -1, -1, -1,
5759 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
5760 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5761 103, -1, 105, 106, -1, -1, -1, -1, 111, 112,
5762 113, 114, 115, 116, 117, 118, 119, -1, -1, -1,
5763 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
5764 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
5765 22, 23, 24, -1, -1, 148, 149, 150, 30, 31,
5766 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5767 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
5768 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5769 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5770 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5771 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5772 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
5773 102, 103, -1, 105, 106, -1, 108, -1, -1, 111,
5774 112, 113, 114, 115, 116, 117, 118, 119, -1, -1,
5775 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5776 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5777 23, 24, -1, -1, -1, -1, 148, 30, 31, 32,
5778 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5779 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5780 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5781 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5782 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5783 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5784 -1, -1, -1, -1, -1, -1, 99, -1, -1, 102,
5785 103, -1, 105, 106, -1, 108, -1, -1, 111, 112,
5786 113, 114, 115, 116, 117, 118, 119, -1, -1, 3,
5787 4, 5, -1, 7, -1, -1, -1, 11, 12, -1,
5788 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
5789 24, -1, -1, -1, -1, 148, 30, 31, 32, 33,
5790 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5791 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5792 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5793 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5794 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5795 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5796 -1, 95, -1, -1, -1, 99, -1, -1, 102, 103,
5797 -1, 105, 106, -1, -1, -1, -1, 111, 112, 113,
5798 114, 115, 116, 117, 118, 119, -1, -1, 3, 4,
5799 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5800 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5801 -1, -1, -1, -1, 148, 30, 31, 32, 33, 34,
5802 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5803 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5804 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5805 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5806 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5807 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5808 -1, -1, -1, -1, 99, -1, -1, 102, 103, -1,
5809 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5810 115, 116, 117, 118, 119, -1, -1, 3, 4, 5,
5811 -1, 7, -1, -1, -1, 11, 12, -1, -1, -1,
5812 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
5813 -1, -1, -1, 148, 30, 31, 32, 33, 34, 35,
5814 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5815 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5816 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
5817 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5818 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5819 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5820 -1, -1, -1, 99, -1, -1, 102, 103, -1, 105,
5821 106, -1, -1, -1, -1, 111, 112, 113, 114, 115,
5822 116, 117, 118, 119, -1, -1, 3, 4, 5, -1,
5823 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5824 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5825 -1, -1, 148, 30, 31, 32, 33, 34, 35, 36,
5826 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5827 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5828 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5829 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5830 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5831 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5832 -1, -1, 99, -1, -1, 102, 103, -1, 105, 106,
5833 -1, -1, -1, -1, 111, 112, 113, 114, 115, 116,
5834 117, 118, 119, -1, -1, 3, 4, 5, -1, 7,
5835 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
5836 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5837 -1, 148, 30, 31, 32, 33, 34, 35, 36, -1,
5838 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
5839 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5840 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5841 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5842 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5843 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5844 -1, 99, -1, -1, 102, 103, -1, 105, 106, 33,
5845 34, 35, 36, 111, 112, 113, 114, 115, 116, 117,
5846 118, 119, -1, -1, -1, 49, 50, 51, 52, -1,
5847 -1, -1, 56, -1, -1, 59, 60, 61, 62, 63,
5848 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5849 148, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5850 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
5851 -1, -1, -1, -1, -1, 99, -1, -1, 102, -1,
5852 -1, 105, 106, -1, 108, -1, -1, 111, 112, 113,
5853 114, 115, 116, 117, 118, 119, -1, -1, -1, -1,
5854 -1, -1, 33, 34, 35, 36, -1, -1, -1, -1,
5855 -1, -1, -1, -1, -1, -1, -1, 141, 49, 50,
5856 51, 52, -1, -1, 148, 56, -1, 58, 59, 60,
5857 61, 62, 63, -1, -1, -1, -1, -1, 162, -1,
5858 -1, -1, -1, -1, -1, -1, -1, 78, -1, -1,
5859 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5860 91, 92, -1, -1, -1, -1, -1, -1, 99, -1,
5861 -1, 102, -1, -1, 105, 106, -1, 108, 109, -1,
5862 111, 112, 113, 114, 115, 116, 117, 118, 119, -1,
5863 -1, -1, -1, -1, -1, 33, 34, 35, 36, -1,
5864 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5865 141, 49, 50, 51, 52, -1, -1, 148, 56, -1,
5866 -1, 59, 60, 61, 62, 63, -1, -1, -1, -1,
5867 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5868 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5869 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
5870 -1, 99, -1, -1, 102, -1, -1, 105, 106, -1,
5871 108, -1, -1, 111, 112, 113, 114, 115, 116, 117,
5872 118, 119, -1, -1, -1, -1, -1, -1, 33, 34,
5873 35, 36, -1, -1, -1, 52, 53, -1, -1, 56,
5874 -1, -1, -1, 141, 49, 50, 51, 52, -1, -1,
5875 148, 56, -1, -1, 59, 60, 61, 62, 63, 76,
5876 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
5877 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
5878 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
5879 -1, 108, 109, -1, 99, -1, -1, 102, -1, -1,
5880 105, 106, -1, -1, -1, -1, 111, 112, 113, 114,
5881 115, 116, 117, 118, 119, -1, -1, -1, -1, -1,
5882 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5883 147, -1, 149, 150, 52, 53, 141, -1, 56, 156,
5884 157, -1, -1, 148, -1, -1, -1, -1, -1, -1,
5885 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5886 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5887 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5888 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5889 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
5890 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5891 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5892 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5893 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
5894 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5895 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
5896 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
5897 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
5898 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
5899 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5900 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5901 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
5902 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
5903 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
5904 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5905 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
5906 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
5907 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
5908 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
5909 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5910 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5911 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
5912 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
5913 150, 52, 53, -1, -1, 56, 156, 157, -1, -1,
5914 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5915 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
5916 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
5917 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
5918 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
5919 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5920 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5921 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
5922 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
5923 52, 53, -1, -1, 56, 156, 157, -1, -1, -1,
5924 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5925 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
5926 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
5927 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
5928 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
5929 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5930 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5931 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
5932 142, 143, 144, 145, 146, 147, -1, 149, 150, 52,
5933 53, -1, -1, 56, 156, 157, -1, -1, -1, -1,
5934 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5935 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
5936 83, 84, -1, -1, 87, 88, -1, -1, -1, -1,
5937 93, 94, 95, 96, -1, -1, -1, -1, -1, -1,
5938 -1, -1, -1, -1, -1, 108, 109, -1, -1, -1,
5939 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5940 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5941 -1, -1, -1, -1, -1, 138, 139, 140, 141, 142,
5942 143, 144, 145, 146, 147, -1, 149, 150, 52, 53,
5943 -1, -1, 56, 156, 157, -1, -1, -1, -1, -1,
5944 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5945 -1, -1, 76, 77, 78, 79, 80, 81, 82, 83,
5946 84, -1, -1, 87, 88, -1, -1, -1, -1, 93,
5947 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
5948 -1, -1, -1, -1, 108, 109, -1, -1, -1, -1,
5949 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5950 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5951 -1, -1, -1, -1, 138, 139, 140, 141, 142, 143,
5952 144, 145, 146, 147, -1, 149, 150, 52, 53, -1,
5953 -1, 56, 156, 157, -1, -1, -1, -1, -1, -1,
5954 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5955 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
5956 -1, -1, 87, 88, -1, -1, -1, -1, 93, 94,
5957 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
5958 -1, -1, -1, 108, 109, -1, -1, -1, -1, -1,
5959 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5960 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5961 -1, -1, -1, 138, 139, 140, 141, 142, 143, 144,
5962 145, 146, 147, -1, 149, 150, 52, 53, -1, -1,
5963 56, 156, 157, -1, -1, -1, -1, -1, -1, -1,
5964 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5965 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
5966 -1, 87, 88, -1, -1, -1, -1, 93, 94, 95,
5967 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5968 -1, -1, 108, 109, -1, -1, -1, -1, -1, -1,
5969 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5970 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5971 -1, -1, 138, 139, 140, 141, 142, 143, 144, 145,
5972 146, 147, -1, 149, 150, 52, 53, -1, -1, 56,
5973 156, 157, -1, -1, -1, -1, -1, -1, -1, -1,
5974 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
5975 77, 78, 79, 80, 81, 82, 83, 84, -1, -1,
5976 87, 88, -1, -1, -1, -1, 93, 94, 95, 96,
5977 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5978 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
5979 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5980 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5981 -1, 138, 139, 140, 141, 142, 143, 144, 145, 146,
5982 147, -1, 149, 150, 52, 53, -1, -1, 56, 156,
5983 157, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5984 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
5985 78, 79, 80, 81, 82, 83, 84, -1, -1, 87,
5986 88, -1, -1, -1, -1, 93, 94, 95, 96, -1,
5987 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5988 108, 109, -1, -1, -1, -1, -1, -1, -1, -1,
5989 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5990 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5991 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
5992 -1, 149, 150, 52, 53, -1, -1, 56, 156, 157,
5993 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5994 -1, -1, -1, -1, -1, -1, -1, 76, 77, 78,
5995 79, 80, 81, 82, 83, 84, -1, -1, 87, 88,
5996 -1, -1, -1, -1, 93, 94, 95, 96, -1, -1,
5997 -1, -1, -1, -1, -1, -1, -1, -1, -1, 108,
5998 109, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5999 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6000 -1, -1, -1, -1, -1, -1, -1, -1, -1, 138,
6001 139, 140, 141, 142, 143, 144, 145, 146, 147, -1,
6002 149, 150, 52, 53, -1, -1, 56, 156, 157, -1,
6003 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6004 -1, -1, -1, -1, -1, -1, 76, 77, 78, 79,
6005 80, 81, 82, 83, 84, -1, -1, 87, 88, -1,
6006 -1, -1, -1, 93, 94, 95, 96, -1, -1, -1,
6007 -1, -1, -1, -1, -1, -1, -1, -1, 108, 109,
6008 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6009 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6010 -1, -1, -1, -1, -1, -1, -1, -1, 138, 139,
6011 140, 141, 142, 143, 144, 145, 146, 147, -1, 149,
6012 150, 52, 53, -1, -1, 56, 156, 157, -1, -1,
6013 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6014 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
6015 81, 82, 83, 84, -1, -1, 87, 88, -1, -1,
6016 -1, -1, 93, 94, 95, 96, -1, -1, -1, -1,
6017 -1, -1, -1, -1, -1, -1, -1, 108, 109, -1,
6018 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6019 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6020 -1, -1, -1, -1, -1, -1, -1, 138, 139, 140,
6021 141, 142, 143, 144, 145, 146, 147, -1, 149, 150,
6022 52, 53, -1, -1, 56, 156, 157, -1, -1, -1,
6023 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6024 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
6025 82, 83, 84, -1, -1, 87, 88, -1, -1, -1,
6026 -1, 93, 94, 95, 96, -1, -1, -1, -1, -1,
6027 -1, -1, -1, -1, -1, -1, 108, 109, -1, -1,
6028 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6029 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
6030 -1, -1, -1, -1, -1, -1, 138, 139, 140, 141,
6031 142, 143, 144, 145, 146, 147, -1, 149, 150, -1,
6032 -1, -1, -1, -1, 156
6033};
6034
6035/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
6036 state STATE-NUM. */
6037static const yytype_int16 yystos[] =
6038{
6039 0, 164, 165, 0, 1, 3, 4, 5, 6, 7,
6040 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
6041 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
6042 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
6043 57, 59, 60, 61, 62, 63, 64, 65, 76, 77,
6044 91, 92, 99, 102, 103, 105, 106, 108, 111, 112,
6045 113, 114, 115, 116, 117, 118, 119, 148, 149, 150,
6046 166, 167, 168, 176, 178, 180, 186, 187, 193, 194,
6047 196, 197, 198, 200, 201, 202, 204, 205, 214, 217,
6048 233, 245, 246, 247, 248, 249, 250, 251, 252, 253,
6049 254, 255, 264, 286, 295, 296, 348, 349, 350, 351,
6050 352, 353, 354, 357, 359, 360, 374, 375, 377, 378,
6051 379, 380, 381, 382, 383, 384, 385, 423, 437, 3,
6052 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
6053 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
6054 24, 25, 26, 30, 31, 32, 33, 34, 35, 36,
6055 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
6056 52, 53, 56, 76, 77, 78, 79, 80, 81, 82,
6057 83, 84, 87, 88, 93, 94, 95, 96, 108, 109,
6058 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
6059 149, 150, 156, 208, 209, 210, 212, 213, 374, 39,
6060 58, 99, 102, 108, 109, 110, 113, 149, 186, 187,
6061 197, 205, 214, 219, 225, 228, 230, 245, 381, 382,
6062 384, 385, 421, 422, 225, 157, 226, 227, 157, 222,
6063 226, 157, 162, 430, 54, 209, 430, 152, 169, 152,
6064 21, 22, 31, 32, 196, 214, 245, 264, 214, 214,
6065 214, 56, 47, 102, 172, 173, 174, 176, 199, 200,
6066 437, 176, 235, 220, 230, 421, 437, 219, 420, 421,
6067 437, 46, 99, 148, 155, 186, 187, 204, 233, 245,
6068 381, 382, 385, 287, 208, 363, 376, 380, 363, 364,
6069 365, 161, 161, 161, 161, 379, 193, 214, 214, 160,
6070 162, 429, 435, 436, 40, 41, 42, 43, 44, 37,
6071 38, 157, 388, 389, 390, 391, 437, 388, 390, 26,
6072 152, 222, 226, 256, 297, 28, 257, 294, 135, 155,
6073 102, 108, 201, 135, 25, 78, 79, 80, 81, 82,
6074 83, 84, 85, 86, 87, 88, 89, 90, 95, 96,
6075 101, 136, 138, 139, 140, 141, 142, 143, 144, 145,
6076 146, 147, 216, 216, 69, 97, 98, 154, 427, 234,
6077 1, 180, 189, 189, 190, 191, 190, 189, 429, 436,
6078 99, 198, 205, 245, 269, 381, 382, 385, 52, 56,
6079 95, 99, 206, 207, 245, 381, 382, 385, 207, 33,
6080 34, 35, 36, 49, 50, 51, 52, 56, 157, 185,
6081 208, 383, 418, 225, 98, 427, 428, 297, 351, 100,
6082 100, 155, 219, 56, 219, 219, 219, 363, 388, 388,
6083 135, 101, 155, 229, 437, 98, 154, 427, 100, 100,
6084 155, 229, 225, 430, 431, 225, 92, 224, 225, 230,
6085 395, 421, 437, 180, 431, 180, 54, 64, 65, 177,
6086 157, 215, 166, 172, 98, 427, 100, 175, 199, 158,
6087 429, 436, 431, 236, 431, 159, 155, 430, 434, 155,
6088 434, 153, 434, 430, 56, 379, 201, 203, 389, 155,
6089 98, 154, 427, 288, 66, 120, 122, 123, 366, 120,
6090 120, 366, 67, 366, 355, 361, 358, 362, 78, 160,
6091 168, 189, 189, 189, 189, 176, 180, 180, 52, 54,
6092 55, 56, 57, 58, 78, 92, 102, 108, 109, 110,
6093 142, 145, 274, 336, 392, 394, 395, 396, 397, 398,
6094 399, 400, 401, 402, 405, 406, 407, 408, 409, 412,
6095 413, 414, 415, 416, 135, 243, 394, 135, 244, 298,
6096 299, 107, 195, 302, 303, 302, 218, 437, 199, 155,
6097 204, 155, 218, 183, 214, 214, 214, 214, 214, 214,
6098 214, 214, 214, 214, 214, 214, 214, 181, 214, 214,
6099 214, 214, 214, 214, 214, 214, 214, 214, 214, 52,
6100 53, 56, 212, 222, 423, 424, 425, 224, 230, 52,
6101 53, 56, 212, 222, 424, 170, 172, 13, 265, 435,
6102 265, 172, 189, 172, 429, 239, 56, 98, 154, 427,
6103 25, 180, 52, 56, 206, 139, 386, 98, 154, 427,
6104 242, 419, 69, 98, 426, 52, 56, 424, 218, 218,
6105 211, 125, 135, 135, 218, 219, 108, 219, 228, 421,
6106 52, 56, 224, 52, 56, 218, 218, 422, 431, 158,
6107 431, 155, 431, 155, 431, 209, 237, 214, 153, 153,
6108 424, 424, 218, 169, 431, 174, 431, 421, 155, 203,
6109 52, 56, 224, 52, 56, 289, 368, 367, 120, 356,
6110 366, 66, 120, 120, 356, 66, 120, 214, 102, 108,
6111 270, 271, 272, 273, 397, 155, 417, 437, 431, 275,
6112 276, 155, 393, 219, 155, 417, 34, 52, 155, 393,
6113 52, 155, 393, 52, 197, 214, 170, 435, 197, 214,
6114 170, 153, 300, 298, 10, 68, 263, 304, 263, 108,
6115 193, 219, 230, 231, 232, 431, 203, 155, 178, 179,
6116 193, 205, 214, 219, 221, 232, 245, 385, 184, 182,
6117 430, 100, 100, 222, 226, 430, 432, 155, 100, 100,
6118 222, 223, 226, 437, 263, 8, 258, 344, 437, 172,
6119 13, 172, 263, 27, 266, 435, 263, 25, 238, 309,
6120 17, 260, 307, 52, 56, 224, 52, 56, 190, 241,
6121 387, 240, 52, 56, 206, 224, 170, 180, 188, 223,
6122 226, 179, 214, 221, 179, 221, 209, 219, 219, 229,
6123 100, 100, 432, 100, 100, 395, 421, 180, 221, 434,
6124 201, 432, 157, 291, 394, 369, 54, 55, 57, 373,
6125 385, 161, 366, 161, 161, 161, 272, 397, 155, 431,
6126 155, 416, 219, 135, 392, 399, 412, 414, 402, 406,
6127 408, 400, 409, 414, 398, 400, 44, 44, 263, 44,
6128 44, 263, 301, 153, 305, 219, 155, 44, 203, 44,
6129 135, 44, 98, 154, 427, 52, 56, 58, 91, 92,
6130 99, 102, 105, 106, 108, 113, 141, 286, 315, 316,
6131 317, 318, 321, 326, 327, 328, 331, 332, 333, 334,
6132 335, 336, 337, 338, 339, 340, 341, 342, 343, 348,
6133 349, 352, 353, 354, 357, 359, 360, 382, 406, 315,
6134 137, 218, 218, 195, 159, 100, 218, 218, 195, 219,
6135 232, 345, 437, 9, 15, 259, 261, 347, 437, 14,
6136 261, 262, 267, 268, 437, 268, 192, 310, 307, 263,
6137 108, 219, 306, 263, 432, 172, 435, 189, 170, 432,
6138 263, 431, 185, 297, 294, 218, 218, 100, 218, 218,
6139 431, 155, 431, 394, 290, 370, 431, 270, 273, 271,
6140 155, 393, 155, 393, 417, 155, 393, 155, 393, 393,
6141 214, 214, 214, 214, 140, 281, 282, 437, 281, 108,
6142 219, 176, 176, 218, 214, 52, 56, 224, 52, 56,
6143 339, 339, 56, 206, 323, 316, 324, 325, 326, 327,
6144 330, 432, 322, 430, 433, 52, 363, 52, 102, 380,
6145 101, 155, 140, 155, 155, 316, 89, 90, 98, 154,
6146 157, 319, 320, 52, 214, 179, 221, 179, 221, 218,
6147 179, 221, 179, 221, 101, 346, 437, 172, 171, 172,
6148 189, 263, 263, 311, 263, 219, 155, 265, 263, 170,
6149 435, 263, 218, 283, 430, 29, 124, 292, 371, 155,
6150 155, 400, 414, 400, 400, 274, 277, 280, 283, 398,
6151 400, 401, 403, 404, 410, 411, 414, 416, 172, 170,
6152 219, 432, 316, 432, 316, 328, 330, 432, 155, 113,
6153 331, 153, 125, 189, 340, 324, 328, 321, 329, 330,
6154 333, 337, 339, 339, 206, 432, 431, 324, 327, 331,
6155 324, 327, 331, 179, 221, 99, 205, 245, 381, 382,
6156 385, 265, 172, 265, 314, 315, 108, 219, 172, 263,
6157 158, 160, 293, 172, 372, 271, 393, 155, 393, 393,
6158 393, 417, 283, 140, 275, 155, 278, 279, 99, 245,
6159 155, 417, 155, 278, 155, 278, 431, 155, 155, 363,
6160 433, 431, 155, 155, 431, 431, 431, 432, 432, 432,
6161 56, 98, 154, 427, 172, 347, 172, 265, 40, 41,
6162 219, 268, 307, 308, 52, 284, 285, 396, 170, 153,
6163 172, 400, 140, 245, 277, 411, 414, 56, 98, 403,
6164 408, 400, 410, 414, 400, 329, 329, 328, 330, 52,
6165 56, 224, 52, 56, 344, 267, 312, 189, 189, 155,
6166 430, 263, 121, 393, 155, 278, 155, 278, 52, 56,
6167 417, 155, 278, 155, 278, 278, 155, 432, 172, 285,
6168 400, 414, 400, 400, 268, 309, 313, 278, 155, 278,
6169 278, 278, 400, 278
6170};
6171
6172/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
6173static const yytype_int16 yyr1[] =
6174{
6175 0, 163, 165, 164, 166, 167, 167, 167, 168, 168,
6176 169, 171, 170, 170, 172, 173, 173, 173, 174, 175,
6177 174, 177, 176, 176, 176, 176, 176, 176, 176, 176,
6178 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
6179 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
6180 178, 178, 179, 179, 179, 180, 180, 180, 180, 180,
6181 181, 182, 180, 183, 184, 180, 180, 185, 186, 188,
6182 187, 189, 189, 191, 192, 190, 193, 193, 194, 194,
6183 195, 196, 197, 197, 197, 197, 197, 197, 197, 197,
6184 197, 197, 197, 198, 198, 199, 199, 200, 200, 200,
6185 200, 200, 200, 200, 200, 200, 200, 201, 201, 202,
6186 202, 203, 203, 204, 204, 204, 204, 204, 204, 204,
6187 204, 204, 205, 205, 205, 205, 205, 205, 205, 205,
6188 205, 206, 206, 207, 207, 207, 208, 208, 208, 208,
6189 208, 209, 209, 210, 211, 210, 212, 212, 212, 212,
6190 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
6191 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
6192 212, 212, 212, 212, 212, 212, 213, 213, 213, 213,
6193 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
6194 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
6195 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
6196 213, 213, 213, 213, 213, 213, 213, 214, 214, 214,
6197 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
6198 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
6199 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
6200 214, 214, 214, 214, 214, 214, 214, 215, 214, 214,
6201 214, 214, 214, 214, 214, 216, 216, 216, 216, 217,
6202 217, 218, 219, 220, 220, 220, 220, 221, 221, 222,
6203 222, 222, 223, 223, 224, 224, 224, 224, 224, 225,
6204 225, 225, 225, 225, 227, 226, 228, 228, 229, 229,
6205 230, 230, 230, 230, 230, 230, 231, 231, 232, 232,
6206 232, 233, 233, 233, 233, 233, 233, 233, 233, 233,
6207 233, 233, 234, 233, 235, 233, 236, 233, 233, 233,
6208 233, 233, 233, 233, 233, 233, 233, 237, 233, 233,
6209 233, 233, 233, 233, 233, 233, 233, 233, 233, 238,
6210 233, 239, 233, 233, 233, 240, 233, 241, 233, 242,
6211 233, 243, 233, 244, 233, 233, 233, 233, 233, 245,
6212 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
6213 256, 257, 258, 259, 260, 261, 262, 263, 263, 264,
6214 265, 265, 265, 266, 266, 267, 267, 268, 268, 269,
6215 269, 270, 270, 271, 271, 272, 272, 272, 272, 272,
6216 273, 273, 274, 274, 276, 275, 277, 277, 277, 277,
6217 278, 278, 279, 280, 280, 280, 280, 280, 280, 280,
6218 280, 280, 280, 280, 280, 280, 280, 280, 281, 281,
6219 282, 282, 283, 283, 284, 284, 285, 285, 287, 288,
6220 289, 290, 286, 291, 291, 292, 293, 292, 294, 295,
6221 295, 295, 295, 296, 296, 296, 296, 296, 296, 296,
6222 296, 296, 297, 297, 299, 300, 301, 298, 303, 304,
6223 305, 302, 306, 306, 306, 306, 307, 308, 308, 310,
6224 311, 312, 309, 313, 313, 314, 314, 314, 315, 315,
6225 315, 315, 315, 315, 316, 317, 317, 318, 318, 319,
6226 320, 321, 321, 321, 321, 321, 321, 321, 321, 321,
6227 321, 321, 321, 321, 322, 321, 321, 323, 321, 324,
6228 324, 324, 324, 324, 324, 325, 325, 326, 326, 327,
6229 328, 328, 329, 329, 330, 331, 331, 331, 331, 332,
6230 332, 333, 333, 334, 334, 335, 335, 336, 337, 337,
6231 338, 338, 338, 338, 338, 338, 338, 338, 338, 338,
6232 339, 339, 339, 339, 339, 339, 339, 339, 339, 339,
6233 340, 341, 341, 342, 343, 343, 343, 344, 344, 345,
6234 345, 345, 346, 346, 347, 347, 348, 348, 349, 350,
6235 350, 350, 351, 352, 353, 354, 355, 355, 356, 356,
6236 357, 358, 358, 359, 360, 361, 361, 362, 362, 363,
6237 363, 364, 364, 365, 365, 366, 367, 366, 368, 369,
6238 370, 371, 372, 366, 373, 373, 373, 373, 374, 374,
6239 375, 376, 376, 377, 378, 378, 379, 379, 379, 379,
6240 380, 380, 380, 381, 381, 381, 382, 382, 382, 382,
6241 382, 382, 382, 383, 383, 384, 384, 385, 385, 387,
6242 386, 386, 388, 388, 389, 390, 391, 390, 392, 392,
6243 392, 392, 392, 393, 393, 394, 394, 394, 394, 394,
6244 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
6245 395, 396, 396, 396, 396, 397, 397, 398, 399, 399,
6246 400, 400, 401, 402, 402, 403, 403, 404, 404, 405,
6247 405, 406, 406, 407, 408, 408, 409, 410, 411, 411,
6248 412, 412, 413, 413, 414, 414, 415, 415, 416, 416,
6249 417, 417, 418, 419, 418, 420, 420, 421, 421, 422,
6250 422, 422, 422, 422, 422, 423, 423, 423, 424, 424,
6251 425, 425, 425, 426, 426, 427, 427, 428, 428, 429,
6252 429, 430, 430, 431, 432, 433, 434, 434, 435, 435,
6253 436, 436, 437
6254};
6255
6256/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
6257static const yytype_int8 yyr2[] =
6258{
6259 0, 2, 0, 2, 2, 1, 1, 3, 1, 2,
6260 3, 0, 6, 3, 2, 1, 1, 3, 1, 0,
6261 3, 0, 4, 3, 3, 3, 2, 3, 3, 3,
6262 3, 3, 4, 1, 4, 4, 6, 4, 1, 1,
6263 4, 4, 7, 6, 6, 6, 6, 4, 6, 4,
6264 6, 4, 1, 3, 1, 1, 3, 3, 3, 2,
6265 0, 0, 5, 0, 0, 5, 1, 1, 2, 0,
6266 5, 1, 1, 0, 0, 4, 1, 1, 1, 4,
6267 3, 1, 2, 3, 4, 5, 4, 5, 2, 2,
6268 2, 2, 2, 1, 3, 1, 3, 1, 2, 3,
6269 5, 2, 4, 2, 4, 1, 3, 1, 3, 2,
6270 3, 1, 3, 1, 1, 4, 3, 3, 3, 3,
6271 2, 1, 1, 1, 4, 3, 3, 3, 3, 2,
6272 1, 1, 1, 2, 1, 3, 1, 1, 1, 1,
6273 1, 1, 1, 1, 0, 4, 1, 1, 1, 1,
6274 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6275 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6276 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6277 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6278 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6279 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6280 1, 1, 1, 1, 1, 1, 1, 4, 4, 7,
6281 6, 6, 6, 6, 5, 4, 3, 3, 2, 2,
6282 2, 2, 3, 3, 3, 3, 3, 3, 4, 2,
6283 2, 3, 3, 3, 3, 1, 3, 3, 3, 3,
6284 3, 2, 2, 3, 3, 3, 3, 0, 4, 6,
6285 4, 6, 4, 6, 1, 1, 1, 1, 1, 3,
6286 3, 1, 1, 1, 2, 4, 2, 1, 3, 3,
6287 5, 3, 1, 1, 1, 1, 2, 4, 2, 1,
6288 2, 2, 4, 1, 0, 2, 2, 1, 2, 1,
6289 1, 2, 1, 3, 4, 3, 1, 1, 3, 4,
6290 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6291 1, 1, 0, 4, 0, 3, 0, 4, 3, 3,
6292 2, 3, 3, 1, 4, 3, 1, 0, 6, 4,
6293 3, 2, 1, 2, 1, 6, 6, 4, 4, 0,
6294 6, 0, 5, 5, 6, 0, 6, 0, 7, 0,
6295 5, 0, 5, 0, 5, 1, 1, 1, 1, 1,
6296 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6297 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6298 1, 1, 2, 1, 1, 1, 5, 1, 2, 1,
6299 1, 1, 3, 1, 3, 1, 3, 5, 1, 3,
6300 2, 1, 1, 1, 0, 2, 4, 2, 2, 1,
6301 2, 0, 1, 6, 8, 4, 6, 4, 2, 6,
6302 2, 4, 6, 2, 4, 2, 4, 1, 1, 1,
6303 3, 4, 1, 4, 1, 3, 1, 1, 0, 0,
6304 0, 0, 7, 4, 1, 3, 0, 4, 3, 2,
6305 4, 5, 5, 2, 4, 4, 3, 3, 3, 2,
6306 1, 4, 3, 3, 0, 0, 0, 5, 0, 0,
6307 0, 5, 1, 2, 3, 4, 5, 1, 1, 0,
6308 0, 0, 8, 1, 1, 1, 3, 3, 1, 2,
6309 3, 1, 1, 1, 1, 3, 1, 3, 1, 1,
6310 1, 1, 1, 4, 4, 4, 3, 4, 4, 4,
6311 3, 3, 3, 2, 0, 4, 2, 0, 4, 1,
6312 1, 2, 2, 4, 1, 2, 3, 1, 3, 5,
6313 2, 1, 1, 3, 1, 3, 1, 2, 1, 1,
6314 3, 2, 1, 1, 3, 2, 1, 2, 1, 1,
6315 1, 3, 3, 2, 2, 1, 1, 1, 2, 2,
6316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6317 1, 2, 2, 4, 2, 3, 1, 6, 1, 1,
6318 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
6319 1, 2, 3, 3, 3, 4, 0, 3, 1, 2,
6320 4, 0, 3, 4, 4, 0, 3, 0, 3, 0,
6321 2, 0, 2, 0, 2, 1, 0, 3, 0, 0,
6322 0, 0, 0, 8, 1, 1, 1, 1, 1, 1,
6323 2, 1, 1, 3, 1, 2, 1, 1, 1, 1,
6324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6325 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6326 4, 0, 1, 1, 3, 1, 0, 3, 4, 2,
6327 2, 1, 1, 2, 0, 6, 8, 4, 6, 4,
6328 6, 2, 4, 6, 2, 4, 2, 4, 1, 0,
6329 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
6330 1, 3, 1, 2, 1, 2, 1, 1, 3, 1,
6331 3, 1, 1, 1, 2, 1, 3, 3, 1, 3,
6332 1, 3, 1, 1, 2, 1, 1, 1, 2, 1,
6333 2, 1, 1, 0, 4, 1, 2, 1, 3, 3,
6334 2, 1, 4, 2, 1, 1, 1, 1, 1, 1,
6335 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
6336 1, 0, 1, 2, 2, 2, 1, 1, 1, 1,
6337 1, 2, 0
6338};
6339
6340
6341enum { YYENOMEM = -2 };
6342
6343#define yyerrok (yyerrstatus = 0)
6344#define yyclearin (yychar = YYEMPTY)
6345
6346#define YYACCEPT goto yyacceptlab
6347#define YYABORT goto yyabortlab
6348#define YYERROR goto yyerrorlab
6349#define YYNOMEM goto yyexhaustedlab
6350
6351
6352#define YYRECOVERING() (!!yyerrstatus)
6353
6354#define YYBACKUP(Token, Value) \
6355 do \
6356 if (yychar == YYEMPTY) \
6357 { \
6358 yychar = (Token); \
6359 yylval = (Value); \
6360 YYPOPSTACK (yylen); \
6361 yystate = *yyssp; \
6362 goto yybackup; \
6363 } \
6364 else \
6365 { \
6366 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
6367 YYERROR; \
6368 } \
6369 while (0)
6370
6371/* Backward compatibility with an undocumented macro.
6372 Use YYerror or YYUNDEF. */
6373#define YYERRCODE YYUNDEF
6374
6375/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6376 If N is 0, then set CURRENT to the empty location which ends
6377 the previous symbol: RHS[0] (always defined). */
6378
6379#ifndef YYLLOC_DEFAULT
6380# define YYLLOC_DEFAULT(Current, Rhs, N) \
6381 do \
6382 if (N) \
6383 { \
6384 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
6385 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
6386 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
6387 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
6388 } \
6389 else \
6390 { \
6391 (Current).first_line = (Current).last_line = \
6392 YYRHSLOC (Rhs, 0).last_line; \
6393 (Current).first_column = (Current).last_column = \
6394 YYRHSLOC (Rhs, 0).last_column; \
6395 } \
6396 while (0)
6397#endif
6398
6399#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6400
6401
6402/* Enable debugging if requested. */
6403#if YYDEBUG
6404
6405# ifndef YYFPRINTF
6406# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6407# define YYFPRINTF fprintf
6408# endif
6409
6410# define YYDPRINTF(Args) \
6411do { \
6412 if (yydebug) \
6413 YYFPRINTF Args; \
6414} while (0)
6415
6416
6417/* YYLOCATION_PRINT -- Print the location on the stream.
6418 This macro was not mandated originally: define only if we know
6419 we won't break user code: when these are the locations we know. */
6420
6421# ifndef YYLOCATION_PRINT
6422
6423# if defined YY_LOCATION_PRINT
6424
6425 /* Temporary convenience wrapper in case some people defined the
6426 undocumented and private YY_LOCATION_PRINT macros. */
6427# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
6428
6429# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6430
6431/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
6432
6433YY_ATTRIBUTE_UNUSED
6434static int
6435yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
6436{
6437 int res = 0;
6438 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
6439 if (0 <= yylocp->first_line)
6440 {
6441 res += YYFPRINTF (p, "%d", yylocp->first_line);
6442 if (0 <= yylocp->first_column)
6443 res += YYFPRINTF (p, ".%d", yylocp->first_column);
6444 }
6445 if (0 <= yylocp->last_line)
6446 {
6447 if (yylocp->first_line < yylocp->last_line)
6448 {
6449 res += YYFPRINTF (p, "-%d", yylocp->last_line);
6450 if (0 <= end_col)
6451 res += YYFPRINTF (p, ".%d", end_col);
6452 }
6453 else if (0 <= end_col && yylocp->first_column < end_col)
6454 res += YYFPRINTF (p, "-%d", end_col);
6455 }
6456 return res;
6457}
6458
6459# define YYLOCATION_PRINT yy_location_print_
6460
6461 /* Temporary convenience wrapper in case some people defined the
6462 undocumented and private YY_LOCATION_PRINT macros. */
6463# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
6464
6465# else
6466
6467# define YYLOCATION_PRINT(File, Loc) ((void) 0)
6468 /* Temporary convenience wrapper in case some people defined the
6469 undocumented and private YY_LOCATION_PRINT macros. */
6470# define YY_LOCATION_PRINT YYLOCATION_PRINT
6471
6472# endif
6473# endif /* !defined YYLOCATION_PRINT */
6474
6475
6476# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
6477do { \
6478 if (yydebug) \
6479 { \
6480 YYFPRINTF (p, "%s ", Title); \
6481 yy_symbol_print (stderr, \
6482 Kind, Value, Location, p); \
6483 YYFPRINTF (p, "\n"); \
6484 } \
6485} while (0)
6486
6487
6488/*-----------------------------------.
6489| Print this symbol's value on YYO. |
6490`-----------------------------------*/
6491
6492static void
6493yy_symbol_value_print (FILE *yyo,
6494 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6495{
6496 FILE *yyoutput = yyo;
6497 YY_USE (yyoutput);
6498 YY_USE (yylocationp);
6499 YY_USE (p);
6500 if (!yyvaluep)
6501 return;
6502 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6503 switch (yykind)
6504 {
6505 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
6506#line 1339 "parse.y"
6507 {
6508#ifndef RIPPER
6509 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6510#else
6511 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6512#endif
6513}
6514#line 6513 "parse.c"
6515 break;
6516
6517 case YYSYMBOL_tFID: /* "method" */
6518#line 1339 "parse.y"
6519 {
6520#ifndef RIPPER
6521 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6522#else
6523 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6524#endif
6525}
6526#line 6525 "parse.c"
6527 break;
6528
6529 case YYSYMBOL_tGVAR: /* "global variable" */
6530#line 1339 "parse.y"
6531 {
6532#ifndef RIPPER
6533 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6534#else
6535 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6536#endif
6537}
6538#line 6537 "parse.c"
6539 break;
6540
6541 case YYSYMBOL_tIVAR: /* "instance variable" */
6542#line 1339 "parse.y"
6543 {
6544#ifndef RIPPER
6545 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6546#else
6547 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6548#endif
6549}
6550#line 6549 "parse.c"
6551 break;
6552
6553 case YYSYMBOL_tCONSTANT: /* "constant" */
6554#line 1339 "parse.y"
6555 {
6556#ifndef RIPPER
6557 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6558#else
6559 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6560#endif
6561}
6562#line 6561 "parse.c"
6563 break;
6564
6565 case YYSYMBOL_tCVAR: /* "class variable" */
6566#line 1339 "parse.y"
6567 {
6568#ifndef RIPPER
6569 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6570#else
6571 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6572#endif
6573}
6574#line 6573 "parse.c"
6575 break;
6576
6577 case YYSYMBOL_tLABEL: /* "label" */
6578#line 1339 "parse.y"
6579 {
6580#ifndef RIPPER
6581 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6582#else
6583 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6584#endif
6585}
6586#line 6585 "parse.c"
6587 break;
6588
6589 case YYSYMBOL_tINTEGER: /* "integer literal" */
6590#line 1346 "parse.y"
6591 {
6592#ifndef RIPPER
6593 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6594#else
6595 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6596#endif
6597}
6598#line 6597 "parse.c"
6599 break;
6600
6601 case YYSYMBOL_tFLOAT: /* "float literal" */
6602#line 1346 "parse.y"
6603 {
6604#ifndef RIPPER
6605 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6606#else
6607 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6608#endif
6609}
6610#line 6609 "parse.c"
6611 break;
6612
6613 case YYSYMBOL_tRATIONAL: /* "rational literal" */
6614#line 1346 "parse.y"
6615 {
6616#ifndef RIPPER
6617 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6618#else
6619 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6620#endif
6621}
6622#line 6621 "parse.c"
6623 break;
6624
6625 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
6626#line 1346 "parse.y"
6627 {
6628#ifndef RIPPER
6629 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6630#else
6631 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6632#endif
6633}
6634#line 6633 "parse.c"
6635 break;
6636
6637 case YYSYMBOL_tCHAR: /* "char literal" */
6638#line 1346 "parse.y"
6639 {
6640#ifndef RIPPER
6641 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6642#else
6643 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6644#endif
6645}
6646#line 6645 "parse.c"
6647 break;
6648
6649 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
6650#line 1353 "parse.y"
6651 {
6652#ifndef RIPPER
6653 rb_parser_printf(p, "$%ld", ((*yyvaluep).node)->nd_nth);
6654#else
6655 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6656#endif
6657}
6658#line 6657 "parse.c"
6659 break;
6660
6661 case YYSYMBOL_tBACK_REF: /* "back reference" */
6662#line 1360 "parse.y"
6663 {
6664#ifndef RIPPER
6665 rb_parser_printf(p, "$%c", (int)((*yyvaluep).node)->nd_nth);
6666#else
6667 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6668#endif
6669}
6670#line 6669 "parse.c"
6671 break;
6672
6673 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
6674#line 1346 "parse.y"
6675 {
6676#ifndef RIPPER
6677 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6678#else
6679 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6680#endif
6681}
6682#line 6681 "parse.c"
6683 break;
6684
6685 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
6686#line 1339 "parse.y"
6687 {
6688#ifndef RIPPER
6689 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6690#else
6691 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6692#endif
6693}
6694#line 6693 "parse.c"
6695 break;
6696
6697 case YYSYMBOL_top_compstmt: /* top_compstmt */
6698#line 1331 "parse.y"
6699 {
6700#ifndef RIPPER
6701 if (((*yyvaluep).node)) {
6702 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6703 }
6704#else
6705#endif
6706}
6707#line 6706 "parse.c"
6708 break;
6709
6710 case YYSYMBOL_top_stmts: /* top_stmts */
6711#line 1331 "parse.y"
6712 {
6713#ifndef RIPPER
6714 if (((*yyvaluep).node)) {
6715 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6716 }
6717#else
6718#endif
6719}
6720#line 6719 "parse.c"
6721 break;
6722
6723 case YYSYMBOL_top_stmt: /* top_stmt */
6724#line 1331 "parse.y"
6725 {
6726#ifndef RIPPER
6727 if (((*yyvaluep).node)) {
6728 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6729 }
6730#else
6731#endif
6732}
6733#line 6732 "parse.c"
6734 break;
6735
6736 case YYSYMBOL_begin_block: /* begin_block */
6737#line 1331 "parse.y"
6738 {
6739#ifndef RIPPER
6740 if (((*yyvaluep).node)) {
6741 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6742 }
6743#else
6744#endif
6745}
6746#line 6745 "parse.c"
6747 break;
6748
6749 case YYSYMBOL_bodystmt: /* bodystmt */
6750#line 1331 "parse.y"
6751 {
6752#ifndef RIPPER
6753 if (((*yyvaluep).node)) {
6754 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6755 }
6756#else
6757#endif
6758}
6759#line 6758 "parse.c"
6760 break;
6761
6762 case YYSYMBOL_compstmt: /* compstmt */
6763#line 1331 "parse.y"
6764 {
6765#ifndef RIPPER
6766 if (((*yyvaluep).node)) {
6767 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6768 }
6769#else
6770#endif
6771}
6772#line 6771 "parse.c"
6773 break;
6774
6775 case YYSYMBOL_stmts: /* stmts */
6776#line 1331 "parse.y"
6777 {
6778#ifndef RIPPER
6779 if (((*yyvaluep).node)) {
6780 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6781 }
6782#else
6783#endif
6784}
6785#line 6784 "parse.c"
6786 break;
6787
6788 case YYSYMBOL_stmt_or_begin: /* stmt_or_begin */
6789#line 1331 "parse.y"
6790 {
6791#ifndef RIPPER
6792 if (((*yyvaluep).node)) {
6793 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6794 }
6795#else
6796#endif
6797}
6798#line 6797 "parse.c"
6799 break;
6800
6801 case YYSYMBOL_stmt: /* stmt */
6802#line 1331 "parse.y"
6803 {
6804#ifndef RIPPER
6805 if (((*yyvaluep).node)) {
6806 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6807 }
6808#else
6809#endif
6810}
6811#line 6810 "parse.c"
6812 break;
6813
6814 case YYSYMBOL_command_asgn: /* command_asgn */
6815#line 1331 "parse.y"
6816 {
6817#ifndef RIPPER
6818 if (((*yyvaluep).node)) {
6819 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6820 }
6821#else
6822#endif
6823}
6824#line 6823 "parse.c"
6825 break;
6826
6827 case YYSYMBOL_command_rhs: /* command_rhs */
6828#line 1331 "parse.y"
6829 {
6830#ifndef RIPPER
6831 if (((*yyvaluep).node)) {
6832 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6833 }
6834#else
6835#endif
6836}
6837#line 6836 "parse.c"
6838 break;
6839
6840 case YYSYMBOL_expr: /* expr */
6841#line 1331 "parse.y"
6842 {
6843#ifndef RIPPER
6844 if (((*yyvaluep).node)) {
6845 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6846 }
6847#else
6848#endif
6849}
6850#line 6849 "parse.c"
6851 break;
6852
6853 case YYSYMBOL_def_name: /* def_name */
6854#line 1331 "parse.y"
6855 {
6856#ifndef RIPPER
6857 if (((*yyvaluep).node)) {
6858 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6859 }
6860#else
6861#endif
6862}
6863#line 6862 "parse.c"
6864 break;
6865
6866 case YYSYMBOL_defn_head: /* defn_head */
6867#line 1331 "parse.y"
6868 {
6869#ifndef RIPPER
6870 if (((*yyvaluep).node)) {
6871 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6872 }
6873#else
6874#endif
6875}
6876#line 6875 "parse.c"
6877 break;
6878
6879 case YYSYMBOL_defs_head: /* defs_head */
6880#line 1331 "parse.y"
6881 {
6882#ifndef RIPPER
6883 if (((*yyvaluep).node)) {
6884 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6885 }
6886#else
6887#endif
6888}
6889#line 6888 "parse.c"
6890 break;
6891
6892 case YYSYMBOL_expr_value: /* expr_value */
6893#line 1331 "parse.y"
6894 {
6895#ifndef RIPPER
6896 if (((*yyvaluep).node)) {
6897 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6898 }
6899#else
6900#endif
6901}
6902#line 6901 "parse.c"
6903 break;
6904
6905 case YYSYMBOL_expr_value_do: /* expr_value_do */
6906#line 1331 "parse.y"
6907 {
6908#ifndef RIPPER
6909 if (((*yyvaluep).node)) {
6910 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6911 }
6912#else
6913#endif
6914}
6915#line 6914 "parse.c"
6916 break;
6917
6918 case YYSYMBOL_command_call: /* command_call */
6919#line 1331 "parse.y"
6920 {
6921#ifndef RIPPER
6922 if (((*yyvaluep).node)) {
6923 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6924 }
6925#else
6926#endif
6927}
6928#line 6927 "parse.c"
6929 break;
6930
6931 case YYSYMBOL_block_command: /* block_command */
6932#line 1331 "parse.y"
6933 {
6934#ifndef RIPPER
6935 if (((*yyvaluep).node)) {
6936 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6937 }
6938#else
6939#endif
6940}
6941#line 6940 "parse.c"
6942 break;
6943
6944 case YYSYMBOL_cmd_brace_block: /* cmd_brace_block */
6945#line 1331 "parse.y"
6946 {
6947#ifndef RIPPER
6948 if (((*yyvaluep).node)) {
6949 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6950 }
6951#else
6952#endif
6953}
6954#line 6953 "parse.c"
6955 break;
6956
6957 case YYSYMBOL_fcall: /* fcall */
6958#line 1331 "parse.y"
6959 {
6960#ifndef RIPPER
6961 if (((*yyvaluep).node)) {
6962 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6963 }
6964#else
6965#endif
6966}
6967#line 6966 "parse.c"
6968 break;
6969
6970 case YYSYMBOL_command: /* command */
6971#line 1331 "parse.y"
6972 {
6973#ifndef RIPPER
6974 if (((*yyvaluep).node)) {
6975 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6976 }
6977#else
6978#endif
6979}
6980#line 6979 "parse.c"
6981 break;
6982
6983 case YYSYMBOL_mlhs: /* mlhs */
6984#line 1331 "parse.y"
6985 {
6986#ifndef RIPPER
6987 if (((*yyvaluep).node)) {
6988 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
6989 }
6990#else
6991#endif
6992}
6993#line 6992 "parse.c"
6994 break;
6995
6996 case YYSYMBOL_mlhs_inner: /* mlhs_inner */
6997#line 1331 "parse.y"
6998 {
6999#ifndef RIPPER
7000 if (((*yyvaluep).node)) {
7001 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7002 }
7003#else
7004#endif
7005}
7006#line 7005 "parse.c"
7007 break;
7008
7009 case YYSYMBOL_mlhs_basic: /* mlhs_basic */
7010#line 1331 "parse.y"
7011 {
7012#ifndef RIPPER
7013 if (((*yyvaluep).node)) {
7014 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7015 }
7016#else
7017#endif
7018}
7019#line 7018 "parse.c"
7020 break;
7021
7022 case YYSYMBOL_mlhs_item: /* mlhs_item */
7023#line 1331 "parse.y"
7024 {
7025#ifndef RIPPER
7026 if (((*yyvaluep).node)) {
7027 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7028 }
7029#else
7030#endif
7031}
7032#line 7031 "parse.c"
7033 break;
7034
7035 case YYSYMBOL_mlhs_head: /* mlhs_head */
7036#line 1331 "parse.y"
7037 {
7038#ifndef RIPPER
7039 if (((*yyvaluep).node)) {
7040 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7041 }
7042#else
7043#endif
7044}
7045#line 7044 "parse.c"
7046 break;
7047
7048 case YYSYMBOL_mlhs_post: /* mlhs_post */
7049#line 1331 "parse.y"
7050 {
7051#ifndef RIPPER
7052 if (((*yyvaluep).node)) {
7053 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7054 }
7055#else
7056#endif
7057}
7058#line 7057 "parse.c"
7059 break;
7060
7061 case YYSYMBOL_mlhs_node: /* mlhs_node */
7062#line 1331 "parse.y"
7063 {
7064#ifndef RIPPER
7065 if (((*yyvaluep).node)) {
7066 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7067 }
7068#else
7069#endif
7070}
7071#line 7070 "parse.c"
7072 break;
7073
7074 case YYSYMBOL_lhs: /* lhs */
7075#line 1331 "parse.y"
7076 {
7077#ifndef RIPPER
7078 if (((*yyvaluep).node)) {
7079 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7080 }
7081#else
7082#endif
7083}
7084#line 7083 "parse.c"
7085 break;
7086
7087 case YYSYMBOL_cpath: /* cpath */
7088#line 1331 "parse.y"
7089 {
7090#ifndef RIPPER
7091 if (((*yyvaluep).node)) {
7092 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7093 }
7094#else
7095#endif
7096}
7097#line 7096 "parse.c"
7098 break;
7099
7100 case YYSYMBOL_fitem: /* fitem */
7101#line 1331 "parse.y"
7102 {
7103#ifndef RIPPER
7104 if (((*yyvaluep).node)) {
7105 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7106 }
7107#else
7108#endif
7109}
7110#line 7109 "parse.c"
7111 break;
7112
7113 case YYSYMBOL_undef_list: /* undef_list */
7114#line 1331 "parse.y"
7115 {
7116#ifndef RIPPER
7117 if (((*yyvaluep).node)) {
7118 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7119 }
7120#else
7121#endif
7122}
7123#line 7122 "parse.c"
7124 break;
7125
7126 case YYSYMBOL_arg: /* arg */
7127#line 1331 "parse.y"
7128 {
7129#ifndef RIPPER
7130 if (((*yyvaluep).node)) {
7131 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7132 }
7133#else
7134#endif
7135}
7136#line 7135 "parse.c"
7137 break;
7138
7139 case YYSYMBOL_rel_expr: /* rel_expr */
7140#line 1331 "parse.y"
7141 {
7142#ifndef RIPPER
7143 if (((*yyvaluep).node)) {
7144 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7145 }
7146#else
7147#endif
7148}
7149#line 7148 "parse.c"
7150 break;
7151
7152 case YYSYMBOL_arg_value: /* arg_value */
7153#line 1331 "parse.y"
7154 {
7155#ifndef RIPPER
7156 if (((*yyvaluep).node)) {
7157 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7158 }
7159#else
7160#endif
7161}
7162#line 7161 "parse.c"
7163 break;
7164
7165 case YYSYMBOL_aref_args: /* aref_args */
7166#line 1331 "parse.y"
7167 {
7168#ifndef RIPPER
7169 if (((*yyvaluep).node)) {
7170 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7171 }
7172#else
7173#endif
7174}
7175#line 7174 "parse.c"
7176 break;
7177
7178 case YYSYMBOL_arg_rhs: /* arg_rhs */
7179#line 1331 "parse.y"
7180 {
7181#ifndef RIPPER
7182 if (((*yyvaluep).node)) {
7183 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7184 }
7185#else
7186#endif
7187}
7188#line 7187 "parse.c"
7189 break;
7190
7191 case YYSYMBOL_paren_args: /* paren_args */
7192#line 1331 "parse.y"
7193 {
7194#ifndef RIPPER
7195 if (((*yyvaluep).node)) {
7196 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7197 }
7198#else
7199#endif
7200}
7201#line 7200 "parse.c"
7202 break;
7203
7204 case YYSYMBOL_opt_paren_args: /* opt_paren_args */
7205#line 1331 "parse.y"
7206 {
7207#ifndef RIPPER
7208 if (((*yyvaluep).node)) {
7209 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7210 }
7211#else
7212#endif
7213}
7214#line 7213 "parse.c"
7215 break;
7216
7217 case YYSYMBOL_opt_call_args: /* opt_call_args */
7218#line 1331 "parse.y"
7219 {
7220#ifndef RIPPER
7221 if (((*yyvaluep).node)) {
7222 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7223 }
7224#else
7225#endif
7226}
7227#line 7226 "parse.c"
7228 break;
7229
7230 case YYSYMBOL_call_args: /* call_args */
7231#line 1331 "parse.y"
7232 {
7233#ifndef RIPPER
7234 if (((*yyvaluep).node)) {
7235 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7236 }
7237#else
7238#endif
7239}
7240#line 7239 "parse.c"
7241 break;
7242
7243 case YYSYMBOL_command_args: /* command_args */
7244#line 1331 "parse.y"
7245 {
7246#ifndef RIPPER
7247 if (((*yyvaluep).node)) {
7248 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7249 }
7250#else
7251#endif
7252}
7253#line 7252 "parse.c"
7254 break;
7255
7256 case YYSYMBOL_block_arg: /* block_arg */
7257#line 1331 "parse.y"
7258 {
7259#ifndef RIPPER
7260 if (((*yyvaluep).node)) {
7261 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7262 }
7263#else
7264#endif
7265}
7266#line 7265 "parse.c"
7267 break;
7268
7269 case YYSYMBOL_opt_block_arg: /* opt_block_arg */
7270#line 1331 "parse.y"
7271 {
7272#ifndef RIPPER
7273 if (((*yyvaluep).node)) {
7274 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7275 }
7276#else
7277#endif
7278}
7279#line 7278 "parse.c"
7280 break;
7281
7282 case YYSYMBOL_args: /* args */
7283#line 1331 "parse.y"
7284 {
7285#ifndef RIPPER
7286 if (((*yyvaluep).node)) {
7287 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7288 }
7289#else
7290#endif
7291}
7292#line 7291 "parse.c"
7293 break;
7294
7295 case YYSYMBOL_mrhs_arg: /* mrhs_arg */
7296#line 1331 "parse.y"
7297 {
7298#ifndef RIPPER
7299 if (((*yyvaluep).node)) {
7300 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7301 }
7302#else
7303#endif
7304}
7305#line 7304 "parse.c"
7306 break;
7307
7308 case YYSYMBOL_mrhs: /* mrhs */
7309#line 1331 "parse.y"
7310 {
7311#ifndef RIPPER
7312 if (((*yyvaluep).node)) {
7313 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7314 }
7315#else
7316#endif
7317}
7318#line 7317 "parse.c"
7319 break;
7320
7321 case YYSYMBOL_primary: /* primary */
7322#line 1331 "parse.y"
7323 {
7324#ifndef RIPPER
7325 if (((*yyvaluep).node)) {
7326 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7327 }
7328#else
7329#endif
7330}
7331#line 7330 "parse.c"
7332 break;
7333
7334 case YYSYMBOL_primary_value: /* primary_value */
7335#line 1331 "parse.y"
7336 {
7337#ifndef RIPPER
7338 if (((*yyvaluep).node)) {
7339 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7340 }
7341#else
7342#endif
7343}
7344#line 7343 "parse.c"
7345 break;
7346
7347 case YYSYMBOL_if_tail: /* if_tail */
7348#line 1331 "parse.y"
7349 {
7350#ifndef RIPPER
7351 if (((*yyvaluep).node)) {
7352 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7353 }
7354#else
7355#endif
7356}
7357#line 7356 "parse.c"
7358 break;
7359
7360 case YYSYMBOL_opt_else: /* opt_else */
7361#line 1331 "parse.y"
7362 {
7363#ifndef RIPPER
7364 if (((*yyvaluep).node)) {
7365 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7366 }
7367#else
7368#endif
7369}
7370#line 7369 "parse.c"
7371 break;
7372
7373 case YYSYMBOL_for_var: /* for_var */
7374#line 1331 "parse.y"
7375 {
7376#ifndef RIPPER
7377 if (((*yyvaluep).node)) {
7378 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7379 }
7380#else
7381#endif
7382}
7383#line 7382 "parse.c"
7384 break;
7385
7386 case YYSYMBOL_f_marg: /* f_marg */
7387#line 1331 "parse.y"
7388 {
7389#ifndef RIPPER
7390 if (((*yyvaluep).node)) {
7391 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7392 }
7393#else
7394#endif
7395}
7396#line 7395 "parse.c"
7397 break;
7398
7399 case YYSYMBOL_f_marg_list: /* f_marg_list */
7400#line 1331 "parse.y"
7401 {
7402#ifndef RIPPER
7403 if (((*yyvaluep).node)) {
7404 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7405 }
7406#else
7407#endif
7408}
7409#line 7408 "parse.c"
7410 break;
7411
7412 case YYSYMBOL_f_margs: /* f_margs */
7413#line 1331 "parse.y"
7414 {
7415#ifndef RIPPER
7416 if (((*yyvaluep).node)) {
7417 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7418 }
7419#else
7420#endif
7421}
7422#line 7421 "parse.c"
7423 break;
7424
7425 case YYSYMBOL_f_rest_marg: /* f_rest_marg */
7426#line 1331 "parse.y"
7427 {
7428#ifndef RIPPER
7429 if (((*yyvaluep).node)) {
7430 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7431 }
7432#else
7433#endif
7434}
7435#line 7434 "parse.c"
7436 break;
7437
7438 case YYSYMBOL_block_args_tail: /* block_args_tail */
7439#line 1331 "parse.y"
7440 {
7441#ifndef RIPPER
7442 if (((*yyvaluep).node)) {
7443 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7444 }
7445#else
7446#endif
7447}
7448#line 7447 "parse.c"
7449 break;
7450
7451 case YYSYMBOL_opt_block_args_tail: /* opt_block_args_tail */
7452#line 1331 "parse.y"
7453 {
7454#ifndef RIPPER
7455 if (((*yyvaluep).node)) {
7456 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7457 }
7458#else
7459#endif
7460}
7461#line 7460 "parse.c"
7462 break;
7463
7464 case YYSYMBOL_block_param: /* block_param */
7465#line 1331 "parse.y"
7466 {
7467#ifndef RIPPER
7468 if (((*yyvaluep).node)) {
7469 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7470 }
7471#else
7472#endif
7473}
7474#line 7473 "parse.c"
7475 break;
7476
7477 case YYSYMBOL_opt_block_param: /* opt_block_param */
7478#line 1331 "parse.y"
7479 {
7480#ifndef RIPPER
7481 if (((*yyvaluep).node)) {
7482 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7483 }
7484#else
7485#endif
7486}
7487#line 7486 "parse.c"
7488 break;
7489
7490 case YYSYMBOL_block_param_def: /* block_param_def */
7491#line 1331 "parse.y"
7492 {
7493#ifndef RIPPER
7494 if (((*yyvaluep).node)) {
7495 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7496 }
7497#else
7498#endif
7499}
7500#line 7499 "parse.c"
7501 break;
7502
7503 case YYSYMBOL_opt_bv_decl: /* opt_bv_decl */
7504#line 1331 "parse.y"
7505 {
7506#ifndef RIPPER
7507 if (((*yyvaluep).node)) {
7508 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7509 }
7510#else
7511#endif
7512}
7513#line 7512 "parse.c"
7514 break;
7515
7516 case YYSYMBOL_bv_decls: /* bv_decls */
7517#line 1331 "parse.y"
7518 {
7519#ifndef RIPPER
7520 if (((*yyvaluep).node)) {
7521 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7522 }
7523#else
7524#endif
7525}
7526#line 7525 "parse.c"
7527 break;
7528
7529 case YYSYMBOL_bvar: /* bvar */
7530#line 1331 "parse.y"
7531 {
7532#ifndef RIPPER
7533 if (((*yyvaluep).node)) {
7534 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7535 }
7536#else
7537#endif
7538}
7539#line 7538 "parse.c"
7540 break;
7541
7542 case YYSYMBOL_lambda: /* lambda */
7543#line 1331 "parse.y"
7544 {
7545#ifndef RIPPER
7546 if (((*yyvaluep).node)) {
7547 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7548 }
7549#else
7550#endif
7551}
7552#line 7551 "parse.c"
7553 break;
7554
7555 case YYSYMBOL_f_larglist: /* f_larglist */
7556#line 1331 "parse.y"
7557 {
7558#ifndef RIPPER
7559 if (((*yyvaluep).node)) {
7560 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7561 }
7562#else
7563#endif
7564}
7565#line 7564 "parse.c"
7566 break;
7567
7568 case YYSYMBOL_lambda_body: /* lambda_body */
7569#line 1331 "parse.y"
7570 {
7571#ifndef RIPPER
7572 if (((*yyvaluep).node)) {
7573 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7574 }
7575#else
7576#endif
7577}
7578#line 7577 "parse.c"
7579 break;
7580
7581 case YYSYMBOL_do_block: /* do_block */
7582#line 1331 "parse.y"
7583 {
7584#ifndef RIPPER
7585 if (((*yyvaluep).node)) {
7586 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7587 }
7588#else
7589#endif
7590}
7591#line 7590 "parse.c"
7592 break;
7593
7594 case YYSYMBOL_block_call: /* block_call */
7595#line 1331 "parse.y"
7596 {
7597#ifndef RIPPER
7598 if (((*yyvaluep).node)) {
7599 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7600 }
7601#else
7602#endif
7603}
7604#line 7603 "parse.c"
7605 break;
7606
7607 case YYSYMBOL_method_call: /* method_call */
7608#line 1331 "parse.y"
7609 {
7610#ifndef RIPPER
7611 if (((*yyvaluep).node)) {
7612 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7613 }
7614#else
7615#endif
7616}
7617#line 7616 "parse.c"
7618 break;
7619
7620 case YYSYMBOL_brace_block: /* brace_block */
7621#line 1331 "parse.y"
7622 {
7623#ifndef RIPPER
7624 if (((*yyvaluep).node)) {
7625 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7626 }
7627#else
7628#endif
7629}
7630#line 7629 "parse.c"
7631 break;
7632
7633 case YYSYMBOL_brace_body: /* brace_body */
7634#line 1331 "parse.y"
7635 {
7636#ifndef RIPPER
7637 if (((*yyvaluep).node)) {
7638 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7639 }
7640#else
7641#endif
7642}
7643#line 7642 "parse.c"
7644 break;
7645
7646 case YYSYMBOL_do_body: /* do_body */
7647#line 1331 "parse.y"
7648 {
7649#ifndef RIPPER
7650 if (((*yyvaluep).node)) {
7651 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7652 }
7653#else
7654#endif
7655}
7656#line 7655 "parse.c"
7657 break;
7658
7659 case YYSYMBOL_case_args: /* case_args */
7660#line 1331 "parse.y"
7661 {
7662#ifndef RIPPER
7663 if (((*yyvaluep).node)) {
7664 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7665 }
7666#else
7667#endif
7668}
7669#line 7668 "parse.c"
7670 break;
7671
7672 case YYSYMBOL_case_body: /* case_body */
7673#line 1331 "parse.y"
7674 {
7675#ifndef RIPPER
7676 if (((*yyvaluep).node)) {
7677 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7678 }
7679#else
7680#endif
7681}
7682#line 7681 "parse.c"
7683 break;
7684
7685 case YYSYMBOL_cases: /* cases */
7686#line 1331 "parse.y"
7687 {
7688#ifndef RIPPER
7689 if (((*yyvaluep).node)) {
7690 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7691 }
7692#else
7693#endif
7694}
7695#line 7694 "parse.c"
7696 break;
7697
7698 case YYSYMBOL_p_case_body: /* p_case_body */
7699#line 1331 "parse.y"
7700 {
7701#ifndef RIPPER
7702 if (((*yyvaluep).node)) {
7703 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7704 }
7705#else
7706#endif
7707}
7708#line 7707 "parse.c"
7709 break;
7710
7711 case YYSYMBOL_p_cases: /* p_cases */
7712#line 1331 "parse.y"
7713 {
7714#ifndef RIPPER
7715 if (((*yyvaluep).node)) {
7716 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7717 }
7718#else
7719#endif
7720}
7721#line 7720 "parse.c"
7722 break;
7723
7724 case YYSYMBOL_p_top_expr: /* p_top_expr */
7725#line 1331 "parse.y"
7726 {
7727#ifndef RIPPER
7728 if (((*yyvaluep).node)) {
7729 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7730 }
7731#else
7732#endif
7733}
7734#line 7733 "parse.c"
7735 break;
7736
7737 case YYSYMBOL_p_top_expr_body: /* p_top_expr_body */
7738#line 1331 "parse.y"
7739 {
7740#ifndef RIPPER
7741 if (((*yyvaluep).node)) {
7742 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7743 }
7744#else
7745#endif
7746}
7747#line 7746 "parse.c"
7748 break;
7749
7750 case YYSYMBOL_p_expr: /* p_expr */
7751#line 1331 "parse.y"
7752 {
7753#ifndef RIPPER
7754 if (((*yyvaluep).node)) {
7755 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7756 }
7757#else
7758#endif
7759}
7760#line 7759 "parse.c"
7761 break;
7762
7763 case YYSYMBOL_p_as: /* p_as */
7764#line 1331 "parse.y"
7765 {
7766#ifndef RIPPER
7767 if (((*yyvaluep).node)) {
7768 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7769 }
7770#else
7771#endif
7772}
7773#line 7772 "parse.c"
7774 break;
7775
7776 case YYSYMBOL_p_alt: /* p_alt */
7777#line 1331 "parse.y"
7778 {
7779#ifndef RIPPER
7780 if (((*yyvaluep).node)) {
7781 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7782 }
7783#else
7784#endif
7785}
7786#line 7785 "parse.c"
7787 break;
7788
7789 case YYSYMBOL_p_expr_basic: /* p_expr_basic */
7790#line 1331 "parse.y"
7791 {
7792#ifndef RIPPER
7793 if (((*yyvaluep).node)) {
7794 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7795 }
7796#else
7797#endif
7798}
7799#line 7798 "parse.c"
7800 break;
7801
7802 case YYSYMBOL_p_args: /* p_args */
7803#line 1331 "parse.y"
7804 {
7805#ifndef RIPPER
7806 if (((*yyvaluep).node)) {
7807 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7808 }
7809#else
7810#endif
7811}
7812#line 7811 "parse.c"
7813 break;
7814
7815 case YYSYMBOL_p_args_head: /* p_args_head */
7816#line 1331 "parse.y"
7817 {
7818#ifndef RIPPER
7819 if (((*yyvaluep).node)) {
7820 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7821 }
7822#else
7823#endif
7824}
7825#line 7824 "parse.c"
7826 break;
7827
7828 case YYSYMBOL_p_args_tail: /* p_args_tail */
7829#line 1331 "parse.y"
7830 {
7831#ifndef RIPPER
7832 if (((*yyvaluep).node)) {
7833 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7834 }
7835#else
7836#endif
7837}
7838#line 7837 "parse.c"
7839 break;
7840
7841 case YYSYMBOL_p_find: /* p_find */
7842#line 1331 "parse.y"
7843 {
7844#ifndef RIPPER
7845 if (((*yyvaluep).node)) {
7846 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7847 }
7848#else
7849#endif
7850}
7851#line 7850 "parse.c"
7852 break;
7853
7854 case YYSYMBOL_p_args_post: /* p_args_post */
7855#line 1331 "parse.y"
7856 {
7857#ifndef RIPPER
7858 if (((*yyvaluep).node)) {
7859 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7860 }
7861#else
7862#endif
7863}
7864#line 7863 "parse.c"
7865 break;
7866
7867 case YYSYMBOL_p_arg: /* p_arg */
7868#line 1331 "parse.y"
7869 {
7870#ifndef RIPPER
7871 if (((*yyvaluep).node)) {
7872 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7873 }
7874#else
7875#endif
7876}
7877#line 7876 "parse.c"
7878 break;
7879
7880 case YYSYMBOL_p_kwargs: /* p_kwargs */
7881#line 1331 "parse.y"
7882 {
7883#ifndef RIPPER
7884 if (((*yyvaluep).node)) {
7885 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7886 }
7887#else
7888#endif
7889}
7890#line 7889 "parse.c"
7891 break;
7892
7893 case YYSYMBOL_p_kwarg: /* p_kwarg */
7894#line 1331 "parse.y"
7895 {
7896#ifndef RIPPER
7897 if (((*yyvaluep).node)) {
7898 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7899 }
7900#else
7901#endif
7902}
7903#line 7902 "parse.c"
7904 break;
7905
7906 case YYSYMBOL_p_kw: /* p_kw */
7907#line 1331 "parse.y"
7908 {
7909#ifndef RIPPER
7910 if (((*yyvaluep).node)) {
7911 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7912 }
7913#else
7914#endif
7915}
7916#line 7915 "parse.c"
7917 break;
7918
7919 case YYSYMBOL_p_value: /* p_value */
7920#line 1331 "parse.y"
7921 {
7922#ifndef RIPPER
7923 if (((*yyvaluep).node)) {
7924 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7925 }
7926#else
7927#endif
7928}
7929#line 7928 "parse.c"
7930 break;
7931
7932 case YYSYMBOL_p_primitive: /* p_primitive */
7933#line 1331 "parse.y"
7934 {
7935#ifndef RIPPER
7936 if (((*yyvaluep).node)) {
7937 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7938 }
7939#else
7940#endif
7941}
7942#line 7941 "parse.c"
7943 break;
7944
7945 case YYSYMBOL_p_variable: /* p_variable */
7946#line 1331 "parse.y"
7947 {
7948#ifndef RIPPER
7949 if (((*yyvaluep).node)) {
7950 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7951 }
7952#else
7953#endif
7954}
7955#line 7954 "parse.c"
7956 break;
7957
7958 case YYSYMBOL_p_var_ref: /* p_var_ref */
7959#line 1331 "parse.y"
7960 {
7961#ifndef RIPPER
7962 if (((*yyvaluep).node)) {
7963 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7964 }
7965#else
7966#endif
7967}
7968#line 7967 "parse.c"
7969 break;
7970
7971 case YYSYMBOL_p_expr_ref: /* p_expr_ref */
7972#line 1331 "parse.y"
7973 {
7974#ifndef RIPPER
7975 if (((*yyvaluep).node)) {
7976 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7977 }
7978#else
7979#endif
7980}
7981#line 7980 "parse.c"
7982 break;
7983
7984 case YYSYMBOL_p_const: /* p_const */
7985#line 1331 "parse.y"
7986 {
7987#ifndef RIPPER
7988 if (((*yyvaluep).node)) {
7989 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
7990 }
7991#else
7992#endif
7993}
7994#line 7993 "parse.c"
7995 break;
7996
7997 case YYSYMBOL_opt_rescue: /* opt_rescue */
7998#line 1331 "parse.y"
7999 {
8000#ifndef RIPPER
8001 if (((*yyvaluep).node)) {
8002 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8003 }
8004#else
8005#endif
8006}
8007#line 8006 "parse.c"
8008 break;
8009
8010 case YYSYMBOL_exc_list: /* exc_list */
8011#line 1331 "parse.y"
8012 {
8013#ifndef RIPPER
8014 if (((*yyvaluep).node)) {
8015 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8016 }
8017#else
8018#endif
8019}
8020#line 8019 "parse.c"
8021 break;
8022
8023 case YYSYMBOL_exc_var: /* exc_var */
8024#line 1331 "parse.y"
8025 {
8026#ifndef RIPPER
8027 if (((*yyvaluep).node)) {
8028 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8029 }
8030#else
8031#endif
8032}
8033#line 8032 "parse.c"
8034 break;
8035
8036 case YYSYMBOL_opt_ensure: /* opt_ensure */
8037#line 1331 "parse.y"
8038 {
8039#ifndef RIPPER
8040 if (((*yyvaluep).node)) {
8041 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8042 }
8043#else
8044#endif
8045}
8046#line 8045 "parse.c"
8047 break;
8048
8049 case YYSYMBOL_literal: /* literal */
8050#line 1331 "parse.y"
8051 {
8052#ifndef RIPPER
8053 if (((*yyvaluep).node)) {
8054 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8055 }
8056#else
8057#endif
8058}
8059#line 8058 "parse.c"
8060 break;
8061
8062 case YYSYMBOL_strings: /* strings */
8063#line 1331 "parse.y"
8064 {
8065#ifndef RIPPER
8066 if (((*yyvaluep).node)) {
8067 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8068 }
8069#else
8070#endif
8071}
8072#line 8071 "parse.c"
8073 break;
8074
8075 case YYSYMBOL_string: /* string */
8076#line 1331 "parse.y"
8077 {
8078#ifndef RIPPER
8079 if (((*yyvaluep).node)) {
8080 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8081 }
8082#else
8083#endif
8084}
8085#line 8084 "parse.c"
8086 break;
8087
8088 case YYSYMBOL_string1: /* string1 */
8089#line 1331 "parse.y"
8090 {
8091#ifndef RIPPER
8092 if (((*yyvaluep).node)) {
8093 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8094 }
8095#else
8096#endif
8097}
8098#line 8097 "parse.c"
8099 break;
8100
8101 case YYSYMBOL_xstring: /* xstring */
8102#line 1331 "parse.y"
8103 {
8104#ifndef RIPPER
8105 if (((*yyvaluep).node)) {
8106 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8107 }
8108#else
8109#endif
8110}
8111#line 8110 "parse.c"
8112 break;
8113
8114 case YYSYMBOL_regexp: /* regexp */
8115#line 1331 "parse.y"
8116 {
8117#ifndef RIPPER
8118 if (((*yyvaluep).node)) {
8119 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8120 }
8121#else
8122#endif
8123}
8124#line 8123 "parse.c"
8125 break;
8126
8127 case YYSYMBOL_words: /* words */
8128#line 1331 "parse.y"
8129 {
8130#ifndef RIPPER
8131 if (((*yyvaluep).node)) {
8132 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8133 }
8134#else
8135#endif
8136}
8137#line 8136 "parse.c"
8138 break;
8139
8140 case YYSYMBOL_word_list: /* word_list */
8141#line 1331 "parse.y"
8142 {
8143#ifndef RIPPER
8144 if (((*yyvaluep).node)) {
8145 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8146 }
8147#else
8148#endif
8149}
8150#line 8149 "parse.c"
8151 break;
8152
8153 case YYSYMBOL_word: /* word */
8154#line 1331 "parse.y"
8155 {
8156#ifndef RIPPER
8157 if (((*yyvaluep).node)) {
8158 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8159 }
8160#else
8161#endif
8162}
8163#line 8162 "parse.c"
8164 break;
8165
8166 case YYSYMBOL_symbols: /* symbols */
8167#line 1331 "parse.y"
8168 {
8169#ifndef RIPPER
8170 if (((*yyvaluep).node)) {
8171 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8172 }
8173#else
8174#endif
8175}
8176#line 8175 "parse.c"
8177 break;
8178
8179 case YYSYMBOL_symbol_list: /* symbol_list */
8180#line 1331 "parse.y"
8181 {
8182#ifndef RIPPER
8183 if (((*yyvaluep).node)) {
8184 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8185 }
8186#else
8187#endif
8188}
8189#line 8188 "parse.c"
8190 break;
8191
8192 case YYSYMBOL_qwords: /* qwords */
8193#line 1331 "parse.y"
8194 {
8195#ifndef RIPPER
8196 if (((*yyvaluep).node)) {
8197 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8198 }
8199#else
8200#endif
8201}
8202#line 8201 "parse.c"
8203 break;
8204
8205 case YYSYMBOL_qsymbols: /* qsymbols */
8206#line 1331 "parse.y"
8207 {
8208#ifndef RIPPER
8209 if (((*yyvaluep).node)) {
8210 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8211 }
8212#else
8213#endif
8214}
8215#line 8214 "parse.c"
8216 break;
8217
8218 case YYSYMBOL_qword_list: /* qword_list */
8219#line 1331 "parse.y"
8220 {
8221#ifndef RIPPER
8222 if (((*yyvaluep).node)) {
8223 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8224 }
8225#else
8226#endif
8227}
8228#line 8227 "parse.c"
8229 break;
8230
8231 case YYSYMBOL_qsym_list: /* qsym_list */
8232#line 1331 "parse.y"
8233 {
8234#ifndef RIPPER
8235 if (((*yyvaluep).node)) {
8236 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8237 }
8238#else
8239#endif
8240}
8241#line 8240 "parse.c"
8242 break;
8243
8244 case YYSYMBOL_string_contents: /* string_contents */
8245#line 1331 "parse.y"
8246 {
8247#ifndef RIPPER
8248 if (((*yyvaluep).node)) {
8249 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8250 }
8251#else
8252#endif
8253}
8254#line 8253 "parse.c"
8255 break;
8256
8257 case YYSYMBOL_xstring_contents: /* xstring_contents */
8258#line 1331 "parse.y"
8259 {
8260#ifndef RIPPER
8261 if (((*yyvaluep).node)) {
8262 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8263 }
8264#else
8265#endif
8266}
8267#line 8266 "parse.c"
8268 break;
8269
8270 case YYSYMBOL_regexp_contents: /* regexp_contents */
8271#line 1331 "parse.y"
8272 {
8273#ifndef RIPPER
8274 if (((*yyvaluep).node)) {
8275 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8276 }
8277#else
8278#endif
8279}
8280#line 8279 "parse.c"
8281 break;
8282
8283 case YYSYMBOL_string_content: /* string_content */
8284#line 1331 "parse.y"
8285 {
8286#ifndef RIPPER
8287 if (((*yyvaluep).node)) {
8288 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8289 }
8290#else
8291#endif
8292}
8293#line 8292 "parse.c"
8294 break;
8295
8296 case YYSYMBOL_string_dvar: /* string_dvar */
8297#line 1331 "parse.y"
8298 {
8299#ifndef RIPPER
8300 if (((*yyvaluep).node)) {
8301 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8302 }
8303#else
8304#endif
8305}
8306#line 8305 "parse.c"
8307 break;
8308
8309 case YYSYMBOL_symbol: /* symbol */
8310#line 1331 "parse.y"
8311 {
8312#ifndef RIPPER
8313 if (((*yyvaluep).node)) {
8314 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8315 }
8316#else
8317#endif
8318}
8319#line 8318 "parse.c"
8320 break;
8321
8322 case YYSYMBOL_ssym: /* ssym */
8323#line 1331 "parse.y"
8324 {
8325#ifndef RIPPER
8326 if (((*yyvaluep).node)) {
8327 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8328 }
8329#else
8330#endif
8331}
8332#line 8331 "parse.c"
8333 break;
8334
8335 case YYSYMBOL_dsym: /* dsym */
8336#line 1331 "parse.y"
8337 {
8338#ifndef RIPPER
8339 if (((*yyvaluep).node)) {
8340 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8341 }
8342#else
8343#endif
8344}
8345#line 8344 "parse.c"
8346 break;
8347
8348 case YYSYMBOL_numeric: /* numeric */
8349#line 1331 "parse.y"
8350 {
8351#ifndef RIPPER
8352 if (((*yyvaluep).node)) {
8353 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8354 }
8355#else
8356#endif
8357}
8358#line 8357 "parse.c"
8359 break;
8360
8361 case YYSYMBOL_simple_numeric: /* simple_numeric */
8362#line 1331 "parse.y"
8363 {
8364#ifndef RIPPER
8365 if (((*yyvaluep).node)) {
8366 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8367 }
8368#else
8369#endif
8370}
8371#line 8370 "parse.c"
8372 break;
8373
8374 case YYSYMBOL_var_ref: /* var_ref */
8375#line 1331 "parse.y"
8376 {
8377#ifndef RIPPER
8378 if (((*yyvaluep).node)) {
8379 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8380 }
8381#else
8382#endif
8383}
8384#line 8383 "parse.c"
8385 break;
8386
8387 case YYSYMBOL_var_lhs: /* var_lhs */
8388#line 1331 "parse.y"
8389 {
8390#ifndef RIPPER
8391 if (((*yyvaluep).node)) {
8392 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8393 }
8394#else
8395#endif
8396}
8397#line 8396 "parse.c"
8398 break;
8399
8400 case YYSYMBOL_backref: /* backref */
8401#line 1331 "parse.y"
8402 {
8403#ifndef RIPPER
8404 if (((*yyvaluep).node)) {
8405 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8406 }
8407#else
8408#endif
8409}
8410#line 8409 "parse.c"
8411 break;
8412
8413 case YYSYMBOL_superclass: /* superclass */
8414#line 1331 "parse.y"
8415 {
8416#ifndef RIPPER
8417 if (((*yyvaluep).node)) {
8418 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8419 }
8420#else
8421#endif
8422}
8423#line 8422 "parse.c"
8424 break;
8425
8426 case YYSYMBOL_f_opt_paren_args: /* f_opt_paren_args */
8427#line 1331 "parse.y"
8428 {
8429#ifndef RIPPER
8430 if (((*yyvaluep).node)) {
8431 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8432 }
8433#else
8434#endif
8435}
8436#line 8435 "parse.c"
8437 break;
8438
8439 case YYSYMBOL_f_paren_args: /* f_paren_args */
8440#line 1331 "parse.y"
8441 {
8442#ifndef RIPPER
8443 if (((*yyvaluep).node)) {
8444 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8445 }
8446#else
8447#endif
8448}
8449#line 8448 "parse.c"
8450 break;
8451
8452 case YYSYMBOL_f_arglist: /* f_arglist */
8453#line 1331 "parse.y"
8454 {
8455#ifndef RIPPER
8456 if (((*yyvaluep).node)) {
8457 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8458 }
8459#else
8460#endif
8461}
8462#line 8461 "parse.c"
8463 break;
8464
8465 case YYSYMBOL_args_tail: /* args_tail */
8466#line 1331 "parse.y"
8467 {
8468#ifndef RIPPER
8469 if (((*yyvaluep).node)) {
8470 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8471 }
8472#else
8473#endif
8474}
8475#line 8474 "parse.c"
8476 break;
8477
8478 case YYSYMBOL_opt_args_tail: /* opt_args_tail */
8479#line 1331 "parse.y"
8480 {
8481#ifndef RIPPER
8482 if (((*yyvaluep).node)) {
8483 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8484 }
8485#else
8486#endif
8487}
8488#line 8487 "parse.c"
8489 break;
8490
8491 case YYSYMBOL_f_args: /* f_args */
8492#line 1331 "parse.y"
8493 {
8494#ifndef RIPPER
8495 if (((*yyvaluep).node)) {
8496 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8497 }
8498#else
8499#endif
8500}
8501#line 8500 "parse.c"
8502 break;
8503
8504 case YYSYMBOL_f_arg_item: /* f_arg_item */
8505#line 1331 "parse.y"
8506 {
8507#ifndef RIPPER
8508 if (((*yyvaluep).node)) {
8509 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8510 }
8511#else
8512#endif
8513}
8514#line 8513 "parse.c"
8515 break;
8516
8517 case YYSYMBOL_f_arg: /* f_arg */
8518#line 1331 "parse.y"
8519 {
8520#ifndef RIPPER
8521 if (((*yyvaluep).node)) {
8522 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8523 }
8524#else
8525#endif
8526}
8527#line 8526 "parse.c"
8528 break;
8529
8530 case YYSYMBOL_f_kw: /* f_kw */
8531#line 1331 "parse.y"
8532 {
8533#ifndef RIPPER
8534 if (((*yyvaluep).node)) {
8535 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8536 }
8537#else
8538#endif
8539}
8540#line 8539 "parse.c"
8541 break;
8542
8543 case YYSYMBOL_f_block_kw: /* f_block_kw */
8544#line 1331 "parse.y"
8545 {
8546#ifndef RIPPER
8547 if (((*yyvaluep).node)) {
8548 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8549 }
8550#else
8551#endif
8552}
8553#line 8552 "parse.c"
8554 break;
8555
8556 case YYSYMBOL_f_block_kwarg: /* f_block_kwarg */
8557#line 1331 "parse.y"
8558 {
8559#ifndef RIPPER
8560 if (((*yyvaluep).node)) {
8561 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8562 }
8563#else
8564#endif
8565}
8566#line 8565 "parse.c"
8567 break;
8568
8569 case YYSYMBOL_f_kwarg: /* f_kwarg */
8570#line 1331 "parse.y"
8571 {
8572#ifndef RIPPER
8573 if (((*yyvaluep).node)) {
8574 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8575 }
8576#else
8577#endif
8578}
8579#line 8578 "parse.c"
8580 break;
8581
8582 case YYSYMBOL_f_opt: /* f_opt */
8583#line 1331 "parse.y"
8584 {
8585#ifndef RIPPER
8586 if (((*yyvaluep).node)) {
8587 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8588 }
8589#else
8590#endif
8591}
8592#line 8591 "parse.c"
8593 break;
8594
8595 case YYSYMBOL_f_block_opt: /* f_block_opt */
8596#line 1331 "parse.y"
8597 {
8598#ifndef RIPPER
8599 if (((*yyvaluep).node)) {
8600 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8601 }
8602#else
8603#endif
8604}
8605#line 8604 "parse.c"
8606 break;
8607
8608 case YYSYMBOL_f_block_optarg: /* f_block_optarg */
8609#line 1331 "parse.y"
8610 {
8611#ifndef RIPPER
8612 if (((*yyvaluep).node)) {
8613 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8614 }
8615#else
8616#endif
8617}
8618#line 8617 "parse.c"
8619 break;
8620
8621 case YYSYMBOL_f_optarg: /* f_optarg */
8622#line 1331 "parse.y"
8623 {
8624#ifndef RIPPER
8625 if (((*yyvaluep).node)) {
8626 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8627 }
8628#else
8629#endif
8630}
8631#line 8630 "parse.c"
8632 break;
8633
8634 case YYSYMBOL_singleton: /* singleton */
8635#line 1331 "parse.y"
8636 {
8637#ifndef RIPPER
8638 if (((*yyvaluep).node)) {
8639 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8640 }
8641#else
8642#endif
8643}
8644#line 8643 "parse.c"
8645 break;
8646
8647 case YYSYMBOL_assoc_list: /* assoc_list */
8648#line 1331 "parse.y"
8649 {
8650#ifndef RIPPER
8651 if (((*yyvaluep).node)) {
8652 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8653 }
8654#else
8655#endif
8656}
8657#line 8656 "parse.c"
8658 break;
8659
8660 case YYSYMBOL_assocs: /* assocs */
8661#line 1331 "parse.y"
8662 {
8663#ifndef RIPPER
8664 if (((*yyvaluep).node)) {
8665 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8666 }
8667#else
8668#endif
8669}
8670#line 8669 "parse.c"
8671 break;
8672
8673 case YYSYMBOL_assoc: /* assoc */
8674#line 1331 "parse.y"
8675 {
8676#ifndef RIPPER
8677 if (((*yyvaluep).node)) {
8678 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8679 }
8680#else
8681#endif
8682}
8683#line 8682 "parse.c"
8684 break;
8685
8686 case YYSYMBOL_none: /* none */
8687#line 1331 "parse.y"
8688 {
8689#ifndef RIPPER
8690 if (((*yyvaluep).node)) {
8691 rb_parser_printf(p, "%s", ruby_node_name(nd_type(((*yyvaluep).node))));
8692 }
8693#else
8694#endif
8695}
8696#line 8695 "parse.c"
8697 break;
8698
8699 default:
8700 break;
8701 }
8702 YY_IGNORE_MAYBE_UNINITIALIZED_END
8703}
8704
8705
8706/*---------------------------.
8707| Print this symbol on YYO. |
8708`---------------------------*/
8709
8710static void
8711yy_symbol_print (FILE *yyo,
8712 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
8713{
8714 YYFPRINTF (p, "%s %s (",
8715 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
8716
8717 YYLOCATION_PRINT (yyo, yylocationp);
8718 YYFPRINTF (p, ": ");
8719 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
8720 YYFPRINTF (p, ")");
8721}
8722
8723/*------------------------------------------------------------------.
8724| yy_stack_print -- Print the state stack from its BOTTOM up to its |
8725| TOP (included). |
8726`------------------------------------------------------------------*/
8727
8728static void
8729ruby_parser_yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
8730#define yy_stack_print(b, t) ruby_parser_yy_stack_print(b, t, p)
8731{
8732 YYFPRINTF (p, "Stack now");
8733 for (; yybottom <= yytop; yybottom++)
8734 {
8735 int yybot = *yybottom;
8736 YYFPRINTF (p, " %d", yybot);
8737 }
8738 YYFPRINTF (p, "\n");
8739}
8740
8741# define YY_STACK_PRINT(Bottom, Top) \
8742do { \
8743 if (yydebug) \
8744 yy_stack_print ((Bottom), (Top)); \
8745} while (0)
8746
8747
8748/*------------------------------------------------.
8749| Report that the YYRULE is going to be reduced. |
8750`------------------------------------------------*/
8751
8752static void
8753yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
8754 int yyrule, struct parser_params *p)
8755{
8756 int yylno = yyrline[yyrule];
8757 int yynrhs = yyr2[yyrule];
8758 int yyi;
8759 YYFPRINTF (p, "Reducing stack by rule %d (line %d):\n",
8760 yyrule - 1, yylno);
8761 /* The symbols being reduced. */
8762 for (yyi = 0; yyi < yynrhs; yyi++)
8763 {
8764 YYFPRINTF (p, " $%d = ", yyi + 1);
8765 yy_symbol_print (stderr,
8766 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
8767 &yyvsp[(yyi + 1) - (yynrhs)],
8768 &(yylsp[(yyi + 1) - (yynrhs)]), p);
8769 YYFPRINTF (p, "\n");
8770 }
8771}
8772
8773# define YY_REDUCE_PRINT(Rule) \
8774do { \
8775 if (yydebug) \
8776 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
8777} while (0)
8778
8779/* Nonzero means print parse trace. It is left uninitialized so that
8780 multiple parsers can coexist. */
8781#ifndef yydebug
8782int yydebug;
8783#endif
8784#else /* !YYDEBUG */
8785# define YYDPRINTF(Args) ((void) 0)
8786# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
8787# define YY_STACK_PRINT(Bottom, Top)
8788# define YY_REDUCE_PRINT(Rule)
8789#endif /* !YYDEBUG */
8790
8791
8792/* YYINITDEPTH -- initial size of the parser's stacks. */
8793#ifndef YYINITDEPTH
8794# define YYINITDEPTH 200
8795#endif
8796
8797/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
8798 if the built-in stack extension method is used).
8799
8800 Do not make this value too large; the results are undefined if
8801 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
8802 evaluated with infinite-precision integer arithmetic. */
8803
8804#ifndef YYMAXDEPTH
8805# define YYMAXDEPTH 10000
8806#endif
8807
8808
8809/* Context of a parse error. */
8810typedef struct
8811{
8812 yy_state_t *yyssp;
8813 yysymbol_kind_t yytoken;
8814 YYLTYPE *yylloc;
8815} yypcontext_t;
8816
8817/* Put in YYARG at most YYARGN of the expected tokens given the
8818 current YYCTX, and return the number of tokens stored in YYARG. If
8819 YYARG is null, return the number of expected tokens (guaranteed to
8820 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
8821 Return 0 if there are more than YYARGN expected tokens, yet fill
8822 YYARG up to YYARGN. */
8823static int
8824yypcontext_expected_tokens (const yypcontext_t *yyctx,
8825 yysymbol_kind_t yyarg[], int yyargn)
8826{
8827 /* Actual size of YYARG. */
8828 int yycount = 0;
8829 int yyn = yypact[+*yyctx->yyssp];
8830 if (!yypact_value_is_default (yyn))
8831 {
8832 /* Start YYX at -YYN if negative to avoid negative indexes in
8833 YYCHECK. In other words, skip the first -YYN actions for
8834 this state because they are default actions. */
8835 int yyxbegin = yyn < 0 ? -yyn : 0;
8836 /* Stay within bounds of both yycheck and yytname. */
8837 int yychecklim = YYLAST - yyn + 1;
8838 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
8839 int yyx;
8840 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
8841 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
8842 && !yytable_value_is_error (yytable[yyx + yyn]))
8843 {
8844 if (!yyarg)
8845 ++yycount;
8846 else if (yycount == yyargn)
8847 return 0;
8848 else
8849 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
8850 }
8851 }
8852 if (yyarg && yycount == 0 && 0 < yyargn)
8853 yyarg[0] = YYSYMBOL_YYEMPTY;
8854 return yycount;
8855}
8856
8857
8858
8859
8860#ifndef yystrlen
8861# if defined __GLIBC__ && defined _STRING_H
8862# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
8863# else
8864/* Return the length of YYSTR. */
8865static YYPTRDIFF_T
8866yystrlen (const char *yystr)
8867{
8868 YYPTRDIFF_T yylen;
8869 for (yylen = 0; yystr[yylen]; yylen++)
8870 continue;
8871 return yylen;
8872}
8873# endif
8874#endif
8875
8876#ifndef yystpcpy
8877# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
8878# define yystpcpy stpcpy
8879# else
8880/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
8881 YYDEST. */
8882static char *
8883yystpcpy (char *yydest, const char *yysrc)
8884{
8885 char *yyd = yydest;
8886 const char *yys = yysrc;
8887
8888 while ((*yyd++ = *yys++) != '\0')
8889 continue;
8890
8891 return yyd - 1;
8892}
8893# endif
8894#endif
8895
8896#ifndef yytnamerr
8897/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
8898 quotes and backslashes, so that it's suitable for yyerror. The
8899 heuristic is that double-quoting is unnecessary unless the string
8900 contains an apostrophe, a comma, or backslash (other than
8901 backslash-backslash). YYSTR is taken from yytname. If YYRES is
8902 null, do not copy; instead, return the length of what the result
8903 would have been. */
8904static YYPTRDIFF_T
8905yytnamerr (char *yyres, const char *yystr)
8906{
8907 if (*yystr == '"')
8908 {
8909 YYPTRDIFF_T yyn = 0;
8910 char const *yyp = yystr;
8911 for (;;)
8912 switch (*++yyp)
8913 {
8914 case '\'':
8915 case ',':
8916 goto do_not_strip_quotes;
8917
8918 case '\\':
8919 if (*++yyp != '\\')
8920 goto do_not_strip_quotes;
8921 else
8922 goto append;
8923
8924 append:
8925 default:
8926 if (yyres)
8927 yyres[yyn] = *yyp;
8928 yyn++;
8929 break;
8930
8931 case '"':
8932 if (yyres)
8933 yyres[yyn] = '\0';
8934 return yyn;
8935 }
8936 do_not_strip_quotes: ;
8937 }
8938
8939 if (yyres)
8940 return yystpcpy (yyres, yystr) - yyres;
8941 else
8942 return yystrlen (yystr);
8943}
8944#endif
8945
8946
8947static int
8948yy_syntax_error_arguments (const yypcontext_t *yyctx,
8949 yysymbol_kind_t yyarg[], int yyargn)
8950{
8951 /* Actual size of YYARG. */
8952 int yycount = 0;
8953 /* There are many possibilities here to consider:
8954 - If this state is a consistent state with a default action, then
8955 the only way this function was invoked is if the default action
8956 is an error action. In that case, don't check for expected
8957 tokens because there are none.
8958 - The only way there can be no lookahead present (in yychar) is if
8959 this state is a consistent state with a default action. Thus,
8960 detecting the absence of a lookahead is sufficient to determine
8961 that there is no unexpected or expected token to report. In that
8962 case, just report a simple "syntax error".
8963 - Don't assume there isn't a lookahead just because this state is a
8964 consistent state with a default action. There might have been a
8965 previous inconsistent state, consistent state with a non-default
8966 action, or user semantic action that manipulated yychar.
8967 - Of course, the expected token list depends on states to have
8968 correct lookahead information, and it depends on the parser not
8969 to perform extra reductions after fetching a lookahead from the
8970 scanner and before detecting a syntax error. Thus, state merging
8971 (from LALR or IELR) and default reductions corrupt the expected
8972 token list. However, the list is correct for canonical LR with
8973 one exception: it will still contain any token that will not be
8974 accepted due to an error action in a later state.
8975 */
8976 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
8977 {
8978 int yyn;
8979 if (yyarg)
8980 yyarg[yycount] = yyctx->yytoken;
8981 ++yycount;
8982 yyn = yypcontext_expected_tokens (yyctx,
8983 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
8984 if (yyn == YYENOMEM)
8985 return YYENOMEM;
8986 else
8987 yycount += yyn;
8988 }
8989 return yycount;
8990}
8991
8992/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
8993 about the unexpected token YYTOKEN for the state stack whose top is
8994 YYSSP.
8995
8996 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
8997 not large enough to hold the message. In that case, also set
8998 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
8999 required number of bytes is too large to store. */
9000static int
9001yysyntax_error (struct parser_params *p, YYPTRDIFF_T *yymsg_alloc, char **yymsg,
9002 const yypcontext_t *yyctx)
9003{
9004 enum { YYARGS_MAX = 5 };
9005 /* Internationalized format string. */
9006 const char *yyformat = YY_NULLPTR;
9007 /* Arguments of yyformat: reported tokens (one for the "unexpected",
9008 one per "expected"). */
9009 yysymbol_kind_t yyarg[YYARGS_MAX];
9010 /* Cumulated lengths of YYARG. */
9011 YYPTRDIFF_T yysize = 0;
9012
9013 /* Actual size of YYARG. */
9014 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
9015 if (yycount == YYENOMEM)
9016 return YYENOMEM;
9017
9018 switch (yycount)
9019 {
9020#define YYCASE_(N, S) \
9021 case N: \
9022 yyformat = S; \
9023 break
9024 default: /* Avoid compiler warnings. */
9025 YYCASE_(0, YY_("syntax error"));
9026 YYCASE_(1, YY_("syntax error, unexpected %s"));
9027 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
9028 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
9029 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
9030 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
9031#undef YYCASE_
9032 }
9033
9034 /* Compute error message size. Don't count the "%s"s, but reserve
9035 room for the terminator. */
9036 yysize = yystrlen (yyformat) - 2 * yycount + 1;
9037 {
9038 int yyi;
9039 for (yyi = 0; yyi < yycount; ++yyi)
9040 {
9041 YYPTRDIFF_T yysize1
9042 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
9043 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
9044 yysize = yysize1;
9045 else
9046 return YYENOMEM;
9047 }
9048 }
9049
9050 if (*yymsg_alloc < yysize)
9051 {
9052 *yymsg_alloc = 2 * yysize;
9053 if (! (yysize <= *yymsg_alloc
9054 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
9055 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
9056 return -1;
9057 }
9058
9059 /* Avoid sprintf, as that infringes on the user's name space.
9060 Don't have undefined behavior even if the translation
9061 produced a string with the wrong number of "%s"s. */
9062 {
9063 char *yyp = *yymsg;
9064 int yyi = 0;
9065 while ((*yyp = *yyformat) != '\0')
9066 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
9067 {
9068 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
9069 yyformat += 2;
9070 }
9071 else
9072 {
9073 ++yyp;
9074 ++yyformat;
9075 }
9076 }
9077 return 0;
9078}
9079
9080
9081/*-----------------------------------------------.
9082| Release the memory associated to this symbol. |
9083`-----------------------------------------------*/
9084
9085static void
9086yydestruct (const char *yymsg,
9087 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
9088{
9089 YY_USE (yyvaluep);
9090 YY_USE (yylocationp);
9091 YY_USE (p);
9092 if (!yymsg)
9093 yymsg = "Deleting";
9094 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
9095
9096 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
9097 YY_USE (yykind);
9098 YY_IGNORE_MAYBE_UNINITIALIZED_END
9099}
9100
9101
9102
9103
9104
9105
9106/*----------.
9107| yyparse. |
9108`----------*/
9109
9110int
9111yyparse (struct parser_params *p)
9112{
9113/* Lookahead token kind. */
9114int yychar;
9115
9116
9117/* The semantic value of the lookahead symbol. */
9118/* Default value used for initialization, for pacifying older GCCs
9119 or non-GCC compilers. */
9120YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
9121YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
9122
9123/* Location data for the lookahead symbol. */
9124static YYLTYPE yyloc_default
9125# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
9126 = { 1, 1, 1, 1 }
9127# endif
9128;
9129YYLTYPE yylloc = yyloc_default;
9130
9131 /* Number of syntax errors so far. */
9132 int yynerrs = 0;
9133
9134 yy_state_fast_t yystate = 0;
9135 /* Number of tokens to shift before error messages enabled. */
9136 int yyerrstatus = 0;
9137
9138 /* Refer to the stacks through separate pointers, to allow yyoverflow
9139 to reallocate them elsewhere. */
9140
9141 /* Their size. */
9142 YYPTRDIFF_T yystacksize = YYINITDEPTH;
9143
9144 /* The state stack: array, bottom, top. */
9145 yy_state_t yyssa[YYINITDEPTH];
9146 yy_state_t *yyss = yyssa;
9147 yy_state_t *yyssp = yyss;
9148
9149 /* The semantic value stack: array, bottom, top. */
9150 YYSTYPE yyvsa[YYINITDEPTH];
9151 YYSTYPE *yyvs = yyvsa;
9152 YYSTYPE *yyvsp = yyvs;
9153
9154 /* The location stack: array, bottom, top. */
9155 YYLTYPE yylsa[YYINITDEPTH];
9156 YYLTYPE *yyls = yylsa;
9157 YYLTYPE *yylsp = yyls;
9158
9159 int yyn;
9160 /* The return value of yyparse. */
9161 int yyresult;
9162 /* Lookahead symbol kind. */
9163 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
9164 /* The variables used to return semantic value and location from the
9165 action routines. */
9166 YYSTYPE yyval;
9167 YYLTYPE yyloc;
9168
9169 /* The locations where the error started and ended. */
9170 YYLTYPE yyerror_range[3];
9171
9172 /* Buffer for error messages, and its allocated size. */
9173 char yymsgbuf[128];
9174 char *yymsg = yymsgbuf;
9175 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
9176
9177#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
9178
9179 /* The number of symbols on the RHS of the reduced rule.
9180 Keep to zero when no symbol should be popped. */
9181 int yylen = 0;
9182
9183 YYDPRINTF ((p, "Starting parse\n"));
9184
9185 yychar = YYEMPTY; /* Cause a token to be read. */
9186
9187
9188/* User initialization code. */
9189#line 1371 "parse.y"
9190{
9191 RUBY_SET_YYLLOC_OF_NONE(yylloc);
9192}
9193
9194#line 9190 "parse.c"
9195
9196 yylsp[0] = yylloc;
9197 goto yysetstate;
9198
9199
9200/*------------------------------------------------------------.
9201| yynewstate -- push a new state, which is found in yystate. |
9202`------------------------------------------------------------*/
9203yynewstate:
9204 /* In all cases, when you get here, the value and location stacks
9205 have just been pushed. So pushing a state here evens the stacks. */
9206 yyssp++;
9207
9208
9209/*--------------------------------------------------------------------.
9210| yysetstate -- set current state (the top of the stack) to yystate. |
9211`--------------------------------------------------------------------*/
9212yysetstate:
9213 YYDPRINTF ((p, "Entering state %d\n", yystate));
9214 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
9215 YY_IGNORE_USELESS_CAST_BEGIN
9216 *yyssp = YY_CAST (yy_state_t, yystate);
9217 YY_IGNORE_USELESS_CAST_END
9218 YY_STACK_PRINT (yyss, yyssp);
9219
9220 if (yyss + yystacksize - 1 <= yyssp)
9221#if !defined yyoverflow && !defined YYSTACK_RELOCATE
9222 YYNOMEM;
9223#else
9224 {
9225 /* Get the current used size of the three stacks, in elements. */
9226 YYPTRDIFF_T yysize = yyssp - yyss + 1;
9227
9228# if defined yyoverflow
9229 {
9230 /* Give user a chance to reallocate the stack. Use copies of
9231 these so that the &'s don't force the real ones into
9232 memory. */
9233 yy_state_t *yyss1 = yyss;
9234 YYSTYPE *yyvs1 = yyvs;
9235 YYLTYPE *yyls1 = yyls;
9236
9237 /* Each stack pointer address is followed by the size of the
9238 data in use in that stack, in bytes. This used to be a
9239 conditional around just the two extra args, but that might
9240 be undefined if yyoverflow is a macro. */
9241 yyoverflow (YY_("memory exhausted"),
9242 &yyss1, yysize * YYSIZEOF (*yyssp),
9243 &yyvs1, yysize * YYSIZEOF (*yyvsp),
9244 &yyls1, yysize * YYSIZEOF (*yylsp),
9245 &yystacksize);
9246 yyss = yyss1;
9247 yyvs = yyvs1;
9248 yyls = yyls1;
9249 }
9250# else /* defined YYSTACK_RELOCATE */
9251 /* Extend the stack our own way. */
9252 if (YYMAXDEPTH <= yystacksize)
9253 YYNOMEM;
9254 yystacksize *= 2;
9255 if (YYMAXDEPTH < yystacksize)
9256 yystacksize = YYMAXDEPTH;
9257
9258 {
9259 yy_state_t *yyss1 = yyss;
9260 union yyalloc *yyptr =
9261 YY_CAST (union yyalloc *,
9262 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
9263 if (! yyptr)
9264 YYNOMEM;
9265 YYSTACK_RELOCATE (yyss_alloc, yyss);
9266 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
9267 YYSTACK_RELOCATE (yyls_alloc, yyls);
9268# undef YYSTACK_RELOCATE
9269 if (yyss1 != yyssa)
9270 YYSTACK_FREE (yyss1);
9271 }
9272# endif
9273
9274 yyssp = yyss + yysize - 1;
9275 yyvsp = yyvs + yysize - 1;
9276 yylsp = yyls + yysize - 1;
9277
9278 YY_IGNORE_USELESS_CAST_BEGIN
9279 YYDPRINTF ((p, "Stack size increased to %ld\n",
9280 YY_CAST (long, yystacksize)));
9281 YY_IGNORE_USELESS_CAST_END
9282
9283 if (yyss + yystacksize - 1 <= yyssp)
9284 YYABORT;
9285 }
9286#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
9287
9288
9289 if (yystate == YYFINAL)
9290 YYACCEPT;
9291
9292 goto yybackup;
9293
9294
9295/*-----------.
9296| yybackup. |
9297`-----------*/
9298yybackup:
9299 /* Do appropriate processing given the current state. Read a
9300 lookahead token if we need one and don't already have one. */
9301
9302 /* First try to decide what to do without reference to lookahead token. */
9303 yyn = yypact[yystate];
9304 if (yypact_value_is_default (yyn))
9305 goto yydefault;
9306
9307 /* Not known => get a lookahead token if don't already have one. */
9308
9309 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
9310 if (yychar == YYEMPTY)
9311 {
9312 YYDPRINTF ((p, "Reading a token\n"));
9313 yychar = yylex (&yylval, &yylloc, p);
9314 }
9315
9316 if (yychar <= END_OF_INPUT)
9317 {
9318 yychar = END_OF_INPUT;
9319 yytoken = YYSYMBOL_YYEOF;
9320 YYDPRINTF ((p, "Now at end of input.\n"));
9321 }
9322 else if (yychar == YYerror)
9323 {
9324 /* The scanner already issued an error message, process directly
9325 to error recovery. But do not keep the error token as
9326 lookahead, it is too special and may lead us to an endless
9327 loop in error recovery. */
9328 yychar = YYUNDEF;
9329 yytoken = YYSYMBOL_YYerror;
9330 yyerror_range[1] = yylloc;
9331 goto yyerrlab1;
9332 }
9333 else
9334 {
9335 yytoken = YYTRANSLATE (yychar);
9336 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
9337 }
9338
9339 /* If the proper action on seeing token YYTOKEN is to reduce or to
9340 detect an error, take that action. */
9341 yyn += yytoken;
9342 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
9343 goto yydefault;
9344 yyn = yytable[yyn];
9345 if (yyn <= 0)
9346 {
9347 if (yytable_value_is_error (yyn))
9348 goto yyerrlab;
9349 yyn = -yyn;
9350 goto yyreduce;
9351 }
9352
9353 /* Count tokens shifted since error; after three, turn off error
9354 status. */
9355 if (yyerrstatus)
9356 yyerrstatus--;
9357
9358 /* Shift the lookahead token. */
9359 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
9360 yystate = yyn;
9361 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
9362 *++yyvsp = yylval;
9363 YY_IGNORE_MAYBE_UNINITIALIZED_END
9364 *++yylsp = yylloc;
9365
9366 /* Discard the shifted token. */
9367 yychar = YYEMPTY;
9368 goto yynewstate;
9369
9370
9371/*-----------------------------------------------------------.
9372| yydefault -- do the default action for the current state. |
9373`-----------------------------------------------------------*/
9374yydefault:
9375 yyn = yydefact[yystate];
9376 if (yyn == 0)
9377 goto yyerrlab;
9378 goto yyreduce;
9379
9380
9381/*-----------------------------.
9382| yyreduce -- do a reduction. |
9383`-----------------------------*/
9384yyreduce:
9385 /* yyn is the number of a rule to reduce with. */
9386 yylen = yyr2[yyn];
9387
9388 /* If YYLEN is nonzero, implement the default value of the action:
9389 '$$ = $1'.
9390
9391 Otherwise, the following line sets YYVAL to garbage.
9392 This behavior is undocumented and Bison
9393 users should not rely upon it. Assigning to YYVAL
9394 unconditionally makes the parser a bit smaller, and it avoids a
9395 GCC warning that YYVAL may be used uninitialized. */
9396 yyval = yyvsp[1-yylen];
9397
9398 /* Default location. */
9399 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
9400 yyerror_range[1] = yyloc;
9401 YY_REDUCE_PRINT (yyn);
9402 switch (yyn)
9403 {
9404 case 2: /* $@1: %empty */
9405#line 1580 "parse.y"
9406 {
9407 SET_LEX_STATE(EXPR_BEG);
9408 local_push(p, ifndef_ripper(1)+0);
9409 }
9410#line 9406 "parse.c"
9411 break;
9412
9413 case 3: /* program: $@1 top_compstmt */
9414#line 1585 "parse.y"
9415 {
9416 /*%%%*/
9417 if ((yyvsp[0].node) && !compile_for_eval) {
9418 NODE *node = (yyvsp[0].node);
9419 /* last expression should not be void */
9420 if (nd_type_p(node, NODE_BLOCK)) {
9421 while (node->nd_next) {
9422 node = node->nd_next;
9423 }
9424 node = node->nd_head;
9425 }
9426 node = remove_begin(node);
9427 void_expr(p, node);
9428 }
9429 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
9430 /*% %*/
9431 /*% ripper[final]: program!($2) %*/
9432 local_pop(p);
9433 }
9434#line 9430 "parse.c"
9435 break;
9436
9437 case 4: /* top_compstmt: top_stmts opt_terms */
9438#line 1607 "parse.y"
9439 {
9440 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
9441 }
9442#line 9438 "parse.c"
9443 break;
9444
9445 case 5: /* top_stmts: none */
9446#line 1613 "parse.y"
9447 {
9448 /*%%%*/
9449 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9450 /*% %*/
9451 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
9452 }
9453#line 9449 "parse.c"
9454 break;
9455
9456 case 6: /* top_stmts: top_stmt */
9457#line 1620 "parse.y"
9458 {
9459 /*%%%*/
9460 (yyval.node) = newline_node((yyvsp[0].node));
9461 /*% %*/
9462 /*% ripper: stmts_add!(stmts_new!, $1) %*/
9463 }
9464#line 9460 "parse.c"
9465 break;
9466
9467 case 7: /* top_stmts: top_stmts terms top_stmt */
9468#line 1627 "parse.y"
9469 {
9470 /*%%%*/
9471 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
9472 /*% %*/
9473 /*% ripper: stmts_add!($1, $3) %*/
9474 }
9475#line 9471 "parse.c"
9476 break;
9477
9478 case 9: /* top_stmt: "`BEGIN'" begin_block */
9479#line 1637 "parse.y"
9480 {
9481 (yyval.node) = (yyvsp[0].node);
9482 }
9483#line 9479 "parse.c"
9484 break;
9485
9486 case 10: /* begin_block: '{' top_compstmt '}' */
9487#line 1643 "parse.y"
9488 {
9489 /*%%%*/
9490 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
9491 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
9492 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9493 /*% %*/
9494 /*% ripper: BEGIN!($2) %*/
9495 }
9496#line 9492 "parse.c"
9497 break;
9498
9499 case 11: /* $@2: %empty */
9500#line 1655 "parse.y"
9501 {if (!(yyvsp[-1].node)) {yyerror1(&(yylsp[0]), "else without rescue is useless");}}
9502#line 9498 "parse.c"
9503 break;
9504
9505 case 12: /* bodystmt: compstmt opt_rescue k_else $@2 compstmt opt_ensure */
9506#line 1658 "parse.y"
9507 {
9508 /*%%%*/
9509 (yyval.node) = new_bodystmt(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9510 /*% %*/
9511 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/
9512 }
9513#line 9509 "parse.c"
9514 break;
9515
9516 case 13: /* bodystmt: compstmt opt_rescue opt_ensure */
9517#line 1667 "parse.y"
9518 {
9519 /*%%%*/
9520 (yyval.node) = new_bodystmt(p, (yyvsp[-2].node), (yyvsp[-1].node), 0, (yyvsp[0].node), &(yyloc));
9521 /*% %*/
9522 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/
9523 }
9524#line 9520 "parse.c"
9525 break;
9526
9527 case 14: /* compstmt: stmts opt_terms */
9528#line 1676 "parse.y"
9529 {
9530 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
9531 }
9532#line 9528 "parse.c"
9533 break;
9534
9535 case 15: /* stmts: none */
9536#line 1682 "parse.y"
9537 {
9538 /*%%%*/
9539 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9540 /*% %*/
9541 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
9542 }
9543#line 9539 "parse.c"
9544 break;
9545
9546 case 16: /* stmts: stmt_or_begin */
9547#line 1689 "parse.y"
9548 {
9549 /*%%%*/
9550 (yyval.node) = newline_node((yyvsp[0].node));
9551 /*% %*/
9552 /*% ripper: stmts_add!(stmts_new!, $1) %*/
9553 }
9554#line 9550 "parse.c"
9555 break;
9556
9557 case 17: /* stmts: stmts terms stmt_or_begin */
9558#line 1696 "parse.y"
9559 {
9560 /*%%%*/
9561 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
9562 /*% %*/
9563 /*% ripper: stmts_add!($1, $3) %*/
9564 }
9565#line 9561 "parse.c"
9566 break;
9567
9568 case 18: /* stmt_or_begin: stmt */
9569#line 1705 "parse.y"
9570 {
9571 (yyval.node) = (yyvsp[0].node);
9572 }
9573#line 9569 "parse.c"
9574 break;
9575
9576 case 19: /* $@3: %empty */
9577#line 1709 "parse.y"
9578 {
9579 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
9580 }
9581#line 9577 "parse.c"
9582 break;
9583
9584 case 20: /* stmt_or_begin: "`BEGIN'" $@3 begin_block */
9585#line 1713 "parse.y"
9586 {
9587 (yyval.node) = (yyvsp[0].node);
9588 }
9589#line 9585 "parse.c"
9590 break;
9591
9592 case 21: /* $@4: %empty */
9593#line 1718 "parse.y"
9594 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
9595#line 9591 "parse.c"
9596 break;
9597
9598 case 22: /* stmt: "`alias'" fitem $@4 fitem */
9599#line 1719 "parse.y"
9600 {
9601 /*%%%*/
9602 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9603 /*% %*/
9604 /*% ripper: alias!($2, $4) %*/
9605 }
9606#line 9602 "parse.c"
9607 break;
9608
9609 case 23: /* stmt: "`alias'" "global variable" "global variable" */
9610#line 1726 "parse.y"
9611 {
9612 /*%%%*/
9613 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
9614 /*% %*/
9615 /*% ripper: var_alias!($2, $3) %*/
9616 }
9617#line 9613 "parse.c"
9618 break;
9619
9620 case 24: /* stmt: "`alias'" "global variable" "back reference" */
9621#line 1733 "parse.y"
9622 {
9623 /*%%%*/
9624 char buf[2];
9625 buf[0] = '$';
9626 buf[1] = (char)(yyvsp[0].node)->nd_nth;
9627 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
9628 /*% %*/
9629 /*% ripper: var_alias!($2, $3) %*/
9630 }
9631#line 9627 "parse.c"
9632 break;
9633
9634 case 25: /* stmt: "`alias'" "global variable" "numbered reference" */
9635#line 1743 "parse.y"
9636 {
9637 static const char mesg[] = "can't make alias for the number variables";
9638 /*%%%*/
9639 yyerror1(&(yylsp[0]), mesg);
9640 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9641 /*% %*/
9642 /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/
9643 }
9644#line 9640 "parse.c"
9645 break;
9646
9647 case 26: /* stmt: "`undef'" undef_list */
9648#line 1752 "parse.y"
9649 {
9650 /*%%%*/
9651 (yyval.node) = (yyvsp[0].node);
9652 /*% %*/
9653 /*% ripper: undef!($2) %*/
9654 }
9655#line 9651 "parse.c"
9656 break;
9657
9658 case 27: /* stmt: stmt "`if' modifier" expr_value */
9659#line 1759 "parse.y"
9660 {
9661 /*%%%*/
9662 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
9663 fixpos((yyval.node), (yyvsp[0].node));
9664 /*% %*/
9665 /*% ripper: if_mod!($3, $1) %*/
9666 }
9667#line 9663 "parse.c"
9668 break;
9669
9670 case 28: /* stmt: stmt "`unless' modifier" expr_value */
9671#line 1767 "parse.y"
9672 {
9673 /*%%%*/
9674 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
9675 fixpos((yyval.node), (yyvsp[0].node));
9676 /*% %*/
9677 /*% ripper: unless_mod!($3, $1) %*/
9678 }
9679#line 9675 "parse.c"
9680 break;
9681
9682 case 29: /* stmt: stmt "`while' modifier" expr_value */
9683#line 1775 "parse.y"
9684 {
9685 /*%%%*/
9686 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
9687 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
9688 }
9689 else {
9690 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
9691 }
9692 /*% %*/
9693 /*% ripper: while_mod!($3, $1) %*/
9694 }
9695#line 9691 "parse.c"
9696 break;
9697
9698 case 30: /* stmt: stmt "`until' modifier" expr_value */
9699#line 1787 "parse.y"
9700 {
9701 /*%%%*/
9702 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
9703 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
9704 }
9705 else {
9706 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
9707 }
9708 /*% %*/
9709 /*% ripper: until_mod!($3, $1) %*/
9710 }
9711#line 9707 "parse.c"
9712 break;
9713
9714 case 31: /* stmt: stmt "`rescue' modifier" stmt */
9715#line 1799 "parse.y"
9716 {
9717 /*%%%*/
9718 NODE *resq;
9719 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9720 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
9721 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-2].node)), resq, 0, &(yyloc));
9722 /*% %*/
9723 /*% ripper: rescue_mod!($1, $3) %*/
9724 }
9725#line 9721 "parse.c"
9726 break;
9727
9728 case 32: /* stmt: "`END'" '{' compstmt '}' */
9729#line 1809 "parse.y"
9730 {
9731 if (p->ctxt.in_def) {
9732 rb_warn0("END in method; use at_exit");
9733 }
9734 /*%%%*/
9735 {
9736 NODE *scope = NEW_NODE(
9737 NODE_SCOPE, 0 /* tbl */, (yyvsp[-1].node) /* body */, 0 /* args */, &(yyloc));
9738 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
9739 }
9740 /*% %*/
9741 /*% ripper: END!($3) %*/
9742 }
9743#line 9739 "parse.c"
9744 break;
9745
9746 case 34: /* stmt: mlhs '=' lex_ctxt command_call */
9747#line 1824 "parse.y"
9748 {
9749 /*%%%*/
9750 value_expr((yyvsp[0].node));
9751 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9752 /*% %*/
9753 /*% ripper: massign!($1, $4) %*/
9754 }
9755#line 9751 "parse.c"
9756 break;
9757
9758 case 35: /* stmt: lhs '=' lex_ctxt mrhs */
9759#line 1832 "parse.y"
9760 {
9761 /*%%%*/
9762 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9763 /*% %*/
9764 /*% ripper: assign!($1, $4) %*/
9765 }
9766#line 9762 "parse.c"
9767 break;
9768
9769 case 36: /* stmt: mlhs '=' lex_ctxt mrhs_arg "`rescue' modifier" stmt */
9770#line 1839 "parse.y"
9771 {
9772 /*%%%*/
9773 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9774 (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));
9775 /*% %*/
9776 /*% ripper: massign!($1, rescue_mod!($4, $6)) %*/
9777 }
9778#line 9774 "parse.c"
9779 break;
9780
9781 case 37: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
9782#line 1847 "parse.y"
9783 {
9784 /*%%%*/
9785 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9786 /*% %*/
9787 /*% ripper: massign!($1, $4) %*/
9788 }
9789#line 9785 "parse.c"
9790 break;
9791
9792 case 39: /* stmt: error */
9793#line 1855 "parse.y"
9794 {
9795 /*%%%*/
9796 (yyval.node) = NEW_ERROR(&(yyloc));
9797 /*% %*/
9798 }
9799#line 9795 "parse.c"
9800 break;
9801
9802 case 40: /* command_asgn: lhs '=' lex_ctxt command_rhs */
9803#line 1863 "parse.y"
9804 {
9805 /*%%%*/
9806 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9807 /*% %*/
9808 /*% ripper: assign!($1, $4) %*/
9809 }
9810#line 9806 "parse.c"
9811 break;
9812
9813 case 41: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
9814#line 1870 "parse.y"
9815 {
9816 /*%%%*/
9817 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
9818 /*% %*/
9819 /*% ripper: opassign!($1, $2, $4) %*/
9820 }
9821#line 9817 "parse.c"
9822 break;
9823
9824 case 42: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
9825#line 1877 "parse.y"
9826 {
9827 /*%%%*/
9828 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
9829 /*% %*/
9830 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
9831
9832 }
9833#line 9829 "parse.c"
9834 break;
9835
9836 case 43: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
9837#line 1885 "parse.y"
9838 {
9839 /*%%%*/
9840 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
9841 /*% %*/
9842 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
9843 }
9844#line 9840 "parse.c"
9845 break;
9846
9847 case 44: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
9848#line 1892 "parse.y"
9849 {
9850 /*%%%*/
9851 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
9852 /*% %*/
9853 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
9854 }
9855#line 9851 "parse.c"
9856 break;
9857
9858 case 45: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
9859#line 1899 "parse.y"
9860 {
9861 /*%%%*/
9862 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
9863 (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));
9864 /*% %*/
9865 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
9866 }
9867#line 9863 "parse.c"
9868 break;
9869
9870 case 46: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
9871#line 1907 "parse.y"
9872 {
9873 /*%%%*/
9874 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
9875 /*% %*/
9876 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/
9877 }
9878#line 9874 "parse.c"
9879 break;
9880
9881 case 47: /* command_asgn: defn_head f_opt_paren_args '=' command */
9882#line 1914 "parse.y"
9883 {
9884 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
9885 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9886 /*%%%*/
9887 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9888 /*% %*/
9889 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
9890 /*% ripper: def!(get_value($1), $2, $4) %*/
9891 local_pop(p);
9892 }
9893#line 9889 "parse.c"
9894 break;
9895
9896 case 48: /* command_asgn: defn_head f_opt_paren_args '=' command "`rescue' modifier" arg */
9897#line 1925 "parse.y"
9898 {
9899 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
9900 restore_defun(p, (yyvsp[-5].node)->nd_defn);
9901 /*%%%*/
9902 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9903 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
9904 /*% %*/
9905 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
9906 /*% ripper: def!(get_value($1), $2, $4) %*/
9907 local_pop(p);
9908 }
9909#line 9905 "parse.c"
9910 break;
9911
9912 case 49: /* command_asgn: defs_head f_opt_paren_args '=' command */
9913#line 1937 "parse.y"
9914 {
9915 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
9916 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9917 /*%%%*/
9918 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9919 /*%
9920 $1 = get_value($1);
9921 %*/
9922 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
9923 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
9924 local_pop(p);
9925 }
9926#line 9922 "parse.c"
9927 break;
9928
9929 case 50: /* command_asgn: defs_head f_opt_paren_args '=' command "`rescue' modifier" arg */
9930#line 1950 "parse.y"
9931 {
9932 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
9933 restore_defun(p, (yyvsp[-5].node)->nd_defn);
9934 /*%%%*/
9935 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9936 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
9937 /*%
9938 $1 = get_value($1);
9939 %*/
9940 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
9941 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
9942 local_pop(p);
9943 }
9944#line 9940 "parse.c"
9945 break;
9946
9947 case 51: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
9948#line 1964 "parse.y"
9949 {
9950 /*%%%*/
9951 rb_backref_error(p, (yyvsp[-3].node));
9952 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9953 /*% %*/
9954 /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/
9955 }
9956#line 9952 "parse.c"
9957 break;
9958
9959 case 52: /* command_rhs: command_call */
9960#line 1974 "parse.y"
9961 {
9962 value_expr((yyvsp[0].node));
9963 (yyval.node) = (yyvsp[0].node);
9964 }
9965#line 9961 "parse.c"
9966 break;
9967
9968 case 53: /* command_rhs: command_call "`rescue' modifier" stmt */
9969#line 1979 "parse.y"
9970 {
9971 /*%%%*/
9972 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9973 value_expr((yyvsp[-2].node));
9974 (yyval.node) = NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
9975 /*% %*/
9976 /*% ripper: rescue_mod!($1, $3) %*/
9977 }
9978#line 9974 "parse.c"
9979 break;
9980
9981 case 56: /* expr: expr "`and'" expr */
9982#line 1992 "parse.y"
9983 {
9984 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9985 }
9986#line 9982 "parse.c"
9987 break;
9988
9989 case 57: /* expr: expr "`or'" expr */
9990#line 1996 "parse.y"
9991 {
9992 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9993 }
9994#line 9990 "parse.c"
9995 break;
9996
9997 case 58: /* expr: "`not'" opt_nl expr */
9998#line 2000 "parse.y"
9999 {
10000 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
10001 }
10002#line 9998 "parse.c"
10003 break;
10004
10005 case 59: /* expr: '!' command_call */
10006#line 2004 "parse.y"
10007 {
10008 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
10009 }
10010#line 10006 "parse.c"
10011 break;
10012
10013 case 60: /* @5: %empty */
10014#line 2008 "parse.y"
10015 {
10016 value_expr((yyvsp[-1].node));
10017 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
10018 p->command_start = FALSE;
10019 (yyvsp[0].ctxt) = p->ctxt;
10020 p->ctxt.in_kwarg = 1;
10021 (yyval.tbl) = push_pvtbl(p);
10022 }
10023#line 10019 "parse.c"
10024 break;
10025
10026 case 61: /* @6: %empty */
10027#line 2016 "parse.y"
10028 {
10029 (yyval.tbl) = push_pktbl(p);
10030 }
10031#line 10027 "parse.c"
10032 break;
10033
10034 case 62: /* expr: arg "=>" @5 @6 p_top_expr_body */
10035#line 2020 "parse.y"
10036 {
10037 pop_pktbl(p, (yyvsp[-1].tbl));
10038 pop_pvtbl(p, (yyvsp[-2].tbl));
10039 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10040 /*%%%*/
10041 (yyval.node) = NEW_CASE3((yyvsp[-4].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc));
10042 /*% %*/
10043 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
10044 }
10045#line 10041 "parse.c"
10046 break;
10047
10048 case 63: /* @7: %empty */
10049#line 2030 "parse.y"
10050 {
10051 value_expr((yyvsp[-1].node));
10052 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
10053 p->command_start = FALSE;
10054 (yyvsp[0].ctxt) = p->ctxt;
10055 p->ctxt.in_kwarg = 1;
10056 (yyval.tbl) = push_pvtbl(p);
10057 }
10058#line 10054 "parse.c"
10059 break;
10060
10061 case 64: /* @8: %empty */
10062#line 2038 "parse.y"
10063 {
10064 (yyval.tbl) = push_pktbl(p);
10065 }
10066#line 10062 "parse.c"
10067 break;
10068
10069 case 65: /* expr: arg "`in'" @7 @8 p_top_expr_body */
10070#line 2042 "parse.y"
10071 {
10072 pop_pktbl(p, (yyvsp[-1].tbl));
10073 pop_pvtbl(p, (yyvsp[-2].tbl));
10074 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
10075 /*%%%*/
10076 (yyval.node) = NEW_CASE3((yyvsp[-4].node), NEW_IN((yyvsp[0].node), NEW_TRUE(&(yylsp[0])), NEW_FALSE(&(yylsp[0])), &(yylsp[0])), &(yyloc));
10077 /*% %*/
10078 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
10079 }
10080#line 10076 "parse.c"
10081 break;
10082
10083 case 67: /* def_name: fname */
10084#line 2055 "parse.y"
10085 {
10086 ID fname = get_id((yyvsp[0].id));
10087 ID cur_arg = p->cur_arg;
10088 YYSTYPE c = {.ctxt = p->ctxt};
10089 numparam_name(p, fname);
10090 local_push(p, 0);
10091 p->cur_arg = 0;
10092 p->ctxt.in_def = 1;
10093 (yyval.node) = NEW_NODE(NODE_SELF, /*vid*/cur_arg, /*mid*/fname, /*cval*/c.val, &(yyloc));
10094 /*%%%*/
10095 /*%
10096 $$ = NEW_RIPPER(fname, get_value($1), $$, &NULL_LOC);
10097 %*/
10098 }
10099#line 10095 "parse.c"
10100 break;
10101
10102 case 68: /* defn_head: k_def def_name */
10103#line 2072 "parse.y"
10104 {
10105 (yyval.node) = (yyvsp[0].node);
10106 /*%%%*/
10107 (yyval.node) = NEW_NODE(NODE_DEFN, 0, (yyval.node)->nd_mid, (yyval.node), &(yyloc));
10108 /*% %*/
10109 }
10110#line 10106 "parse.c"
10111 break;
10112
10113 case 69: /* $@9: %empty */
10114#line 2081 "parse.y"
10115 {
10116 SET_LEX_STATE(EXPR_FNAME);
10117 p->ctxt.in_argdef = 1;
10118 }
10119#line 10115 "parse.c"
10120 break;
10121
10122 case 70: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
10123#line 2086 "parse.y"
10124 {
10125 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
10126 (yyval.node) = (yyvsp[0].node);
10127 /*%%%*/
10128 (yyval.node) = NEW_NODE(NODE_DEFS, (yyvsp[-3].node), (yyval.node)->nd_mid, (yyval.node), &(yyloc));
10129 /*%
10130 VALUE ary = rb_ary_new_from_args(3, $2, $3, get_value($$));
10131 add_mark_object(p, ary);
10132 $<node>$->nd_rval = ary;
10133 %*/
10134 }
10135#line 10131 "parse.c"
10136 break;
10137
10138 case 71: /* expr_value: expr */
10139#line 2100 "parse.y"
10140 {
10141 value_expr((yyvsp[0].node));
10142 (yyval.node) = (yyvsp[0].node);
10143 }
10144#line 10140 "parse.c"
10145 break;
10146
10147 case 72: /* expr_value: error */
10148#line 2105 "parse.y"
10149 {
10150 /*%%%*/
10151 (yyval.node) = NEW_ERROR(&(yyloc));
10152 /*% %*/
10153 }
10154#line 10150 "parse.c"
10155 break;
10156
10157 case 73: /* $@10: %empty */
10158#line 2112 "parse.y"
10159 {COND_PUSH(1);}
10160#line 10156 "parse.c"
10161 break;
10162
10163 case 74: /* $@11: %empty */
10164#line 2112 "parse.y"
10165 {COND_POP();}
10166#line 10162 "parse.c"
10167 break;
10168
10169 case 75: /* expr_value_do: $@10 expr_value do $@11 */
10170#line 2113 "parse.y"
10171 {
10172 (yyval.node) = (yyvsp[-2].node);
10173 }
10174#line 10170 "parse.c"
10175 break;
10176
10177 case 79: /* block_command: block_call call_op2 operation2 command_args */
10178#line 2124 "parse.y"
10179 {
10180 /*%%%*/
10181 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10182 /*% %*/
10183 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
10184 }
10185#line 10181 "parse.c"
10186 break;
10187
10188 case 80: /* cmd_brace_block: "{ arg" brace_body '}' */
10189#line 2133 "parse.y"
10190 {
10191 (yyval.node) = (yyvsp[-1].node);
10192 /*%%%*/
10193 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10194 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10195 /*% %*/
10196 }
10197#line 10193 "parse.c"
10198 break;
10199
10200 case 81: /* fcall: operation */
10201#line 2143 "parse.y"
10202 {
10203 /*%%%*/
10204 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
10205 nd_set_line((yyval.node), p->tokline);
10206 /*% %*/
10207 /*% ripper: $1 %*/
10208 }
10209#line 10205 "parse.c"
10210 break;
10211
10212 case 82: /* command: fcall command_args */
10213#line 2153 "parse.y"
10214 {
10215 /*%%%*/
10216 (yyvsp[-1].node)->nd_args = (yyvsp[0].node);
10217 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
10218 (yyval.node) = (yyvsp[-1].node);
10219 /*% %*/
10220 /*% ripper: command!($1, $2) %*/
10221 }
10222#line 10218 "parse.c"
10223 break;
10224
10225 case 83: /* command: fcall command_args cmd_brace_block */
10226#line 2162 "parse.y"
10227 {
10228 /*%%%*/
10229 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
10230 (yyvsp[-2].node)->nd_args = (yyvsp[-1].node);
10231 (yyval.node) = method_add_block(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10232 fixpos((yyval.node), (yyvsp[-2].node));
10233 nd_set_last_loc((yyvsp[-2].node), (yylsp[-1]).end_pos);
10234 /*% %*/
10235 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
10236 }
10237#line 10233 "parse.c"
10238 break;
10239
10240 case 84: /* command: primary_value call_op operation2 command_args */
10241#line 2173 "parse.y"
10242 {
10243 /*%%%*/
10244 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
10245 /*% %*/
10246 /*% ripper: command_call!($1, $2, $3, $4) %*/
10247 }
10248#line 10244 "parse.c"
10249 break;
10250
10251 case 85: /* command: primary_value call_op operation2 command_args cmd_brace_block */
10252#line 2180 "parse.y"
10253 {
10254 /*%%%*/
10255 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10256 /*% %*/
10257 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
10258 }
10259#line 10255 "parse.c"
10260 break;
10261
10262 case 86: /* command: primary_value "::" operation2 command_args */
10263#line 2187 "parse.y"
10264 {
10265 /*%%%*/
10266 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
10267 /*% %*/
10268 /*% ripper: command_call!($1, ID2VAL(idCOLON2), $3, $4) %*/
10269 }
10270#line 10266 "parse.c"
10271 break;
10272
10273 case 87: /* command: primary_value "::" operation2 command_args cmd_brace_block */
10274#line 2194 "parse.y"
10275 {
10276 /*%%%*/
10277 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10278 /*% %*/
10279 /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/
10280 }
10281#line 10277 "parse.c"
10282 break;
10283
10284 case 88: /* command: "`super'" command_args */
10285#line 2201 "parse.y"
10286 {
10287 /*%%%*/
10288 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
10289 fixpos((yyval.node), (yyvsp[0].node));
10290 /*% %*/
10291 /*% ripper: super!($2) %*/
10292 }
10293#line 10289 "parse.c"
10294 break;
10295
10296 case 89: /* command: "`yield'" command_args */
10297#line 2209 "parse.y"
10298 {
10299 /*%%%*/
10300 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
10301 fixpos((yyval.node), (yyvsp[0].node));
10302 /*% %*/
10303 /*% ripper: yield!($2) %*/
10304 }
10305#line 10301 "parse.c"
10306 break;
10307
10308 case 90: /* command: k_return call_args */
10309#line 2217 "parse.y"
10310 {
10311 /*%%%*/
10312 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
10313 /*% %*/
10314 /*% ripper: return!($2) %*/
10315 }
10316#line 10312 "parse.c"
10317 break;
10318
10319 case 91: /* command: "`break'" call_args */
10320#line 2224 "parse.y"
10321 {
10322 /*%%%*/
10323 (yyval.node) = NEW_BREAK(ret_args(p, (yyvsp[0].node)), &(yyloc));
10324 /*% %*/
10325 /*% ripper: break!($2) %*/
10326 }
10327#line 10323 "parse.c"
10328 break;
10329
10330 case 92: /* command: "`next'" call_args */
10331#line 2231 "parse.y"
10332 {
10333 /*%%%*/
10334 (yyval.node) = NEW_NEXT(ret_args(p, (yyvsp[0].node)), &(yyloc));
10335 /*% %*/
10336 /*% ripper: next!($2) %*/
10337 }
10338#line 10334 "parse.c"
10339 break;
10340
10341 case 94: /* mlhs: "(" mlhs_inner rparen */
10342#line 2241 "parse.y"
10343 {
10344 /*%%%*/
10345 (yyval.node) = (yyvsp[-1].node);
10346 /*% %*/
10347 /*% ripper: mlhs_paren!($2) %*/
10348 }
10349#line 10345 "parse.c"
10350 break;
10351
10352 case 96: /* mlhs_inner: "(" mlhs_inner rparen */
10353#line 2251 "parse.y"
10354 {
10355 /*%%%*/
10356 (yyval.node) = NEW_MASGN(NEW_LIST((yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
10357 /*% %*/
10358 /*% ripper: mlhs_paren!($2) %*/
10359 }
10360#line 10356 "parse.c"
10361 break;
10362
10363 case 97: /* mlhs_basic: mlhs_head */
10364#line 2260 "parse.y"
10365 {
10366 /*%%%*/
10367 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
10368 /*% %*/
10369 /*% ripper: $1 %*/
10370 }
10371#line 10367 "parse.c"
10372 break;
10373
10374 case 98: /* mlhs_basic: mlhs_head mlhs_item */
10375#line 2267 "parse.y"
10376 {
10377 /*%%%*/
10378 (yyval.node) = NEW_MASGN(list_append(p, (yyvsp[-1].node),(yyvsp[0].node)), 0, &(yyloc));
10379 /*% %*/
10380 /*% ripper: mlhs_add!($1, $2) %*/
10381 }
10382#line 10378 "parse.c"
10383 break;
10384
10385 case 99: /* mlhs_basic: mlhs_head "*" mlhs_node */
10386#line 2274 "parse.y"
10387 {
10388 /*%%%*/
10389 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10390 /*% %*/
10391 /*% ripper: mlhs_add_star!($1, $3) %*/
10392 }
10393#line 10389 "parse.c"
10394 break;
10395
10396 case 100: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
10397#line 2281 "parse.y"
10398 {
10399 /*%%%*/
10400 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
10401 /*% %*/
10402 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
10403 }
10404#line 10400 "parse.c"
10405 break;
10406
10407 case 101: /* mlhs_basic: mlhs_head "*" */
10408#line 2288 "parse.y"
10409 {
10410 /*%%%*/
10411 (yyval.node) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
10412 /*% %*/
10413 /*% ripper: mlhs_add_star!($1, Qnil) %*/
10414 }
10415#line 10411 "parse.c"
10416 break;
10417
10418 case 102: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
10419#line 2295 "parse.y"
10420 {
10421 /*%%%*/
10422 (yyval.node) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
10423 /*% %*/
10424 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
10425 }
10426#line 10422 "parse.c"
10427 break;
10428
10429 case 103: /* mlhs_basic: "*" mlhs_node */
10430#line 2302 "parse.y"
10431 {
10432 /*%%%*/
10433 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
10434 /*% %*/
10435 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
10436 }
10437#line 10433 "parse.c"
10438 break;
10439
10440 case 104: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
10441#line 2309 "parse.y"
10442 {
10443 /*%%%*/
10444 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
10445 /*% %*/
10446 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
10447 }
10448#line 10444 "parse.c"
10449 break;
10450
10451 case 105: /* mlhs_basic: "*" */
10452#line 2316 "parse.y"
10453 {
10454 /*%%%*/
10455 (yyval.node) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
10456 /*% %*/
10457 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
10458 }
10459#line 10455 "parse.c"
10460 break;
10461
10462 case 106: /* mlhs_basic: "*" ',' mlhs_post */
10463#line 2323 "parse.y"
10464 {
10465 /*%%%*/
10466 (yyval.node) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
10467 /*% %*/
10468 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
10469 }
10470#line 10466 "parse.c"
10471 break;
10472
10473 case 108: /* mlhs_item: "(" mlhs_inner rparen */
10474#line 2333 "parse.y"
10475 {
10476 /*%%%*/
10477 (yyval.node) = (yyvsp[-1].node);
10478 /*% %*/
10479 /*% ripper: mlhs_paren!($2) %*/
10480 }
10481#line 10477 "parse.c"
10482 break;
10483
10484 case 109: /* mlhs_head: mlhs_item ',' */
10485#line 2342 "parse.y"
10486 {
10487 /*%%%*/
10488 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
10489 /*% %*/
10490 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
10491 }
10492#line 10488 "parse.c"
10493 break;
10494
10495 case 110: /* mlhs_head: mlhs_head mlhs_item ',' */
10496#line 2349 "parse.y"
10497 {
10498 /*%%%*/
10499 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
10500 /*% %*/
10501 /*% ripper: mlhs_add!($1, $2) %*/
10502 }
10503#line 10499 "parse.c"
10504 break;
10505
10506 case 111: /* mlhs_post: mlhs_item */
10507#line 2358 "parse.y"
10508 {
10509 /*%%%*/
10510 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
10511 /*% %*/
10512 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
10513 }
10514#line 10510 "parse.c"
10515 break;
10516
10517 case 112: /* mlhs_post: mlhs_post ',' mlhs_item */
10518#line 2365 "parse.y"
10519 {
10520 /*%%%*/
10521 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
10522 /*% %*/
10523 /*% ripper: mlhs_add!($1, $3) %*/
10524 }
10525#line 10521 "parse.c"
10526 break;
10527
10528 case 113: /* mlhs_node: user_variable */
10529#line 2374 "parse.y"
10530 {
10531 /*%%%*/
10532 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10533 /*% %*/
10534 /*% ripper: assignable(p, var_field(p, $1)) %*/
10535 }
10536#line 10532 "parse.c"
10537 break;
10538
10539 case 114: /* mlhs_node: keyword_variable */
10540#line 2381 "parse.y"
10541 {
10542 /*%%%*/
10543 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10544 /*% %*/
10545 /*% ripper: assignable(p, var_field(p, $1)) %*/
10546 }
10547#line 10543 "parse.c"
10548 break;
10549
10550 case 115: /* mlhs_node: primary_value '[' opt_call_args rbracket */
10551#line 2388 "parse.y"
10552 {
10553 /*%%%*/
10554 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10555 /*% %*/
10556 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
10557 }
10558#line 10554 "parse.c"
10559 break;
10560
10561 case 116: /* mlhs_node: primary_value call_op "local variable or method" */
10562#line 2395 "parse.y"
10563 {
10564 if ((yyvsp[-1].id) == tANDDOT) {
10565 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
10566 }
10567 /*%%%*/
10568 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10569 /*% %*/
10570 /*% ripper: field!($1, $2, $3) %*/
10571 }
10572#line 10568 "parse.c"
10573 break;
10574
10575 case 117: /* mlhs_node: primary_value "::" "local variable or method" */
10576#line 2405 "parse.y"
10577 {
10578 /*%%%*/
10579 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
10580 /*% %*/
10581 /*% ripper: const_path_field!($1, $3) %*/
10582 }
10583#line 10579 "parse.c"
10584 break;
10585
10586 case 118: /* mlhs_node: primary_value call_op "constant" */
10587#line 2412 "parse.y"
10588 {
10589 if ((yyvsp[-1].id) == tANDDOT) {
10590 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
10591 }
10592 /*%%%*/
10593 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10594 /*% %*/
10595 /*% ripper: field!($1, $2, $3) %*/
10596 }
10597#line 10593 "parse.c"
10598 break;
10599
10600 case 119: /* mlhs_node: primary_value "::" "constant" */
10601#line 2422 "parse.y"
10602 {
10603 /*%%%*/
10604 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
10605 /*% %*/
10606 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
10607 }
10608#line 10604 "parse.c"
10609 break;
10610
10611 case 120: /* mlhs_node: ":: at EXPR_BEG" "constant" */
10612#line 2429 "parse.y"
10613 {
10614 /*%%%*/
10615 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
10616 /*% %*/
10617 /*% ripper: const_decl(p, top_const_field!($2)) %*/
10618 }
10619#line 10615 "parse.c"
10620 break;
10621
10622 case 121: /* mlhs_node: backref */
10623#line 2436 "parse.y"
10624 {
10625 /*%%%*/
10626 rb_backref_error(p, (yyvsp[0].node));
10627 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10628 /*% %*/
10629 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
10630 }
10631#line 10627 "parse.c"
10632 break;
10633
10634 case 122: /* lhs: user_variable */
10635#line 2446 "parse.y"
10636 {
10637 /*%%%*/
10638 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10639 /*% %*/
10640 /*% ripper: assignable(p, var_field(p, $1)) %*/
10641 }
10642#line 10638 "parse.c"
10643 break;
10644
10645 case 123: /* lhs: keyword_variable */
10646#line 2453 "parse.y"
10647 {
10648 /*%%%*/
10649 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10650 /*% %*/
10651 /*% ripper: assignable(p, var_field(p, $1)) %*/
10652 }
10653#line 10649 "parse.c"
10654 break;
10655
10656 case 124: /* lhs: primary_value '[' opt_call_args rbracket */
10657#line 2460 "parse.y"
10658 {
10659 /*%%%*/
10660 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10661 /*% %*/
10662 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
10663 }
10664#line 10660 "parse.c"
10665 break;
10666
10667 case 125: /* lhs: primary_value call_op "local variable or method" */
10668#line 2467 "parse.y"
10669 {
10670 /*%%%*/
10671 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10672 /*% %*/
10673 /*% ripper: field!($1, $2, $3) %*/
10674 }
10675#line 10671 "parse.c"
10676 break;
10677
10678 case 126: /* lhs: primary_value "::" "local variable or method" */
10679#line 2474 "parse.y"
10680 {
10681 /*%%%*/
10682 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
10683 /*% %*/
10684 /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/
10685 }
10686#line 10682 "parse.c"
10687 break;
10688
10689 case 127: /* lhs: primary_value call_op "constant" */
10690#line 2481 "parse.y"
10691 {
10692 /*%%%*/
10693 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
10694 /*% %*/
10695 /*% ripper: field!($1, $2, $3) %*/
10696 }
10697#line 10693 "parse.c"
10698 break;
10699
10700 case 128: /* lhs: primary_value "::" "constant" */
10701#line 2488 "parse.y"
10702 {
10703 /*%%%*/
10704 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
10705 /*% %*/
10706 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
10707 }
10708#line 10704 "parse.c"
10709 break;
10710
10711 case 129: /* lhs: ":: at EXPR_BEG" "constant" */
10712#line 2495 "parse.y"
10713 {
10714 /*%%%*/
10715 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
10716 /*% %*/
10717 /*% ripper: const_decl(p, top_const_field!($2)) %*/
10718 }
10719#line 10715 "parse.c"
10720 break;
10721
10722 case 130: /* lhs: backref */
10723#line 2502 "parse.y"
10724 {
10725 /*%%%*/
10726 rb_backref_error(p, (yyvsp[0].node));
10727 (yyval.node) = NEW_BEGIN(0, &(yyloc));
10728 /*% %*/
10729 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
10730 }
10731#line 10727 "parse.c"
10732 break;
10733
10734 case 131: /* cname: "local variable or method" */
10735#line 2512 "parse.y"
10736 {
10737 static const char mesg[] = "class/module name must be CONSTANT";
10738 /*%%%*/
10739 yyerror1(&(yylsp[0]), mesg);
10740 /*% %*/
10741 /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/
10742 }
10743#line 10739 "parse.c"
10744 break;
10745
10746 case 133: /* cpath: ":: at EXPR_BEG" cname */
10747#line 2523 "parse.y"
10748 {
10749 /*%%%*/
10750 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
10751 /*% %*/
10752 /*% ripper: top_const_ref!($2) %*/
10753 }
10754#line 10750 "parse.c"
10755 break;
10756
10757 case 134: /* cpath: cname */
10758#line 2530 "parse.y"
10759 {
10760 /*%%%*/
10761 (yyval.node) = NEW_COLON2(0, (yyval.node), &(yyloc));
10762 /*% %*/
10763 /*% ripper: const_ref!($1) %*/
10764 }
10765#line 10761 "parse.c"
10766 break;
10767
10768 case 135: /* cpath: primary_value "::" cname */
10769#line 2537 "parse.y"
10770 {
10771 /*%%%*/
10772 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
10773 /*% %*/
10774 /*% ripper: const_path_ref!($1, $3) %*/
10775 }
10776#line 10772 "parse.c"
10777 break;
10778
10779 case 139: /* fname: op */
10780#line 2549 "parse.y"
10781 {
10782 SET_LEX_STATE(EXPR_ENDFN);
10783 (yyval.id) = (yyvsp[0].id);
10784 }
10785#line 10781 "parse.c"
10786 break;
10787
10788 case 141: /* fitem: fname */
10789#line 2557 "parse.y"
10790 {
10791 /*%%%*/
10792 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
10793 /*% %*/
10794 /*% ripper: symbol_literal!($1) %*/
10795 }
10796#line 10792 "parse.c"
10797 break;
10798
10799 case 143: /* undef_list: fitem */
10800#line 2567 "parse.y"
10801 {
10802 /*%%%*/
10803 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
10804 /*% %*/
10805 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
10806 }
10807#line 10803 "parse.c"
10808 break;
10809
10810 case 144: /* $@12: %empty */
10811#line 2573 "parse.y"
10812 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
10813#line 10809 "parse.c"
10814 break;
10815
10816 case 145: /* undef_list: undef_list ',' $@12 fitem */
10817#line 2574 "parse.y"
10818 {
10819 /*%%%*/
10820 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
10821 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
10822 /*% %*/
10823 /*% ripper: rb_ary_push($1, get_value($4)) %*/
10824 }
10825#line 10821 "parse.c"
10826 break;
10827
10828 case 146: /* op: '|' */
10829#line 2583 "parse.y"
10830 { ifndef_ripper((yyval.id) = '|'); }
10831#line 10827 "parse.c"
10832 break;
10833
10834 case 147: /* op: '^' */
10835#line 2584 "parse.y"
10836 { ifndef_ripper((yyval.id) = '^'); }
10837#line 10833 "parse.c"
10838 break;
10839
10840 case 148: /* op: '&' */
10841#line 2585 "parse.y"
10842 { ifndef_ripper((yyval.id) = '&'); }
10843#line 10839 "parse.c"
10844 break;
10845
10846 case 149: /* op: "<=>" */
10847#line 2586 "parse.y"
10848 { ifndef_ripper((yyval.id) = tCMP); }
10849#line 10845 "parse.c"
10850 break;
10851
10852 case 150: /* op: "==" */
10853#line 2587 "parse.y"
10854 { ifndef_ripper((yyval.id) = tEQ); }
10855#line 10851 "parse.c"
10856 break;
10857
10858 case 151: /* op: "===" */
10859#line 2588 "parse.y"
10860 { ifndef_ripper((yyval.id) = tEQQ); }
10861#line 10857 "parse.c"
10862 break;
10863
10864 case 152: /* op: "=~" */
10865#line 2589 "parse.y"
10866 { ifndef_ripper((yyval.id) = tMATCH); }
10867#line 10863 "parse.c"
10868 break;
10869
10870 case 153: /* op: "!~" */
10871#line 2590 "parse.y"
10872 { ifndef_ripper((yyval.id) = tNMATCH); }
10873#line 10869 "parse.c"
10874 break;
10875
10876 case 154: /* op: '>' */
10877#line 2591 "parse.y"
10878 { ifndef_ripper((yyval.id) = '>'); }
10879#line 10875 "parse.c"
10880 break;
10881
10882 case 155: /* op: ">=" */
10883#line 2592 "parse.y"
10884 { ifndef_ripper((yyval.id) = tGEQ); }
10885#line 10881 "parse.c"
10886 break;
10887
10888 case 156: /* op: '<' */
10889#line 2593 "parse.y"
10890 { ifndef_ripper((yyval.id) = '<'); }
10891#line 10887 "parse.c"
10892 break;
10893
10894 case 157: /* op: "<=" */
10895#line 2594 "parse.y"
10896 { ifndef_ripper((yyval.id) = tLEQ); }
10897#line 10893 "parse.c"
10898 break;
10899
10900 case 158: /* op: "!=" */
10901#line 2595 "parse.y"
10902 { ifndef_ripper((yyval.id) = tNEQ); }
10903#line 10899 "parse.c"
10904 break;
10905
10906 case 159: /* op: "<<" */
10907#line 2596 "parse.y"
10908 { ifndef_ripper((yyval.id) = tLSHFT); }
10909#line 10905 "parse.c"
10910 break;
10911
10912 case 160: /* op: ">>" */
10913#line 2597 "parse.y"
10914 { ifndef_ripper((yyval.id) = tRSHFT); }
10915#line 10911 "parse.c"
10916 break;
10917
10918 case 161: /* op: '+' */
10919#line 2598 "parse.y"
10920 { ifndef_ripper((yyval.id) = '+'); }
10921#line 10917 "parse.c"
10922 break;
10923
10924 case 162: /* op: '-' */
10925#line 2599 "parse.y"
10926 { ifndef_ripper((yyval.id) = '-'); }
10927#line 10923 "parse.c"
10928 break;
10929
10930 case 163: /* op: '*' */
10931#line 2600 "parse.y"
10932 { ifndef_ripper((yyval.id) = '*'); }
10933#line 10929 "parse.c"
10934 break;
10935
10936 case 164: /* op: "*" */
10937#line 2601 "parse.y"
10938 { ifndef_ripper((yyval.id) = '*'); }
10939#line 10935 "parse.c"
10940 break;
10941
10942 case 165: /* op: '/' */
10943#line 2602 "parse.y"
10944 { ifndef_ripper((yyval.id) = '/'); }
10945#line 10941 "parse.c"
10946 break;
10947
10948 case 166: /* op: '%' */
10949#line 2603 "parse.y"
10950 { ifndef_ripper((yyval.id) = '%'); }
10951#line 10947 "parse.c"
10952 break;
10953
10954 case 167: /* op: "**" */
10955#line 2604 "parse.y"
10956 { ifndef_ripper((yyval.id) = tPOW); }
10957#line 10953 "parse.c"
10958 break;
10959
10960 case 168: /* op: "**arg" */
10961#line 2605 "parse.y"
10962 { ifndef_ripper((yyval.id) = tDSTAR); }
10963#line 10959 "parse.c"
10964 break;
10965
10966 case 169: /* op: '!' */
10967#line 2606 "parse.y"
10968 { ifndef_ripper((yyval.id) = '!'); }
10969#line 10965 "parse.c"
10970 break;
10971
10972 case 170: /* op: '~' */
10973#line 2607 "parse.y"
10974 { ifndef_ripper((yyval.id) = '~'); }
10975#line 10971 "parse.c"
10976 break;
10977
10978 case 171: /* op: "unary+" */
10979#line 2608 "parse.y"
10980 { ifndef_ripper((yyval.id) = tUPLUS); }
10981#line 10977 "parse.c"
10982 break;
10983
10984 case 172: /* op: "unary-" */
10985#line 2609 "parse.y"
10986 { ifndef_ripper((yyval.id) = tUMINUS); }
10987#line 10983 "parse.c"
10988 break;
10989
10990 case 173: /* op: "[]" */
10991#line 2610 "parse.y"
10992 { ifndef_ripper((yyval.id) = tAREF); }
10993#line 10989 "parse.c"
10994 break;
10995
10996 case 174: /* op: "[]=" */
10997#line 2611 "parse.y"
10998 { ifndef_ripper((yyval.id) = tASET); }
10999#line 10995 "parse.c"
11000 break;
11001
11002 case 175: /* op: '`' */
11003#line 2612 "parse.y"
11004 { ifndef_ripper((yyval.id) = '`'); }
11005#line 11001 "parse.c"
11006 break;
11007
11008 case 217: /* arg: lhs '=' lex_ctxt arg_rhs */
11009#line 2630 "parse.y"
11010 {
11011 /*%%%*/
11012 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11013 /*% %*/
11014 /*% ripper: assign!($1, $4) %*/
11015 }
11016#line 11012 "parse.c"
11017 break;
11018
11019 case 218: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
11020#line 2637 "parse.y"
11021 {
11022 /*%%%*/
11023 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11024 /*% %*/
11025 /*% ripper: opassign!($1, $2, $4) %*/
11026 }
11027#line 11023 "parse.c"
11028 break;
11029
11030 case 219: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
11031#line 2644 "parse.y"
11032 {
11033 /*%%%*/
11034 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
11035 /*% %*/
11036 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
11037 }
11038#line 11034 "parse.c"
11039 break;
11040
11041 case 220: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11042#line 2651 "parse.y"
11043 {
11044 /*%%%*/
11045 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11046 /*% %*/
11047 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11048 }
11049#line 11045 "parse.c"
11050 break;
11051
11052 case 221: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
11053#line 2658 "parse.y"
11054 {
11055 /*%%%*/
11056 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11057 /*% %*/
11058 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
11059 }
11060#line 11056 "parse.c"
11061 break;
11062
11063 case 222: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
11064#line 2665 "parse.y"
11065 {
11066 /*%%%*/
11067 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11068 /*% %*/
11069 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/
11070 }
11071#line 11067 "parse.c"
11072 break;
11073
11074 case 223: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
11075#line 2672 "parse.y"
11076 {
11077 /*%%%*/
11078 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
11079 (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));
11080 /*% %*/
11081 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
11082 }
11083#line 11079 "parse.c"
11084 break;
11085
11086 case 224: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
11087#line 2680 "parse.y"
11088 {
11089 /*%%%*/
11090 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
11091 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
11092 /*% %*/
11093 /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
11094 }
11095#line 11091 "parse.c"
11096 break;
11097
11098 case 225: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
11099#line 2688 "parse.y"
11100 {
11101 /*%%%*/
11102 rb_backref_error(p, (yyvsp[-3].node));
11103 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11104 /*% %*/
11105 /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/
11106 }
11107#line 11103 "parse.c"
11108 break;
11109
11110 case 226: /* arg: arg ".." arg */
11111#line 2696 "parse.y"
11112 {
11113 /*%%%*/
11114 value_expr((yyvsp[-2].node));
11115 value_expr((yyvsp[0].node));
11116 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11117 /*% %*/
11118 /*% ripper: dot2!($1, $3) %*/
11119 }
11120#line 11116 "parse.c"
11121 break;
11122
11123 case 227: /* arg: arg "..." arg */
11124#line 2705 "parse.y"
11125 {
11126 /*%%%*/
11127 value_expr((yyvsp[-2].node));
11128 value_expr((yyvsp[0].node));
11129 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11130 /*% %*/
11131 /*% ripper: dot3!($1, $3) %*/
11132 }
11133#line 11129 "parse.c"
11134 break;
11135
11136 case 228: /* arg: arg ".." */
11137#line 2714 "parse.y"
11138 {
11139 /*%%%*/
11140 value_expr((yyvsp[-1].node));
11141 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11142 /*% %*/
11143 /*% ripper: dot2!($1, Qnil) %*/
11144 }
11145#line 11141 "parse.c"
11146 break;
11147
11148 case 229: /* arg: arg "..." */
11149#line 2722 "parse.y"
11150 {
11151 /*%%%*/
11152 value_expr((yyvsp[-1].node));
11153 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11154 /*% %*/
11155 /*% ripper: dot3!($1, Qnil) %*/
11156 }
11157#line 11153 "parse.c"
11158 break;
11159
11160 case 230: /* arg: "(.." arg */
11161#line 2730 "parse.y"
11162 {
11163 /*%%%*/
11164 value_expr((yyvsp[0].node));
11165 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11166 /*% %*/
11167 /*% ripper: dot2!(Qnil, $2) %*/
11168 }
11169#line 11165 "parse.c"
11170 break;
11171
11172 case 231: /* arg: "(..." arg */
11173#line 2738 "parse.y"
11174 {
11175 /*%%%*/
11176 value_expr((yyvsp[0].node));
11177 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11178 /*% %*/
11179 /*% ripper: dot3!(Qnil, $2) %*/
11180 }
11181#line 11177 "parse.c"
11182 break;
11183
11184 case 232: /* arg: arg '+' arg */
11185#line 2746 "parse.y"
11186 {
11187 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11188 }
11189#line 11185 "parse.c"
11190 break;
11191
11192 case 233: /* arg: arg '-' arg */
11193#line 2750 "parse.y"
11194 {
11195 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11196 }
11197#line 11193 "parse.c"
11198 break;
11199
11200 case 234: /* arg: arg '*' arg */
11201#line 2754 "parse.y"
11202 {
11203 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11204 }
11205#line 11201 "parse.c"
11206 break;
11207
11208 case 235: /* arg: arg '/' arg */
11209#line 2758 "parse.y"
11210 {
11211 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11212 }
11213#line 11209 "parse.c"
11214 break;
11215
11216 case 236: /* arg: arg '%' arg */
11217#line 2762 "parse.y"
11218 {
11219 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11220 }
11221#line 11217 "parse.c"
11222 break;
11223
11224 case 237: /* arg: arg "**" arg */
11225#line 2766 "parse.y"
11226 {
11227 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11228 }
11229#line 11225 "parse.c"
11230 break;
11231
11232 case 238: /* arg: tUMINUS_NUM simple_numeric "**" arg */
11233#line 2770 "parse.y"
11234 {
11235 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
11236 }
11237#line 11233 "parse.c"
11238 break;
11239
11240 case 239: /* arg: "unary+" arg */
11241#line 2774 "parse.y"
11242 {
11243 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
11244 }
11245#line 11241 "parse.c"
11246 break;
11247
11248 case 240: /* arg: "unary-" arg */
11249#line 2778 "parse.y"
11250 {
11251 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
11252 }
11253#line 11249 "parse.c"
11254 break;
11255
11256 case 241: /* arg: arg '|' arg */
11257#line 2782 "parse.y"
11258 {
11259 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11260 }
11261#line 11257 "parse.c"
11262 break;
11263
11264 case 242: /* arg: arg '^' arg */
11265#line 2786 "parse.y"
11266 {
11267 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11268 }
11269#line 11265 "parse.c"
11270 break;
11271
11272 case 243: /* arg: arg '&' arg */
11273#line 2790 "parse.y"
11274 {
11275 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11276 }
11277#line 11273 "parse.c"
11278 break;
11279
11280 case 244: /* arg: arg "<=>" arg */
11281#line 2794 "parse.y"
11282 {
11283 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11284 }
11285#line 11281 "parse.c"
11286 break;
11287
11288 case 246: /* arg: arg "==" arg */
11289#line 2799 "parse.y"
11290 {
11291 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11292 }
11293#line 11289 "parse.c"
11294 break;
11295
11296 case 247: /* arg: arg "===" arg */
11297#line 2803 "parse.y"
11298 {
11299 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11300 }
11301#line 11297 "parse.c"
11302 break;
11303
11304 case 248: /* arg: arg "!=" arg */
11305#line 2807 "parse.y"
11306 {
11307 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11308 }
11309#line 11305 "parse.c"
11310 break;
11311
11312 case 249: /* arg: arg "=~" arg */
11313#line 2811 "parse.y"
11314 {
11315 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11316 }
11317#line 11313 "parse.c"
11318 break;
11319
11320 case 250: /* arg: arg "!~" arg */
11321#line 2815 "parse.y"
11322 {
11323 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11324 }
11325#line 11321 "parse.c"
11326 break;
11327
11328 case 251: /* arg: '!' arg */
11329#line 2819 "parse.y"
11330 {
11331 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
11332 }
11333#line 11329 "parse.c"
11334 break;
11335
11336 case 252: /* arg: '~' arg */
11337#line 2823 "parse.y"
11338 {
11339 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
11340 }
11341#line 11337 "parse.c"
11342 break;
11343
11344 case 253: /* arg: arg "<<" arg */
11345#line 2827 "parse.y"
11346 {
11347 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11348 }
11349#line 11345 "parse.c"
11350 break;
11351
11352 case 254: /* arg: arg ">>" arg */
11353#line 2831 "parse.y"
11354 {
11355 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11356 }
11357#line 11353 "parse.c"
11358 break;
11359
11360 case 255: /* arg: arg "&&" arg */
11361#line 2835 "parse.y"
11362 {
11363 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11364 }
11365#line 11361 "parse.c"
11366 break;
11367
11368 case 256: /* arg: arg "||" arg */
11369#line 2839 "parse.y"
11370 {
11371 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11372 }
11373#line 11369 "parse.c"
11374 break;
11375
11376 case 257: /* $@13: %empty */
11377#line 2842 "parse.y"
11378 {p->ctxt.in_defined = 1;}
11379#line 11375 "parse.c"
11380 break;
11381
11382 case 258: /* arg: "`defined?'" opt_nl $@13 arg */
11383#line 2843 "parse.y"
11384 {
11385 p->ctxt.in_defined = 0;
11386 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
11387 }
11388#line 11384 "parse.c"
11389 break;
11390
11391 case 259: /* arg: arg '?' arg opt_nl ':' arg */
11392#line 2848 "parse.y"
11393 {
11394 /*%%%*/
11395 value_expr((yyvsp[-5].node));
11396 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11397 fixpos((yyval.node), (yyvsp[-5].node));
11398 /*% %*/
11399 /*% ripper: ifop!($1, $3, $6) %*/
11400 }
11401#line 11397 "parse.c"
11402 break;
11403
11404 case 260: /* arg: defn_head f_opt_paren_args '=' arg */
11405#line 2857 "parse.y"
11406 {
11407 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
11408 restore_defun(p, (yyvsp[-3].node)->nd_defn);
11409 /*%%%*/
11410 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11411 /*% %*/
11412 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
11413 /*% ripper: def!(get_value($1), $2, $4) %*/
11414 local_pop(p);
11415 }
11416#line 11412 "parse.c"
11417 break;
11418
11419 case 261: /* arg: defn_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
11420#line 2868 "parse.y"
11421 {
11422 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
11423 restore_defun(p, (yyvsp[-5].node)->nd_defn);
11424 /*%%%*/
11425 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
11426 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
11427 /*% %*/
11428 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
11429 /*% ripper: def!(get_value($1), $2, $4) %*/
11430 local_pop(p);
11431 }
11432#line 11428 "parse.c"
11433 break;
11434
11435 case 262: /* arg: defs_head f_opt_paren_args '=' arg */
11436#line 2880 "parse.y"
11437 {
11438 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
11439 restore_defun(p, (yyvsp[-3].node)->nd_defn);
11440 /*%%%*/
11441 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11442 /*%
11443 $1 = get_value($1);
11444 %*/
11445 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
11446 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
11447 local_pop(p);
11448 }
11449#line 11445 "parse.c"
11450 break;
11451
11452 case 263: /* arg: defs_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
11453#line 2893 "parse.y"
11454 {
11455 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
11456 restore_defun(p, (yyvsp[-5].node)->nd_defn);
11457 /*%%%*/
11458 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
11459 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
11460 /*%
11461 $1 = get_value($1);
11462 %*/
11463 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
11464 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
11465 local_pop(p);
11466 }
11467#line 11463 "parse.c"
11468 break;
11469
11470 case 264: /* arg: primary */
11471#line 2907 "parse.y"
11472 {
11473 (yyval.node) = (yyvsp[0].node);
11474 }
11475#line 11471 "parse.c"
11476 break;
11477
11478 case 265: /* relop: '>' */
11479#line 2912 "parse.y"
11480 {(yyval.id) = '>';}
11481#line 11477 "parse.c"
11482 break;
11483
11484 case 266: /* relop: '<' */
11485#line 2913 "parse.y"
11486 {(yyval.id) = '<';}
11487#line 11483 "parse.c"
11488 break;
11489
11490 case 267: /* relop: ">=" */
11491#line 2914 "parse.y"
11492 {(yyval.id) = idGE;}
11493#line 11489 "parse.c"
11494 break;
11495
11496 case 268: /* relop: "<=" */
11497#line 2915 "parse.y"
11498 {(yyval.id) = idLE;}
11499#line 11495 "parse.c"
11500 break;
11501
11502 case 269: /* rel_expr: arg relop arg */
11503#line 2919 "parse.y"
11504 {
11505 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11506 }
11507#line 11503 "parse.c"
11508 break;
11509
11510 case 270: /* rel_expr: rel_expr relop arg */
11511#line 2923 "parse.y"
11512 {
11513 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
11514 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
11515 }
11516#line 11512 "parse.c"
11517 break;
11518
11519 case 271: /* lex_ctxt: none */
11520#line 2930 "parse.y"
11521 {
11522 (yyval.ctxt) = p->ctxt;
11523 }
11524#line 11520 "parse.c"
11525 break;
11526
11527 case 272: /* arg_value: arg */
11528#line 2936 "parse.y"
11529 {
11530 value_expr((yyvsp[0].node));
11531 (yyval.node) = (yyvsp[0].node);
11532 }
11533#line 11529 "parse.c"
11534 break;
11535
11536 case 274: /* aref_args: args trailer */
11537#line 2944 "parse.y"
11538 {
11539 (yyval.node) = (yyvsp[-1].node);
11540 }
11541#line 11537 "parse.c"
11542 break;
11543
11544 case 275: /* aref_args: args ',' assocs trailer */
11545#line 2948 "parse.y"
11546 {
11547 /*%%%*/
11548 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
11549 /*% %*/
11550 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
11551 }
11552#line 11548 "parse.c"
11553 break;
11554
11555 case 276: /* aref_args: assocs trailer */
11556#line 2955 "parse.y"
11557 {
11558 /*%%%*/
11559 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
11560 /*% %*/
11561 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
11562 }
11563#line 11559 "parse.c"
11564 break;
11565
11566 case 277: /* arg_rhs: arg */
11567#line 2964 "parse.y"
11568 {
11569 value_expr((yyvsp[0].node));
11570 (yyval.node) = (yyvsp[0].node);
11571 }
11572#line 11568 "parse.c"
11573 break;
11574
11575 case 278: /* arg_rhs: arg "`rescue' modifier" arg */
11576#line 2969 "parse.y"
11577 {
11578 /*%%%*/
11579 value_expr((yyvsp[-2].node));
11580 (yyval.node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
11581 /*% %*/
11582 /*% ripper: rescue_mod!($1, $3) %*/
11583 }
11584#line 11580 "parse.c"
11585 break;
11586
11587 case 279: /* paren_args: '(' opt_call_args rparen */
11588#line 2979 "parse.y"
11589 {
11590 /*%%%*/
11591 (yyval.node) = (yyvsp[-1].node);
11592 /*% %*/
11593 /*% ripper: arg_paren!(escape_Qundef($2)) %*/
11594 }
11595#line 11591 "parse.c"
11596 break;
11597
11598 case 280: /* paren_args: '(' args ',' args_forward rparen */
11599#line 2986 "parse.y"
11600 {
11601 if (!check_forwarding_args(p)) {
11602 (yyval.node) = Qnone;
11603 }
11604 else {
11605 /*%%%*/
11606 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
11607 /*% %*/
11608 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
11609 }
11610 }
11611#line 11607 "parse.c"
11612 break;
11613
11614 case 281: /* paren_args: '(' args_forward rparen */
11615#line 2998 "parse.y"
11616 {
11617 if (!check_forwarding_args(p)) {
11618 (yyval.node) = Qnone;
11619 }
11620 else {
11621 /*%%%*/
11622 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
11623 /*% %*/
11624 /*% ripper: arg_paren!($2) %*/
11625 }
11626 }
11627#line 11623 "parse.c"
11628 break;
11629
11630 case 286: /* opt_call_args: args ',' */
11631#line 3018 "parse.y"
11632 {
11633 (yyval.node) = (yyvsp[-1].node);
11634 }
11635#line 11631 "parse.c"
11636 break;
11637
11638 case 287: /* opt_call_args: args ',' assocs ',' */
11639#line 3022 "parse.y"
11640 {
11641 /*%%%*/
11642 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
11643 /*% %*/
11644 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
11645 }
11646#line 11642 "parse.c"
11647 break;
11648
11649 case 288: /* opt_call_args: assocs ',' */
11650#line 3029 "parse.y"
11651 {
11652 /*%%%*/
11653 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
11654 /*% %*/
11655 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
11656 }
11657#line 11653 "parse.c"
11658 break;
11659
11660 case 289: /* call_args: command */
11661#line 3038 "parse.y"
11662 {
11663 /*%%%*/
11664 value_expr((yyvsp[0].node));
11665 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11666 /*% %*/
11667 /*% ripper: args_add!(args_new!, $1) %*/
11668 }
11669#line 11665 "parse.c"
11670 break;
11671
11672 case 290: /* call_args: args opt_block_arg */
11673#line 3046 "parse.y"
11674 {
11675 /*%%%*/
11676 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node));
11677 /*% %*/
11678 /*% ripper: args_add_block!($1, $2) %*/
11679 }
11680#line 11676 "parse.c"
11681 break;
11682
11683 case 291: /* call_args: assocs opt_block_arg */
11684#line 3053 "parse.y"
11685 {
11686 /*%%%*/
11687 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
11688 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
11689 /*% %*/
11690 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
11691 }
11692#line 11688 "parse.c"
11693 break;
11694
11695 case 292: /* call_args: args ',' assocs opt_block_arg */
11696#line 3061 "parse.y"
11697 {
11698 /*%%%*/
11699 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
11700 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
11701 /*% %*/
11702 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
11703 }
11704#line 11700 "parse.c"
11705 break;
11706
11707 case 294: /* $@14: %empty */
11708#line 3072 "parse.y"
11709 {
11710 /* If call_args starts with a open paren '(' or '[',
11711 * look-ahead reading of the letters calls CMDARG_PUSH(0),
11712 * but the push must be done after CMDARG_PUSH(1).
11713 * So this code makes them consistent by first cancelling
11714 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
11715 * and finally redoing CMDARG_PUSH(0).
11716 */
11717 int lookahead = 0;
11718 switch (yychar) {
11719 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
11720 lookahead = 1;
11721 }
11722 if (lookahead) CMDARG_POP();
11723 CMDARG_PUSH(1);
11724 if (lookahead) CMDARG_PUSH(0);
11725 }
11726#line 11722 "parse.c"
11727 break;
11728
11729 case 295: /* command_args: $@14 call_args */
11730#line 3090 "parse.y"
11731 {
11732 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
11733 * but the push must be done after CMDARG_POP() in the parser.
11734 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
11735 * CMDARG_POP() to pop 1 pushed by command_args,
11736 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
11737 */
11738 int lookahead = 0;
11739 switch (yychar) {
11740 case tLBRACE_ARG:
11741 lookahead = 1;
11742 }
11743 if (lookahead) CMDARG_POP();
11744 CMDARG_POP();
11745 if (lookahead) CMDARG_PUSH(0);
11746 (yyval.node) = (yyvsp[0].node);
11747 }
11748#line 11744 "parse.c"
11749 break;
11750
11751 case 296: /* block_arg: "&" arg_value */
11752#line 3110 "parse.y"
11753 {
11754 /*%%%*/
11755 (yyval.node) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
11756 /*% %*/
11757 /*% ripper: $2 %*/
11758 }
11759#line 11755 "parse.c"
11760 break;
11761
11762 case 297: /* block_arg: "&" */
11763#line 3117 "parse.y"
11764 {
11765 if (!local_id(p, idFWD_BLOCK)) {
11766 compile_error(p, "no anonymous block parameter");
11767 }
11768 /*%%%*/
11769 (yyval.node) = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[0])), &(yyloc));
11770 /*% %*/
11771 /*% ripper: Qnil %*/
11772 }
11773#line 11769 "parse.c"
11774 break;
11775
11776 case 298: /* opt_block_arg: ',' block_arg */
11777#line 3129 "parse.y"
11778 {
11779 (yyval.node) = (yyvsp[0].node);
11780 }
11781#line 11777 "parse.c"
11782 break;
11783
11784 case 299: /* opt_block_arg: none */
11785#line 3133 "parse.y"
11786 {
11787 (yyval.node) = 0;
11788 }
11789#line 11785 "parse.c"
11790 break;
11791
11792 case 300: /* args: arg_value */
11793#line 3140 "parse.y"
11794 {
11795 /*%%%*/
11796 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11797 /*% %*/
11798 /*% ripper: args_add!(args_new!, $1) %*/
11799 }
11800#line 11796 "parse.c"
11801 break;
11802
11803 case 301: /* args: "*" arg_value */
11804#line 3147 "parse.y"
11805 {
11806 /*%%%*/
11807 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
11808 /*% %*/
11809 /*% ripper: args_add_star!(args_new!, $2) %*/
11810 }
11811#line 11807 "parse.c"
11812 break;
11813
11814 case 302: /* args: "*" */
11815#line 3154 "parse.y"
11816 {
11817 if (!local_id(p, idFWD_REST) ||
11818 local_id(p, idFWD_ALL)) {
11819 compile_error(p, "no anonymous rest parameter");
11820 }
11821 /*%%%*/
11822 (yyval.node) = NEW_SPLAT(NEW_LVAR(idFWD_REST, &(yylsp[0])), &(yyloc));
11823 /*% %*/
11824 /*% ripper: args_add_star!(args_new!, Qnil) %*/
11825 }
11826#line 11822 "parse.c"
11827 break;
11828
11829 case 303: /* args: args ',' arg_value */
11830#line 3165 "parse.y"
11831 {
11832 /*%%%*/
11833 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11834 /*% %*/
11835 /*% ripper: args_add!($1, $3) %*/
11836 }
11837#line 11833 "parse.c"
11838 break;
11839
11840 case 304: /* args: args ',' "*" arg_value */
11841#line 3172 "parse.y"
11842 {
11843 /*%%%*/
11844 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11845 /*% %*/
11846 /*% ripper: args_add_star!($1, $4) %*/
11847 }
11848#line 11844 "parse.c"
11849 break;
11850
11851 case 305: /* args: args ',' "*" */
11852#line 3179 "parse.y"
11853 {
11854 if (!local_id(p, idFWD_REST) ||
11855 local_id(p, idFWD_ALL)) {
11856 compile_error(p, "no anonymous rest parameter");
11857 }
11858 /*%%%*/
11859 (yyval.node) = rest_arg_append(p, (yyvsp[-2].node), NEW_LVAR(idFWD_REST, &(yylsp[0])), &(yyloc));
11860 /*% %*/
11861 /*% ripper: args_add_star!($1, Qnil) %*/
11862 }
11863#line 11859 "parse.c"
11864 break;
11865
11866 case 308: /* mrhs: args ',' arg_value */
11867#line 3198 "parse.y"
11868 {
11869 /*%%%*/
11870 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11871 /*% %*/
11872 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
11873 }
11874#line 11870 "parse.c"
11875 break;
11876
11877 case 309: /* mrhs: args ',' "*" arg_value */
11878#line 3205 "parse.y"
11879 {
11880 /*%%%*/
11881 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11882 /*% %*/
11883 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
11884 }
11885#line 11881 "parse.c"
11886 break;
11887
11888 case 310: /* mrhs: "*" arg_value */
11889#line 3212 "parse.y"
11890 {
11891 /*%%%*/
11892 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
11893 /*% %*/
11894 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
11895 }
11896#line 11892 "parse.c"
11897 break;
11898
11899 case 321: /* primary: "method" */
11900#line 3231 "parse.y"
11901 {
11902 /*%%%*/
11903 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
11904 /*% %*/
11905 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
11906 }
11907#line 11903 "parse.c"
11908 break;
11909
11910 case 322: /* $@15: %empty */
11911#line 3238 "parse.y"
11912 {
11913 CMDARG_PUSH(0);
11914 }
11915#line 11911 "parse.c"
11916 break;
11917
11918 case 323: /* primary: k_begin $@15 bodystmt k_end */
11919#line 3243 "parse.y"
11920 {
11921 CMDARG_POP();
11922 /*%%%*/
11923 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
11924 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
11925 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
11926 /*% %*/
11927 /*% ripper: begin!($3) %*/
11928 }
11929#line 11925 "parse.c"
11930 break;
11931
11932 case 324: /* $@16: %empty */
11933#line 3252 "parse.y"
11934 {SET_LEX_STATE(EXPR_ENDARG);}
11935#line 11931 "parse.c"
11936 break;
11937
11938 case 325: /* primary: "( arg" $@16 rparen */
11939#line 3253 "parse.y"
11940 {
11941 /*%%%*/
11942 (yyval.node) = NEW_BEGIN(0, &(yyloc));
11943 /*% %*/
11944 /*% ripper: paren!(0) %*/
11945 }
11946#line 11942 "parse.c"
11947 break;
11948
11949 case 326: /* $@17: %empty */
11950#line 3259 "parse.y"
11951 {SET_LEX_STATE(EXPR_ENDARG);}
11952#line 11948 "parse.c"
11953 break;
11954
11955 case 327: /* primary: "( arg" stmt $@17 rparen */
11956#line 3260 "parse.y"
11957 {
11958 /*%%%*/
11959 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) (yyvsp[-2].node)->nd_state = 0;
11960 (yyval.node) = (yyvsp[-2].node);
11961 /*% %*/
11962 /*% ripper: paren!($2) %*/
11963 }
11964#line 11960 "parse.c"
11965 break;
11966
11967 case 328: /* primary: "(" compstmt ')' */
11968#line 3268 "parse.y"
11969 {
11970 /*%%%*/
11971 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) (yyvsp[-1].node)->nd_state = 0;
11972 (yyval.node) = (yyvsp[-1].node);
11973 /*% %*/
11974 /*% ripper: paren!($2) %*/
11975 }
11976#line 11972 "parse.c"
11977 break;
11978
11979 case 329: /* primary: primary_value "::" "constant" */
11980#line 3276 "parse.y"
11981 {
11982 /*%%%*/
11983 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11984 /*% %*/
11985 /*% ripper: const_path_ref!($1, $3) %*/
11986 }
11987#line 11983 "parse.c"
11988 break;
11989
11990 case 330: /* primary: ":: at EXPR_BEG" "constant" */
11991#line 3283 "parse.y"
11992 {
11993 /*%%%*/
11994 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
11995 /*% %*/
11996 /*% ripper: top_const_ref!($2) %*/
11997 }
11998#line 11994 "parse.c"
11999 break;
12000
12001 case 331: /* primary: "[" aref_args ']' */
12002#line 3290 "parse.y"
12003 {
12004 /*%%%*/
12005 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12006 /*% %*/
12007 /*% ripper: array!(escape_Qundef($2)) %*/
12008 }
12009#line 12005 "parse.c"
12010 break;
12011
12012 case 332: /* primary: "{" assoc_list '}' */
12013#line 3297 "parse.y"
12014 {
12015 /*%%%*/
12016 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
12017 (yyval.node)->nd_brace = TRUE;
12018 /*% %*/
12019 /*% ripper: hash!(escape_Qundef($2)) %*/
12020 }
12021#line 12017 "parse.c"
12022 break;
12023
12024 case 333: /* primary: k_return */
12025#line 3305 "parse.y"
12026 {
12027 /*%%%*/
12028 (yyval.node) = NEW_RETURN(0, &(yyloc));
12029 /*% %*/
12030 /*% ripper: return0! %*/
12031 }
12032#line 12028 "parse.c"
12033 break;
12034
12035 case 334: /* primary: "`yield'" '(' call_args rparen */
12036#line 3312 "parse.y"
12037 {
12038 /*%%%*/
12039 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
12040 /*% %*/
12041 /*% ripper: yield!(paren!($3)) %*/
12042 }
12043#line 12039 "parse.c"
12044 break;
12045
12046 case 335: /* primary: "`yield'" '(' rparen */
12047#line 3319 "parse.y"
12048 {
12049 /*%%%*/
12050 (yyval.node) = NEW_YIELD(0, &(yyloc));
12051 /*% %*/
12052 /*% ripper: yield!(paren!(args_new!)) %*/
12053 }
12054#line 12050 "parse.c"
12055 break;
12056
12057 case 336: /* primary: "`yield'" */
12058#line 3326 "parse.y"
12059 {
12060 /*%%%*/
12061 (yyval.node) = NEW_YIELD(0, &(yyloc));
12062 /*% %*/
12063 /*% ripper: yield0! %*/
12064 }
12065#line 12061 "parse.c"
12066 break;
12067
12068 case 337: /* $@18: %empty */
12069#line 3332 "parse.y"
12070 {p->ctxt.in_defined = 1;}
12071#line 12067 "parse.c"
12072 break;
12073
12074 case 338: /* primary: "`defined?'" opt_nl '(' $@18 expr rparen */
12075#line 3333 "parse.y"
12076 {
12077 p->ctxt.in_defined = 0;
12078 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
12079 }
12080#line 12076 "parse.c"
12081 break;
12082
12083 case 339: /* primary: "`not'" '(' expr rparen */
12084#line 3338 "parse.y"
12085 {
12086 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
12087 }
12088#line 12084 "parse.c"
12089 break;
12090
12091 case 340: /* primary: "`not'" '(' rparen */
12092#line 3342 "parse.y"
12093 {
12094 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
12095 }
12096#line 12092 "parse.c"
12097 break;
12098
12099 case 341: /* primary: fcall brace_block */
12100#line 3346 "parse.y"
12101 {
12102 /*%%%*/
12103 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12104 /*% %*/
12105 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
12106 }
12107#line 12103 "parse.c"
12108 break;
12109
12110 case 343: /* primary: method_call brace_block */
12111#line 3354 "parse.y"
12112 {
12113 /*%%%*/
12114 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
12115 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12116 /*% %*/
12117 /*% ripper: method_add_block!($1, $2) %*/
12118 }
12119#line 12115 "parse.c"
12120 break;
12121
12122 case 345: /* primary: k_if expr_value then compstmt if_tail k_end */
12123#line 3366 "parse.y"
12124 {
12125 /*%%%*/
12126 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
12127 fixpos((yyval.node), (yyvsp[-4].node));
12128 /*% %*/
12129 /*% ripper: if!($2, $4, escape_Qundef($5)) %*/
12130 }
12131#line 12127 "parse.c"
12132 break;
12133
12134 case 346: /* primary: k_unless expr_value then compstmt opt_else k_end */
12135#line 3377 "parse.y"
12136 {
12137 /*%%%*/
12138 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
12139 fixpos((yyval.node), (yyvsp[-4].node));
12140 /*% %*/
12141 /*% ripper: unless!($2, $4, escape_Qundef($5)) %*/
12142 }
12143#line 12139 "parse.c"
12144 break;
12145
12146 case 347: /* primary: k_while expr_value_do compstmt k_end */
12147#line 3387 "parse.y"
12148 {
12149 /*%%%*/
12150 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
12151 fixpos((yyval.node), (yyvsp[-2].node));
12152 /*% %*/
12153 /*% ripper: while!($2, $3) %*/
12154 }
12155#line 12151 "parse.c"
12156 break;
12157
12158 case 348: /* primary: k_until expr_value_do compstmt k_end */
12159#line 3397 "parse.y"
12160 {
12161 /*%%%*/
12162 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
12163 fixpos((yyval.node), (yyvsp[-2].node));
12164 /*% %*/
12165 /*% ripper: until!($2, $3) %*/
12166 }
12167#line 12163 "parse.c"
12168 break;
12169
12170 case 349: /* @19: %empty */
12171#line 3405 "parse.y"
12172 {
12173 (yyval.val) = p->case_labels;
12174 p->case_labels = Qnil;
12175 }
12176#line 12172 "parse.c"
12177 break;
12178
12179 case 350: /* primary: k_case expr_value opt_terms @19 case_body k_end */
12180#line 3411 "parse.y"
12181 {
12182 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
12183 p->case_labels = (yyvsp[-2].val);
12184 /*%%%*/
12185 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
12186 fixpos((yyval.node), (yyvsp[-4].node));
12187 /*% %*/
12188 /*% ripper: case!($2, $5) %*/
12189 }
12190#line 12186 "parse.c"
12191 break;
12192
12193 case 351: /* @20: %empty */
12194#line 3421 "parse.y"
12195 {
12196 (yyval.val) = p->case_labels;
12197 p->case_labels = 0;
12198 }
12199#line 12195 "parse.c"
12200 break;
12201
12202 case 352: /* primary: k_case opt_terms @20 case_body k_end */
12203#line 3427 "parse.y"
12204 {
12205 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
12206 p->case_labels = (yyvsp[-2].val);
12207 /*%%%*/
12208 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
12209 /*% %*/
12210 /*% ripper: case!(Qnil, $4) %*/
12211 }
12212#line 12208 "parse.c"
12213 break;
12214
12215 case 353: /* primary: k_case expr_value opt_terms p_case_body k_end */
12216#line 3438 "parse.y"
12217 {
12218 /*%%%*/
12219 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12220 /*% %*/
12221 /*% ripper: case!($2, $4) %*/
12222 }
12223#line 12219 "parse.c"
12224 break;
12225
12226 case 354: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
12227#line 3447 "parse.y"
12228 {
12229 /*%%%*/
12230 /*
12231 * for a, b, c in e
12232 * #=>
12233 * e.each{|*x| a, b, c = x}
12234 *
12235 * for a in e
12236 * #=>
12237 * e.each{|x| a, = x}
12238 */
12239 ID id = internal_id(p);
12240 NODE *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
12241 NODE *args, *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
12242 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
12243 tbl->ids[0] = id; /* internal id */
12244
12245 switch (nd_type((yyvsp[-4].node))) {
12246 case NODE_LASGN:
12247 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
12248 (yyvsp[-4].node)->nd_value = internal_var;
12249 id = 0;
12250 m->nd_plen = 1;
12251 m->nd_next = (yyvsp[-4].node);
12252 break;
12253 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
12254 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
12255 break;
12256 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
12257 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]));
12258 }
12259 /* {|*internal_id| <m> = internal_id; ... } */
12260 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
12261 scope = NEW_NODE(NODE_SCOPE, tbl, (yyvsp[-1].node), args, &(yyloc));
12262 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
12263 fixpos((yyval.node), (yyvsp[-4].node));
12264 /*% %*/
12265 /*% ripper: for!($2, $4, $5) %*/
12266 }
12267#line 12263 "parse.c"
12268 break;
12269
12270 case 355: /* $@21: %empty */
12271#line 3487 "parse.y"
12272 {
12273 if (p->ctxt.in_def) {
12274 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[-1]));
12275 yyerror1(&loc, "class definition in method body");
12276 }
12277 p->ctxt.in_class = 1;
12278 local_push(p, 0);
12279 }
12280#line 12276 "parse.c"
12281 break;
12282
12283 case 356: /* primary: k_class cpath superclass $@21 bodystmt k_end */
12284#line 3497 "parse.y"
12285 {
12286 /*%%%*/
12287 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
12288 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
12289 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
12290 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
12291 /*% %*/
12292 /*% ripper: class!($2, $3, $5) %*/
12293 local_pop(p);
12294 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
12295 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
12296 }
12297#line 12293 "parse.c"
12298 break;
12299
12300 case 357: /* $@22: %empty */
12301#line 3510 "parse.y"
12302 {
12303 p->ctxt.in_def = 0;
12304 p->ctxt.in_class = 0;
12305 local_push(p, 0);
12306 }
12307#line 12303 "parse.c"
12308 break;
12309
12310 case 358: /* primary: k_class "<<" expr $@22 term bodystmt k_end */
12311#line 3518 "parse.y"
12312 {
12313 /*%%%*/
12314 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
12315 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
12316 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
12317 fixpos((yyval.node), (yyvsp[-4].node));
12318 /*% %*/
12319 /*% ripper: sclass!($3, $6) %*/
12320 local_pop(p);
12321 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
12322 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
12323 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
12324 }
12325#line 12321 "parse.c"
12326 break;
12327
12328 case 359: /* $@23: %empty */
12329#line 3532 "parse.y"
12330 {
12331 if (p->ctxt.in_def) {
12332 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
12333 yyerror1(&loc, "module definition in method body");
12334 }
12335 p->ctxt.in_class = 1;
12336 local_push(p, 0);
12337 }
12338#line 12334 "parse.c"
12339 break;
12340
12341 case 360: /* primary: k_module cpath $@23 bodystmt k_end */
12342#line 3542 "parse.y"
12343 {
12344 /*%%%*/
12345 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12346 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
12347 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
12348 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
12349 /*% %*/
12350 /*% ripper: module!($2, $4) %*/
12351 local_pop(p);
12352 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
12353 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
12354 }
12355#line 12351 "parse.c"
12356 break;
12357
12358 case 361: /* $@24: %empty */
12359#line 3556 "parse.y"
12360 {
12361 /*%%%*/
12362 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
12363 /*% %*/
12364 }
12365#line 12361 "parse.c"
12366 break;
12367
12368 case 362: /* primary: defn_head f_arglist $@24 bodystmt k_end */
12369#line 3563 "parse.y"
12370 {
12371 restore_defun(p, (yyvsp[-4].node)->nd_defn);
12372 /*%%%*/
12373 (yyval.node) = set_defun_body(p, (yyvsp[-4].node), (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12374 /*% %*/
12375 /*% ripper: def!(get_value($1), $2, $4) %*/
12376 local_pop(p);
12377 }
12378#line 12374 "parse.c"
12379 break;
12380
12381 case 363: /* $@25: %empty */
12382#line 3573 "parse.y"
12383 {
12384 /*%%%*/
12385 push_end_expect_token_locations(p, &(yylsp[-1]).beg_pos);
12386 /*% %*/
12387 }
12388#line 12384 "parse.c"
12389 break;
12390
12391 case 364: /* primary: defs_head f_arglist $@25 bodystmt k_end */
12392#line 3580 "parse.y"
12393 {
12394 restore_defun(p, (yyvsp[-4].node)->nd_defn);
12395 /*%%%*/
12396 (yyval.node) = set_defun_body(p, (yyvsp[-4].node), (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
12397 /*%
12398 $1 = get_value($1);
12399 %*/
12400 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
12401 local_pop(p);
12402 }
12403#line 12399 "parse.c"
12404 break;
12405
12406 case 365: /* primary: "`break'" */
12407#line 3591 "parse.y"
12408 {
12409 /*%%%*/
12410 (yyval.node) = NEW_BREAK(0, &(yyloc));
12411 /*% %*/
12412 /*% ripper: break!(args_new!) %*/
12413 }
12414#line 12410 "parse.c"
12415 break;
12416
12417 case 366: /* primary: "`next'" */
12418#line 3598 "parse.y"
12419 {
12420 /*%%%*/
12421 (yyval.node) = NEW_NEXT(0, &(yyloc));
12422 /*% %*/
12423 /*% ripper: next!(args_new!) %*/
12424 }
12425#line 12421 "parse.c"
12426 break;
12427
12428 case 367: /* primary: "`redo'" */
12429#line 3605 "parse.y"
12430 {
12431 /*%%%*/
12432 (yyval.node) = NEW_REDO(&(yyloc));
12433 /*% %*/
12434 /*% ripper: redo! %*/
12435 }
12436#line 12432 "parse.c"
12437 break;
12438
12439 case 368: /* primary: "`retry'" */
12440#line 3612 "parse.y"
12441 {
12442 /*%%%*/
12443 (yyval.node) = NEW_RETRY(&(yyloc));
12444 /*% %*/
12445 /*% ripper: retry! %*/
12446 }
12447#line 12443 "parse.c"
12448 break;
12449
12450 case 369: /* primary_value: primary */
12451#line 3621 "parse.y"
12452 {
12453 value_expr((yyvsp[0].node));
12454 (yyval.node) = (yyvsp[0].node);
12455 }
12456#line 12452 "parse.c"
12457 break;
12458
12459 case 370: /* k_begin: "`begin'" */
12460#line 3628 "parse.y"
12461 {
12462 token_info_push(p, "begin", &(yyloc));
12463 /*%%%*/
12464 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12465 /*% %*/
12466 }
12467#line 12463 "parse.c"
12468 break;
12469
12470 case 371: /* k_if: "`if'" */
12471#line 3637 "parse.y"
12472 {
12473 WARN_EOL("if");
12474 token_info_push(p, "if", &(yyloc));
12475 if (p->token_info && p->token_info->nonspc &&
12476 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
12477 const char *tok = p->lex.ptok - rb_strlen_lit("if");
12478 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
12479 beg += rb_strlen_lit("else");
12480 while (beg < tok && ISSPACE(*beg)) beg++;
12481 if (beg == tok) {
12482 p->token_info->nonspc = 0;
12483 }
12484 }
12485 /*%%%*/
12486 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12487 /*% %*/
12488 }
12489#line 12485 "parse.c"
12490 break;
12491
12492 case 372: /* k_unless: "`unless'" */
12493#line 3657 "parse.y"
12494 {
12495 token_info_push(p, "unless", &(yyloc));
12496 /*%%%*/
12497 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12498 /*% %*/
12499 }
12500#line 12496 "parse.c"
12501 break;
12502
12503 case 373: /* k_while: "`while'" */
12504#line 3666 "parse.y"
12505 {
12506 token_info_push(p, "while", &(yyloc));
12507 /*%%%*/
12508 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12509 /*% %*/
12510 }
12511#line 12507 "parse.c"
12512 break;
12513
12514 case 374: /* k_until: "`until'" */
12515#line 3675 "parse.y"
12516 {
12517 token_info_push(p, "until", &(yyloc));
12518 /*%%%*/
12519 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12520 /*% %*/
12521 }
12522#line 12518 "parse.c"
12523 break;
12524
12525 case 375: /* k_case: "`case'" */
12526#line 3684 "parse.y"
12527 {
12528 token_info_push(p, "case", &(yyloc));
12529 /*%%%*/
12530 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12531 /*% %*/
12532 }
12533#line 12529 "parse.c"
12534 break;
12535
12536 case 376: /* k_for: "`for'" */
12537#line 3693 "parse.y"
12538 {
12539 token_info_push(p, "for", &(yyloc));
12540 /*%%%*/
12541 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12542 /*% %*/
12543 }
12544#line 12540 "parse.c"
12545 break;
12546
12547 case 377: /* k_class: "`class'" */
12548#line 3702 "parse.y"
12549 {
12550 token_info_push(p, "class", &(yyloc));
12551 (yyval.ctxt) = p->ctxt;
12552 /*%%%*/
12553 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12554 /*% %*/
12555 }
12556#line 12552 "parse.c"
12557 break;
12558
12559 case 378: /* k_module: "`module'" */
12560#line 3712 "parse.y"
12561 {
12562 token_info_push(p, "module", &(yyloc));
12563 (yyval.ctxt) = p->ctxt;
12564 /*%%%*/
12565 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12566 /*% %*/
12567 }
12568#line 12564 "parse.c"
12569 break;
12570
12571 case 379: /* k_def: "`def'" */
12572#line 3722 "parse.y"
12573 {
12574 token_info_push(p, "def", &(yyloc));
12575 p->ctxt.in_argdef = 1;
12576 }
12577#line 12573 "parse.c"
12578 break;
12579
12580 case 380: /* k_do: "`do'" */
12581#line 3729 "parse.y"
12582 {
12583 token_info_push(p, "do", &(yyloc));
12584 /*%%%*/
12585 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12586 /*% %*/
12587
12588 }
12589#line 12585 "parse.c"
12590 break;
12591
12592 case 381: /* k_do_block: "`do' for block" */
12593#line 3739 "parse.y"
12594 {
12595 token_info_push(p, "do", &(yyloc));
12596 /*%%%*/
12597 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
12598 /*% %*/
12599 }
12600#line 12596 "parse.c"
12601 break;
12602
12603 case 382: /* k_rescue: "`rescue'" */
12604#line 3748 "parse.y"
12605 {
12606 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
12607 }
12608#line 12604 "parse.c"
12609 break;
12610
12611 case 383: /* k_ensure: "`ensure'" */
12612#line 3754 "parse.y"
12613 {
12614 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
12615 }
12616#line 12612 "parse.c"
12617 break;
12618
12619 case 384: /* k_when: "`when'" */
12620#line 3760 "parse.y"
12621 {
12622 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
12623 }
12624#line 12620 "parse.c"
12625 break;
12626
12627 case 385: /* k_else: "`else'" */
12628#line 3766 "parse.y"
12629 {
12630 token_info *ptinfo_beg = p->token_info;
12631 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
12632 token_info_warn(p, "else", p->token_info, same, &(yyloc));
12633 if (same) {
12634 token_info e;
12635 e.next = ptinfo_beg->next;
12636 e.token = "else";
12637 token_info_setup(&e, p->lex.pbeg, &(yyloc));
12638 if (!e.nonspc) *ptinfo_beg = e;
12639 }
12640 }
12641#line 12637 "parse.c"
12642 break;
12643
12644 case 386: /* k_elsif: "`elsif'" */
12645#line 3781 "parse.y"
12646 {
12647 WARN_EOL("elsif");
12648 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
12649 }
12650#line 12646 "parse.c"
12651 break;
12652
12653 case 387: /* k_end: "`end'" */
12654#line 3788 "parse.y"
12655 {
12656 token_info_pop(p, "end", &(yyloc));
12657 /*%%%*/
12658 pop_end_expect_token_locations(p);
12659 /*% %*/
12660 }
12661#line 12657 "parse.c"
12662 break;
12663
12664 case 388: /* k_end: "dummy end" */
12665#line 3795 "parse.y"
12666 {
12667 compile_error(p, "syntax error, unexpected end-of-input");
12668 }
12669#line 12665 "parse.c"
12670 break;
12671
12672 case 389: /* k_return: "`return'" */
12673#line 3801 "parse.y"
12674 {
12675 if (p->ctxt.in_class && !p->ctxt.in_def && !dyna_in_block(p))
12676 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
12677 }
12678#line 12674 "parse.c"
12679 break;
12680
12681 case 396: /* if_tail: k_elsif expr_value then compstmt if_tail */
12682#line 3820 "parse.y"
12683 {
12684 /*%%%*/
12685 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12686 fixpos((yyval.node), (yyvsp[-3].node));
12687 /*% %*/
12688 /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/
12689 }
12690#line 12686 "parse.c"
12691 break;
12692
12693 case 398: /* opt_else: k_else compstmt */
12694#line 3831 "parse.y"
12695 {
12696 /*%%%*/
12697 (yyval.node) = (yyvsp[0].node);
12698 /*% %*/
12699 /*% ripper: else!($2) %*/
12700 }
12701#line 12697 "parse.c"
12702 break;
12703
12704 case 401: /* f_marg: f_norm_arg */
12705#line 3844 "parse.y"
12706 {
12707 /*%%%*/
12708 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12709 mark_lvar_used(p, (yyval.node));
12710 /*% %*/
12711 /*% ripper: assignable(p, $1) %*/
12712 }
12713#line 12709 "parse.c"
12714 break;
12715
12716 case 402: /* f_marg: "(" f_margs rparen */
12717#line 3852 "parse.y"
12718 {
12719 /*%%%*/
12720 (yyval.node) = (yyvsp[-1].node);
12721 /*% %*/
12722 /*% ripper: mlhs_paren!($2) %*/
12723 }
12724#line 12720 "parse.c"
12725 break;
12726
12727 case 403: /* f_marg_list: f_marg */
12728#line 3861 "parse.y"
12729 {
12730 /*%%%*/
12731 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
12732 /*% %*/
12733 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
12734 }
12735#line 12731 "parse.c"
12736 break;
12737
12738 case 404: /* f_marg_list: f_marg_list ',' f_marg */
12739#line 3868 "parse.y"
12740 {
12741 /*%%%*/
12742 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
12743 /*% %*/
12744 /*% ripper: mlhs_add!($1, $3) %*/
12745 }
12746#line 12742 "parse.c"
12747 break;
12748
12749 case 405: /* f_margs: f_marg_list */
12750#line 3877 "parse.y"
12751 {
12752 /*%%%*/
12753 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
12754 /*% %*/
12755 /*% ripper: $1 %*/
12756 }
12757#line 12753 "parse.c"
12758 break;
12759
12760 case 406: /* f_margs: f_marg_list ',' f_rest_marg */
12761#line 3884 "parse.y"
12762 {
12763 /*%%%*/
12764 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
12765 /*% %*/
12766 /*% ripper: mlhs_add_star!($1, $3) %*/
12767 }
12768#line 12764 "parse.c"
12769 break;
12770
12771 case 407: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
12772#line 3891 "parse.y"
12773 {
12774 /*%%%*/
12775 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
12776 /*% %*/
12777 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
12778 }
12779#line 12775 "parse.c"
12780 break;
12781
12782 case 408: /* f_margs: f_rest_marg */
12783#line 3898 "parse.y"
12784 {
12785 /*%%%*/
12786 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
12787 /*% %*/
12788 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
12789 }
12790#line 12786 "parse.c"
12791 break;
12792
12793 case 409: /* f_margs: f_rest_marg ',' f_marg_list */
12794#line 3905 "parse.y"
12795 {
12796 /*%%%*/
12797 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
12798 /*% %*/
12799 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
12800 }
12801#line 12797 "parse.c"
12802 break;
12803
12804 case 410: /* f_rest_marg: "*" f_norm_arg */
12805#line 3914 "parse.y"
12806 {
12807 /*%%%*/
12808 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12809 mark_lvar_used(p, (yyval.node));
12810 /*% %*/
12811 /*% ripper: assignable(p, $2) %*/
12812 }
12813#line 12809 "parse.c"
12814 break;
12815
12816 case 411: /* f_rest_marg: "*" */
12817#line 3922 "parse.y"
12818 {
12819 /*%%%*/
12820 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
12821 /*% %*/
12822 /*% ripper: Qnil %*/
12823 }
12824#line 12820 "parse.c"
12825 break;
12826
12827 case 413: /* f_any_kwrest: f_no_kwarg */
12828#line 3931 "parse.y"
12829 {(yyval.id) = ID2VAL(idNil);}
12830#line 12826 "parse.c"
12831 break;
12832
12833 case 414: /* $@26: %empty */
12834#line 3934 "parse.y"
12835 {p->ctxt.in_argdef = 0;}
12836#line 12832 "parse.c"
12837 break;
12838
12839 case 416: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
12840#line 3937 "parse.y"
12841 {
12842 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12843 }
12844#line 12840 "parse.c"
12845 break;
12846
12847 case 417: /* block_args_tail: f_block_kwarg opt_f_block_arg */
12848#line 3941 "parse.y"
12849 {
12850 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
12851 }
12852#line 12848 "parse.c"
12853 break;
12854
12855 case 418: /* block_args_tail: f_any_kwrest opt_f_block_arg */
12856#line 3945 "parse.y"
12857 {
12858 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12859 }
12860#line 12856 "parse.c"
12861 break;
12862
12863 case 419: /* block_args_tail: f_block_arg */
12864#line 3949 "parse.y"
12865 {
12866 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
12867 }
12868#line 12864 "parse.c"
12869 break;
12870
12871 case 420: /* opt_block_args_tail: ',' block_args_tail */
12872#line 3955 "parse.y"
12873 {
12874 (yyval.node) = (yyvsp[0].node);
12875 }
12876#line 12872 "parse.c"
12877 break;
12878
12879 case 421: /* opt_block_args_tail: %empty */
12880#line 3959 "parse.y"
12881 {
12882 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12883 }
12884#line 12880 "parse.c"
12885 break;
12886
12887 case 422: /* excessed_comma: ',' */
12888#line 3965 "parse.y"
12889 {
12890 /* magic number for rest_id in iseq_set_arguments() */
12891 /*%%%*/
12892 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
12893 /*% %*/
12894 /*% ripper: excessed_comma! %*/
12895 }
12896#line 12892 "parse.c"
12897 break;
12898
12899 case 423: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
12900#line 3975 "parse.y"
12901 {
12902 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12903 }
12904#line 12900 "parse.c"
12905 break;
12906
12907 case 424: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
12908#line 3979 "parse.y"
12909 {
12910 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12911 }
12912#line 12908 "parse.c"
12913 break;
12914
12915 case 425: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
12916#line 3983 "parse.y"
12917 {
12918 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12919 }
12920#line 12916 "parse.c"
12921 break;
12922
12923 case 426: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
12924#line 3987 "parse.y"
12925 {
12926 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12927 }
12928#line 12924 "parse.c"
12929 break;
12930
12931 case 427: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
12932#line 3991 "parse.y"
12933 {
12934 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12935 }
12936#line 12932 "parse.c"
12937 break;
12938
12939 case 428: /* block_param: f_arg excessed_comma */
12940#line 3995 "parse.y"
12941 {
12942 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12943 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), Qnone, (yyval.node), &(yyloc));
12944 }
12945#line 12941 "parse.c"
12946 break;
12947
12948 case 429: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
12949#line 4000 "parse.y"
12950 {
12951 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12952 }
12953#line 12949 "parse.c"
12954 break;
12955
12956 case 430: /* block_param: f_arg opt_block_args_tail */
12957#line 4004 "parse.y"
12958 {
12959 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12960 }
12961#line 12957 "parse.c"
12962 break;
12963
12964 case 431: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
12965#line 4008 "parse.y"
12966 {
12967 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12968 }
12969#line 12965 "parse.c"
12970 break;
12971
12972 case 432: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
12973#line 4012 "parse.y"
12974 {
12975 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12976 }
12977#line 12973 "parse.c"
12978 break;
12979
12980 case 433: /* block_param: f_block_optarg opt_block_args_tail */
12981#line 4016 "parse.y"
12982 {
12983 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12984 }
12985#line 12981 "parse.c"
12986 break;
12987
12988 case 434: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
12989#line 4020 "parse.y"
12990 {
12991 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12992 }
12993#line 12989 "parse.c"
12994 break;
12995
12996 case 435: /* block_param: f_rest_arg opt_block_args_tail */
12997#line 4024 "parse.y"
12998 {
12999 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
13000 }
13001#line 12997 "parse.c"
13002 break;
13003
13004 case 436: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
13005#line 4028 "parse.y"
13006 {
13007 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13008 }
13009#line 13005 "parse.c"
13010 break;
13011
13012 case 437: /* block_param: block_args_tail */
13013#line 4032 "parse.y"
13014 {
13015 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
13016 }
13017#line 13013 "parse.c"
13018 break;
13019
13020 case 439: /* opt_block_param: block_param_def */
13021#line 4039 "parse.y"
13022 {
13023 p->command_start = TRUE;
13024 }
13025#line 13021 "parse.c"
13026 break;
13027
13028 case 440: /* block_param_def: '|' opt_bv_decl '|' */
13029#line 4045 "parse.y"
13030 {
13031 p->cur_arg = 0;
13032 p->max_numparam = ORDINAL_PARAM;
13033 p->ctxt.in_argdef = 0;
13034 /*%%%*/
13035 (yyval.node) = 0;
13036 /*% %*/
13037 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/
13038 }
13039#line 13035 "parse.c"
13040 break;
13041
13042 case 441: /* block_param_def: '|' block_param opt_bv_decl '|' */
13043#line 4055 "parse.y"
13044 {
13045 p->cur_arg = 0;
13046 p->max_numparam = ORDINAL_PARAM;
13047 p->ctxt.in_argdef = 0;
13048 /*%%%*/
13049 (yyval.node) = (yyvsp[-2].node);
13050 /*% %*/
13051 /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/
13052 }
13053#line 13049 "parse.c"
13054 break;
13055
13056 case 442: /* opt_bv_decl: opt_nl */
13057#line 4068 "parse.y"
13058 {
13059 (yyval.node) = 0;
13060 }
13061#line 13057 "parse.c"
13062 break;
13063
13064 case 443: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
13065#line 4072 "parse.y"
13066 {
13067 /*%%%*/
13068 (yyval.node) = 0;
13069 /*% %*/
13070 /*% ripper: $3 %*/
13071 }
13072#line 13068 "parse.c"
13073 break;
13074
13075 case 446: /* bvar: "local variable or method" */
13076#line 4087 "parse.y"
13077 {
13078 new_bv(p, get_id((yyvsp[0].id)));
13079 /*% ripper: get_value($1) %*/
13080 }
13081#line 13077 "parse.c"
13082 break;
13083
13084 case 447: /* bvar: f_bad_arg */
13085#line 4092 "parse.y"
13086 {
13087 (yyval.node) = 0;
13088 }
13089#line 13085 "parse.c"
13090 break;
13091
13092 case 448: /* @27: %empty */
13093#line 4098 "parse.y"
13094 {
13095 token_info_push(p, "->", &(yylsp[0]));
13096 (yyvsp[0].vars) = dyna_push(p);
13097 (yyval.num) = p->lex.lpar_beg;
13098 p->lex.lpar_beg = p->lex.paren_nest;
13099 }
13100#line 13096 "parse.c"
13101 break;
13102
13103 case 449: /* @28: %empty */
13104#line 4104 "parse.y"
13105 {
13106 (yyval.num) = p->max_numparam;
13107 p->max_numparam = 0;
13108 }
13109#line 13105 "parse.c"
13110 break;
13111
13112 case 450: /* @29: %empty */
13113#line 4108 "parse.y"
13114 {
13115 (yyval.node) = numparam_push(p);
13116 }
13117#line 13113 "parse.c"
13118 break;
13119
13120 case 451: /* $@30: %empty */
13121#line 4112 "parse.y"
13122 {
13123 CMDARG_PUSH(0);
13124 }
13125#line 13121 "parse.c"
13126 break;
13127
13128 case 452: /* lambda: "->" @27 @28 @29 f_larglist $@30 lambda_body */
13129#line 4116 "parse.y"
13130 {
13131 int max_numparam = p->max_numparam;
13132 p->lex.lpar_beg = (yyvsp[-5].num);
13133 p->max_numparam = (yyvsp[-4].num);
13134 CMDARG_POP();
13135 (yyvsp[-2].node) = args_with_numbered(p, (yyvsp[-2].node), max_numparam);
13136 /*%%%*/
13137 {
13138 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13139 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node), (yyvsp[0].node), &loc);
13140 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
13141 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13142 nd_set_first_loc((yyval.node), (yylsp[-6]).beg_pos);
13143 }
13144 /*% %*/
13145 /*% ripper: lambda!($5, $7) %*/
13146 numparam_pop(p, (yyvsp[-3].node));
13147 dyna_pop(p, (yyvsp[-6].vars));
13148 }
13149#line 13145 "parse.c"
13150 break;
13151
13152 case 453: /* f_larglist: '(' f_args opt_bv_decl ')' */
13153#line 4138 "parse.y"
13154 {
13155 p->ctxt.in_argdef = 0;
13156 /*%%%*/
13157 (yyval.node) = (yyvsp[-2].node);
13158 p->max_numparam = ORDINAL_PARAM;
13159 /*% %*/
13160 /*% ripper: paren!($2) %*/
13161 }
13162#line 13158 "parse.c"
13163 break;
13164
13165 case 454: /* f_larglist: f_args */
13166#line 4147 "parse.y"
13167 {
13168 p->ctxt.in_argdef = 0;
13169 /*%%%*/
13170 if (!args_info_empty_p((yyvsp[0].node)->nd_ainfo))
13171 p->max_numparam = ORDINAL_PARAM;
13172 /*% %*/
13173 (yyval.node) = (yyvsp[0].node);
13174 }
13175#line 13171 "parse.c"
13176 break;
13177
13178 case 455: /* lambda_body: tLAMBEG compstmt '}' */
13179#line 4158 "parse.y"
13180 {
13181 token_info_pop(p, "}", &(yylsp[0]));
13182 (yyval.node) = (yyvsp[-1].node);
13183 }
13184#line 13180 "parse.c"
13185 break;
13186
13187 case 456: /* $@31: %empty */
13188#line 4163 "parse.y"
13189 {
13190 /*%%%*/
13191 push_end_expect_token_locations(p, &(yylsp[0]).beg_pos);
13192 /*% %*/
13193 }
13194#line 13190 "parse.c"
13195 break;
13196
13197 case 457: /* lambda_body: "`do' for lambda" $@31 bodystmt k_end */
13198#line 4169 "parse.y"
13199 {
13200 (yyval.node) = (yyvsp[-1].node);
13201 }
13202#line 13198 "parse.c"
13203 break;
13204
13205 case 458: /* do_block: k_do_block do_body k_end */
13206#line 4175 "parse.y"
13207 {
13208 (yyval.node) = (yyvsp[-1].node);
13209 /*%%%*/
13210 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13211 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13212 /*% %*/
13213 }
13214#line 13210 "parse.c"
13215 break;
13216
13217 case 459: /* block_call: command do_block */
13218#line 4185 "parse.y"
13219 {
13220 /*%%%*/
13221 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
13222 compile_error(p, "block given to yield");
13223 }
13224 else {
13225 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
13226 }
13227 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13228 fixpos((yyval.node), (yyvsp[-1].node));
13229 /*% %*/
13230 /*% ripper: method_add_block!($1, $2) %*/
13231 }
13232#line 13228 "parse.c"
13233 break;
13234
13235 case 460: /* block_call: block_call call_op2 operation2 opt_paren_args */
13236#line 4199 "parse.y"
13237 {
13238 /*%%%*/
13239 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13240 /*% %*/
13241 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
13242 }
13243#line 13239 "parse.c"
13244 break;
13245
13246 case 461: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
13247#line 4206 "parse.y"
13248 {
13249 /*%%%*/
13250 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
13251 /*% %*/
13252 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
13253 }
13254#line 13250 "parse.c"
13255 break;
13256
13257 case 462: /* block_call: block_call call_op2 operation2 command_args do_block */
13258#line 4213 "parse.y"
13259 {
13260 /*%%%*/
13261 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
13262 /*% %*/
13263 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
13264 }
13265#line 13261 "parse.c"
13266 break;
13267
13268 case 463: /* method_call: fcall paren_args */
13269#line 4222 "parse.y"
13270 {
13271 /*%%%*/
13272 (yyval.node) = (yyvsp[-1].node);
13273 (yyval.node)->nd_args = (yyvsp[0].node);
13274 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
13275 /*% %*/
13276 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
13277 }
13278#line 13274 "parse.c"
13279 break;
13280
13281 case 464: /* method_call: primary_value call_op operation2 opt_paren_args */
13282#line 4231 "parse.y"
13283 {
13284 /*%%%*/
13285 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13286 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13287 /*% %*/
13288 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
13289 }
13290#line 13286 "parse.c"
13291 break;
13292
13293 case 465: /* method_call: primary_value "::" operation2 paren_args */
13294#line 4239 "parse.y"
13295 {
13296 /*%%%*/
13297 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13298 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13299 /*% %*/
13300 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), $3), $4) %*/
13301 }
13302#line 13298 "parse.c"
13303 break;
13304
13305 case 466: /* method_call: primary_value "::" operation3 */
13306#line 4247 "parse.y"
13307 {
13308 /*%%%*/
13309 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
13310 /*% %*/
13311 /*% ripper: call!($1, ID2VAL(idCOLON2), $3) %*/
13312 }
13313#line 13309 "parse.c"
13314 break;
13315
13316 case 467: /* method_call: primary_value call_op paren_args */
13317#line 4254 "parse.y"
13318 {
13319 /*%%%*/
13320 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13321 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13322 /*% %*/
13323 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
13324 }
13325#line 13321 "parse.c"
13326 break;
13327
13328 case 468: /* method_call: primary_value "::" paren_args */
13329#line 4262 "parse.y"
13330 {
13331 /*%%%*/
13332 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
13333 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
13334 /*% %*/
13335 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), ID2VAL(idCall)), $3) %*/
13336 }
13337#line 13333 "parse.c"
13338 break;
13339
13340 case 469: /* method_call: "`super'" paren_args */
13341#line 4270 "parse.y"
13342 {
13343 /*%%%*/
13344 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
13345 /*% %*/
13346 /*% ripper: super!($2) %*/
13347 }
13348#line 13344 "parse.c"
13349 break;
13350
13351 case 470: /* method_call: "`super'" */
13352#line 4277 "parse.y"
13353 {
13354 /*%%%*/
13355 (yyval.node) = NEW_ZSUPER(&(yyloc));
13356 /*% %*/
13357 /*% ripper: zsuper! %*/
13358 }
13359#line 13355 "parse.c"
13360 break;
13361
13362 case 471: /* method_call: primary_value '[' opt_call_args rbracket */
13363#line 4284 "parse.y"
13364 {
13365 /*%%%*/
13366 if ((yyvsp[-3].node) && nd_type_p((yyvsp[-3].node), NODE_SELF))
13367 (yyval.node) = NEW_FCALL(tAREF, (yyvsp[-1].node), &(yyloc));
13368 else
13369 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
13370 fixpos((yyval.node), (yyvsp[-3].node));
13371 /*% %*/
13372 /*% ripper: aref!($1, escape_Qundef($3)) %*/
13373 }
13374#line 13370 "parse.c"
13375 break;
13376
13377 case 472: /* brace_block: '{' brace_body '}' */
13378#line 4297 "parse.y"
13379 {
13380 (yyval.node) = (yyvsp[-1].node);
13381 /*%%%*/
13382 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13383 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13384 /*% %*/
13385 }
13386#line 13382 "parse.c"
13387 break;
13388
13389 case 473: /* brace_block: k_do do_body k_end */
13390#line 4305 "parse.y"
13391 {
13392 (yyval.node) = (yyvsp[-1].node);
13393 /*%%%*/
13394 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
13395 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
13396 /*% %*/
13397 }
13398#line 13394 "parse.c"
13399 break;
13400
13401 case 474: /* @32: %empty */
13402#line 4314 "parse.y"
13403 {(yyval.vars) = dyna_push(p);}
13404#line 13400 "parse.c"
13405 break;
13406
13407 case 475: /* @33: %empty */
13408#line 4315 "parse.y"
13409 {
13410 (yyval.num) = p->max_numparam;
13411 p->max_numparam = 0;
13412 }
13413#line 13409 "parse.c"
13414 break;
13415
13416 case 476: /* @34: %empty */
13417#line 4319 "parse.y"
13418 {
13419 (yyval.node) = numparam_push(p);
13420 }
13421#line 13417 "parse.c"
13422 break;
13423
13424 case 477: /* brace_body: @32 @33 @34 opt_block_param compstmt */
13425#line 4323 "parse.y"
13426 {
13427 int max_numparam = p->max_numparam;
13428 p->max_numparam = (yyvsp[-3].num);
13429 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
13430 /*%%%*/
13431 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13432 /*% %*/
13433 /*% ripper: brace_block!(escape_Qundef($4), $5) %*/
13434 numparam_pop(p, (yyvsp[-2].node));
13435 dyna_pop(p, (yyvsp[-4].vars));
13436 }
13437#line 13433 "parse.c"
13438 break;
13439
13440 case 478: /* @35: %empty */
13441#line 4336 "parse.y"
13442 {(yyval.vars) = dyna_push(p);}
13443#line 13439 "parse.c"
13444 break;
13445
13446 case 479: /* @36: %empty */
13447#line 4337 "parse.y"
13448 {
13449 (yyval.num) = p->max_numparam;
13450 p->max_numparam = 0;
13451 }
13452#line 13448 "parse.c"
13453 break;
13454
13455 case 480: /* @37: %empty */
13456#line 4341 "parse.y"
13457 {
13458 (yyval.node) = numparam_push(p);
13459 CMDARG_PUSH(0);
13460 }
13461#line 13457 "parse.c"
13462 break;
13463
13464 case 481: /* do_body: @35 @36 @37 opt_block_param bodystmt */
13465#line 4346 "parse.y"
13466 {
13467 int max_numparam = p->max_numparam;
13468 p->max_numparam = (yyvsp[-3].num);
13469 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
13470 /*%%%*/
13471 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13472 /*% %*/
13473 /*% ripper: do_block!(escape_Qundef($4), $5) %*/
13474 CMDARG_POP();
13475 numparam_pop(p, (yyvsp[-2].node));
13476 dyna_pop(p, (yyvsp[-4].vars));
13477 }
13478#line 13474 "parse.c"
13479 break;
13480
13481 case 482: /* case_args: arg_value */
13482#line 4361 "parse.y"
13483 {
13484 /*%%%*/
13485 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
13486 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13487 /*% %*/
13488 /*% ripper: args_add!(args_new!, $1) %*/
13489 }
13490#line 13486 "parse.c"
13491 break;
13492
13493 case 483: /* case_args: "*" arg_value */
13494#line 4369 "parse.y"
13495 {
13496 /*%%%*/
13497 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
13498 /*% %*/
13499 /*% ripper: args_add_star!(args_new!, $2) %*/
13500 }
13501#line 13497 "parse.c"
13502 break;
13503
13504 case 484: /* case_args: case_args ',' arg_value */
13505#line 4376 "parse.y"
13506 {
13507 /*%%%*/
13508 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
13509 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
13510 /*% %*/
13511 /*% ripper: args_add!($1, $3) %*/
13512 }
13513#line 13509 "parse.c"
13514 break;
13515
13516 case 485: /* case_args: case_args ',' "*" arg_value */
13517#line 4384 "parse.y"
13518 {
13519 /*%%%*/
13520 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
13521 /*% %*/
13522 /*% ripper: args_add_star!($1, $4) %*/
13523 }
13524#line 13520 "parse.c"
13525 break;
13526
13527 case 486: /* case_body: k_when case_args then compstmt cases */
13528#line 4395 "parse.y"
13529 {
13530 /*%%%*/
13531 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13532 fixpos((yyval.node), (yyvsp[-3].node));
13533 /*% %*/
13534 /*% ripper: when!($2, $4, escape_Qundef($5)) %*/
13535 }
13536#line 13532 "parse.c"
13537 break;
13538
13539 case 489: /* @38: %empty */
13540#line 4409 "parse.y"
13541 {
13542 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
13543 p->command_start = FALSE;
13544 (yyvsp[0].ctxt) = p->ctxt;
13545 p->ctxt.in_kwarg = 1;
13546 (yyval.tbl) = push_pvtbl(p);
13547 }
13548#line 13544 "parse.c"
13549 break;
13550
13551 case 490: /* @39: %empty */
13552#line 4416 "parse.y"
13553 {
13554 (yyval.tbl) = push_pktbl(p);
13555 }
13556#line 13552 "parse.c"
13557 break;
13558
13559 case 491: /* $@40: %empty */
13560#line 4420 "parse.y"
13561 {
13562 pop_pktbl(p, (yyvsp[-2].tbl));
13563 pop_pvtbl(p, (yyvsp[-3].tbl));
13564 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
13565 }
13566#line 13562 "parse.c"
13567 break;
13568
13569 case 492: /* p_case_body: "`in'" @38 @39 p_top_expr then $@40 compstmt p_cases */
13570#line 4427 "parse.y"
13571 {
13572 /*%%%*/
13573 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
13574 /*% %*/
13575 /*% ripper: in!($4, $7, escape_Qundef($8)) %*/
13576 }
13577#line 13573 "parse.c"
13578 break;
13579
13580 case 496: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
13581#line 4441 "parse.y"
13582 {
13583 /*%%%*/
13584 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
13585 fixpos((yyval.node), (yyvsp[0].node));
13586 /*% %*/
13587 /*% ripper: if_mod!($3, $1) %*/
13588 }
13589#line 13585 "parse.c"
13590 break;
13591
13592 case 497: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
13593#line 4449 "parse.y"
13594 {
13595 /*%%%*/
13596 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
13597 fixpos((yyval.node), (yyvsp[0].node));
13598 /*% %*/
13599 /*% ripper: unless_mod!($3, $1) %*/
13600 }
13601#line 13597 "parse.c"
13602 break;
13603
13604 case 499: /* p_top_expr_body: p_expr ',' */
13605#line 4460 "parse.y"
13606 {
13607 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, Qnone, &(yyloc));
13608 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
13609 }
13610#line 13606 "parse.c"
13611 break;
13612
13613 case 500: /* p_top_expr_body: p_expr ',' p_args */
13614#line 4465 "parse.y"
13615 {
13616 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
13617 /*%%%*/
13618 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
13619 /*%
13620 %*/
13621 }
13622#line 13618 "parse.c"
13623 break;
13624
13625 case 501: /* p_top_expr_body: p_find */
13626#line 4473 "parse.y"
13627 {
13628 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
13629 }
13630#line 13626 "parse.c"
13631 break;
13632
13633 case 502: /* p_top_expr_body: p_args_tail */
13634#line 4477 "parse.y"
13635 {
13636 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
13637 }
13638#line 13634 "parse.c"
13639 break;
13640
13641 case 503: /* p_top_expr_body: p_kwargs */
13642#line 4481 "parse.y"
13643 {
13644 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
13645 }
13646#line 13642 "parse.c"
13647 break;
13648
13649 case 505: /* p_as: p_expr "=>" p_variable */
13650#line 4490 "parse.y"
13651 {
13652 /*%%%*/
13653 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
13654 n = list_append(p, n, (yyvsp[0].node));
13655 (yyval.node) = new_hash(p, n, &(yyloc));
13656 /*% %*/
13657 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
13658 }
13659#line 13655 "parse.c"
13660 break;
13661
13662 case 507: /* p_alt: p_alt '|' p_expr_basic */
13663#line 4502 "parse.y"
13664 {
13665 /*%%%*/
13666 (yyval.node) = NEW_NODE(NODE_OR, (yyvsp[-2].node), (yyvsp[0].node), 0, &(yyloc));
13667 /*% %*/
13668 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
13669 }
13670#line 13666 "parse.c"
13671 break;
13672
13673 case 509: /* p_lparen: '(' */
13674#line 4511 "parse.y"
13675 {(yyval.tbl) = push_pktbl(p);}
13676#line 13672 "parse.c"
13677 break;
13678
13679 case 510: /* p_lbracket: '[' */
13680#line 4512 "parse.y"
13681 {(yyval.tbl) = push_pktbl(p);}
13682#line 13678 "parse.c"
13683 break;
13684
13685 case 513: /* p_expr_basic: p_const p_lparen p_args rparen */
13686#line 4517 "parse.y"
13687 {
13688 pop_pktbl(p, (yyvsp[-2].tbl));
13689 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
13690 /*%%%*/
13691 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13692 /*%
13693 %*/
13694 }
13695#line 13691 "parse.c"
13696 break;
13697
13698 case 514: /* p_expr_basic: p_const p_lparen p_find rparen */
13699#line 4526 "parse.y"
13700 {
13701 pop_pktbl(p, (yyvsp[-2].tbl));
13702 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (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 515: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
13712#line 4535 "parse.y"
13713 {
13714 pop_pktbl(p, (yyvsp[-2].tbl));
13715 (yyval.node) = new_hash_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 516: /* p_expr_basic: p_const '(' rparen */
13725#line 4544 "parse.y"
13726 {
13727 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
13728 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
13729 }
13730#line 13726 "parse.c"
13731 break;
13732
13733 case 517: /* p_expr_basic: p_const p_lbracket p_args rbracket */
13734#line 4549 "parse.y"
13735 {
13736 pop_pktbl(p, (yyvsp[-2].tbl));
13737 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
13738 /*%%%*/
13739 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
13740 /*%
13741 %*/
13742 }
13743#line 13739 "parse.c"
13744 break;
13745
13746 case 518: /* p_expr_basic: p_const p_lbracket p_find rbracket */
13747#line 4558 "parse.y"
13748 {
13749 pop_pktbl(p, (yyvsp[-2].tbl));
13750 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (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 519: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
13760#line 4567 "parse.y"
13761 {
13762 pop_pktbl(p, (yyvsp[-2].tbl));
13763 (yyval.node) = new_hash_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 520: /* p_expr_basic: p_const '[' rbracket */
13773#line 4576 "parse.y"
13774 {
13775 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
13776 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
13777 }
13778#line 13774 "parse.c"
13779 break;
13780
13781 case 521: /* p_expr_basic: "[" p_args rbracket */
13782#line 4581 "parse.y"
13783 {
13784 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
13785 }
13786#line 13782 "parse.c"
13787 break;
13788
13789 case 522: /* p_expr_basic: "[" p_find rbracket */
13790#line 4585 "parse.y"
13791 {
13792 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
13793 }
13794#line 13790 "parse.c"
13795 break;
13796
13797 case 523: /* p_expr_basic: "[" rbracket */
13798#line 4589 "parse.y"
13799 {
13800 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
13801 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
13802 }
13803#line 13799 "parse.c"
13804 break;
13805
13806 case 524: /* @41: %empty */
13807#line 4594 "parse.y"
13808 {
13809 (yyval.tbl) = push_pktbl(p);
13810 (yyvsp[0].ctxt) = p->ctxt;
13811 p->ctxt.in_kwarg = 0;
13812 }
13813#line 13809 "parse.c"
13814 break;
13815
13816 case 525: /* p_expr_basic: "{" @41 p_kwargs rbrace */
13817#line 4600 "parse.y"
13818 {
13819 pop_pktbl(p, (yyvsp[-2].tbl));
13820 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
13821 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
13822 }
13823#line 13819 "parse.c"
13824 break;
13825
13826 case 526: /* p_expr_basic: "{" rbrace */
13827#line 4606 "parse.y"
13828 {
13829 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
13830 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
13831 }
13832#line 13828 "parse.c"
13833 break;
13834
13835 case 527: /* @42: %empty */
13836#line 4610 "parse.y"
13837 {(yyval.tbl) = push_pktbl(p);}
13838#line 13834 "parse.c"
13839 break;
13840
13841 case 528: /* p_expr_basic: "(" @42 p_expr rparen */
13842#line 4611 "parse.y"
13843 {
13844 pop_pktbl(p, (yyvsp[-2].tbl));
13845 (yyval.node) = (yyvsp[-1].node);
13846 }
13847#line 13843 "parse.c"
13848 break;
13849
13850 case 529: /* p_args: p_expr */
13851#line 4618 "parse.y"
13852 {
13853 /*%%%*/
13854 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
13855 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &(yyloc));
13856 /*%
13857 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, 0, Qnone, &@$);
13858 %*/
13859 }
13860#line 13856 "parse.c"
13861 break;
13862
13863 case 530: /* p_args: p_args_head */
13864#line 4627 "parse.y"
13865 {
13866 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, Qnone, &(yyloc));
13867 }
13868#line 13864 "parse.c"
13869 break;
13870
13871 case 531: /* p_args: p_args_head p_arg */
13872#line 4631 "parse.y"
13873 {
13874 /*%%%*/
13875 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, Qnone, &(yyloc));
13876 /*%
13877 VALUE pre_args = rb_ary_concat($1, get_value($2));
13878 $$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$);
13879 %*/
13880 }
13881#line 13877 "parse.c"
13882 break;
13883
13884 case 532: /* p_args: p_args_head p_rest */
13885#line 4640 "parse.y"
13886 {
13887 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, (yyvsp[0].id), Qnone, &(yyloc));
13888 }
13889#line 13885 "parse.c"
13890 break;
13891
13892 case 533: /* p_args: p_args_head p_rest ',' p_args_post */
13893#line 4644 "parse.y"
13894 {
13895 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
13896 }
13897#line 13893 "parse.c"
13898 break;
13899
13900 case 535: /* p_args_head: p_arg ',' */
13901#line 4651 "parse.y"
13902 {
13903 (yyval.node) = (yyvsp[-1].node);
13904 }
13905#line 13901 "parse.c"
13906 break;
13907
13908 case 536: /* p_args_head: p_args_head p_arg ',' */
13909#line 4655 "parse.y"
13910 {
13911 /*%%%*/
13912 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
13913 /*% %*/
13914 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
13915 }
13916#line 13912 "parse.c"
13917 break;
13918
13919 case 537: /* p_args_tail: p_rest */
13920#line 4664 "parse.y"
13921 {
13922 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].id), Qnone, &(yyloc));
13923 }
13924#line 13920 "parse.c"
13925 break;
13926
13927 case 538: /* p_args_tail: p_rest ',' p_args_post */
13928#line 4668 "parse.y"
13929 {
13930 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
13931 }
13932#line 13928 "parse.c"
13933 break;
13934
13935 case 539: /* p_find: p_rest ',' p_args_post ',' p_rest */
13936#line 4674 "parse.y"
13937 {
13938 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].id), (yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
13939 }
13940#line 13936 "parse.c"
13941 break;
13942
13943 case 540: /* p_rest: "*" "local variable or method" */
13944#line 4681 "parse.y"
13945 {
13946 (yyval.id) = (yyvsp[0].id);
13947 }
13948#line 13944 "parse.c"
13949 break;
13950
13951 case 541: /* p_rest: "*" */
13952#line 4685 "parse.y"
13953 {
13954 (yyval.id) = 0;
13955 }
13956#line 13952 "parse.c"
13957 break;
13958
13959 case 543: /* p_args_post: p_args_post ',' p_arg */
13960#line 4692 "parse.y"
13961 {
13962 /*%%%*/
13963 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
13964 /*% %*/
13965 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
13966 }
13967#line 13963 "parse.c"
13968 break;
13969
13970 case 544: /* p_arg: p_expr */
13971#line 4701 "parse.y"
13972 {
13973 /*%%%*/
13974 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
13975 /*% %*/
13976 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
13977 }
13978#line 13974 "parse.c"
13979 break;
13980
13981 case 545: /* p_kwargs: p_kwarg ',' p_any_kwrest */
13982#line 4710 "parse.y"
13983 {
13984 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
13985 }
13986#line 13982 "parse.c"
13987 break;
13988
13989 case 546: /* p_kwargs: p_kwarg */
13990#line 4714 "parse.y"
13991 {
13992 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
13993 }
13994#line 13990 "parse.c"
13995 break;
13996
13997 case 547: /* p_kwargs: p_kwarg ',' */
13998#line 4718 "parse.y"
13999 {
14000 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
14001 }
14002#line 13998 "parse.c"
14003 break;
14004
14005 case 548: /* p_kwargs: p_any_kwrest */
14006#line 4722 "parse.y"
14007 {
14008 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
14009 }
14010#line 14006 "parse.c"
14011 break;
14012
14013 case 550: /* p_kwarg: p_kwarg ',' p_kw */
14014#line 4730 "parse.y"
14015 {
14016 /*%%%*/
14017 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
14018 /*% %*/
14019 /*% ripper: rb_ary_push($1, $3) %*/
14020 }
14021#line 14017 "parse.c"
14022 break;
14023
14024 case 551: /* p_kw: p_kw_label p_expr */
14025#line 4739 "parse.y"
14026 {
14027 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
14028 /*%%%*/
14029 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
14030 /*% %*/
14031 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
14032 }
14033#line 14029 "parse.c"
14034 break;
14035
14036 case 552: /* p_kw: p_kw_label */
14037#line 4747 "parse.y"
14038 {
14039 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14040 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
14041 yyerror1(&(yylsp[0]), "key must be valid as local variables");
14042 }
14043 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
14044 /*%%%*/
14045 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
14046 /*% %*/
14047 /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/
14048 }
14049#line 14045 "parse.c"
14050 break;
14051
14052 case 554: /* p_kw_label: "string literal" string_contents tLABEL_END */
14053#line 4762 "parse.y"
14054 {
14055 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
14056 /*%%%*/
14057 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
14058 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
14059 (yyval.id) = SYM2ID(node->nd_lit);
14060 }
14061 /*%
14062 if (ripper_is_node_yylval($2) && RNODE($2)->nd_cval) {
14063 VALUE label = RNODE($2)->nd_cval;
14064 VALUE rval = RNODE($2)->nd_rval;
14065 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
14066 RNODE($$)->nd_loc = loc;
14067 }
14068 %*/
14069 else {
14070 yyerror1(&loc, "symbol literal with interpolation is not allowed");
14071 (yyval.id) = 0;
14072 }
14073 }
14074#line 14070 "parse.c"
14075 break;
14076
14077 case 555: /* p_kwrest: kwrest_mark "local variable or method" */
14078#line 4785 "parse.y"
14079 {
14080 (yyval.id) = (yyvsp[0].id);
14081 }
14082#line 14078 "parse.c"
14083 break;
14084
14085 case 556: /* p_kwrest: kwrest_mark */
14086#line 4789 "parse.y"
14087 {
14088 (yyval.id) = 0;
14089 }
14090#line 14086 "parse.c"
14091 break;
14092
14093 case 557: /* p_kwnorest: kwrest_mark "`nil'" */
14094#line 4795 "parse.y"
14095 {
14096 (yyval.id) = 0;
14097 }
14098#line 14094 "parse.c"
14099 break;
14100
14101 case 559: /* p_any_kwrest: p_kwnorest */
14102#line 4801 "parse.y"
14103 {(yyval.id) = ID2VAL(idNil);}
14104#line 14100 "parse.c"
14105 break;
14106
14107 case 561: /* p_value: p_primitive ".." p_primitive */
14108#line 4806 "parse.y"
14109 {
14110 /*%%%*/
14111 value_expr((yyvsp[-2].node));
14112 value_expr((yyvsp[0].node));
14113 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14114 /*% %*/
14115 /*% ripper: dot2!($1, $3) %*/
14116 }
14117#line 14113 "parse.c"
14118 break;
14119
14120 case 562: /* p_value: p_primitive "..." p_primitive */
14121#line 4815 "parse.y"
14122 {
14123 /*%%%*/
14124 value_expr((yyvsp[-2].node));
14125 value_expr((yyvsp[0].node));
14126 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
14127 /*% %*/
14128 /*% ripper: dot3!($1, $3) %*/
14129 }
14130#line 14126 "parse.c"
14131 break;
14132
14133 case 563: /* p_value: p_primitive ".." */
14134#line 4824 "parse.y"
14135 {
14136 /*%%%*/
14137 value_expr((yyvsp[-1].node));
14138 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
14139 /*% %*/
14140 /*% ripper: dot2!($1, Qnil) %*/
14141 }
14142#line 14138 "parse.c"
14143 break;
14144
14145 case 564: /* p_value: p_primitive "..." */
14146#line 4832 "parse.y"
14147 {
14148 /*%%%*/
14149 value_expr((yyvsp[-1].node));
14150 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
14151 /*% %*/
14152 /*% ripper: dot3!($1, Qnil) %*/
14153 }
14154#line 14150 "parse.c"
14155 break;
14156
14157 case 568: /* p_value: "(.." p_primitive */
14158#line 4843 "parse.y"
14159 {
14160 /*%%%*/
14161 value_expr((yyvsp[0].node));
14162 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
14163 /*% %*/
14164 /*% ripper: dot2!(Qnil, $2) %*/
14165 }
14166#line 14162 "parse.c"
14167 break;
14168
14169 case 569: /* p_value: "(..." p_primitive */
14170#line 4851 "parse.y"
14171 {
14172 /*%%%*/
14173 value_expr((yyvsp[0].node));
14174 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
14175 /*% %*/
14176 /*% ripper: dot3!(Qnil, $2) %*/
14177 }
14178#line 14174 "parse.c"
14179 break;
14180
14181 case 578: /* p_primitive: keyword_variable */
14182#line 4869 "parse.y"
14183 {
14184 /*%%%*/
14185 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14186 /*% %*/
14187 /*% ripper: var_ref!($1) %*/
14188 }
14189#line 14185 "parse.c"
14190 break;
14191
14192 case 580: /* p_variable: "local variable or method" */
14193#line 4879 "parse.y"
14194 {
14195 /*%%%*/
14196 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
14197 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14198 /*% %*/
14199 /*% ripper: assignable(p, var_field(p, $1)) %*/
14200 }
14201#line 14197 "parse.c"
14202 break;
14203
14204 case 581: /* p_var_ref: '^' "local variable or method" */
14205#line 4889 "parse.y"
14206 {
14207 /*%%%*/
14208 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
14209 if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
14210 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
14211 }
14212 (yyval.node) = n;
14213 /*% %*/
14214 /*% ripper: var_ref!($2) %*/
14215 }
14216#line 14212 "parse.c"
14217 break;
14218
14219 case 582: /* p_var_ref: '^' nonlocal_var */
14220#line 4900 "parse.y"
14221 {
14222 /*%%%*/
14223 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14224 /*% %*/
14225 /*% ripper: var_ref!($2) %*/
14226 }
14227#line 14223 "parse.c"
14228 break;
14229
14230 case 583: /* p_expr_ref: '^' "(" expr_value rparen */
14231#line 4909 "parse.y"
14232 {
14233 /*%%%*/
14234 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
14235 /*% %*/
14236 /*% ripper: begin!($3) %*/
14237 }
14238#line 14234 "parse.c"
14239 break;
14240
14241 case 584: /* p_const: ":: at EXPR_BEG" cname */
14242#line 4918 "parse.y"
14243 {
14244 /*%%%*/
14245 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
14246 /*% %*/
14247 /*% ripper: top_const_ref!($2) %*/
14248 }
14249#line 14245 "parse.c"
14250 break;
14251
14252 case 585: /* p_const: p_const "::" cname */
14253#line 4925 "parse.y"
14254 {
14255 /*%%%*/
14256 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
14257 /*% %*/
14258 /*% ripper: const_path_ref!($1, $3) %*/
14259 }
14260#line 14256 "parse.c"
14261 break;
14262
14263 case 586: /* p_const: "constant" */
14264#line 4932 "parse.y"
14265 {
14266 /*%%%*/
14267 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
14268 /*% %*/
14269 /*% ripper: var_ref!($1) %*/
14270 }
14271#line 14267 "parse.c"
14272 break;
14273
14274 case 587: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
14275#line 4943 "parse.y"
14276 {
14277 /*%%%*/
14278 (yyval.node) = NEW_RESBODY((yyvsp[-4].node),
14279 (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),
14280 (yyvsp[0].node), &(yyloc));
14281
14282 if ((yyvsp[-4].node)) {
14283 fixpos((yyval.node), (yyvsp[-4].node));
14284 }
14285 else if ((yyvsp[-3].node)) {
14286 fixpos((yyval.node), (yyvsp[-3].node));
14287 }
14288 else {
14289 fixpos((yyval.node), (yyvsp[-1].node));
14290 }
14291 /*% %*/
14292 /*% ripper: rescue!(escape_Qundef($2), escape_Qundef($3), escape_Qundef($5), escape_Qundef($6)) %*/
14293 }
14294#line 14290 "parse.c"
14295 break;
14296
14297 case 589: /* exc_list: arg_value */
14298#line 4965 "parse.y"
14299 {
14300 /*%%%*/
14301 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
14302 /*% %*/
14303 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
14304 }
14305#line 14301 "parse.c"
14306 break;
14307
14308 case 590: /* exc_list: mrhs */
14309#line 4972 "parse.y"
14310 {
14311 /*%%%*/
14312 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
14313 /*% %*/
14314 /*% ripper: $1 %*/
14315 }
14316#line 14312 "parse.c"
14317 break;
14318
14319 case 592: /* exc_var: "=>" lhs */
14320#line 4982 "parse.y"
14321 {
14322 (yyval.node) = (yyvsp[0].node);
14323 }
14324#line 14320 "parse.c"
14325 break;
14326
14327 case 594: /* opt_ensure: k_ensure compstmt */
14328#line 4989 "parse.y"
14329 {
14330 /*%%%*/
14331 (yyval.node) = (yyvsp[0].node);
14332 /*% %*/
14333 /*% ripper: ensure!($2) %*/
14334 }
14335#line 14331 "parse.c"
14336 break;
14337
14338 case 598: /* strings: string */
14339#line 5003 "parse.y"
14340 {
14341 /*%%%*/
14342 NODE *node = (yyvsp[0].node);
14343 if (!node) {
14344 node = NEW_STR(STR_NEW0(), &(yyloc));
14345 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
14346 }
14347 else {
14348 node = evstr2dstr(p, node);
14349 }
14350 (yyval.node) = node;
14351 /*% %*/
14352 /*% ripper: $1 %*/
14353 }
14354#line 14350 "parse.c"
14355 break;
14356
14357 case 601: /* string: string string1 */
14358#line 5022 "parse.y"
14359 {
14360 /*%%%*/
14361 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14362 /*% %*/
14363 /*% ripper: string_concat!($1, $2) %*/
14364 }
14365#line 14361 "parse.c"
14366 break;
14367
14368 case 602: /* string1: "string literal" string_contents "terminator" */
14369#line 5031 "parse.y"
14370 {
14371 /*%%%*/
14372 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
14373 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
14374 /*% %*/
14375 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
14376 }
14377#line 14373 "parse.c"
14378 break;
14379
14380 case 603: /* xstring: "backtick literal" xstring_contents "terminator" */
14381#line 5041 "parse.y"
14382 {
14383 /*%%%*/
14384 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
14385 /*% %*/
14386 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
14387 }
14388#line 14384 "parse.c"
14389 break;
14390
14391 case 604: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
14392#line 5050 "parse.y"
14393 {
14394 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
14395 }
14396#line 14392 "parse.c"
14397 break;
14398
14399 case 605: /* words: "word list" ' ' word_list "terminator" */
14400#line 5056 "parse.y"
14401 {
14402 /*%%%*/
14403 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14404 /*% %*/
14405 /*% ripper: array!($3) %*/
14406 }
14407#line 14403 "parse.c"
14408 break;
14409
14410 case 606: /* word_list: %empty */
14411#line 5065 "parse.y"
14412 {
14413 /*%%%*/
14414 (yyval.node) = 0;
14415 /*% %*/
14416 /*% ripper: words_new! %*/
14417 }
14418#line 14414 "parse.c"
14419 break;
14420
14421 case 607: /* word_list: word_list word ' ' */
14422#line 5072 "parse.y"
14423 {
14424 /*%%%*/
14425 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
14426 /*% %*/
14427 /*% ripper: words_add!($1, $2) %*/
14428 }
14429#line 14425 "parse.c"
14430 break;
14431
14432 case 609: /* word: word string_content */
14433#line 5083 "parse.y"
14434 {
14435 /*%%%*/
14436 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14437 /*% %*/
14438 /*% ripper: word_add!($1, $2) %*/
14439 }
14440#line 14436 "parse.c"
14441 break;
14442
14443 case 610: /* symbols: "symbol list" ' ' symbol_list "terminator" */
14444#line 5092 "parse.y"
14445 {
14446 /*%%%*/
14447 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14448 /*% %*/
14449 /*% ripper: array!($3) %*/
14450 }
14451#line 14447 "parse.c"
14452 break;
14453
14454 case 611: /* symbol_list: %empty */
14455#line 5101 "parse.y"
14456 {
14457 /*%%%*/
14458 (yyval.node) = 0;
14459 /*% %*/
14460 /*% ripper: symbols_new! %*/
14461 }
14462#line 14458 "parse.c"
14463 break;
14464
14465 case 612: /* symbol_list: symbol_list word ' ' */
14466#line 5108 "parse.y"
14467 {
14468 /*%%%*/
14469 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
14470 /*% %*/
14471 /*% ripper: symbols_add!($1, $2) %*/
14472 }
14473#line 14469 "parse.c"
14474 break;
14475
14476 case 613: /* qwords: "verbatim word list" ' ' qword_list "terminator" */
14477#line 5117 "parse.y"
14478 {
14479 /*%%%*/
14480 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14481 /*% %*/
14482 /*% ripper: array!($3) %*/
14483 }
14484#line 14480 "parse.c"
14485 break;
14486
14487 case 614: /* qsymbols: "verbatim symbol list" ' ' qsym_list "terminator" */
14488#line 5126 "parse.y"
14489 {
14490 /*%%%*/
14491 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
14492 /*% %*/
14493 /*% ripper: array!($3) %*/
14494 }
14495#line 14491 "parse.c"
14496 break;
14497
14498 case 615: /* qword_list: %empty */
14499#line 5135 "parse.y"
14500 {
14501 /*%%%*/
14502 (yyval.node) = 0;
14503 /*% %*/
14504 /*% ripper: qwords_new! %*/
14505 }
14506#line 14502 "parse.c"
14507 break;
14508
14509 case 616: /* qword_list: qword_list "literal content" ' ' */
14510#line 5142 "parse.y"
14511 {
14512 /*%%%*/
14513 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
14514 /*% %*/
14515 /*% ripper: qwords_add!($1, $2) %*/
14516 }
14517#line 14513 "parse.c"
14518 break;
14519
14520 case 617: /* qsym_list: %empty */
14521#line 5151 "parse.y"
14522 {
14523 /*%%%*/
14524 (yyval.node) = 0;
14525 /*% %*/
14526 /*% ripper: qsymbols_new! %*/
14527 }
14528#line 14524 "parse.c"
14529 break;
14530
14531 case 618: /* qsym_list: qsym_list "literal content" ' ' */
14532#line 5158 "parse.y"
14533 {
14534 /*%%%*/
14535 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
14536 /*% %*/
14537 /*% ripper: qsymbols_add!($1, $2) %*/
14538 }
14539#line 14535 "parse.c"
14540 break;
14541
14542 case 619: /* string_contents: %empty */
14543#line 5167 "parse.y"
14544 {
14545 /*%%%*/
14546 (yyval.node) = 0;
14547 /*% %*/
14548 /*% ripper: string_content! %*/
14549 /*%%%*/
14550 /*%
14551 $$ = ripper_new_yylval(p, 0, $$, 0);
14552 %*/
14553 }
14554#line 14550 "parse.c"
14555 break;
14556
14557 case 620: /* string_contents: string_contents string_content */
14558#line 5178 "parse.y"
14559 {
14560 /*%%%*/
14561 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14562 /*% %*/
14563 /*% ripper: string_add!($1, $2) %*/
14564 /*%%%*/
14565 /*%
14566 if (ripper_is_node_yylval($1) && ripper_is_node_yylval($2) &&
14567 !RNODE($1)->nd_cval) {
14568 RNODE($1)->nd_cval = RNODE($2)->nd_cval;
14569 RNODE($1)->nd_rval = add_mark_object(p, $$);
14570 $$ = $1;
14571 }
14572 %*/
14573 }
14574#line 14570 "parse.c"
14575 break;
14576
14577 case 621: /* xstring_contents: %empty */
14578#line 5196 "parse.y"
14579 {
14580 /*%%%*/
14581 (yyval.node) = 0;
14582 /*% %*/
14583 /*% ripper: xstring_new! %*/
14584 }
14585#line 14581 "parse.c"
14586 break;
14587
14588 case 622: /* xstring_contents: xstring_contents string_content */
14589#line 5203 "parse.y"
14590 {
14591 /*%%%*/
14592 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
14593 /*% %*/
14594 /*% ripper: xstring_add!($1, $2) %*/
14595 }
14596#line 14592 "parse.c"
14597 break;
14598
14599 case 623: /* regexp_contents: %empty */
14600#line 5212 "parse.y"
14601 {
14602 /*%%%*/
14603 (yyval.node) = 0;
14604 /*% %*/
14605 /*% ripper: regexp_new! %*/
14606 /*%%%*/
14607 /*%
14608 $$ = ripper_new_yylval(p, 0, $$, 0);
14609 %*/
14610 }
14611#line 14607 "parse.c"
14612 break;
14613
14614 case 624: /* regexp_contents: regexp_contents string_content */
14615#line 5223 "parse.y"
14616 {
14617 /*%%%*/
14618 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
14619 if (!head) {
14620 (yyval.node) = tail;
14621 }
14622 else if (!tail) {
14623 (yyval.node) = head;
14624 }
14625 else {
14626 switch (nd_type(head)) {
14627 case NODE_STR:
14628 nd_set_type(head, NODE_DSTR);
14629 break;
14630 case NODE_DSTR:
14631 break;
14632 default:
14633 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
14634 break;
14635 }
14636 (yyval.node) = list_append(p, head, tail);
14637 }
14638 /*%
14639 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
14640 if (ripper_is_node_yylval(n1)) {
14641 s1 = RNODE(n1)->nd_cval;
14642 n1 = RNODE(n1)->nd_rval;
14643 }
14644 if (ripper_is_node_yylval(n2)) {
14645 s2 = RNODE(n2)->nd_cval;
14646 n2 = RNODE(n2)->nd_rval;
14647 }
14648 $$ = dispatch2(regexp_add, n1, n2);
14649 if (!s1 && s2) {
14650 $$ = ripper_new_yylval(p, 0, $$, s2);
14651 }
14652 %*/
14653 }
14654#line 14650 "parse.c"
14655 break;
14656
14657 case 626: /* @43: %empty */
14658#line 5266 "parse.y"
14659 {
14660 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
14661 (yyval.strterm) = p->lex.strterm;
14662 p->lex.strterm = 0;
14663 SET_LEX_STATE(EXPR_BEG);
14664 }
14665#line 14661 "parse.c"
14666 break;
14667
14668 case 627: /* string_content: tSTRING_DVAR @43 string_dvar */
14669#line 5273 "parse.y"
14670 {
14671 p->lex.strterm = (yyvsp[-1].strterm);
14672 /*%%%*/
14673 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
14674 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
14675 /*% %*/
14676 /*% ripper: string_dvar!($3) %*/
14677 }
14678#line 14674 "parse.c"
14679 break;
14680
14681 case 628: /* $@44: %empty */
14682#line 5282 "parse.y"
14683 {
14684 CMDARG_PUSH(0);
14685 COND_PUSH(0);
14686 }
14687#line 14683 "parse.c"
14688 break;
14689
14690 case 629: /* @45: %empty */
14691#line 5286 "parse.y"
14692 {
14693 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
14694 (yyval.strterm) = p->lex.strterm;
14695 p->lex.strterm = 0;
14696 }
14697#line 14693 "parse.c"
14698 break;
14699
14700 case 630: /* @46: %empty */
14701#line 5291 "parse.y"
14702 {
14703 (yyval.num) = p->lex.state;
14704 SET_LEX_STATE(EXPR_BEG);
14705 }
14706#line 14702 "parse.c"
14707 break;
14708
14709 case 631: /* @47: %empty */
14710#line 5295 "parse.y"
14711 {
14712 (yyval.num) = p->lex.brace_nest;
14713 p->lex.brace_nest = 0;
14714 }
14715#line 14711 "parse.c"
14716 break;
14717
14718 case 632: /* @48: %empty */
14719#line 5299 "parse.y"
14720 {
14721 (yyval.num) = p->heredoc_indent;
14722 p->heredoc_indent = 0;
14723 }
14724#line 14720 "parse.c"
14725 break;
14726
14727 case 633: /* string_content: tSTRING_DBEG $@44 @45 @46 @47 @48 compstmt "'}'" */
14728#line 5304 "parse.y"
14729 {
14730 COND_POP();
14731 CMDARG_POP();
14732 p->lex.strterm = (yyvsp[-5].strterm);
14733 SET_LEX_STATE((yyvsp[-4].num));
14734 p->lex.brace_nest = (yyvsp[-3].num);
14735 p->heredoc_indent = (yyvsp[-2].num);
14736 p->heredoc_line_indent = -1;
14737 /*%%%*/
14738 if ((yyvsp[-1].node)) (yyvsp[-1].node)->flags &= ~NODE_FL_NEWLINE;
14739 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
14740 /*% %*/
14741 /*% ripper: string_embexpr!($7) %*/
14742 }
14743#line 14739 "parse.c"
14744 break;
14745
14746 case 634: /* string_dvar: "global variable" */
14747#line 5321 "parse.y"
14748 {
14749 /*%%%*/
14750 (yyval.node) = NEW_GVAR((yyvsp[0].id), &(yyloc));
14751 /*% %*/
14752 /*% ripper: var_ref!($1) %*/
14753 }
14754#line 14750 "parse.c"
14755 break;
14756
14757 case 635: /* string_dvar: "instance variable" */
14758#line 5328 "parse.y"
14759 {
14760 /*%%%*/
14761 (yyval.node) = NEW_IVAR((yyvsp[0].id), &(yyloc));
14762 /*% %*/
14763 /*% ripper: var_ref!($1) %*/
14764 }
14765#line 14761 "parse.c"
14766 break;
14767
14768 case 636: /* string_dvar: "class variable" */
14769#line 5335 "parse.y"
14770 {
14771 /*%%%*/
14772 (yyval.node) = NEW_CVAR((yyvsp[0].id), &(yyloc));
14773 /*% %*/
14774 /*% ripper: var_ref!($1) %*/
14775 }
14776#line 14772 "parse.c"
14777 break;
14778
14779 case 640: /* ssym: "symbol literal" sym */
14780#line 5349 "parse.y"
14781 {
14782 SET_LEX_STATE(EXPR_END);
14783 /*%%%*/
14784 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
14785 /*% %*/
14786 /*% ripper: symbol_literal!(symbol!($2)) %*/
14787 }
14788#line 14784 "parse.c"
14789 break;
14790
14791 case 643: /* dsym: "symbol literal" string_contents "terminator" */
14792#line 5363 "parse.y"
14793 {
14794 SET_LEX_STATE(EXPR_END);
14795 /*%%%*/
14796 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
14797 /*% %*/
14798 /*% ripper: dyna_symbol!($2) %*/
14799 }
14800#line 14796 "parse.c"
14801 break;
14802
14803 case 645: /* numeric: tUMINUS_NUM simple_numeric */
14804#line 5374 "parse.y"
14805 {
14806 /*%%%*/
14807 (yyval.node) = (yyvsp[0].node);
14808 RB_OBJ_WRITE(p->ast, &(yyval.node)->nd_lit, negate_lit(p, (yyval.node)->nd_lit));
14809 /*% %*/
14810 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
14811 }
14812#line 14808 "parse.c"
14813 break;
14814
14815 case 656: /* keyword_variable: "`nil'" */
14816#line 5399 "parse.y"
14817 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
14818#line 14814 "parse.c"
14819 break;
14820
14821 case 657: /* keyword_variable: "`self'" */
14822#line 5400 "parse.y"
14823 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
14824#line 14820 "parse.c"
14825 break;
14826
14827 case 658: /* keyword_variable: "`true'" */
14828#line 5401 "parse.y"
14829 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
14830#line 14826 "parse.c"
14831 break;
14832
14833 case 659: /* keyword_variable: "`false'" */
14834#line 5402 "parse.y"
14835 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
14836#line 14832 "parse.c"
14837 break;
14838
14839 case 660: /* keyword_variable: "`__FILE__'" */
14840#line 5403 "parse.y"
14841 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
14842#line 14838 "parse.c"
14843 break;
14844
14845 case 661: /* keyword_variable: "`__LINE__'" */
14846#line 5404 "parse.y"
14847 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
14848#line 14844 "parse.c"
14849 break;
14850
14851 case 662: /* keyword_variable: "`__ENCODING__'" */
14852#line 5405 "parse.y"
14853 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
14854#line 14850 "parse.c"
14855 break;
14856
14857 case 663: /* var_ref: user_variable */
14858#line 5409 "parse.y"
14859 {
14860 /*%%%*/
14861 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14862 /*%
14863 if (id_is_var(p, get_id($1))) {
14864 $$ = dispatch1(var_ref, $1);
14865 }
14866 else {
14867 $$ = dispatch1(vcall, $1);
14868 }
14869 %*/
14870 }
14871#line 14867 "parse.c"
14872 break;
14873
14874 case 664: /* var_ref: keyword_variable */
14875#line 5422 "parse.y"
14876 {
14877 /*%%%*/
14878 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
14879 /*% %*/
14880 /*% ripper: var_ref!($1) %*/
14881 }
14882#line 14878 "parse.c"
14883 break;
14884
14885 case 665: /* var_lhs: user_variable */
14886#line 5431 "parse.y"
14887 {
14888 /*%%%*/
14889 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14890 /*% %*/
14891 /*% ripper: assignable(p, var_field(p, $1)) %*/
14892 }
14893#line 14889 "parse.c"
14894 break;
14895
14896 case 666: /* var_lhs: keyword_variable */
14897#line 5438 "parse.y"
14898 {
14899 /*%%%*/
14900 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
14901 /*% %*/
14902 /*% ripper: assignable(p, var_field(p, $1)) %*/
14903 }
14904#line 14900 "parse.c"
14905 break;
14906
14907 case 669: /* $@49: %empty */
14908#line 5451 "parse.y"
14909 {
14910 SET_LEX_STATE(EXPR_BEG);
14911 p->command_start = TRUE;
14912 }
14913#line 14909 "parse.c"
14914 break;
14915
14916 case 670: /* superclass: '<' $@49 expr_value term */
14917#line 5456 "parse.y"
14918 {
14919 (yyval.node) = (yyvsp[-1].node);
14920 }
14921#line 14917 "parse.c"
14922 break;
14923
14924 case 671: /* superclass: %empty */
14925#line 5460 "parse.y"
14926 {
14927 /*%%%*/
14928 (yyval.node) = 0;
14929 /*% %*/
14930 /*% ripper: Qnil %*/
14931 }
14932#line 14928 "parse.c"
14933 break;
14934
14935 case 673: /* f_opt_paren_args: none */
14936#line 5470 "parse.y"
14937 {
14938 p->ctxt.in_argdef = 0;
14939 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[-1]));
14940 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[-1]));
14941 }
14942#line 14938 "parse.c"
14943 break;
14944
14945 case 674: /* f_paren_args: '(' f_args rparen */
14946#line 5478 "parse.y"
14947 {
14948 /*%%%*/
14949 (yyval.node) = (yyvsp[-1].node);
14950 /*% %*/
14951 /*% ripper: paren!($2) %*/
14952 SET_LEX_STATE(EXPR_BEG);
14953 p->command_start = TRUE;
14954 p->ctxt.in_argdef = 0;
14955 }
14956#line 14952 "parse.c"
14957 break;
14958
14959 case 676: /* @50: %empty */
14960#line 5490 "parse.y"
14961 {
14962 (yyval.ctxt) = p->ctxt;
14963 p->ctxt.in_kwarg = 1;
14964 p->ctxt.in_argdef = 1;
14965 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
14966 }
14967#line 14963 "parse.c"
14968 break;
14969
14970 case 677: /* f_arglist: @50 f_args term */
14971#line 5497 "parse.y"
14972 {
14973 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
14974 p->ctxt.in_argdef = 0;
14975 (yyval.node) = (yyvsp[-1].node);
14976 SET_LEX_STATE(EXPR_BEG);
14977 p->command_start = TRUE;
14978 }
14979#line 14975 "parse.c"
14980 break;
14981
14982 case 678: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
14983#line 5507 "parse.y"
14984 {
14985 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
14986 }
14987#line 14983 "parse.c"
14988 break;
14989
14990 case 679: /* args_tail: f_kwarg opt_f_block_arg */
14991#line 5511 "parse.y"
14992 {
14993 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
14994 }
14995#line 14991 "parse.c"
14996 break;
14997
14998 case 680: /* args_tail: f_any_kwrest opt_f_block_arg */
14999#line 5515 "parse.y"
15000 {
15001 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
15002 }
15003#line 14999 "parse.c"
15004 break;
15005
15006 case 681: /* args_tail: f_block_arg */
15007#line 5519 "parse.y"
15008 {
15009 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
15010 }
15011#line 15007 "parse.c"
15012 break;
15013
15014 case 682: /* args_tail: args_forward */
15015#line 5523 "parse.y"
15016 {
15017 add_forwarding_args(p);
15018 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[0].id), ID2VAL(idFWD_BLOCK), &(yylsp[0]));
15019 /*%%%*/
15020 ((yyval.node)->nd_ainfo)->forwarding = 1;
15021 /*% %*/
15022 }
15023#line 15019 "parse.c"
15024 break;
15025
15026 case 683: /* opt_args_tail: ',' args_tail */
15027#line 5533 "parse.y"
15028 {
15029 (yyval.node) = (yyvsp[0].node);
15030 }
15031#line 15027 "parse.c"
15032 break;
15033
15034 case 684: /* opt_args_tail: %empty */
15035#line 5537 "parse.y"
15036 {
15037 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
15038 }
15039#line 15035 "parse.c"
15040 break;
15041
15042 case 685: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
15043#line 5543 "parse.y"
15044 {
15045 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15046 }
15047#line 15043 "parse.c"
15048 break;
15049
15050 case 686: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15051#line 5547 "parse.y"
15052 {
15053 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15054 }
15055#line 15051 "parse.c"
15056 break;
15057
15058 case 687: /* f_args: f_arg ',' f_optarg opt_args_tail */
15059#line 5551 "parse.y"
15060 {
15061 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15062 }
15063#line 15059 "parse.c"
15064 break;
15065
15066 case 688: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
15067#line 5555 "parse.y"
15068 {
15069 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15070 }
15071#line 15067 "parse.c"
15072 break;
15073
15074 case 689: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
15075#line 5559 "parse.y"
15076 {
15077 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15078 }
15079#line 15075 "parse.c"
15080 break;
15081
15082 case 690: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
15083#line 5563 "parse.y"
15084 {
15085 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15086 }
15087#line 15083 "parse.c"
15088 break;
15089
15090 case 691: /* f_args: f_arg opt_args_tail */
15091#line 5567 "parse.y"
15092 {
15093 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15094 }
15095#line 15091 "parse.c"
15096 break;
15097
15098 case 692: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
15099#line 5571 "parse.y"
15100 {
15101 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15102 }
15103#line 15099 "parse.c"
15104 break;
15105
15106 case 693: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
15107#line 5575 "parse.y"
15108 {
15109 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15110 }
15111#line 15107 "parse.c"
15112 break;
15113
15114 case 694: /* f_args: f_optarg opt_args_tail */
15115#line 5579 "parse.y"
15116 {
15117 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15118 }
15119#line 15115 "parse.c"
15120 break;
15121
15122 case 695: /* f_args: f_optarg ',' f_arg opt_args_tail */
15123#line 5583 "parse.y"
15124 {
15125 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15126 }
15127#line 15123 "parse.c"
15128 break;
15129
15130 case 696: /* f_args: f_rest_arg opt_args_tail */
15131#line 5587 "parse.y"
15132 {
15133 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
15134 }
15135#line 15131 "parse.c"
15136 break;
15137
15138 case 697: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
15139#line 5591 "parse.y"
15140 {
15141 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
15142 }
15143#line 15139 "parse.c"
15144 break;
15145
15146 case 698: /* f_args: args_tail */
15147#line 5595 "parse.y"
15148 {
15149 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
15150 }
15151#line 15147 "parse.c"
15152 break;
15153
15154 case 699: /* f_args: %empty */
15155#line 5599 "parse.y"
15156 {
15157 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
15158 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[0]));
15159 }
15160#line 15156 "parse.c"
15161 break;
15162
15163 case 700: /* args_forward: "(..." */
15164#line 5606 "parse.y"
15165 {
15166 /*%%%*/
15167#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
15168 (yyval.id) = 0;
15169#else
15170 (yyval.id) = idFWD_KWREST;
15171#endif
15172 /*% %*/
15173 /*% ripper: args_forward! %*/
15174 }
15175#line 15171 "parse.c"
15176 break;
15177
15178 case 701: /* f_bad_arg: "constant" */
15179#line 5619 "parse.y"
15180 {
15181 static const char mesg[] = "formal argument cannot be a constant";
15182 /*%%%*/
15183 yyerror1(&(yylsp[0]), mesg);
15184 (yyval.id) = 0;
15185 /*% %*/
15186 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
15187 }
15188#line 15184 "parse.c"
15189 break;
15190
15191 case 702: /* f_bad_arg: "instance variable" */
15192#line 5628 "parse.y"
15193 {
15194 static const char mesg[] = "formal argument cannot be an instance variable";
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 703: /* f_bad_arg: "global variable" */
15205#line 5637 "parse.y"
15206 {
15207 static const char mesg[] = "formal argument cannot be a global 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 704: /* f_bad_arg: "class variable" */
15218#line 5646 "parse.y"
15219 {
15220 static const char mesg[] = "formal argument cannot be a class 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 706: /* f_norm_arg: "local variable or method" */
15231#line 5658 "parse.y"
15232 {
15233 formal_argument(p, (yyvsp[0].id));
15234 p->max_numparam = ORDINAL_PARAM;
15235 (yyval.id) = (yyvsp[0].id);
15236 }
15237#line 15233 "parse.c"
15238 break;
15239
15240 case 707: /* f_arg_asgn: f_norm_arg */
15241#line 5666 "parse.y"
15242 {
15243 ID id = get_id((yyvsp[0].id));
15244 arg_var(p, id);
15245 p->cur_arg = id;
15246 (yyval.id) = (yyvsp[0].id);
15247 }
15248#line 15244 "parse.c"
15249 break;
15250
15251 case 708: /* f_arg_item: f_arg_asgn */
15252#line 5675 "parse.y"
15253 {
15254 p->cur_arg = 0;
15255 /*%%%*/
15256 (yyval.node) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
15257 /*% %*/
15258 /*% ripper: get_value($1) %*/
15259 }
15260#line 15256 "parse.c"
15261 break;
15262
15263 case 709: /* f_arg_item: "(" f_margs rparen */
15264#line 5683 "parse.y"
15265 {
15266 /*%%%*/
15267 ID tid = internal_id(p);
15268 YYLTYPE loc;
15269 loc.beg_pos = (yylsp[-1]).beg_pos;
15270 loc.end_pos = (yylsp[-1]).beg_pos;
15271 arg_var(p, tid);
15272 if (dyna_in_block(p)) {
15273 (yyvsp[-1].node)->nd_value = NEW_DVAR(tid, &loc);
15274 }
15275 else {
15276 (yyvsp[-1].node)->nd_value = NEW_LVAR(tid, &loc);
15277 }
15278 (yyval.node) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
15279 (yyval.node)->nd_next = (yyvsp[-1].node);
15280 /*% %*/
15281 /*% ripper: mlhs_paren!($2) %*/
15282 }
15283#line 15279 "parse.c"
15284 break;
15285
15286 case 711: /* f_arg: f_arg ',' f_arg_item */
15287#line 5706 "parse.y"
15288 {
15289 /*%%%*/
15290 (yyval.node) = (yyvsp[-2].node);
15291 (yyval.node)->nd_plen++;
15292 (yyval.node)->nd_next = block_append(p, (yyval.node)->nd_next, (yyvsp[0].node)->nd_next);
15293 rb_discard_node(p, (yyvsp[0].node));
15294 /*% %*/
15295 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15296 }
15297#line 15293 "parse.c"
15298 break;
15299
15300 case 712: /* f_label: "label" */
15301#line 5719 "parse.y"
15302 {
15303 arg_var(p, formal_argument(p, (yyvsp[0].id)));
15304 p->cur_arg = get_id((yyvsp[0].id));
15305 p->max_numparam = ORDINAL_PARAM;
15306 p->ctxt.in_argdef = 0;
15307 (yyval.id) = (yyvsp[0].id);
15308 }
15309#line 15305 "parse.c"
15310 break;
15311
15312 case 713: /* f_kw: f_label arg_value */
15313#line 5729 "parse.y"
15314 {
15315 p->cur_arg = 0;
15316 p->ctxt.in_argdef = 1;
15317 /*%%%*/
15318 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15319 /*% %*/
15320 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
15321 }
15322#line 15318 "parse.c"
15323 break;
15324
15325 case 714: /* f_kw: f_label */
15326#line 5738 "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[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
15332 /*% %*/
15333 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
15334 }
15335#line 15331 "parse.c"
15336 break;
15337
15338 case 715: /* f_block_kw: f_label primary_value */
15339#line 5749 "parse.y"
15340 {
15341 p->ctxt.in_argdef = 1;
15342 /*%%%*/
15343 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15344 /*% %*/
15345 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
15346 }
15347#line 15343 "parse.c"
15348 break;
15349
15350 case 716: /* f_block_kw: f_label */
15351#line 5757 "parse.y"
15352 {
15353 p->ctxt.in_argdef = 1;
15354 /*%%%*/
15355 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
15356 /*% %*/
15357 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
15358 }
15359#line 15355 "parse.c"
15360 break;
15361
15362 case 717: /* f_block_kwarg: f_block_kw */
15363#line 5767 "parse.y"
15364 {
15365 /*%%%*/
15366 (yyval.node) = (yyvsp[0].node);
15367 /*% %*/
15368 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15369 }
15370#line 15366 "parse.c"
15371 break;
15372
15373 case 718: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
15374#line 5774 "parse.y"
15375 {
15376 /*%%%*/
15377 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
15378 /*% %*/
15379 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15380 }
15381#line 15377 "parse.c"
15382 break;
15383
15384 case 719: /* f_kwarg: f_kw */
15385#line 5784 "parse.y"
15386 {
15387 /*%%%*/
15388 (yyval.node) = (yyvsp[0].node);
15389 /*% %*/
15390 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15391 }
15392#line 15388 "parse.c"
15393 break;
15394
15395 case 720: /* f_kwarg: f_kwarg ',' f_kw */
15396#line 5791 "parse.y"
15397 {
15398 /*%%%*/
15399 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
15400 /*% %*/
15401 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15402 }
15403#line 15399 "parse.c"
15404 break;
15405
15406 case 723: /* f_no_kwarg: p_kwnorest */
15407#line 5804 "parse.y"
15408 {
15409 /*%%%*/
15410 /*% %*/
15411 /*% ripper: nokw_param!(Qnil) %*/
15412 }
15413#line 15409 "parse.c"
15414 break;
15415
15416 case 724: /* f_kwrest: kwrest_mark "local variable or method" */
15417#line 5812 "parse.y"
15418 {
15419 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
15420 /*%%%*/
15421 (yyval.id) = (yyvsp[0].id);
15422 /*% %*/
15423 /*% ripper: kwrest_param!($2) %*/
15424 }
15425#line 15421 "parse.c"
15426 break;
15427
15428 case 725: /* f_kwrest: kwrest_mark */
15429#line 5820 "parse.y"
15430 {
15431 arg_var(p, idFWD_KWREST);
15432 /*%%%*/
15433 (yyval.id) = idFWD_KWREST;
15434 /*% %*/
15435 /*% ripper: kwrest_param!(Qnil) %*/
15436 }
15437#line 15433 "parse.c"
15438 break;
15439
15440 case 726: /* f_opt: f_arg_asgn f_eq arg_value */
15441#line 5830 "parse.y"
15442 {
15443 p->cur_arg = 0;
15444 p->ctxt.in_argdef = 1;
15445 /*%%%*/
15446 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
15447 /*% %*/
15448 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
15449 }
15450#line 15446 "parse.c"
15451 break;
15452
15453 case 727: /* f_block_opt: f_arg_asgn f_eq primary_value */
15454#line 5841 "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 728: /* f_block_optarg: f_block_opt */
15467#line 5852 "parse.y"
15468 {
15469 /*%%%*/
15470 (yyval.node) = (yyvsp[0].node);
15471 /*% %*/
15472 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15473 }
15474#line 15470 "parse.c"
15475 break;
15476
15477 case 729: /* f_block_optarg: f_block_optarg ',' f_block_opt */
15478#line 5859 "parse.y"
15479 {
15480 /*%%%*/
15481 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
15482 /*% %*/
15483 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15484 }
15485#line 15481 "parse.c"
15486 break;
15487
15488 case 730: /* f_optarg: f_opt */
15489#line 5868 "parse.y"
15490 {
15491 /*%%%*/
15492 (yyval.node) = (yyvsp[0].node);
15493 /*% %*/
15494 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
15495 }
15496#line 15492 "parse.c"
15497 break;
15498
15499 case 731: /* f_optarg: f_optarg ',' f_opt */
15500#line 5875 "parse.y"
15501 {
15502 /*%%%*/
15503 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
15504 /*% %*/
15505 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15506 }
15507#line 15503 "parse.c"
15508 break;
15509
15510 case 734: /* f_rest_arg: restarg_mark "local variable or method" */
15511#line 5888 "parse.y"
15512 {
15513 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
15514 /*%%%*/
15515 (yyval.id) = (yyvsp[0].id);
15516 /*% %*/
15517 /*% ripper: rest_param!($2) %*/
15518 }
15519#line 15515 "parse.c"
15520 break;
15521
15522 case 735: /* f_rest_arg: restarg_mark */
15523#line 5896 "parse.y"
15524 {
15525 arg_var(p, idFWD_REST);
15526 /*%%%*/
15527 (yyval.id) = idFWD_REST;
15528 /*% %*/
15529 /*% ripper: rest_param!(Qnil) %*/
15530 }
15531#line 15527 "parse.c"
15532 break;
15533
15534 case 738: /* f_block_arg: blkarg_mark "local variable or method" */
15535#line 5910 "parse.y"
15536 {
15537 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
15538 /*%%%*/
15539 (yyval.id) = (yyvsp[0].id);
15540 /*% %*/
15541 /*% ripper: blockarg!($2) %*/
15542 }
15543#line 15539 "parse.c"
15544 break;
15545
15546 case 739: /* f_block_arg: blkarg_mark */
15547#line 5918 "parse.y"
15548 {
15549 arg_var(p, idFWD_BLOCK);
15550 /*%%%*/
15551 (yyval.id) = idFWD_BLOCK;
15552 /*% %*/
15553 /*% ripper: blockarg!(Qnil) %*/
15554 }
15555#line 15551 "parse.c"
15556 break;
15557
15558 case 740: /* opt_f_block_arg: ',' f_block_arg */
15559#line 5928 "parse.y"
15560 {
15561 (yyval.id) = (yyvsp[0].id);
15562 }
15563#line 15559 "parse.c"
15564 break;
15565
15566 case 741: /* opt_f_block_arg: none */
15567#line 5932 "parse.y"
15568 {
15569 (yyval.id) = Qnull;
15570 }
15571#line 15567 "parse.c"
15572 break;
15573
15574 case 742: /* singleton: var_ref */
15575#line 5938 "parse.y"
15576 {
15577 value_expr((yyvsp[0].node));
15578 (yyval.node) = (yyvsp[0].node);
15579 }
15580#line 15576 "parse.c"
15581 break;
15582
15583 case 743: /* $@51: %empty */
15584#line 5942 "parse.y"
15585 {SET_LEX_STATE(EXPR_BEG);}
15586#line 15582 "parse.c"
15587 break;
15588
15589 case 744: /* singleton: '(' $@51 expr rparen */
15590#line 5943 "parse.y"
15591 {
15592 /*%%%*/
15593 switch (nd_type((yyvsp[-1].node))) {
15594 case NODE_STR:
15595 case NODE_DSTR:
15596 case NODE_XSTR:
15597 case NODE_DXSTR:
15598 case NODE_DREGX:
15599 case NODE_LIT:
15600 case NODE_LIST:
15601 case NODE_ZLIST:
15602 yyerror1(&(yylsp[-1]), "can't define singleton method for literals");
15603 break;
15604 default:
15605 value_expr((yyvsp[-1].node));
15606 break;
15607 }
15608 (yyval.node) = (yyvsp[-1].node);
15609 /*% %*/
15610 /*% ripper: paren!($3) %*/
15611 }
15612#line 15608 "parse.c"
15613 break;
15614
15615 case 746: /* assoc_list: assocs trailer */
15616#line 5968 "parse.y"
15617 {
15618 /*%%%*/
15619 (yyval.node) = (yyvsp[-1].node);
15620 /*% %*/
15621 /*% ripper: assoclist_from_args!($1) %*/
15622 }
15623#line 15619 "parse.c"
15624 break;
15625
15626 case 748: /* assocs: assocs ',' assoc */
15627#line 5979 "parse.y"
15628 {
15629 /*%%%*/
15630 NODE *assocs = (yyvsp[-2].node);
15631 NODE *tail = (yyvsp[0].node);
15632 if (!assocs) {
15633 assocs = tail;
15634 }
15635 else if (tail) {
15636 if (assocs->nd_head &&
15637 !tail->nd_head && nd_type_p(tail->nd_next, NODE_LIST) &&
15638 nd_type_p(tail->nd_next->nd_head, NODE_HASH)) {
15639 /* DSTAR */
15640 tail = tail->nd_next->nd_head->nd_head;
15641 }
15642 assocs = list_concat(assocs, tail);
15643 }
15644 (yyval.node) = assocs;
15645 /*% %*/
15646 /*% ripper: rb_ary_push($1, get_value($3)) %*/
15647 }
15648#line 15644 "parse.c"
15649 break;
15650
15651 case 749: /* assoc: arg_value "=>" arg_value */
15652#line 6002 "parse.y"
15653 {
15654 /*%%%*/
15655 if (nd_type_p((yyvsp[-2].node), NODE_STR)) {
15656 nd_set_type((yyvsp[-2].node), NODE_LIT);
15657 RB_OBJ_WRITE(p->ast, &(yyvsp[-2].node)->nd_lit, rb_fstring((yyvsp[-2].node)->nd_lit));
15658 }
15659 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
15660 /*% %*/
15661 /*% ripper: assoc_new!($1, $3) %*/
15662 }
15663#line 15659 "parse.c"
15664 break;
15665
15666 case 750: /* assoc: "label" arg_value */
15667#line 6013 "parse.y"
15668 {
15669 /*%%%*/
15670 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
15671 /*% %*/
15672 /*% ripper: assoc_new!($1, $2) %*/
15673 }
15674#line 15670 "parse.c"
15675 break;
15676
15677 case 751: /* assoc: "label" */
15678#line 6020 "parse.y"
15679 {
15680 /*%%%*/
15681 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
15682 if (!val) val = NEW_BEGIN(0, &(yyloc));
15683 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
15684 /*% %*/
15685 /*% ripper: assoc_new!($1, Qnil) %*/
15686 }
15687#line 15683 "parse.c"
15688 break;
15689
15690 case 752: /* assoc: "string literal" string_contents tLABEL_END arg_value */
15691#line 6029 "parse.y"
15692 {
15693 /*%%%*/
15694 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
15695 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
15696 /*% %*/
15697 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
15698 }
15699#line 15695 "parse.c"
15700 break;
15701
15702 case 753: /* assoc: "**arg" arg_value */
15703#line 6037 "parse.y"
15704 {
15705 /*%%%*/
15706 if (nd_type_p((yyvsp[0].node), NODE_HASH) &&
15707 !((yyvsp[0].node)->nd_head && (yyvsp[0].node)->nd_head->nd_alen)) {
15708 static VALUE empty_hash;
15709 if (!empty_hash) {
15710 empty_hash = rb_obj_freeze(rb_hash_new());
15711 rb_gc_register_mark_object(empty_hash);
15712 }
15713 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
15714 }
15715 else
15716 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
15717 /*% %*/
15718 /*% ripper: assoc_splat!($2) %*/
15719 }
15720#line 15716 "parse.c"
15721 break;
15722
15723 case 754: /* assoc: "**arg" */
15724#line 6054 "parse.y"
15725 {
15726 if (!local_id(p, idFWD_KWREST) ||
15727 local_id(p, idFWD_ALL)) {
15728 compile_error(p, "no anonymous keyword rest parameter");
15729 }
15730 /*%%%*/
15731 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)),
15732 NEW_LVAR(idFWD_KWREST, &(yyloc)));
15733 /*% %*/
15734 /*% ripper: assoc_splat!(Qnil) %*/
15735 }
15736#line 15732 "parse.c"
15737 break;
15738
15739 case 778: /* term: ';' */
15740#line 6114 "parse.y"
15741 {yyerrok;token_flush(p);}
15742#line 15738 "parse.c"
15743 break;
15744
15745 case 779: /* term: '\n' */
15746#line 6116 "parse.y"
15747 {
15748 (yyloc).end_pos = (yyloc).beg_pos;
15749 token_flush(p);
15750 }
15751#line 15747 "parse.c"
15752 break;
15753
15754 case 781: /* terms: terms ';' */
15755#line 6123 "parse.y"
15756 {yyerrok;}
15757#line 15753 "parse.c"
15758 break;
15759
15760 case 782: /* none: %empty */
15761#line 6127 "parse.y"
15762 {
15763 (yyval.node) = Qnull;
15764 }
15765#line 15761 "parse.c"
15766 break;
15767
15768
15769#line 15765 "parse.c"
15770
15771 default: break;
15772 }
15773 /* User semantic actions sometimes alter yychar, and that requires
15774 that yytoken be updated with the new translation. We take the
15775 approach of translating immediately before every use of yytoken.
15776 One alternative is translating here after every semantic action,
15777 but that translation would be missed if the semantic action invokes
15778 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
15779 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
15780 incorrect destructor might then be invoked immediately. In the
15781 case of YYERROR or YYBACKUP, subsequent parser actions might lead
15782 to an incorrect destructor call or verbose syntax error message
15783 before the lookahead is translated. */
15784 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
15785
15786 YYPOPSTACK (yylen);
15787 yylen = 0;
15788
15789 *++yyvsp = yyval;
15790 *++yylsp = yyloc;
15791
15792 /* Now 'shift' the result of the reduction. Determine what state
15793 that goes to, based on the state we popped back to and the rule
15794 number reduced by. */
15795 {
15796 const int yylhs = yyr1[yyn] - YYNTOKENS;
15797 const int yyi = yypgoto[yylhs] + *yyssp;
15798 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
15799 ? yytable[yyi]
15800 : yydefgoto[yylhs]);
15801 }
15802
15803 goto yynewstate;
15804
15805
15806/*--------------------------------------.
15807| yyerrlab -- here on detecting error. |
15808`--------------------------------------*/
15809yyerrlab:
15810 /* Make sure we have latest lookahead translation. See comments at
15811 user semantic actions for why this is necessary. */
15812 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
15813 /* If not already recovering from an error, report this error. */
15814 if (!yyerrstatus)
15815 {
15816 ++yynerrs;
15817 {
15818 yypcontext_t yyctx
15819 = {yyssp, yytoken, &yylloc};
15820 char const *yymsgp = YY_("syntax error");
15821 int yysyntax_error_status;
15822 yysyntax_error_status = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
15823 if (yysyntax_error_status == 0)
15824 yymsgp = yymsg;
15825 else if (yysyntax_error_status == -1)
15826 {
15827 if (yymsg != yymsgbuf)
15828 YYSTACK_FREE (yymsg);
15829 yymsg = YY_CAST (char *,
15830 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
15831 if (yymsg)
15832 {
15833 yysyntax_error_status
15834 = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
15835 yymsgp = yymsg;
15836 }
15837 else
15838 {
15839 yymsg = yymsgbuf;
15840 yymsg_alloc = sizeof yymsgbuf;
15841 yysyntax_error_status = YYENOMEM;
15842 }
15843 }
15844 yyerror (&yylloc, p, yymsgp);
15845 if (yysyntax_error_status == YYENOMEM)
15846 YYNOMEM;
15847 }
15848 }
15849
15850 yyerror_range[1] = yylloc;
15851 if (yyerrstatus == 3)
15852 {
15853 /* If just tried and failed to reuse lookahead token after an
15854 error, discard it. */
15855
15856 if (yychar <= END_OF_INPUT)
15857 {
15858 /* Return failure if at end of input. */
15859 if (yychar == END_OF_INPUT)
15860 YYABORT;
15861 }
15862 else
15863 {
15864 yydestruct ("Error: discarding",
15865 yytoken, &yylval, &yylloc, p);
15866 yychar = YYEMPTY;
15867 }
15868 }
15869
15870 /* Else will try to reuse lookahead token after shifting the error
15871 token. */
15872 goto yyerrlab1;
15873
15874
15875/*---------------------------------------------------.
15876| yyerrorlab -- error raised explicitly by YYERROR. |
15877`---------------------------------------------------*/
15878yyerrorlab:
15879 /* Pacify compilers when the user code never invokes YYERROR and the
15880 label yyerrorlab therefore never appears in user code. */
15881 if (0)
15882 YYERROR;
15883 ++yynerrs;
15884
15885 /* Do not reclaim the symbols of the rule whose action triggered
15886 this YYERROR. */
15887 YYPOPSTACK (yylen);
15888 yylen = 0;
15889 YY_STACK_PRINT (yyss, yyssp);
15890 yystate = *yyssp;
15891 goto yyerrlab1;
15892
15893
15894/*-------------------------------------------------------------.
15895| yyerrlab1 -- common code for both syntax error and YYERROR. |
15896`-------------------------------------------------------------*/
15897yyerrlab1:
15898 yyerrstatus = 3; /* Each real token shifted decrements this. */
15899
15900 /* Pop stack until we find a state that shifts the error token. */
15901 for (;;)
15902 {
15903 yyn = yypact[yystate];
15904 if (!yypact_value_is_default (yyn))
15905 {
15906 yyn += YYSYMBOL_YYerror;
15907 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
15908 {
15909 yyn = yytable[yyn];
15910 if (0 < yyn)
15911 break;
15912 }
15913 }
15914
15915 /* Pop the current state because it cannot handle the error token. */
15916 if (yyssp == yyss)
15917 YYABORT;
15918
15919 yyerror_range[1] = *yylsp;
15920 yydestruct ("Error: popping",
15921 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
15922 YYPOPSTACK (1);
15923 yystate = *yyssp;
15924 YY_STACK_PRINT (yyss, yyssp);
15925 }
15926
15927 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
15928 *++yyvsp = yylval;
15929 YY_IGNORE_MAYBE_UNINITIALIZED_END
15930
15931 yyerror_range[2] = yylloc;
15932 ++yylsp;
15933 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
15934
15935 /* Shift the error token. */
15936 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
15937
15938 yystate = yyn;
15939 goto yynewstate;
15940
15941
15942/*-------------------------------------.
15943| yyacceptlab -- YYACCEPT comes here. |
15944`-------------------------------------*/
15945yyacceptlab:
15946 yyresult = 0;
15947 goto yyreturnlab;
15948
15949
15950/*-----------------------------------.
15951| yyabortlab -- YYABORT comes here. |
15952`-----------------------------------*/
15953yyabortlab:
15954 yyresult = 1;
15955 goto yyreturnlab;
15956
15957
15958/*-----------------------------------------------------------.
15959| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
15960`-----------------------------------------------------------*/
15961yyexhaustedlab:
15962 yyerror (&yylloc, p, YY_("memory exhausted"));
15963 yyresult = 2;
15964 goto yyreturnlab;
15965
15966
15967/*----------------------------------------------------------.
15968| yyreturnlab -- parsing is finished, clean up and return. |
15969`----------------------------------------------------------*/
15970yyreturnlab:
15971 if (yychar != YYEMPTY)
15972 {
15973 /* Make sure we have latest lookahead translation. See comments at
15974 user semantic actions for why this is necessary. */
15975 yytoken = YYTRANSLATE (yychar);
15976 yydestruct ("Cleanup: discarding lookahead",
15977 yytoken, &yylval, &yylloc, p);
15978 }
15979 /* Do not reclaim the symbols of the rule whose action triggered
15980 this YYABORT or YYACCEPT. */
15981 YYPOPSTACK (yylen);
15982 YY_STACK_PRINT (yyss, yyssp);
15983 while (yyssp != yyss)
15984 {
15985 yydestruct ("Cleanup: popping",
15986 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
15987 YYPOPSTACK (1);
15988 }
15989#ifndef yyoverflow
15990 if (yyss != yyssa)
15991 YYSTACK_FREE (yyss);
15992#endif
15993 if (yymsg != yymsgbuf)
15994 YYSTACK_FREE (yymsg);
15995 return yyresult;
15996}
15997
15998#line 6131 "parse.y"
15999
16000# undef p
16001# undef yylex
16002# undef yylval
16003# define yylval (*p->lval)
16004
16005static int regx_options(struct parser_params*);
16006static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
16007static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
16008static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
16009static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
16010
16011#ifndef RIPPER
16012# define set_yylval_node(x) { \
16013 YYLTYPE _cur_loc; \
16014 rb_parser_set_location(p, &_cur_loc); \
16015 yylval.node = (x); \
16016}
16017# define set_yylval_str(x) \
16018do { \
16019 set_yylval_node(NEW_STR(x, &_cur_loc)); \
16020 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16021} while(0)
16022# define set_yylval_literal(x) \
16023do { \
16024 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
16025 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
16026} while(0)
16027# define set_yylval_num(x) (yylval.num = (x))
16028# define set_yylval_id(x) (yylval.id = (x))
16029# define set_yylval_name(x) (yylval.id = (x))
16030# define yylval_id() (yylval.id)
16031#else
16032static inline VALUE
16033ripper_yylval_id(struct parser_params *p, ID x)
16034{
16035 return ripper_new_yylval(p, x, ID2SYM(x), 0);
16036}
16037# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
16038# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
16039# define set_yylval_id(x) (void)(x)
16040# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
16041# define set_yylval_literal(x) add_mark_object(p, (x))
16042# define set_yylval_node(x) (yylval.val = ripper_new_yylval(p, 0, 0, STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)))
16043# define yylval_id() yylval.id
16044# define _cur_loc NULL_LOC /* dummy */
16045#endif
16046
16047#define set_yylval_noname() set_yylval_id(keyword_nil)
16048#define has_delayed_token(p) (!NIL_P(p->delayed.token))
16049
16050#ifndef RIPPER
16051#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
16052#define dispatch_scan_event(p, t) parser_dispatch_scan_event(p, t, __LINE__)
16053
16054static bool
16055parser_has_token(struct parser_params *p)
16056{
16057 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);
16058 return p->lex.pcur > p->lex.ptok;
16059}
16060
16061static VALUE
16062code_loc_to_ary(const rb_code_location_t *loc)
16063{
16064 VALUE ary = rb_ary_new_from_args(4,
16065 INT2NUM(loc->beg_pos.lineno), INT2NUM(loc->beg_pos.column),
16066 INT2NUM(loc->end_pos.lineno), INT2NUM(loc->end_pos.column));
16067 rb_obj_freeze(ary);
16068
16069 return ary;
16070}
16071
16072static void
16073parser_append_tokens(struct parser_params *p, VALUE str, enum yytokentype t, int line)
16074{
16075 VALUE ary;
16076 int token_id;
16077
16078 ary = rb_ary_new2(4);
16079 token_id = p->token_id;
16080 rb_ary_push(ary, INT2FIX(token_id));
16081 rb_ary_push(ary, ID2SYM(parser_token2id(t)));
16082 rb_ary_push(ary, str);
16083 rb_ary_push(ary, code_loc_to_ary(p->yylloc));
16084 rb_obj_freeze(ary);
16085 rb_ary_push(p->tokens, ary);
16086 p->token_id++;
16087
16088 if (p->debug) {
16089 rb_parser_printf(p, "Append tokens (line: %d) %"PRIsVALUE"\n", line, ary);
16090 }
16091}
16092
16093static void
16094parser_dispatch_scan_event(struct parser_params *p, enum yytokentype t, int line)
16095{
16096 debug_token_line(p, "parser_dispatch_scan_event", line);
16097
16098 if (!parser_has_token(p)) return;
16099
16100 RUBY_SET_YYLLOC(*p->yylloc);
16101
16102 if (p->keep_tokens) {
16103 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16104 parser_append_tokens(p, str, t, line);
16105 }
16106
16107 token_flush(p);
16108}
16109
16110#define dispatch_delayed_token(p, t) parser_dispatch_delayed_token(p, t, __LINE__)
16111static void
16112parser_dispatch_delayed_token(struct parser_params *p, enum yytokentype t, int line)
16113{
16114 int saved_line = p->ruby_sourceline;
16115 const char *saved_tokp = p->lex.ptok;
16116
16117 debug_token_line(p, "parser_dispatch_delayed_token", line);
16118
16119 if (!has_delayed_token(p)) return;
16120
16121 RUBY_SET_YYLLOC_OF_DELAYED_TOKEN(*p->yylloc);
16122
16123 if (p->keep_tokens) {
16124 p->ruby_sourceline = p->delayed.beg_line;
16125 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
16126 parser_append_tokens(p, p->delayed.token, t, line);
16127 p->ruby_sourceline = saved_line;
16128 p->lex.ptok = saved_tokp;
16129 }
16130
16131 p->delayed.token = Qnil;
16132}
16133#else
16134#define literal_flush(p, ptr) ((void)(ptr))
16135
16136#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val))
16137
16138static inline VALUE
16139intern_sym(const char *name)
16140{
16141 ID id = rb_intern_const(name);
16142 return ID2SYM(id);
16143}
16144
16145static int
16146ripper_has_scan_event(struct parser_params *p)
16147{
16148 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
16149 return p->lex.pcur > p->lex.ptok;
16150}
16151
16152static VALUE
16153ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
16154{
16155 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
16156 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
16157 RUBY_SET_YYLLOC(*p->yylloc);
16158 token_flush(p);
16159 return rval;
16160}
16161
16162static void
16163ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
16164{
16165 if (!ripper_has_scan_event(p)) return;
16166 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
16167}
16168#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
16169
16170static void
16171ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
16172{
16173 int saved_line = p->ruby_sourceline;
16174 const char *saved_tokp = p->lex.ptok;
16175
16176 if (!has_delayed_token(p)) return;
16177 p->ruby_sourceline = p->delayed.beg_line;
16178 p->lex.ptok = p->lex.pbeg + p->delayed.beg_col;
16179 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
16180 p->delayed.token = Qnil;
16181 p->ruby_sourceline = saved_line;
16182 p->lex.ptok = saved_tokp;
16183}
16184#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
16185#endif /* RIPPER */
16186
16187static inline int
16188is_identchar(const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
16189{
16190 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
16191}
16192
16193static inline int
16194parser_is_identchar(struct parser_params *p)
16195{
16196 return !(p)->eofp && is_identchar(p->lex.pcur-1, p->lex.pend, p->enc);
16197}
16198
16199static inline int
16200parser_isascii(struct parser_params *p)
16201{
16202 return ISASCII(*(p->lex.pcur-1));
16203}
16204
16205static void
16206token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
16207{
16208 int column = 1, nonspc = 0, i;
16209 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
16210 if (*ptr == '\t') {
16211 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
16212 }
16213 column++;
16214 if (*ptr != ' ' && *ptr != '\t') {
16215 nonspc = 1;
16216 }
16217 }
16218
16219 ptinfo->beg = loc->beg_pos;
16220 ptinfo->indent = column;
16221 ptinfo->nonspc = nonspc;
16222}
16223
16224static void
16225token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
16226{
16227 token_info *ptinfo;
16228
16229 if (!p->token_info_enabled) return;
16230 ptinfo = ALLOC(token_info);
16231 ptinfo->token = token;
16232 ptinfo->next = p->token_info;
16233 token_info_setup(ptinfo, p->lex.pbeg, loc);
16234
16235 p->token_info = ptinfo;
16236}
16237
16238static void
16239token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
16240{
16241 token_info *ptinfo_beg = p->token_info;
16242
16243 if (!ptinfo_beg) return;
16244 p->token_info = ptinfo_beg->next;
16245
16246 /* indentation check of matched keywords (begin..end, if..end, etc.) */
16247 token_info_warn(p, token, ptinfo_beg, 1, loc);
16248 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
16249}
16250
16251static void
16252token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
16253{
16254 token_info *ptinfo_beg = p->token_info;
16255
16256 if (!ptinfo_beg) return;
16257 p->token_info = ptinfo_beg->next;
16258
16259 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
16260 ptinfo_beg->beg.column != beg_pos.column ||
16261 strcmp(ptinfo_beg->token, token)) {
16262 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
16263 beg_pos.lineno, beg_pos.column, token,
16264 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
16265 ptinfo_beg->token);
16266 }
16267
16268 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
16269}
16270
16271static void
16272token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
16273{
16274 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
16275 if (!p->token_info_enabled) return;
16276 if (!ptinfo_beg) return;
16277 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
16278 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
16279 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
16280 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
16281 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
16282 rb_warn3L(ptinfo_end->beg.lineno,
16283 "mismatched indentations at '%s' with '%s' at %d",
16284 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
16285}
16286
16287static int
16288parser_precise_mbclen(struct parser_params *p, const char *ptr)
16289{
16290 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
16291 if (!MBCLEN_CHARFOUND_P(len)) {
16292 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
16293 return -1;
16294 }
16295 return len;
16296}
16297
16298#ifndef RIPPER
16299static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
16300
16301static inline void
16302parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
16303{
16304 VALUE str;
16305 int lineno = p->ruby_sourceline;
16306 if (!yylloc) {
16307 return;
16308 }
16309 else if (yylloc->beg_pos.lineno == lineno) {
16310 str = p->lex.lastline;
16311 }
16312 else {
16313 return;
16314 }
16315 ruby_show_error_line(p->error_buffer, yylloc, lineno, str);
16316}
16317
16318static int
16319parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
16320{
16321#if 0
16322 YYLTYPE current;
16323
16324 if (!yylloc) {
16325 yylloc = RUBY_SET_YYLLOC(current);
16326 }
16327 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
16328 p->ruby_sourceline != yylloc->end_pos.lineno)) {
16329 yylloc = 0;
16330 }
16331#endif
16332 compile_error(p, "%s", msg);
16333 parser_show_error_line(p, yylloc);
16334 return 0;
16335}
16336
16337static int
16338parser_yyerror0(struct parser_params *p, const char *msg)
16339{
16340 YYLTYPE current;
16341 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
16342}
16343
16344static void
16345ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
16346{
16347 VALUE mesg;
16348 const int max_line_margin = 30;
16349 const char *ptr, *ptr_end, *pt, *pb;
16350 const char *pre = "", *post = "", *pend;
16351 const char *code = "", *caret = "";
16352 const char *lim;
16353 const char *const pbeg = RSTRING_PTR(str);
16354 char *buf;
16355 long len;
16356 int i;
16357
16358 if (!yylloc) return;
16359 pend = RSTRING_END(str);
16360 if (pend > pbeg && pend[-1] == '\n') {
16361 if (--pend > pbeg && pend[-1] == '\r') --pend;
16362 }
16363
16364 pt = pend;
16365 if (lineno == yylloc->end_pos.lineno &&
16366 (pend - pbeg) > yylloc->end_pos.column) {
16367 pt = pbeg + yylloc->end_pos.column;
16368 }
16369
16370 ptr = ptr_end = pt;
16371 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
16372 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
16373
16374 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
16375 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
16376
16377 len = ptr_end - ptr;
16378 if (len > 4) {
16379 if (ptr > pbeg) {
16380 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
16381 if (ptr > pbeg) pre = "...";
16382 }
16383 if (ptr_end < pend) {
16384 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
16385 if (ptr_end < pend) post = "...";
16386 }
16387 }
16388 pb = pbeg;
16389 if (lineno == yylloc->beg_pos.lineno) {
16390 pb += yylloc->beg_pos.column;
16391 if (pb > pt) pb = pt;
16392 }
16393 if (pb < ptr) pb = ptr;
16394 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
16395 return;
16396 }
16397 if (RTEST(errbuf)) {
16398 mesg = rb_attr_get(errbuf, idMesg);
16399 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
16400 rb_str_cat_cstr(mesg, "\n");
16401 }
16402 else {
16403 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
16404 }
16405 if (!errbuf && rb_stderr_tty_p()) {
16406#define CSI_BEGIN "\033["
16407#define CSI_SGR "m"
16408 rb_str_catf(mesg,
16409 CSI_BEGIN""CSI_SGR"%s" /* pre */
16410 CSI_BEGIN"1"CSI_SGR"%.*s"
16411 CSI_BEGIN"1;4"CSI_SGR"%.*s"
16412 CSI_BEGIN";1"CSI_SGR"%.*s"
16413 CSI_BEGIN""CSI_SGR"%s" /* post */
16414 "\n",
16415 pre,
16416 (int)(pb - ptr), ptr,
16417 (int)(pt - pb), pb,
16418 (int)(ptr_end - pt), pt,
16419 post);
16420 }
16421 else {
16422 char *p2;
16423
16424 len = ptr_end - ptr;
16425 lim = pt < pend ? pt : pend;
16426 i = (int)(lim - ptr);
16427 buf = ALLOCA_N(char, i+2);
16428 code = ptr;
16429 caret = p2 = buf;
16430 if (ptr <= pb) {
16431 while (ptr < pb) {
16432 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
16433 }
16434 *p2++ = '^';
16435 ptr++;
16436 }
16437 if (lim > ptr) {
16438 memset(p2, '~', (lim - ptr));
16439 p2 += (lim - ptr);
16440 }
16441 *p2 = '\0';
16442 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
16443 pre, (int)len, code, post,
16444 pre, caret);
16445 }
16446 if (!errbuf) rb_write_error_str(mesg);
16447}
16448#else
16449static int
16450parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
16451{
16452 const char *pcur = 0, *ptok = 0;
16453 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
16454 p->ruby_sourceline == yylloc->end_pos.lineno) {
16455 pcur = p->lex.pcur;
16456 ptok = p->lex.ptok;
16457 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
16458 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
16459 }
16460 parser_yyerror0(p, msg);
16461 if (pcur) {
16462 p->lex.ptok = ptok;
16463 p->lex.pcur = pcur;
16464 }
16465 return 0;
16466}
16467
16468static int
16469parser_yyerror0(struct parser_params *p, const char *msg)
16470{
16471 dispatch1(parse_error, STR_NEW2(msg));
16472 ripper_error(p);
16473 return 0;
16474}
16475
16476static inline void
16477parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
16478{
16479}
16480#endif /* !RIPPER */
16481
16482#ifndef RIPPER
16483static int
16484vtable_size(const struct vtable *tbl)
16485{
16486 if (!DVARS_TERMINAL_P(tbl)) {
16487 return tbl->pos;
16488 }
16489 else {
16490 return 0;
16491 }
16492}
16493#endif
16494
16495static struct vtable *
16496vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
16497{
16498 struct vtable *tbl = ALLOC(struct vtable);
16499 tbl->pos = 0;
16500 tbl->capa = 8;
16501 tbl->tbl = ALLOC_N(ID, tbl->capa);
16502 tbl->prev = prev;
16503#ifndef RIPPER
16504 if (p->debug) {
16505 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
16506 }
16507#endif
16508 return tbl;
16509}
16510#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
16511
16512static void
16513vtable_free_gen(struct parser_params *p, int line, const char *name,
16514 struct vtable *tbl)
16515{
16516#ifndef RIPPER
16517 if (p->debug) {
16518 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
16519 }
16520#endif
16521 if (!DVARS_TERMINAL_P(tbl)) {
16522 if (tbl->tbl) {
16523 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
16524 }
16525 ruby_sized_xfree(tbl, sizeof(*tbl));
16526 }
16527}
16528#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
16529
16530static void
16531vtable_add_gen(struct parser_params *p, int line, const char *name,
16532 struct vtable *tbl, ID id)
16533{
16534#ifndef RIPPER
16535 if (p->debug) {
16536 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
16537 line, name, (void *)tbl, rb_id2name(id));
16538 }
16539#endif
16540 if (DVARS_TERMINAL_P(tbl)) {
16541 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
16542 return;
16543 }
16544 if (tbl->pos == tbl->capa) {
16545 tbl->capa = tbl->capa * 2;
16546 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
16547 }
16548 tbl->tbl[tbl->pos++] = id;
16549}
16550#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
16551
16552#ifndef RIPPER
16553static void
16554vtable_pop_gen(struct parser_params *p, int line, const char *name,
16555 struct vtable *tbl, int n)
16556{
16557 if (p->debug) {
16558 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
16559 line, name, (void *)tbl, n);
16560 }
16561 if (tbl->pos < n) {
16562 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
16563 return;
16564 }
16565 tbl->pos -= n;
16566}
16567#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
16568#endif
16569
16570static int
16571vtable_included(const struct vtable * tbl, ID id)
16572{
16573 int i;
16574
16575 if (!DVARS_TERMINAL_P(tbl)) {
16576 for (i = 0; i < tbl->pos; i++) {
16577 if (tbl->tbl[i] == id) {
16578 return i+1;
16579 }
16580 }
16581 }
16582 return 0;
16583}
16584
16585static void parser_prepare(struct parser_params *p);
16586
16587#ifndef RIPPER
16588static NODE *parser_append_options(struct parser_params *p, NODE *node);
16589
16590static VALUE
16591debug_lines(VALUE fname)
16592{
16593 ID script_lines;
16594 CONST_ID(script_lines, "SCRIPT_LINES__");
16595 if (rb_const_defined_at(rb_cObject, script_lines)) {
16596 VALUE hash = rb_const_get_at(rb_cObject, script_lines);
16597 if (RB_TYPE_P(hash, T_HASH)) {
16598 VALUE lines = rb_ary_new();
16599 rb_hash_aset(hash, fname, lines);
16600 return lines;
16601 }
16602 }
16603 return 0;
16604}
16605
16606static int
16607e_option_supplied(struct parser_params *p)
16608{
16609 return strcmp(p->ruby_sourcefile, "-e") == 0;
16610}
16611
16612static VALUE
16613yycompile0(VALUE arg)
16614{
16615 int n;
16616 NODE *tree;
16617 struct parser_params *p = (struct parser_params *)arg;
16618 VALUE cov = Qfalse;
16619
16620 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string)) {
16621 p->debug_lines = debug_lines(p->ruby_sourcefile_string);
16622 if (p->debug_lines && p->ruby_sourceline > 0) {
16623 VALUE str = rb_default_rs;
16624 n = p->ruby_sourceline;
16625 do {
16626 rb_ary_push(p->debug_lines, str);
16627 } while (--n);
16628 }
16629
16630 if (!e_option_supplied(p)) {
16631 cov = Qtrue;
16632 }
16633 }
16634
16635 if (p->keep_script_lines || ruby_vm_keep_script_lines) {
16636 if (!p->debug_lines) {
16637 p->debug_lines = rb_ary_new();
16638 }
16639
16640 RB_OBJ_WRITE(p->ast, &p->ast->body.script_lines, p->debug_lines);
16641 }
16642
16643 parser_prepare(p);
16644#define RUBY_DTRACE_PARSE_HOOK(name) \
16645 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
16646 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
16647 }
16648 RUBY_DTRACE_PARSE_HOOK(BEGIN);
16649 n = yyparse(p);
16650 RUBY_DTRACE_PARSE_HOOK(END);
16651 p->debug_lines = 0;
16652
16653 p->lex.strterm = 0;
16654 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
16655 if (n || p->error_p) {
16656 VALUE mesg = p->error_buffer;
16657 if (!mesg) {
16659 }
16660 if (!p->error_tolerant) {
16661 rb_set_errinfo(mesg);
16662 return FALSE;
16663 }
16664 }
16665 tree = p->eval_tree;
16666 if (!tree) {
16667 tree = NEW_NIL(&NULL_LOC);
16668 }
16669 else {
16670 VALUE opt = p->compile_option;
16671 VALUE tokens = p->tokens;
16672 NODE *prelude;
16673 NODE *body = parser_append_options(p, tree->nd_body);
16674 if (!opt) opt = rb_obj_hide(rb_ident_hash_new());
16675 rb_hash_aset(opt, rb_sym_intern_ascii_cstr("coverage_enabled"), cov);
16676 prelude = block_append(p, p->eval_tree_begin, body);
16677 tree->nd_body = prelude;
16678 RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt);
16679 if (p->keep_tokens) {
16680 rb_obj_freeze(tokens);
16681 rb_ast_set_tokens(p->ast, tokens);
16682 }
16683 }
16684 p->ast->body.root = tree;
16685 if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count);
16686 return TRUE;
16687}
16688
16689static rb_ast_t *
16690yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line)
16691{
16692 rb_ast_t *ast;
16693 if (NIL_P(fname)) {
16694 p->ruby_sourcefile_string = Qnil;
16695 p->ruby_sourcefile = "(none)";
16696 }
16697 else {
16698 p->ruby_sourcefile_string = rb_fstring(fname);
16699 p->ruby_sourcefile = StringValueCStr(fname);
16700 }
16701 p->ruby_sourceline = line - 1;
16702
16703 p->lvtbl = NULL;
16704
16705 p->ast = ast = rb_ast_new();
16706 rb_suppress_tracing(yycompile0, (VALUE)p);
16707 p->ast = 0;
16708 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
16709
16710 while (p->lvtbl) {
16711 local_pop(p);
16712 }
16713
16714 return ast;
16715}
16716#endif /* !RIPPER */
16717
16718static rb_encoding *
16719must_be_ascii_compatible(VALUE s)
16720{
16721 rb_encoding *enc = rb_enc_get(s);
16722 if (!rb_enc_asciicompat(enc)) {
16723 rb_raise(rb_eArgError, "invalid source encoding");
16724 }
16725 return enc;
16726}
16727
16728static VALUE
16729lex_get_str(struct parser_params *p, VALUE s)
16730{
16731 char *beg, *end, *start;
16732 long len;
16733
16734 beg = RSTRING_PTR(s);
16735 len = RSTRING_LEN(s);
16736 start = beg;
16737 if (p->lex.gets_.ptr) {
16738 if (len == p->lex.gets_.ptr) return Qnil;
16739 beg += p->lex.gets_.ptr;
16740 len -= p->lex.gets_.ptr;
16741 }
16742 end = memchr(beg, '\n', len);
16743 if (end) len = ++end - beg;
16744 p->lex.gets_.ptr += len;
16745 return rb_str_subseq(s, beg - start, len);
16746}
16747
16748static VALUE
16749lex_getline(struct parser_params *p)
16750{
16751 VALUE line = (*p->lex.gets)(p, p->lex.input);
16752 if (NIL_P(line)) return line;
16753 must_be_ascii_compatible(line);
16754 if (RB_OBJ_FROZEN(line)) line = rb_str_dup(line); // needed for RubyVM::AST.of because script_lines in iseq is deep-frozen
16755 p->line_count++;
16756 return line;
16757}
16758
16759static const rb_data_type_t parser_data_type;
16760
16761#ifndef RIPPER
16762static rb_ast_t*
16763parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
16764{
16765 struct parser_params *p;
16766
16767 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
16768
16769 p->lex.gets = lex_get_str;
16770 p->lex.gets_.ptr = 0;
16771 p->lex.input = rb_str_new_frozen(s);
16772 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
16773
16774 return yycompile(vparser, p, fname, line);
16775}
16776
16777rb_ast_t*
16778rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
16779{
16780 return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);
16781}
16782
16783rb_ast_t*
16784rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
16785{
16786 must_be_ascii_compatible(s);
16787 return parser_compile_string(vparser, f, s, line);
16788}
16789
16790VALUE rb_io_gets_internal(VALUE io);
16791
16792static VALUE
16793lex_io_gets(struct parser_params *p, VALUE io)
16794{
16795 return rb_io_gets_internal(io);
16796}
16797
16798rb_ast_t*
16799rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
16800{
16801 struct parser_params *p;
16802
16803 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
16804
16805 p->lex.gets = lex_io_gets;
16806 p->lex.input = file;
16807 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
16808
16809 return yycompile(vparser, p, fname, start);
16810}
16811
16812static VALUE
16813lex_generic_gets(struct parser_params *p, VALUE input)
16814{
16815 return (*p->lex.gets_.call)(input, p->line_count);
16816}
16817
16818rb_ast_t*
16819rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
16820{
16821 struct parser_params *p;
16822
16823 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
16824
16825 p->lex.gets = lex_generic_gets;
16826 p->lex.gets_.call = lex_gets;
16827 p->lex.input = input;
16828 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
16829
16830 return yycompile(vparser, p, fname, start);
16831}
16832#endif /* !RIPPER */
16833
16834#define STR_FUNC_ESCAPE 0x01
16835#define STR_FUNC_EXPAND 0x02
16836#define STR_FUNC_REGEXP 0x04
16837#define STR_FUNC_QWORDS 0x08
16838#define STR_FUNC_SYMBOL 0x10
16839#define STR_FUNC_INDENT 0x20
16840#define STR_FUNC_LABEL 0x40
16841#define STR_FUNC_LIST 0x4000
16842#define STR_FUNC_TERM 0x8000
16843
16844enum string_type {
16845 str_label = STR_FUNC_LABEL,
16846 str_squote = (0),
16847 str_dquote = (STR_FUNC_EXPAND),
16848 str_xquote = (STR_FUNC_EXPAND),
16849 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
16850 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
16851 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
16852 str_ssym = (STR_FUNC_SYMBOL),
16853 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
16854};
16855
16856static VALUE
16857parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
16858{
16859 VALUE str;
16860
16861 str = rb_enc_str_new(ptr, len, enc);
16862 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
16863 if (is_ascii_string(str)) {
16864 }
16865 else if (rb_is_usascii_enc(enc0) && enc != rb_utf8_encoding()) {
16866 rb_enc_associate(str, rb_ascii8bit_encoding());
16867 }
16868 }
16869
16870 return str;
16871}
16872
16873#define peek(p,c) peek_n(p, (c), 0)
16874#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
16875#define peekc(p) peekc_n(p, 0)
16876#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
16877
16878static void
16879add_delayed_token(struct parser_params *p, const char *tok, const char *end, int line)
16880{
16881#ifndef RIPPER
16882 debug_token_line(p, "add_delayed_token", line);
16883#endif
16884
16885 if (tok < end) {
16886 if (!has_delayed_token(p)) {
16887 p->delayed.token = rb_str_buf_new(end - tok);
16888 rb_enc_associate(p->delayed.token, p->enc);
16889 p->delayed.beg_line = p->ruby_sourceline;
16890 p->delayed.beg_col = rb_long2int(tok - p->lex.pbeg);
16891 }
16892 rb_str_buf_cat(p->delayed.token, tok, end - tok);
16893 p->delayed.end_line = p->ruby_sourceline;
16894 p->delayed.end_col = rb_long2int(end - p->lex.pbeg);
16895 p->lex.ptok = end;
16896 }
16897}
16898
16899static int
16900nextline(struct parser_params *p, int set_encoding)
16901{
16902 VALUE v = p->lex.nextline;
16903 p->lex.nextline = 0;
16904 if (!v) {
16905 if (p->eofp)
16906 return -1;
16907
16908 if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
16909 goto end_of_input;
16910 }
16911
16912 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
16913 end_of_input:
16914 p->eofp = 1;
16915 lex_goto_eol(p);
16916 return -1;
16917 }
16918#ifndef RIPPER
16919 if (p->debug_lines) {
16920 if (set_encoding) rb_enc_associate(v, p->enc);
16921 rb_ary_push(p->debug_lines, v);
16922 }
16923#endif
16924 p->cr_seen = FALSE;
16925 }
16926 else if (NIL_P(v)) {
16927 /* after here-document without terminator */
16928 goto end_of_input;
16929 }
16930 add_delayed_token(p, p->lex.ptok, p->lex.pend, __LINE__);
16931 if (p->heredoc_end > 0) {
16932 p->ruby_sourceline = p->heredoc_end;
16933 p->heredoc_end = 0;
16934 }
16935 p->ruby_sourceline++;
16936 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
16937 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
16938 token_flush(p);
16939 p->lex.lastline = v;
16940 return 0;
16941}
16942
16943static int
16944parser_cr(struct parser_params *p, int c)
16945{
16946 if (peek(p, '\n')) {
16947 p->lex.pcur++;
16948 c = '\n';
16949 }
16950 return c;
16951}
16952
16953static inline int
16954nextc0(struct parser_params *p, int set_encoding)
16955{
16956 int c;
16957
16958 if (UNLIKELY((p->lex.pcur == p->lex.pend) || p->eofp || RTEST(p->lex.nextline))) {
16959 if (nextline(p, set_encoding)) return -1;
16960 }
16961 c = (unsigned char)*p->lex.pcur++;
16962 if (UNLIKELY(c == '\r')) {
16963 c = parser_cr(p, c);
16964 }
16965
16966 return c;
16967}
16968#define nextc(p) nextc0(p, TRUE)
16969
16970static void
16971pushback(struct parser_params *p, int c)
16972{
16973 if (c == -1) return;
16974 p->lex.pcur--;
16975 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
16976 p->lex.pcur--;
16977 }
16978}
16979
16980#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
16981
16982#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
16983#define tok(p) (p)->tokenbuf
16984#define toklen(p) (p)->tokidx
16985
16986static int
16987looking_at_eol_p(struct parser_params *p)
16988{
16989 const char *ptr = p->lex.pcur;
16990 while (ptr < p->lex.pend) {
16991 int c = (unsigned char)*ptr++;
16992 int eol = (c == '\n' || c == '#');
16993 if (eol || !ISSPACE(c)) {
16994 return eol;
16995 }
16996 }
16997 return TRUE;
16998}
16999
17000static char*
17001newtok(struct parser_params *p)
17002{
17003 p->tokidx = 0;
17004 p->tokline = p->ruby_sourceline;
17005 if (!p->tokenbuf) {
17006 p->toksiz = 60;
17007 p->tokenbuf = ALLOC_N(char, 60);
17008 }
17009 if (p->toksiz > 4096) {
17010 p->toksiz = 60;
17011 REALLOC_N(p->tokenbuf, char, 60);
17012 }
17013 return p->tokenbuf;
17014}
17015
17016static char *
17017tokspace(struct parser_params *p, int n)
17018{
17019 p->tokidx += n;
17020
17021 if (p->tokidx >= p->toksiz) {
17022 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
17023 REALLOC_N(p->tokenbuf, char, p->toksiz);
17024 }
17025 return &p->tokenbuf[p->tokidx-n];
17026}
17027
17028static void
17029tokadd(struct parser_params *p, int c)
17030{
17031 p->tokenbuf[p->tokidx++] = (char)c;
17032 if (p->tokidx >= p->toksiz) {
17033 p->toksiz *= 2;
17034 REALLOC_N(p->tokenbuf, char, p->toksiz);
17035 }
17036}
17037
17038static int
17039tok_hex(struct parser_params *p, size_t *numlen)
17040{
17041 int c;
17042
17043 c = scan_hex(p->lex.pcur, 2, numlen);
17044 if (!*numlen) {
17045 yyerror0("invalid hex escape");
17046 token_flush(p);
17047 return 0;
17048 }
17049 p->lex.pcur += *numlen;
17050 return c;
17051}
17052
17053#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
17054
17055static int
17056escaped_control_code(int c)
17057{
17058 int c2 = 0;
17059 switch (c) {
17060 case ' ':
17061 c2 = 's';
17062 break;
17063 case '\n':
17064 c2 = 'n';
17065 break;
17066 case '\t':
17067 c2 = 't';
17068 break;
17069 case '\v':
17070 c2 = 'v';
17071 break;
17072 case '\r':
17073 c2 = 'r';
17074 break;
17075 case '\f':
17076 c2 = 'f';
17077 break;
17078 }
17079 return c2;
17080}
17081
17082#define WARN_SPACE_CHAR(c, prefix) \
17083 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
17084
17085static int
17086tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
17087 int regexp_literal, int wide)
17088{
17089 size_t numlen;
17090 int codepoint = scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
17091 p->lex.pcur += numlen;
17092 if (p->lex.strterm == NULL ||
17093 (p->lex.strterm->flags & STRTERM_HEREDOC) ||
17094 (p->lex.strterm->u.literal.u1.func != str_regexp)) {
17095 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
17096 literal_flush(p, p->lex.pcur);
17097 yyerror0("invalid Unicode escape");
17098 return wide && numlen > 0;
17099 }
17100 if (codepoint > 0x10ffff) {
17101 literal_flush(p, p->lex.pcur);
17102 yyerror0("invalid Unicode codepoint (too large)");
17103 return wide;
17104 }
17105 if ((codepoint & 0xfffff800) == 0xd800) {
17106 literal_flush(p, p->lex.pcur);
17107 yyerror0("invalid Unicode codepoint");
17108 return wide;
17109 }
17110 }
17111 if (regexp_literal) {
17112 tokcopy(p, (int)numlen);
17113 }
17114 else if (codepoint >= 0x80) {
17115 rb_encoding *utf8 = rb_utf8_encoding();
17116 if (*encp && utf8 != *encp) {
17117 YYLTYPE loc = RUBY_INIT_YYLLOC();
17118 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
17119 parser_show_error_line(p, &loc);
17120 return wide;
17121 }
17122 *encp = utf8;
17123 tokaddmbc(p, codepoint, *encp);
17124 }
17125 else {
17126 tokadd(p, codepoint);
17127 }
17128 return TRUE;
17129}
17130
17131/* return value is for ?\u3042 */
17132static void
17133tokadd_utf8(struct parser_params *p, rb_encoding **encp,
17134 int term, int symbol_literal, int regexp_literal)
17135{
17136 /*
17137 * If `term` is not -1, then we allow multiple codepoints in \u{}
17138 * upto `term` byte, otherwise we're parsing a character literal.
17139 * And then add the codepoints to the current token.
17140 */
17141 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
17142
17143 const int open_brace = '{', close_brace = '}';
17144
17145 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
17146
17147 if (peek(p, open_brace)) { /* handle \u{...} form */
17148 const char *second = NULL;
17149 int c, last = nextc(p);
17150 if (p->lex.pcur >= p->lex.pend) goto unterminated;
17151 while (ISSPACE(c = *p->lex.pcur) && ++p->lex.pcur < p->lex.pend);
17152 while (c != close_brace) {
17153 if (c == term) goto unterminated;
17154 if (second == multiple_codepoints)
17155 second = p->lex.pcur;
17156 if (regexp_literal) tokadd(p, last);
17157 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
17158 break;
17159 }
17160 while (ISSPACE(c = *p->lex.pcur)) {
17161 if (++p->lex.pcur >= p->lex.pend) goto unterminated;
17162 last = c;
17163 }
17164 if (term == -1 && !second)
17165 second = multiple_codepoints;
17166 }
17167
17168 if (c != close_brace) {
17169 unterminated:
17170 token_flush(p);
17171 yyerror0("unterminated Unicode escape");
17172 return;
17173 }
17174 if (second && second != multiple_codepoints) {
17175 const char *pcur = p->lex.pcur;
17176 p->lex.pcur = second;
17177 dispatch_scan_event(p, tSTRING_CONTENT);
17178 token_flush(p);
17179 p->lex.pcur = pcur;
17180 yyerror0(multiple_codepoints);
17181 token_flush(p);
17182 }
17183
17184 if (regexp_literal) tokadd(p, close_brace);
17185 nextc(p);
17186 }
17187 else { /* handle \uxxxx form */
17188 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
17189 token_flush(p);
17190 return;
17191 }
17192 }
17193}
17194
17195#define ESCAPE_CONTROL 1
17196#define ESCAPE_META 2
17197
17198static int
17199read_escape(struct parser_params *p, int flags, rb_encoding **encp)
17200{
17201 int c;
17202 size_t numlen;
17203
17204 switch (c = nextc(p)) {
17205 case '\\': /* Backslash */
17206 return c;
17207
17208 case 'n': /* newline */
17209 return '\n';
17210
17211 case 't': /* horizontal tab */
17212 return '\t';
17213
17214 case 'r': /* carriage-return */
17215 return '\r';
17216
17217 case 'f': /* form-feed */
17218 return '\f';
17219
17220 case 'v': /* vertical tab */
17221 return '\13';
17222
17223 case 'a': /* alarm(bell) */
17224 return '\007';
17225
17226 case 'e': /* escape */
17227 return 033;
17228
17229 case '0': case '1': case '2': case '3': /* octal constant */
17230 case '4': case '5': case '6': case '7':
17231 pushback(p, c);
17232 c = scan_oct(p->lex.pcur, 3, &numlen);
17233 p->lex.pcur += numlen;
17234 return c;
17235
17236 case 'x': /* hex constant */
17237 c = tok_hex(p, &numlen);
17238 if (numlen == 0) return 0;
17239 return c;
17240
17241 case 'b': /* backspace */
17242 return '\010';
17243
17244 case 's': /* space */
17245 return ' ';
17246
17247 case 'M':
17248 if (flags & ESCAPE_META) goto eof;
17249 if ((c = nextc(p)) != '-') {
17250 goto eof;
17251 }
17252 if ((c = nextc(p)) == '\\') {
17253 switch (peekc(p)) {
17254 case 'u': case 'U':
17255 nextc(p);
17256 goto eof;
17257 }
17258 return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
17259 }
17260 else if (c == -1 || !ISASCII(c)) goto eof;
17261 else {
17262 int c2 = escaped_control_code(c);
17263 if (c2) {
17264 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
17265 WARN_SPACE_CHAR(c2, "\\M-");
17266 }
17267 else {
17268 WARN_SPACE_CHAR(c2, "\\C-\\M-");
17269 }
17270 }
17271 else if (ISCNTRL(c)) goto eof;
17272 return ((c & 0xff) | 0x80);
17273 }
17274
17275 case 'C':
17276 if ((c = nextc(p)) != '-') {
17277 goto eof;
17278 }
17279 case 'c':
17280 if (flags & ESCAPE_CONTROL) goto eof;
17281 if ((c = nextc(p))== '\\') {
17282 switch (peekc(p)) {
17283 case 'u': case 'U':
17284 nextc(p);
17285 goto eof;
17286 }
17287 c = read_escape(p, flags|ESCAPE_CONTROL, encp);
17288 }
17289 else if (c == '?')
17290 return 0177;
17291 else if (c == -1 || !ISASCII(c)) goto eof;
17292 else {
17293 int c2 = escaped_control_code(c);
17294 if (c2) {
17295 if (ISCNTRL(c)) {
17296 if (flags & ESCAPE_META) {
17297 WARN_SPACE_CHAR(c2, "\\M-");
17298 }
17299 else {
17300 WARN_SPACE_CHAR(c2, "");
17301 }
17302 }
17303 else {
17304 if (flags & ESCAPE_META) {
17305 WARN_SPACE_CHAR(c2, "\\M-\\C-");
17306 }
17307 else {
17308 WARN_SPACE_CHAR(c2, "\\C-");
17309 }
17310 }
17311 }
17312 else if (ISCNTRL(c)) goto eof;
17313 }
17314 return c & 0x9f;
17315
17316 eof:
17317 case -1:
17318 yyerror0("Invalid escape character syntax");
17319 token_flush(p);
17320 return '\0';
17321
17322 default:
17323 return c;
17324 }
17325}
17326
17327static void
17328tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
17329{
17330 int len = rb_enc_codelen(c, enc);
17331 rb_enc_mbcput(c, tokspace(p, len), enc);
17332}
17333
17334static int
17335tokadd_escape(struct parser_params *p, rb_encoding **encp)
17336{
17337 int c;
17338 size_t numlen;
17339
17340 switch (c = nextc(p)) {
17341 case '\n':
17342 return 0; /* just ignore */
17343
17344 case '0': case '1': case '2': case '3': /* octal constant */
17345 case '4': case '5': case '6': case '7':
17346 {
17347 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
17348 if (numlen == 0) goto eof;
17349 p->lex.pcur += numlen;
17350 tokcopy(p, (int)numlen + 1);
17351 }
17352 return 0;
17353
17354 case 'x': /* hex constant */
17355 {
17356 tok_hex(p, &numlen);
17357 if (numlen == 0) return -1;
17358 tokcopy(p, (int)numlen + 2);
17359 }
17360 return 0;
17361
17362 eof:
17363 case -1:
17364 yyerror0("Invalid escape character syntax");
17365 token_flush(p);
17366 return -1;
17367
17368 default:
17369 tokadd(p, '\\');
17370 tokadd(p, c);
17371 }
17372 return 0;
17373}
17374
17375static int
17376regx_options(struct parser_params *p)
17377{
17378 int kcode = 0;
17379 int kopt = 0;
17380 int options = 0;
17381 int c, opt, kc;
17382
17383 newtok(p);
17384 while (c = nextc(p), ISALPHA(c)) {
17385 if (c == 'o') {
17386 options |= RE_OPTION_ONCE;
17387 }
17388 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
17389 if (kc >= 0) {
17390 if (kc != rb_ascii8bit_encindex()) kcode = c;
17391 kopt = opt;
17392 }
17393 else {
17394 options |= opt;
17395 }
17396 }
17397 else {
17398 tokadd(p, c);
17399 }
17400 }
17401 options |= kopt;
17402 pushback(p, c);
17403 if (toklen(p)) {
17404 YYLTYPE loc = RUBY_INIT_YYLLOC();
17405 tokfix(p);
17406 compile_error(p, "unknown regexp option%s - %*s",
17407 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
17408 parser_show_error_line(p, &loc);
17409 }
17410 return options | RE_OPTION_ENCODING(kcode);
17411}
17412
17413static int
17414tokadd_mbchar(struct parser_params *p, int c)
17415{
17416 int len = parser_precise_mbclen(p, p->lex.pcur-1);
17417 if (len < 0) return -1;
17418 tokadd(p, c);
17419 p->lex.pcur += --len;
17420 if (len > 0) tokcopy(p, len);
17421 return c;
17422}
17423
17424static inline int
17425simple_re_meta(int c)
17426{
17427 switch (c) {
17428 case '$': case '*': case '+': case '.':
17429 case '?': case '^': case '|':
17430 case ')': case ']': case '}': case '>':
17431 return TRUE;
17432 default:
17433 return FALSE;
17434 }
17435}
17436
17437static int
17438parser_update_heredoc_indent(struct parser_params *p, int c)
17439{
17440 if (p->heredoc_line_indent == -1) {
17441 if (c == '\n') p->heredoc_line_indent = 0;
17442 }
17443 else {
17444 if (c == ' ') {
17445 p->heredoc_line_indent++;
17446 return TRUE;
17447 }
17448 else if (c == '\t') {
17449 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
17450 p->heredoc_line_indent = w * TAB_WIDTH;
17451 return TRUE;
17452 }
17453 else if (c != '\n') {
17454 if (p->heredoc_indent > p->heredoc_line_indent) {
17455 p->heredoc_indent = p->heredoc_line_indent;
17456 }
17457 p->heredoc_line_indent = -1;
17458 }
17459 }
17460 return FALSE;
17461}
17462
17463static void
17464parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
17465{
17466 YYLTYPE loc = RUBY_INIT_YYLLOC();
17467 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
17468 compile_error(p, "%s mixed within %s source", n1, n2);
17469 parser_show_error_line(p, &loc);
17470}
17471
17472static void
17473parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
17474{
17475 const char *pos = p->lex.pcur;
17476 p->lex.pcur = beg;
17477 parser_mixed_error(p, enc1, enc2);
17478 p->lex.pcur = pos;
17479}
17480
17481static int
17482tokadd_string(struct parser_params *p,
17483 int func, int term, int paren, long *nest,
17484 rb_encoding **encp, rb_encoding **enc)
17485{
17486 int c;
17487 bool erred = false;
17488#ifdef RIPPER
17489 const int heredoc_end = (p->heredoc_end ? p->heredoc_end + 1 : 0);
17490 int top_of_line = FALSE;
17491#endif
17492
17493#define mixed_error(enc1, enc2) \
17494 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
17495#define mixed_escape(beg, enc1, enc2) \
17496 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
17497
17498 while ((c = nextc(p)) != -1) {
17499 if (p->heredoc_indent > 0) {
17500 parser_update_heredoc_indent(p, c);
17501 }
17502#ifdef RIPPER
17503 if (top_of_line && heredoc_end == p->ruby_sourceline) {
17504 pushback(p, c);
17505 break;
17506 }
17507#endif
17508
17509 if (paren && c == paren) {
17510 ++*nest;
17511 }
17512 else if (c == term) {
17513 if (!nest || !*nest) {
17514 pushback(p, c);
17515 break;
17516 }
17517 --*nest;
17518 }
17519 else if ((func & STR_FUNC_EXPAND) && c == '#' && p->lex.pcur < p->lex.pend) {
17520 int c2 = *p->lex.pcur;
17521 if (c2 == '$' || c2 == '@' || c2 == '{') {
17522 pushback(p, c);
17523 break;
17524 }
17525 }
17526 else if (c == '\\') {
17527 c = nextc(p);
17528 switch (c) {
17529 case '\n':
17530 if (func & STR_FUNC_QWORDS) break;
17531 if (func & STR_FUNC_EXPAND) {
17532 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
17533 continue;
17534 if (c == term) {
17535 c = '\\';
17536 goto terminate;
17537 }
17538 }
17539 tokadd(p, '\\');
17540 break;
17541
17542 case '\\':
17543 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
17544 break;
17545
17546 case 'u':
17547 if ((func & STR_FUNC_EXPAND) == 0) {
17548 tokadd(p, '\\');
17549 break;
17550 }
17551 tokadd_utf8(p, enc, term,
17552 func & STR_FUNC_SYMBOL,
17553 func & STR_FUNC_REGEXP);
17554 continue;
17555
17556 default:
17557 if (c == -1) return -1;
17558 if (!ISASCII(c)) {
17559 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
17560 goto non_ascii;
17561 }
17562 if (func & STR_FUNC_REGEXP) {
17563 switch (c) {
17564 case 'c':
17565 case 'C':
17566 case 'M': {
17567 pushback(p, c);
17568 c = read_escape(p, 0, enc);
17569
17570 int i;
17571 char escbuf[5];
17572 snprintf(escbuf, sizeof(escbuf), "\\x%02X", c);
17573 for (i = 0; i < 4; i++) {
17574 tokadd(p, escbuf[i]);
17575 }
17576 continue;
17577 }
17578 }
17579
17580 if (c == term && !simple_re_meta(c)) {
17581 tokadd(p, c);
17582 continue;
17583 }
17584 pushback(p, c);
17585 if ((c = tokadd_escape(p, enc)) < 0)
17586 return -1;
17587 if (*enc && *enc != *encp) {
17588 mixed_escape(p->lex.ptok+2, *enc, *encp);
17589 }
17590 continue;
17591 }
17592 else if (func & STR_FUNC_EXPAND) {
17593 pushback(p, c);
17594 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
17595 c = read_escape(p, 0, enc);
17596 }
17597 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
17598 /* ignore backslashed spaces in %w */
17599 }
17600 else if (c != term && !(paren && c == paren)) {
17601 tokadd(p, '\\');
17602 pushback(p, c);
17603 continue;
17604 }
17605 }
17606 }
17607 else if (!parser_isascii(p)) {
17608 non_ascii:
17609 if (!*enc) {
17610 *enc = *encp;
17611 }
17612 else if (*enc != *encp) {
17613 mixed_error(*enc, *encp);
17614 continue;
17615 }
17616 if (tokadd_mbchar(p, c) == -1) return -1;
17617 continue;
17618 }
17619 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
17620 pushback(p, c);
17621 break;
17622 }
17623 if (c & 0x80) {
17624 if (!*enc) {
17625 *enc = *encp;
17626 }
17627 else if (*enc != *encp) {
17628 mixed_error(*enc, *encp);
17629 continue;
17630 }
17631 }
17632 tokadd(p, c);
17633#ifdef RIPPER
17634 top_of_line = (c == '\n');
17635#endif
17636 }
17637 terminate:
17638 if (*enc) *encp = *enc;
17639 return c;
17640}
17641
17642static inline rb_strterm_t *
17643new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
17644{
17645 return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
17646}
17647
17648/* imemo_parser_strterm for literal */
17649#define NEW_STRTERM(func, term, paren) \
17650 new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
17651
17652#ifdef RIPPER
17653static void
17654flush_string_content(struct parser_params *p, rb_encoding *enc)
17655{
17656 VALUE content = yylval.val;
17657 if (!ripper_is_node_yylval(content))
17658 content = ripper_new_yylval(p, 0, 0, content);
17659 if (has_delayed_token(p)) {
17660 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
17661 if (len > 0) {
17662 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
17663 }
17664 dispatch_delayed_token(p, tSTRING_CONTENT);
17665 p->lex.ptok = p->lex.pcur;
17666 RNODE(content)->nd_rval = yylval.val;
17667 }
17668 dispatch_scan_event(p, tSTRING_CONTENT);
17669 if (yylval.val != content)
17670 RNODE(content)->nd_rval = yylval.val;
17671 yylval.val = content;
17672}
17673#else
17674static void
17675flush_string_content(struct parser_params *p, rb_encoding *enc)
17676{
17677 if (has_delayed_token(p)) {
17678 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
17679 if (len > 0) {
17680 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
17681 p->delayed.end_line = p->ruby_sourceline;
17682 p->delayed.end_col = rb_long2int(p->lex.pcur - p->lex.pbeg);
17683 }
17684 dispatch_delayed_token(p, tSTRING_CONTENT);
17685 p->lex.ptok = p->lex.pcur;
17686 }
17687 dispatch_scan_event(p, tSTRING_CONTENT);
17688}
17689#endif
17690
17691RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
17692/* this can be shared with ripper, since it's independent from struct
17693 * parser_params. */
17694#ifndef RIPPER
17695#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
17696#define SPECIAL_PUNCT(idx) ( \
17697 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
17698 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
17699 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
17700 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
17701 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
17702 BIT('0', idx))
17703const unsigned int ruby_global_name_punct_bits[] = {
17704 SPECIAL_PUNCT(0),
17705 SPECIAL_PUNCT(1),
17706 SPECIAL_PUNCT(2),
17707};
17708#undef BIT
17709#undef SPECIAL_PUNCT
17710#endif
17711
17712static enum yytokentype
17713parser_peek_variable_name(struct parser_params *p)
17714{
17715 int c;
17716 const char *ptr = p->lex.pcur;
17717
17718 if (ptr + 1 >= p->lex.pend) return 0;
17719 c = *ptr++;
17720 switch (c) {
17721 case '$':
17722 if ((c = *ptr) == '-') {
17723 if (++ptr >= p->lex.pend) return 0;
17724 c = *ptr;
17725 }
17726 else if (is_global_name_punct(c) || ISDIGIT(c)) {
17727 return tSTRING_DVAR;
17728 }
17729 break;
17730 case '@':
17731 if ((c = *ptr) == '@') {
17732 if (++ptr >= p->lex.pend) return 0;
17733 c = *ptr;
17734 }
17735 break;
17736 case '{':
17737 p->lex.pcur = ptr;
17738 p->command_start = TRUE;
17739 return tSTRING_DBEG;
17740 default:
17741 return 0;
17742 }
17743 if (!ISASCII(c) || c == '_' || ISALPHA(c))
17744 return tSTRING_DVAR;
17745 return 0;
17746}
17747
17748#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
17749#define IS_END() IS_lex_state(EXPR_END_ANY)
17750#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
17751#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
17752#define IS_LABEL_POSSIBLE() (\
17753 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
17754 IS_ARG())
17755#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
17756#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
17757
17758static inline enum yytokentype
17759parser_string_term(struct parser_params *p, int func)
17760{
17761 p->lex.strterm = 0;
17762 if (func & STR_FUNC_REGEXP) {
17763 set_yylval_num(regx_options(p));
17764 dispatch_scan_event(p, tREGEXP_END);
17765 SET_LEX_STATE(EXPR_END);
17766 return tREGEXP_END;
17767 }
17768 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
17769 nextc(p);
17770 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
17771 return tLABEL_END;
17772 }
17773 SET_LEX_STATE(EXPR_END);
17774 return tSTRING_END;
17775}
17776
17777static enum yytokentype
17778parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
17779{
17780 int func = (int)quote->u1.func;
17781 int term = (int)quote->u3.term;
17782 int paren = (int)quote->u2.paren;
17783 int c, space = 0;
17784 rb_encoding *enc = p->enc;
17785 rb_encoding *base_enc = 0;
17786 VALUE lit;
17787
17788 if (func & STR_FUNC_TERM) {
17789 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
17790 SET_LEX_STATE(EXPR_END);
17791 p->lex.strterm = 0;
17792 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
17793 }
17794 c = nextc(p);
17795 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
17796 do {c = nextc(p);} while (ISSPACE(c));
17797 space = 1;
17798 }
17799 if (func & STR_FUNC_LIST) {
17800 quote->u1.func &= ~STR_FUNC_LIST;
17801 space = 1;
17802 }
17803 if (c == term && !quote->u0.nest) {
17804 if (func & STR_FUNC_QWORDS) {
17805 quote->u1.func |= STR_FUNC_TERM;
17806 pushback(p, c); /* dispatch the term at tSTRING_END */
17807 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
17808 return ' ';
17809 }
17810 return parser_string_term(p, func);
17811 }
17812 if (space) {
17813 pushback(p, c);
17814 add_delayed_token(p, p->lex.ptok, p->lex.pcur, __LINE__);
17815 return ' ';
17816 }
17817 newtok(p);
17818 if ((func & STR_FUNC_EXPAND) && c == '#') {
17819 int t = parser_peek_variable_name(p);
17820 if (t) return t;
17821 tokadd(p, '#');
17822 c = nextc(p);
17823 }
17824 pushback(p, c);
17825 if (tokadd_string(p, func, term, paren, &quote->u0.nest,
17826 &enc, &base_enc) == -1) {
17827 if (p->eofp) {
17828#ifndef RIPPER
17829# define unterminated_literal(mesg) yyerror0(mesg)
17830#else
17831# define unterminated_literal(mesg) compile_error(p, mesg)
17832#endif
17833 literal_flush(p, p->lex.pcur);
17834 if (func & STR_FUNC_QWORDS) {
17835 /* no content to add, bailing out here */
17836 unterminated_literal("unterminated list meets end of file");
17837 p->lex.strterm = 0;
17838 return tSTRING_END;
17839 }
17840 if (func & STR_FUNC_REGEXP) {
17841 unterminated_literal("unterminated regexp meets end of file");
17842 }
17843 else {
17844 unterminated_literal("unterminated string meets end of file");
17845 }
17846 quote->u1.func |= STR_FUNC_TERM;
17847 }
17848 }
17849
17850 tokfix(p);
17851 lit = STR_NEW3(tok(p), toklen(p), enc, func);
17852 set_yylval_str(lit);
17853 flush_string_content(p, enc);
17854
17855 return tSTRING_CONTENT;
17856}
17857
17858static enum yytokentype
17859heredoc_identifier(struct parser_params *p)
17860{
17861 /*
17862 * term_len is length of `<<"END"` except `END`,
17863 * in this case term_len is 4 (<, <, " and ").
17864 */
17865 long len, offset = p->lex.pcur - p->lex.pbeg;
17866 int c = nextc(p), term, func = 0, quote = 0;
17867 enum yytokentype token = tSTRING_BEG;
17868 int indent = 0;
17869
17870 if (c == '-') {
17871 c = nextc(p);
17872 func = STR_FUNC_INDENT;
17873 offset++;
17874 }
17875 else if (c == '~') {
17876 c = nextc(p);
17877 func = STR_FUNC_INDENT;
17878 offset++;
17879 indent = INT_MAX;
17880 }
17881 switch (c) {
17882 case '\'':
17883 func |= str_squote; goto quoted;
17884 case '"':
17885 func |= str_dquote; goto quoted;
17886 case '`':
17887 token = tXSTRING_BEG;
17888 func |= str_xquote; goto quoted;
17889
17890 quoted:
17891 quote++;
17892 offset++;
17893 term = c;
17894 len = 0;
17895 while ((c = nextc(p)) != term) {
17896 if (c == -1 || c == '\r' || c == '\n') {
17897 yyerror0("unterminated here document identifier");
17898 return -1;
17899 }
17900 }
17901 break;
17902
17903 default:
17904 if (!parser_is_identchar(p)) {
17905 pushback(p, c);
17906 if (func & STR_FUNC_INDENT) {
17907 pushback(p, indent > 0 ? '~' : '-');
17908 }
17909 return 0;
17910 }
17911 func |= str_dquote;
17912 do {
17913 int n = parser_precise_mbclen(p, p->lex.pcur-1);
17914 if (n < 0) return 0;
17915 p->lex.pcur += --n;
17916 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
17917 pushback(p, c);
17918 break;
17919 }
17920
17921 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
17922 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
17923 yyerror0("too long here document identifier");
17924 dispatch_scan_event(p, tHEREDOC_BEG);
17925 lex_goto_eol(p);
17926
17927 p->lex.strterm = new_strterm(0, 0, 0, p->lex.lastline);
17928 p->lex.strterm->flags |= STRTERM_HEREDOC;
17929 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
17930 here->offset = offset;
17931 here->sourceline = p->ruby_sourceline;
17932 here->length = (int)len;
17933 here->quote = quote;
17934 here->func = func;
17935
17936 token_flush(p);
17937 p->heredoc_indent = indent;
17938 p->heredoc_line_indent = 0;
17939 return token;
17940}
17941
17942static void
17943heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
17944{
17945 VALUE line;
17946
17947 p->lex.strterm = 0;
17948 line = here->lastline;
17949 p->lex.lastline = line;
17950 p->lex.pbeg = RSTRING_PTR(line);
17951 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
17952 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
17953 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
17954 p->heredoc_end = p->ruby_sourceline;
17955 p->ruby_sourceline = (int)here->sourceline;
17956 if (p->eofp) p->lex.nextline = Qnil;
17957 p->eofp = 0;
17958}
17959
17960static int
17961dedent_string(VALUE string, int width)
17962{
17963 char *str;
17964 long len;
17965 int i, col = 0;
17966
17967 RSTRING_GETMEM(string, str, len);
17968 for (i = 0; i < len && col < width; i++) {
17969 if (str[i] == ' ') {
17970 col++;
17971 }
17972 else if (str[i] == '\t') {
17973 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
17974 if (n > width) break;
17975 col = n;
17976 }
17977 else {
17978 break;
17979 }
17980 }
17981 if (!i) return 0;
17982 rb_str_modify(string);
17983 str = RSTRING_PTR(string);
17984 if (RSTRING_LEN(string) != len)
17985 rb_fatal("literal string changed: %+"PRIsVALUE, string);
17986 MEMMOVE(str, str + i, char, len - i);
17987 rb_str_set_len(string, len - i);
17988 return i;
17989}
17990
17991#ifndef RIPPER
17992static NODE *
17993heredoc_dedent(struct parser_params *p, NODE *root)
17994{
17995 NODE *node, *str_node, *prev_node;
17996 int indent = p->heredoc_indent;
17997 VALUE prev_lit = 0;
17998
17999 if (indent <= 0) return root;
18000 p->heredoc_indent = 0;
18001 if (!root) return root;
18002
18003 prev_node = node = str_node = root;
18004 if (nd_type_p(root, NODE_LIST)) str_node = root->nd_head;
18005
18006 while (str_node) {
18007 VALUE lit = str_node->nd_lit;
18008 if (str_node->flags & NODE_FL_NEWLINE) {
18009 dedent_string(lit, indent);
18010 }
18011 if (!prev_lit) {
18012 prev_lit = lit;
18013 }
18014 else if (!literal_concat0(p, prev_lit, lit)) {
18015 return 0;
18016 }
18017 else {
18018 NODE *end = node->nd_end;
18019 node = prev_node->nd_next = node->nd_next;
18020 if (!node) {
18021 if (nd_type_p(prev_node, NODE_DSTR))
18022 nd_set_type(prev_node, NODE_STR);
18023 break;
18024 }
18025 node->nd_end = end;
18026 goto next_str;
18027 }
18028
18029 str_node = 0;
18030 while ((node = (prev_node = node)->nd_next) != 0) {
18031 next_str:
18032 if (!nd_type_p(node, NODE_LIST)) break;
18033 if ((str_node = node->nd_head) != 0) {
18034 enum node_type type = nd_type(str_node);
18035 if (type == NODE_STR || type == NODE_DSTR) break;
18036 prev_lit = 0;
18037 str_node = 0;
18038 }
18039 }
18040 }
18041 return root;
18042}
18043#else /* RIPPER */
18044static VALUE
18045heredoc_dedent(struct parser_params *p, VALUE array)
18046{
18047 int indent = p->heredoc_indent;
18048
18049 if (indent <= 0) return array;
18050 p->heredoc_indent = 0;
18051 dispatch2(heredoc_dedent, array, INT2NUM(indent));
18052 return array;
18053}
18054
18055/*
18056 * call-seq:
18057 * Ripper.dedent_string(input, width) -> Integer
18058 *
18059 * USE OF RIPPER LIBRARY ONLY.
18060 *
18061 * Strips up to +width+ leading whitespaces from +input+,
18062 * and returns the stripped column width.
18063 */
18064static VALUE
18065parser_dedent_string(VALUE self, VALUE input, VALUE width)
18066{
18067 int wid, col;
18068
18069 StringValue(input);
18070 wid = NUM2UINT(width);
18071 col = dedent_string(input, wid);
18072 return INT2NUM(col);
18073}
18074#endif
18075
18076static int
18077whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
18078{
18079 const char *ptr = p->lex.pbeg;
18080 long n;
18081
18082 if (indent) {
18083 while (*ptr && ISSPACE(*ptr)) ptr++;
18084 }
18085 n = p->lex.pend - (ptr + len);
18086 if (n < 0) return FALSE;
18087 if (n > 0 && ptr[len] != '\n') {
18088 if (ptr[len] != '\r') return FALSE;
18089 if (n <= 1 || ptr[len+1] != '\n') return FALSE;
18090 }
18091 return strncmp(eos, ptr, len) == 0;
18092}
18093
18094static int
18095word_match_p(struct parser_params *p, const char *word, long len)
18096{
18097 if (strncmp(p->lex.pcur, word, len)) return 0;
18098 if (p->lex.pcur + len == p->lex.pend) return 1;
18099 int c = (unsigned char)p->lex.pcur[len];
18100 if (ISSPACE(c)) return 1;
18101 switch (c) {
18102 case '\0': case '\004': case '\032': return 1;
18103 }
18104 return 0;
18105}
18106
18107#define NUM_SUFFIX_R (1<<0)
18108#define NUM_SUFFIX_I (1<<1)
18109#define NUM_SUFFIX_ALL 3
18110
18111static int
18112number_literal_suffix(struct parser_params *p, int mask)
18113{
18114 int c, result = 0;
18115 const char *lastp = p->lex.pcur;
18116
18117 while ((c = nextc(p)) != -1) {
18118 if ((mask & NUM_SUFFIX_I) && c == 'i') {
18119 result |= (mask & NUM_SUFFIX_I);
18120 mask &= ~NUM_SUFFIX_I;
18121 /* r after i, rational of complex is disallowed */
18122 mask &= ~NUM_SUFFIX_R;
18123 continue;
18124 }
18125 if ((mask & NUM_SUFFIX_R) && c == 'r') {
18126 result |= (mask & NUM_SUFFIX_R);
18127 mask &= ~NUM_SUFFIX_R;
18128 continue;
18129 }
18130 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
18131 p->lex.pcur = lastp;
18132 literal_flush(p, p->lex.pcur);
18133 return 0;
18134 }
18135 pushback(p, c);
18136 break;
18137 }
18138 return result;
18139}
18140
18141static enum yytokentype
18142set_number_literal(struct parser_params *p, VALUE v,
18143 enum yytokentype type, int suffix)
18144{
18145 if (suffix & NUM_SUFFIX_I) {
18146 v = rb_complex_raw(INT2FIX(0), v);
18147 type = tIMAGINARY;
18148 }
18149 set_yylval_literal(v);
18150 SET_LEX_STATE(EXPR_END);
18151 return type;
18152}
18153
18154static enum yytokentype
18155set_integer_literal(struct parser_params *p, VALUE v, int suffix)
18156{
18157 enum yytokentype type = tINTEGER;
18158 if (suffix & NUM_SUFFIX_R) {
18159 v = rb_rational_raw1(v);
18160 type = tRATIONAL;
18161 }
18162 return set_number_literal(p, v, type, suffix);
18163}
18164
18165#ifdef RIPPER
18166static void
18167dispatch_heredoc_end(struct parser_params *p)
18168{
18169 VALUE str;
18170 if (has_delayed_token(p))
18171 dispatch_delayed_token(p, tSTRING_CONTENT);
18172 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
18173 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
18174 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
18175 lex_goto_eol(p);
18176 token_flush(p);
18177}
18178
18179#else
18180#define dispatch_heredoc_end(p) parser_dispatch_heredoc_end(p, __LINE__)
18181static void
18182parser_dispatch_heredoc_end(struct parser_params *p, int line)
18183{
18184 if (has_delayed_token(p))
18185 dispatch_delayed_token(p, tSTRING_CONTENT);
18186
18187 if (p->keep_tokens) {
18188 VALUE str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
18189 RUBY_SET_YYLLOC_OF_HEREDOC_END(*p->yylloc);
18190 parser_append_tokens(p, str, tHEREDOC_END, line);
18191 }
18192
18193 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*p->yylloc);
18194 lex_goto_eol(p);
18195 token_flush(p);
18196}
18197#endif
18198
18199static enum yytokentype
18200here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
18201{
18202 int c, func, indent = 0;
18203 const char *eos, *ptr, *ptr_end;
18204 long len;
18205 VALUE str = 0;
18206 rb_encoding *enc = p->enc;
18207 rb_encoding *base_enc = 0;
18208 int bol;
18209
18210 eos = RSTRING_PTR(here->lastline) + here->offset;
18211 len = here->length;
18212 indent = (func = here->func) & STR_FUNC_INDENT;
18213
18214 if ((c = nextc(p)) == -1) {
18215 error:
18216#ifdef RIPPER
18217 if (!has_delayed_token(p)) {
18218 dispatch_scan_event(p, tSTRING_CONTENT);
18219 }
18220 else {
18221 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
18222 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
18223 int cr = ENC_CODERANGE_UNKNOWN;
18224 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
18225 if (cr != ENC_CODERANGE_7BIT &&
18226 rb_is_usascii_enc(p->enc) &&
18227 enc != rb_utf8_encoding()) {
18228 enc = rb_ascii8bit_encoding();
18229 }
18230 }
18231 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
18232 }
18233 dispatch_delayed_token(p, tSTRING_CONTENT);
18234 }
18235 lex_goto_eol(p);
18236#endif
18237 heredoc_restore(p, &p->lex.strterm->u.heredoc);
18238 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
18239 (int)len, eos);
18240 token_flush(p);
18241 p->lex.strterm = 0;
18242 SET_LEX_STATE(EXPR_END);
18243 return tSTRING_END;
18244 }
18245 bol = was_bol(p);
18246 if (!bol) {
18247 /* not beginning of line, cannot be the terminator */
18248 }
18249 else if (p->heredoc_line_indent == -1) {
18250 /* `heredoc_line_indent == -1` means
18251 * - "after an interpolation in the same line", or
18252 * - "in a continuing line"
18253 */
18254 p->heredoc_line_indent = 0;
18255 }
18256 else if (whole_match_p(p, eos, len, indent)) {
18257 dispatch_heredoc_end(p);
18258 restore:
18259 heredoc_restore(p, &p->lex.strterm->u.heredoc);
18260 token_flush(p);
18261 p->lex.strterm = 0;
18262 SET_LEX_STATE(EXPR_END);
18263 return tSTRING_END;
18264 }
18265
18266 if (!(func & STR_FUNC_EXPAND)) {
18267 do {
18268 ptr = RSTRING_PTR(p->lex.lastline);
18269 ptr_end = p->lex.pend;
18270 if (ptr_end > ptr) {
18271 switch (ptr_end[-1]) {
18272 case '\n':
18273 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
18274 ptr_end++;
18275 break;
18276 }
18277 case '\r':
18278 --ptr_end;
18279 }
18280 }
18281
18282 if (p->heredoc_indent > 0) {
18283 long i = 0;
18284 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
18285 i++;
18286 p->heredoc_line_indent = 0;
18287 }
18288
18289 if (str)
18290 rb_str_cat(str, ptr, ptr_end - ptr);
18291 else
18292 str = STR_NEW(ptr, ptr_end - ptr);
18293 if (ptr_end < p->lex.pend) rb_str_cat(str, "\n", 1);
18294 lex_goto_eol(p);
18295 if (p->heredoc_indent > 0) {
18296 goto flush_str;
18297 }
18298 if (nextc(p) == -1) {
18299 if (str) {
18300 str = 0;
18301 }
18302 goto error;
18303 }
18304 } while (!whole_match_p(p, eos, len, indent));
18305 }
18306 else {
18307 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
18308 newtok(p);
18309 if (c == '#') {
18310 int t = parser_peek_variable_name(p);
18311 if (p->heredoc_line_indent != -1) {
18312 if (p->heredoc_indent > p->heredoc_line_indent) {
18313 p->heredoc_indent = p->heredoc_line_indent;
18314 }
18315 p->heredoc_line_indent = -1;
18316 }
18317 if (t) return t;
18318 tokadd(p, '#');
18319 c = nextc(p);
18320 }
18321 do {
18322 pushback(p, c);
18323 enc = p->enc;
18324 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
18325 if (p->eofp) goto error;
18326 goto restore;
18327 }
18328 if (c != '\n') {
18329 if (c == '\\') p->heredoc_line_indent = -1;
18330 flush:
18331 str = STR_NEW3(tok(p), toklen(p), enc, func);
18332 flush_str:
18333 set_yylval_str(str);
18334#ifndef RIPPER
18335 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
18336#endif
18337 flush_string_content(p, enc);
18338 return tSTRING_CONTENT;
18339 }
18340 tokadd(p, nextc(p));
18341 if (p->heredoc_indent > 0) {
18342 lex_goto_eol(p);
18343 goto flush;
18344 }
18345 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
18346 if ((c = nextc(p)) == -1) goto error;
18347 } while (!whole_match_p(p, eos, len, indent));
18348 str = STR_NEW3(tok(p), toklen(p), enc, func);
18349 }
18350 dispatch_heredoc_end(p);
18351#ifdef RIPPER
18352 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
18353 yylval.val, str);
18354#endif
18355 heredoc_restore(p, &p->lex.strterm->u.heredoc);
18356 token_flush(p);
18357 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
18358 set_yylval_str(str);
18359#ifndef RIPPER
18360 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
18361#endif
18362 return tSTRING_CONTENT;
18363}
18364
18365#include "lex.c"
18366
18367static int
18368arg_ambiguous(struct parser_params *p, char c)
18369{
18370#ifndef RIPPER
18371 if (c == '/') {
18372 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
18373 }
18374 else {
18375 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
18376 }
18377#else
18378 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
18379#endif
18380 return TRUE;
18381}
18382
18383static ID
18384#ifndef RIPPER
18385formal_argument(struct parser_params *p, ID lhs)
18386#else
18387formal_argument(struct parser_params *p, VALUE lhs)
18388#endif
18389{
18390 ID id = get_id(lhs);
18391
18392 switch (id_type(id)) {
18393 case ID_LOCAL:
18394 break;
18395#ifndef RIPPER
18396# define ERR(mesg) yyerror0(mesg)
18397#else
18398# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
18399#endif
18400 case ID_CONST:
18401 ERR("formal argument cannot be a constant");
18402 return 0;
18403 case ID_INSTANCE:
18404 ERR("formal argument cannot be an instance variable");
18405 return 0;
18406 case ID_GLOBAL:
18407 ERR("formal argument cannot be a global variable");
18408 return 0;
18409 case ID_CLASS:
18410 ERR("formal argument cannot be a class variable");
18411 return 0;
18412 default:
18413 ERR("formal argument must be local variable");
18414 return 0;
18415#undef ERR
18416 }
18417 shadowing_lvar(p, id);
18418 return lhs;
18419}
18420
18421static int
18422lvar_defined(struct parser_params *p, ID id)
18423{
18424 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
18425}
18426
18427/* emacsen -*- hack */
18428static long
18429parser_encode_length(struct parser_params *p, const char *name, long len)
18430{
18431 long nlen;
18432
18433 if (len > 5 && name[nlen = len - 5] == '-') {
18434 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
18435 return nlen;
18436 }
18437 if (len > 4 && name[nlen = len - 4] == '-') {
18438 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
18439 return nlen;
18440 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
18441 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
18442 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
18443 return nlen;
18444 }
18445 return len;
18446}
18447
18448static void
18449parser_set_encode(struct parser_params *p, const char *name)
18450{
18451 int idx = rb_enc_find_index(name);
18452 rb_encoding *enc;
18453 VALUE excargs[3];
18454
18455 if (idx < 0) {
18456 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
18457 error:
18458 excargs[0] = rb_eArgError;
18459 excargs[2] = rb_make_backtrace();
18460 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
18461 rb_exc_raise(rb_make_exception(3, excargs));
18462 }
18463 enc = rb_enc_from_index(idx);
18464 if (!rb_enc_asciicompat(enc)) {
18465 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
18466 goto error;
18467 }
18468 p->enc = enc;
18469#ifndef RIPPER
18470 if (p->debug_lines) {
18471 VALUE lines = p->debug_lines;
18472 long i, n = RARRAY_LEN(lines);
18473 for (i = 0; i < n; ++i) {
18474 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
18475 }
18476 }
18477#endif
18478}
18479
18480static int
18481comment_at_top(struct parser_params *p)
18482{
18483 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
18484 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
18485 while (ptr < ptr_end) {
18486 if (!ISSPACE(*ptr)) return 0;
18487 ptr++;
18488 }
18489 return 1;
18490}
18491
18492typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
18493typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
18494
18495static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
18496
18497static void
18498magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
18499{
18500 if (!comment_at_top(p)) {
18501 return;
18502 }
18503 parser_set_encode(p, val);
18504}
18505
18506static int
18507parser_get_bool(struct parser_params *p, const char *name, const char *val)
18508{
18509 switch (*val) {
18510 case 't': case 'T':
18511 if (STRCASECMP(val, "true") == 0) {
18512 return TRUE;
18513 }
18514 break;
18515 case 'f': case 'F':
18516 if (STRCASECMP(val, "false") == 0) {
18517 return FALSE;
18518 }
18519 break;
18520 }
18521 return parser_invalid_pragma_value(p, name, val);
18522}
18523
18524static int
18525parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
18526{
18527 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
18528 return -1;
18529}
18530
18531static void
18532parser_set_token_info(struct parser_params *p, const char *name, const char *val)
18533{
18534 int b = parser_get_bool(p, name, val);
18535 if (b >= 0) p->token_info_enabled = b;
18536}
18537
18538static void
18539parser_set_compile_option_flag(struct parser_params *p, const char *name, const char *val)
18540{
18541 int b;
18542
18543 if (p->token_seen) {
18544 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
18545 return;
18546 }
18547
18548 b = parser_get_bool(p, name, val);
18549 if (b < 0) return;
18550
18551 if (!p->compile_option)
18552 p->compile_option = rb_obj_hide(rb_ident_hash_new());
18553 rb_hash_aset(p->compile_option, ID2SYM(rb_intern(name)),
18554 RBOOL(b));
18555}
18556
18557static void
18558parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
18559{
18560 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
18561 if (*s == ' ' || *s == '\t') continue;
18562 if (*s == '#') break;
18563 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
18564 return;
18565 }
18566
18567 switch (*val) {
18568 case 'n': case 'N':
18569 if (STRCASECMP(val, "none") == 0) {
18570 p->ctxt.shareable_constant_value = shareable_none;
18571 return;
18572 }
18573 break;
18574 case 'l': case 'L':
18575 if (STRCASECMP(val, "literal") == 0) {
18576 p->ctxt.shareable_constant_value = shareable_literal;
18577 return;
18578 }
18579 break;
18580 case 'e': case 'E':
18581 if (STRCASECMP(val, "experimental_copy") == 0) {
18582 p->ctxt.shareable_constant_value = shareable_copy;
18583 return;
18584 }
18585 if (STRCASECMP(val, "experimental_everything") == 0) {
18586 p->ctxt.shareable_constant_value = shareable_everything;
18587 return;
18588 }
18589 break;
18590 }
18591 parser_invalid_pragma_value(p, name, val);
18592}
18593
18594# if WARN_PAST_SCOPE
18595static void
18596parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
18597{
18598 int b = parser_get_bool(p, name, val);
18599 if (b >= 0) p->past_scope_enabled = b;
18600}
18601# endif
18602
18604 const char *name;
18605 rb_magic_comment_setter_t func;
18606 rb_magic_comment_length_t length;
18607};
18608
18609static const struct magic_comment magic_comments[] = {
18610 {"coding", magic_comment_encoding, parser_encode_length},
18611 {"encoding", magic_comment_encoding, parser_encode_length},
18612 {"frozen_string_literal", parser_set_compile_option_flag},
18613 {"shareable_constant_value", parser_set_shareable_constant_value},
18614 {"warn_indent", parser_set_token_info},
18615# if WARN_PAST_SCOPE
18616 {"warn_past_scope", parser_set_past_scope},
18617# endif
18618};
18619
18620static const char *
18621magic_comment_marker(const char *str, long len)
18622{
18623 long i = 2;
18624
18625 while (i < len) {
18626 switch (str[i]) {
18627 case '-':
18628 if (str[i-1] == '*' && str[i-2] == '-') {
18629 return str + i + 1;
18630 }
18631 i += 2;
18632 break;
18633 case '*':
18634 if (i + 1 >= len) return 0;
18635 if (str[i+1] != '-') {
18636 i += 4;
18637 }
18638 else if (str[i-1] != '-') {
18639 i += 2;
18640 }
18641 else {
18642 return str + i + 2;
18643 }
18644 break;
18645 default:
18646 i += 3;
18647 break;
18648 }
18649 }
18650 return 0;
18651}
18652
18653static int
18654parser_magic_comment(struct parser_params *p, const char *str, long len)
18655{
18656 int indicator = 0;
18657 VALUE name = 0, val = 0;
18658 const char *beg, *end, *vbeg, *vend;
18659#define str_copy(_s, _p, _n) ((_s) \
18660 ? (void)(rb_str_resize((_s), (_n)), \
18661 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
18662 : (void)((_s) = STR_NEW((_p), (_n))))
18663
18664 if (len <= 7) return FALSE;
18665 if (!!(beg = magic_comment_marker(str, len))) {
18666 if (!(end = magic_comment_marker(beg, str + len - beg)))
18667 return FALSE;
18668 indicator = TRUE;
18669 str = beg;
18670 len = end - beg - 3;
18671 }
18672
18673 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
18674 while (len > 0) {
18675 const struct magic_comment *mc = magic_comments;
18676 char *s;
18677 int i;
18678 long n = 0;
18679
18680 for (; len > 0 && *str; str++, --len) {
18681 switch (*str) {
18682 case '\'': case '"': case ':': case ';':
18683 continue;
18684 }
18685 if (!ISSPACE(*str)) break;
18686 }
18687 for (beg = str; len > 0; str++, --len) {
18688 switch (*str) {
18689 case '\'': case '"': case ':': case ';':
18690 break;
18691 default:
18692 if (ISSPACE(*str)) break;
18693 continue;
18694 }
18695 break;
18696 }
18697 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
18698 if (!len) break;
18699 if (*str != ':') {
18700 if (!indicator) return FALSE;
18701 continue;
18702 }
18703
18704 do str++; while (--len > 0 && ISSPACE(*str));
18705 if (!len) break;
18706 if (*str == '"') {
18707 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
18708 if (*str == '\\') {
18709 --len;
18710 ++str;
18711 }
18712 }
18713 vend = str;
18714 if (len) {
18715 --len;
18716 ++str;
18717 }
18718 }
18719 else {
18720 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
18721 vend = str;
18722 }
18723 if (indicator) {
18724 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
18725 }
18726 else {
18727 while (len > 0 && (ISSPACE(*str))) --len, str++;
18728 if (len) return FALSE;
18729 }
18730
18731 n = end - beg;
18732 str_copy(name, beg, n);
18733 s = RSTRING_PTR(name);
18734 for (i = 0; i < n; ++i) {
18735 if (s[i] == '-') s[i] = '_';
18736 }
18737 do {
18738 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
18739 n = vend - vbeg;
18740 if (mc->length) {
18741 n = (*mc->length)(p, vbeg, n);
18742 }
18743 str_copy(val, vbeg, n);
18744 (*mc->func)(p, mc->name, RSTRING_PTR(val));
18745 break;
18746 }
18747 } while (++mc < magic_comments + numberof(magic_comments));
18748#ifdef RIPPER
18749 str_copy(val, vbeg, vend - vbeg);
18750 dispatch2(magic_comment, name, val);
18751#endif
18752 }
18753
18754 return TRUE;
18755}
18756
18757static void
18758set_file_encoding(struct parser_params *p, const char *str, const char *send)
18759{
18760 int sep = 0;
18761 const char *beg = str;
18762 VALUE s;
18763
18764 for (;;) {
18765 if (send - str <= 6) return;
18766 switch (str[6]) {
18767 case 'C': case 'c': str += 6; continue;
18768 case 'O': case 'o': str += 5; continue;
18769 case 'D': case 'd': str += 4; continue;
18770 case 'I': case 'i': str += 3; continue;
18771 case 'N': case 'n': str += 2; continue;
18772 case 'G': case 'g': str += 1; continue;
18773 case '=': case ':':
18774 sep = 1;
18775 str += 6;
18776 break;
18777 default:
18778 str += 6;
18779 if (ISSPACE(*str)) break;
18780 continue;
18781 }
18782 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
18783 sep = 0;
18784 }
18785 for (;;) {
18786 do {
18787 if (++str >= send) return;
18788 } while (ISSPACE(*str));
18789 if (sep) break;
18790 if (*str != '=' && *str != ':') return;
18791 sep = 1;
18792 str++;
18793 }
18794 beg = str;
18795 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
18796 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
18797 parser_set_encode(p, RSTRING_PTR(s));
18798 rb_str_resize(s, 0);
18799}
18800
18801static void
18802parser_prepare(struct parser_params *p)
18803{
18804 int c = nextc0(p, FALSE);
18805 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
18806 switch (c) {
18807 case '#':
18808 if (peek(p, '!')) p->has_shebang = 1;
18809 break;
18810 case 0xef: /* UTF-8 BOM marker */
18811 if (p->lex.pend - p->lex.pcur >= 2 &&
18812 (unsigned char)p->lex.pcur[0] == 0xbb &&
18813 (unsigned char)p->lex.pcur[1] == 0xbf) {
18814 p->enc = rb_utf8_encoding();
18815 p->lex.pcur += 2;
18816#ifndef RIPPER
18817 if (p->debug_lines) {
18818 rb_enc_associate(p->lex.lastline, p->enc);
18819 }
18820#endif
18821 p->lex.pbeg = p->lex.pcur;
18822 return;
18823 }
18824 break;
18825 case EOF:
18826 return;
18827 }
18828 pushback(p, c);
18829 p->enc = rb_enc_get(p->lex.lastline);
18830}
18831
18832#ifndef RIPPER
18833#define ambiguous_operator(tok, op, syn) ( \
18834 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
18835 rb_warning0("even though it seems like "syn""))
18836#else
18837#define ambiguous_operator(tok, op, syn) \
18838 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
18839#endif
18840#define warn_balanced(tok, op, syn) ((void) \
18841 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
18842 space_seen && !ISSPACE(c) && \
18843 (ambiguous_operator(tok, op, syn), 0)), \
18844 (enum yytokentype)(tok))
18845
18846static VALUE
18847parse_rational(struct parser_params *p, char *str, int len, int seen_point)
18848{
18849 VALUE v;
18850 char *point = &str[seen_point];
18851 size_t fraclen = len-seen_point-1;
18852 memmove(point, point+1, fraclen+1);
18853 v = rb_cstr_to_inum(str, 10, FALSE);
18854 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
18855}
18856
18857static enum yytokentype
18858no_digits(struct parser_params *p)
18859{
18860 yyerror0("numeric literal without digits");
18861 if (peek(p, '_')) nextc(p);
18862 /* dummy 0, for tUMINUS_NUM at numeric */
18863 return set_integer_literal(p, INT2FIX(0), 0);
18864}
18865
18866static enum yytokentype
18867parse_numeric(struct parser_params *p, int c)
18868{
18869 int is_float, seen_point, seen_e, nondigit;
18870 int suffix;
18871
18872 is_float = seen_point = seen_e = nondigit = 0;
18873 SET_LEX_STATE(EXPR_END);
18874 newtok(p);
18875 if (c == '-' || c == '+') {
18876 tokadd(p, c);
18877 c = nextc(p);
18878 }
18879 if (c == '0') {
18880 int start = toklen(p);
18881 c = nextc(p);
18882 if (c == 'x' || c == 'X') {
18883 /* hexadecimal */
18884 c = nextc(p);
18885 if (c != -1 && ISXDIGIT(c)) {
18886 do {
18887 if (c == '_') {
18888 if (nondigit) break;
18889 nondigit = c;
18890 continue;
18891 }
18892 if (!ISXDIGIT(c)) break;
18893 nondigit = 0;
18894 tokadd(p, c);
18895 } while ((c = nextc(p)) != -1);
18896 }
18897 pushback(p, c);
18898 tokfix(p);
18899 if (toklen(p) == start) {
18900 return no_digits(p);
18901 }
18902 else if (nondigit) goto trailing_uc;
18903 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
18904 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
18905 }
18906 if (c == 'b' || c == 'B') {
18907 /* binary */
18908 c = nextc(p);
18909 if (c == '0' || c == '1') {
18910 do {
18911 if (c == '_') {
18912 if (nondigit) break;
18913 nondigit = c;
18914 continue;
18915 }
18916 if (c != '0' && c != '1') break;
18917 nondigit = 0;
18918 tokadd(p, c);
18919 } while ((c = nextc(p)) != -1);
18920 }
18921 pushback(p, c);
18922 tokfix(p);
18923 if (toklen(p) == start) {
18924 return no_digits(p);
18925 }
18926 else if (nondigit) goto trailing_uc;
18927 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
18928 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
18929 }
18930 if (c == 'd' || c == 'D') {
18931 /* decimal */
18932 c = nextc(p);
18933 if (c != -1 && ISDIGIT(c)) {
18934 do {
18935 if (c == '_') {
18936 if (nondigit) break;
18937 nondigit = c;
18938 continue;
18939 }
18940 if (!ISDIGIT(c)) break;
18941 nondigit = 0;
18942 tokadd(p, c);
18943 } while ((c = nextc(p)) != -1);
18944 }
18945 pushback(p, c);
18946 tokfix(p);
18947 if (toklen(p) == start) {
18948 return no_digits(p);
18949 }
18950 else if (nondigit) goto trailing_uc;
18951 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
18952 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
18953 }
18954 if (c == '_') {
18955 /* 0_0 */
18956 goto octal_number;
18957 }
18958 if (c == 'o' || c == 'O') {
18959 /* prefixed octal */
18960 c = nextc(p);
18961 if (c == -1 || c == '_' || !ISDIGIT(c)) {
18962 return no_digits(p);
18963 }
18964 }
18965 if (c >= '0' && c <= '7') {
18966 /* octal */
18967 octal_number:
18968 do {
18969 if (c == '_') {
18970 if (nondigit) break;
18971 nondigit = c;
18972 continue;
18973 }
18974 if (c < '0' || c > '9') break;
18975 if (c > '7') goto invalid_octal;
18976 nondigit = 0;
18977 tokadd(p, c);
18978 } while ((c = nextc(p)) != -1);
18979 if (toklen(p) > start) {
18980 pushback(p, c);
18981 tokfix(p);
18982 if (nondigit) goto trailing_uc;
18983 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
18984 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
18985 }
18986 if (nondigit) {
18987 pushback(p, c);
18988 goto trailing_uc;
18989 }
18990 }
18991 if (c > '7' && c <= '9') {
18992 invalid_octal:
18993 yyerror0("Invalid octal digit");
18994 }
18995 else if (c == '.' || c == 'e' || c == 'E') {
18996 tokadd(p, '0');
18997 }
18998 else {
18999 pushback(p, c);
19000 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19001 return set_integer_literal(p, INT2FIX(0), suffix);
19002 }
19003 }
19004
19005 for (;;) {
19006 switch (c) {
19007 case '0': case '1': case '2': case '3': case '4':
19008 case '5': case '6': case '7': case '8': case '9':
19009 nondigit = 0;
19010 tokadd(p, c);
19011 break;
19012
19013 case '.':
19014 if (nondigit) goto trailing_uc;
19015 if (seen_point || seen_e) {
19016 goto decode_num;
19017 }
19018 else {
19019 int c0 = nextc(p);
19020 if (c0 == -1 || !ISDIGIT(c0)) {
19021 pushback(p, c0);
19022 goto decode_num;
19023 }
19024 c = c0;
19025 }
19026 seen_point = toklen(p);
19027 tokadd(p, '.');
19028 tokadd(p, c);
19029 is_float++;
19030 nondigit = 0;
19031 break;
19032
19033 case 'e':
19034 case 'E':
19035 if (nondigit) {
19036 pushback(p, c);
19037 c = nondigit;
19038 goto decode_num;
19039 }
19040 if (seen_e) {
19041 goto decode_num;
19042 }
19043 nondigit = c;
19044 c = nextc(p);
19045 if (c != '-' && c != '+' && !ISDIGIT(c)) {
19046 pushback(p, c);
19047 nondigit = 0;
19048 goto decode_num;
19049 }
19050 tokadd(p, nondigit);
19051 seen_e++;
19052 is_float++;
19053 tokadd(p, c);
19054 nondigit = (c == '-' || c == '+') ? c : 0;
19055 break;
19056
19057 case '_': /* `_' in number just ignored */
19058 if (nondigit) goto decode_num;
19059 nondigit = c;
19060 break;
19061
19062 default:
19063 goto decode_num;
19064 }
19065 c = nextc(p);
19066 }
19067
19068 decode_num:
19069 pushback(p, c);
19070 if (nondigit) {
19071 trailing_uc:
19072 literal_flush(p, p->lex.pcur - 1);
19073 YYLTYPE loc = RUBY_INIT_YYLLOC();
19074 compile_error(p, "trailing `%c' in number", nondigit);
19075 parser_show_error_line(p, &loc);
19076 }
19077 tokfix(p);
19078 if (is_float) {
19079 enum yytokentype type = tFLOAT;
19080 VALUE v;
19081
19082 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
19083 if (suffix & NUM_SUFFIX_R) {
19084 type = tRATIONAL;
19085 v = parse_rational(p, tok(p), toklen(p), seen_point);
19086 }
19087 else {
19088 double d = strtod(tok(p), 0);
19089 if (errno == ERANGE) {
19090 rb_warning1("Float %s out of range", WARN_S(tok(p)));
19091 errno = 0;
19092 }
19093 v = DBL2NUM(d);
19094 }
19095 return set_number_literal(p, v, type, suffix);
19096 }
19097 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
19098 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
19099}
19100
19101static enum yytokentype
19102parse_qmark(struct parser_params *p, int space_seen)
19103{
19104 rb_encoding *enc;
19105 register int c;
19106 VALUE lit;
19107
19108 if (IS_END()) {
19109 SET_LEX_STATE(EXPR_VALUE);
19110 return '?';
19111 }
19112 c = nextc(p);
19113 if (c == -1) {
19114 compile_error(p, "incomplete character syntax");
19115 return 0;
19116 }
19117 if (rb_enc_isspace(c, p->enc)) {
19118 if (!IS_ARG()) {
19119 int c2 = escaped_control_code(c);
19120 if (c2) {
19121 WARN_SPACE_CHAR(c2, "?");
19122 }
19123 }
19124 ternary:
19125 pushback(p, c);
19126 SET_LEX_STATE(EXPR_VALUE);
19127 return '?';
19128 }
19129 newtok(p);
19130 enc = p->enc;
19131 if (!parser_isascii(p)) {
19132 if (tokadd_mbchar(p, c) == -1) return 0;
19133 }
19134 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
19135 p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
19136 if (space_seen) {
19137 const char *start = p->lex.pcur - 1, *ptr = start;
19138 do {
19139 int n = parser_precise_mbclen(p, ptr);
19140 if (n < 0) return -1;
19141 ptr += n;
19142 } while (ptr < p->lex.pend && is_identchar(ptr, p->lex.pend, p->enc));
19143 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
19144 " a conditional operator, put a space after `?'",
19145 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
19146 }
19147 goto ternary;
19148 }
19149 else if (c == '\\') {
19150 if (peek(p, 'u')) {
19151 nextc(p);
19152 enc = rb_utf8_encoding();
19153 tokadd_utf8(p, &enc, -1, 0, 0);
19154 }
19155 else if (!lex_eol_p(p) && !(c = *p->lex.pcur, ISASCII(c))) {
19156 nextc(p);
19157 if (tokadd_mbchar(p, c) == -1) return 0;
19158 }
19159 else {
19160 c = read_escape(p, 0, &enc);
19161 tokadd(p, c);
19162 }
19163 }
19164 else {
19165 tokadd(p, c);
19166 }
19167 tokfix(p);
19168 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
19169 set_yylval_str(lit);
19170 SET_LEX_STATE(EXPR_END);
19171 return tCHAR;
19172}
19173
19174static enum yytokentype
19175parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
19176{
19177 register int c;
19178 const char *ptok = p->lex.pcur;
19179
19180 if (IS_BEG()) {
19181 int term;
19182 int paren;
19183
19184 c = nextc(p);
19185 quotation:
19186 if (c == -1) goto unterminated;
19187 if (!ISALNUM(c)) {
19188 term = c;
19189 if (!ISASCII(c)) goto unknown;
19190 c = 'Q';
19191 }
19192 else {
19193 term = nextc(p);
19194 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
19195 unknown:
19196 pushback(p, term);
19197 c = parser_precise_mbclen(p, p->lex.pcur);
19198 if (c < 0) return 0;
19199 p->lex.pcur += c;
19200 yyerror0("unknown type of %string");
19201 return 0;
19202 }
19203 }
19204 if (term == -1) {
19205 unterminated:
19206 compile_error(p, "unterminated quoted string meets end of file");
19207 return 0;
19208 }
19209 paren = term;
19210 if (term == '(') term = ')';
19211 else if (term == '[') term = ']';
19212 else if (term == '{') term = '}';
19213 else if (term == '<') term = '>';
19214 else paren = 0;
19215
19216 p->lex.ptok = ptok-1;
19217 switch (c) {
19218 case 'Q':
19219 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
19220 return tSTRING_BEG;
19221
19222 case 'q':
19223 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
19224 return tSTRING_BEG;
19225
19226 case 'W':
19227 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
19228 return tWORDS_BEG;
19229
19230 case 'w':
19231 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
19232 return tQWORDS_BEG;
19233
19234 case 'I':
19235 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
19236 return tSYMBOLS_BEG;
19237
19238 case 'i':
19239 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
19240 return tQSYMBOLS_BEG;
19241
19242 case 'x':
19243 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
19244 return tXSTRING_BEG;
19245
19246 case 'r':
19247 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
19248 return tREGEXP_BEG;
19249
19250 case 's':
19251 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
19252 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
19253 return tSYMBEG;
19254
19255 default:
19256 yyerror0("unknown type of %string");
19257 return 0;
19258 }
19259 }
19260 if ((c = nextc(p)) == '=') {
19261 set_yylval_id('%');
19262 SET_LEX_STATE(EXPR_BEG);
19263 return tOP_ASGN;
19264 }
19265 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
19266 goto quotation;
19267 }
19268 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19269 pushback(p, c);
19270 return warn_balanced('%', "%%", "string literal");
19271}
19272
19273static int
19274tokadd_ident(struct parser_params *p, int c)
19275{
19276 do {
19277 if (tokadd_mbchar(p, c) == -1) return -1;
19278 c = nextc(p);
19279 } while (parser_is_identchar(p));
19280 pushback(p, c);
19281 return 0;
19282}
19283
19284static ID
19285tokenize_ident(struct parser_params *p, const enum lex_state_e last_state)
19286{
19287 ID ident = TOK_INTERN();
19288
19289 set_yylval_name(ident);
19290
19291 return ident;
19292}
19293
19294static int
19295parse_numvar(struct parser_params *p)
19296{
19297 size_t len;
19298 int overflow;
19299 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
19300 const unsigned long nth_ref_max =
19301 ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
19302 /* NTH_REF is left-shifted to be ORed with back-ref flag and
19303 * turned into a Fixnum, in compile.c */
19304
19305 if (overflow || n > nth_ref_max) {
19306 /* compile_error()? */
19307 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
19308 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
19309 }
19310 else {
19311 return (int)n;
19312 }
19313}
19314
19315static enum yytokentype
19316parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
19317{
19318 const char *ptr = p->lex.pcur;
19319 register int c;
19320
19321 SET_LEX_STATE(EXPR_END);
19322 p->lex.ptok = ptr - 1; /* from '$' */
19323 newtok(p);
19324 c = nextc(p);
19325 switch (c) {
19326 case '_': /* $_: last read line string */
19327 c = nextc(p);
19328 if (parser_is_identchar(p)) {
19329 tokadd(p, '$');
19330 tokadd(p, '_');
19331 break;
19332 }
19333 pushback(p, c);
19334 c = '_';
19335 /* fall through */
19336 case '~': /* $~: match-data */
19337 case '*': /* $*: argv */
19338 case '$': /* $$: pid */
19339 case '?': /* $?: last status */
19340 case '!': /* $!: error string */
19341 case '@': /* $@: error position */
19342 case '/': /* $/: input record separator */
19343 case '\\': /* $\: output record separator */
19344 case ';': /* $;: field separator */
19345 case ',': /* $,: output field separator */
19346 case '.': /* $.: last read line number */
19347 case '=': /* $=: ignorecase */
19348 case ':': /* $:: load path */
19349 case '<': /* $<: reading filename */
19350 case '>': /* $>: default output handle */
19351 case '\"': /* $": already loaded files */
19352 tokadd(p, '$');
19353 tokadd(p, c);
19354 goto gvar;
19355
19356 case '-':
19357 tokadd(p, '$');
19358 tokadd(p, c);
19359 c = nextc(p);
19360 if (parser_is_identchar(p)) {
19361 if (tokadd_mbchar(p, c) == -1) return 0;
19362 }
19363 else {
19364 pushback(p, c);
19365 pushback(p, '-');
19366 return '$';
19367 }
19368 gvar:
19369 set_yylval_name(TOK_INTERN());
19370 return tGVAR;
19371
19372 case '&': /* $&: last match */
19373 case '`': /* $`: string before last match */
19374 case '\'': /* $': string after last match */
19375 case '+': /* $+: string matches last paren. */
19376 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
19377 tokadd(p, '$');
19378 tokadd(p, c);
19379 goto gvar;
19380 }
19381 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
19382 return tBACK_REF;
19383
19384 case '1': case '2': case '3':
19385 case '4': case '5': case '6':
19386 case '7': case '8': case '9':
19387 tokadd(p, '$');
19388 do {
19389 tokadd(p, c);
19390 c = nextc(p);
19391 } while (c != -1 && ISDIGIT(c));
19392 pushback(p, c);
19393 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
19394 tokfix(p);
19395 c = parse_numvar(p);
19396 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
19397 return tNTH_REF;
19398
19399 default:
19400 if (!parser_is_identchar(p)) {
19401 YYLTYPE loc = RUBY_INIT_YYLLOC();
19402 if (c == -1 || ISSPACE(c)) {
19403 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
19404 }
19405 else {
19406 pushback(p, c);
19407 compile_error(p, "`$%c' is not allowed as a global variable name", c);
19408 }
19409 parser_show_error_line(p, &loc);
19410 set_yylval_noname();
19411 return tGVAR;
19412 }
19413 /* fall through */
19414 case '0':
19415 tokadd(p, '$');
19416 }
19417
19418 if (tokadd_ident(p, c)) return 0;
19419 SET_LEX_STATE(EXPR_END);
19420 tokenize_ident(p, last_state);
19421 return tGVAR;
19422}
19423
19424#ifndef RIPPER
19425static bool
19426parser_numbered_param(struct parser_params *p, int n)
19427{
19428 if (n < 0) return false;
19429
19430 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
19431 return false;
19432 }
19433 if (p->max_numparam == ORDINAL_PARAM) {
19434 compile_error(p, "ordinary parameter is defined");
19435 return false;
19436 }
19437 struct vtable *args = p->lvtbl->args;
19438 if (p->max_numparam < n) {
19439 p->max_numparam = n;
19440 }
19441 while (n > args->pos) {
19442 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
19443 }
19444 return true;
19445}
19446#endif
19447
19448static enum yytokentype
19449parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
19450{
19451 const char *ptr = p->lex.pcur;
19452 enum yytokentype result = tIVAR;
19453 register int c = nextc(p);
19454 YYLTYPE loc;
19455
19456 p->lex.ptok = ptr - 1; /* from '@' */
19457 newtok(p);
19458 tokadd(p, '@');
19459 if (c == '@') {
19460 result = tCVAR;
19461 tokadd(p, '@');
19462 c = nextc(p);
19463 }
19464 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
19465 if (c == -1 || !parser_is_identchar(p)) {
19466 pushback(p, c);
19467 RUBY_SET_YYLLOC(loc);
19468 if (result == tIVAR) {
19469 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
19470 }
19471 else {
19472 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
19473 }
19474 parser_show_error_line(p, &loc);
19475 set_yylval_noname();
19476 SET_LEX_STATE(EXPR_END);
19477 return result;
19478 }
19479 else if (ISDIGIT(c)) {
19480 pushback(p, c);
19481 RUBY_SET_YYLLOC(loc);
19482 if (result == tIVAR) {
19483 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
19484 }
19485 else {
19486 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
19487 }
19488 parser_show_error_line(p, &loc);
19489 set_yylval_noname();
19490 SET_LEX_STATE(EXPR_END);
19491 return result;
19492 }
19493
19494 if (tokadd_ident(p, c)) return 0;
19495 tokenize_ident(p, last_state);
19496 return result;
19497}
19498
19499static enum yytokentype
19500parse_ident(struct parser_params *p, int c, int cmd_state)
19501{
19502 enum yytokentype result;
19503 int mb = ENC_CODERANGE_7BIT;
19504 const enum lex_state_e last_state = p->lex.state;
19505 ID ident;
19506 int enforce_keyword_end = 0;
19507
19508 do {
19509 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
19510 if (tokadd_mbchar(p, c) == -1) return 0;
19511 c = nextc(p);
19512 } while (parser_is_identchar(p));
19513 if ((c == '!' || c == '?') && !peek(p, '=')) {
19514 result = tFID;
19515 tokadd(p, c);
19516 }
19517 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
19518 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
19519 result = tIDENTIFIER;
19520 tokadd(p, c);
19521 }
19522 else {
19523 result = tCONSTANT; /* assume provisionally */
19524 pushback(p, c);
19525 }
19526 tokfix(p);
19527
19528 if (IS_LABEL_POSSIBLE()) {
19529 if (IS_LABEL_SUFFIX(0)) {
19530 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
19531 nextc(p);
19532 set_yylval_name(TOK_INTERN());
19533 return tLABEL;
19534 }
19535 }
19536
19537#ifndef RIPPER
19538 if (!NIL_P(peek_end_expect_token_locations(p))) {
19539 VALUE end_loc;
19540 int lineno, column;
19541 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
19542
19543 end_loc = peek_end_expect_token_locations(p);
19544 lineno = NUM2INT(rb_ary_entry(end_loc, 0));
19545 column = NUM2INT(rb_ary_entry(end_loc, 1));
19546
19547 if (p->debug) {
19548 rb_parser_printf(p, "enforce_keyword_end check. current: (%d, %d), peek: (%d, %d)\n",
19549 p->ruby_sourceline, beg_pos, lineno, column);
19550 }
19551
19552 if ((p->ruby_sourceline > lineno) && (beg_pos <= column)) {
19553 const struct kwtable *kw;
19554
19555 if ((IS_lex_state(EXPR_DOT)) && (kw = rb_reserved_word(tok(p), toklen(p))) && (kw && kw->id[0] == keyword_end)) {
19556 if (p->debug) rb_parser_printf(p, "enforce_keyword_end is enabled\n");
19557 enforce_keyword_end = 1;
19558 }
19559 }
19560 }
19561#endif
19562
19563 if (mb == ENC_CODERANGE_7BIT && (!IS_lex_state(EXPR_DOT) || enforce_keyword_end)) {
19564 const struct kwtable *kw;
19565
19566 /* See if it is a reserved word. */
19567 kw = rb_reserved_word(tok(p), toklen(p));
19568 if (kw) {
19569 enum lex_state_e state = p->lex.state;
19570 if (IS_lex_state_for(state, EXPR_FNAME)) {
19571 SET_LEX_STATE(EXPR_ENDFN);
19572 set_yylval_name(rb_intern2(tok(p), toklen(p)));
19573 return kw->id[0];
19574 }
19575 SET_LEX_STATE(kw->state);
19576 if (IS_lex_state(EXPR_BEG)) {
19577 p->command_start = TRUE;
19578 }
19579 if (kw->id[0] == keyword_do) {
19580 if (lambda_beginning_p()) {
19581 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
19582 return keyword_do_LAMBDA;
19583 }
19584 if (COND_P()) return keyword_do_cond;
19585 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
19586 return keyword_do_block;
19587 return keyword_do;
19588 }
19589 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED | EXPR_CLASS)))
19590 return kw->id[0];
19591 else {
19592 if (kw->id[0] != kw->id[1])
19593 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
19594 return kw->id[1];
19595 }
19596 }
19597 }
19598
19599 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
19600 if (cmd_state) {
19601 SET_LEX_STATE(EXPR_CMDARG);
19602 }
19603 else {
19604 SET_LEX_STATE(EXPR_ARG);
19605 }
19606 }
19607 else if (p->lex.state == EXPR_FNAME) {
19608 SET_LEX_STATE(EXPR_ENDFN);
19609 }
19610 else {
19611 SET_LEX_STATE(EXPR_END);
19612 }
19613
19614 ident = tokenize_ident(p, last_state);
19615 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
19616 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
19617 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
19618 lvar_defined(p, ident)) {
19619 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
19620 }
19621 return result;
19622}
19623
19624static void
19625warn_cr(struct parser_params *p)
19626{
19627 if (!p->cr_seen) {
19628 p->cr_seen = TRUE;
19629 /* carried over with p->lex.nextline for nextc() */
19630 rb_warn0("encountered \\r in middle of line, treated as a mere space");
19631 }
19632}
19633
19634static enum yytokentype
19635parser_yylex(struct parser_params *p)
19636{
19637 register int c;
19638 int space_seen = 0;
19639 int cmd_state;
19640 int label;
19641 enum lex_state_e last_state;
19642 int fallthru = FALSE;
19643 int token_seen = p->token_seen;
19644
19645 if (p->lex.strterm) {
19646 if (p->lex.strterm->flags & STRTERM_HEREDOC) {
19647 token_flush(p);
19648 return here_document(p, &p->lex.strterm->u.heredoc);
19649 }
19650 else {
19651 token_flush(p);
19652 return parse_string(p, &p->lex.strterm->u.literal);
19653 }
19654 }
19655 cmd_state = p->command_start;
19656 p->command_start = FALSE;
19657 p->token_seen = TRUE;
19658#ifndef RIPPER
19659 token_flush(p);
19660#endif
19661 retry:
19662 last_state = p->lex.state;
19663 switch (c = nextc(p)) {
19664 case '\0': /* NUL */
19665 case '\004': /* ^D */
19666 case '\032': /* ^Z */
19667 case -1: /* end of script. */
19668 p->eofp = 1;
19669#ifndef RIPPER
19670 if (!NIL_P(p->end_expect_token_locations) && RARRAY_LEN(p->end_expect_token_locations) > 0) {
19671 pop_end_expect_token_locations(p);
19672 RUBY_SET_YYLLOC_OF_DUMMY_END(*p->yylloc);
19673 return tDUMNY_END;
19674 }
19675#endif
19676 /* Set location for end-of-input because dispatch_scan_event is not called. */
19677 RUBY_SET_YYLLOC(*p->yylloc);
19678 return 0;
19679
19680 /* white spaces */
19681 case '\r':
19682 warn_cr(p);
19683 /* fall through */
19684 case ' ': case '\t': case '\f':
19685 case '\13': /* '\v' */
19686 space_seen = 1;
19687 while ((c = nextc(p))) {
19688 switch (c) {
19689 case '\r':
19690 warn_cr(p);
19691 /* fall through */
19692 case ' ': case '\t': case '\f':
19693 case '\13': /* '\v' */
19694 break;
19695 default:
19696 goto outofloop;
19697 }
19698 }
19699 outofloop:
19700 pushback(p, c);
19701 dispatch_scan_event(p, tSP);
19702#ifndef RIPPER
19703 token_flush(p);
19704#endif
19705 goto retry;
19706
19707 case '#': /* it's a comment */
19708 p->token_seen = token_seen;
19709 /* no magic_comment in shebang line */
19710 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
19711 if (comment_at_top(p)) {
19712 set_file_encoding(p, p->lex.pcur, p->lex.pend);
19713 }
19714 }
19715 lex_goto_eol(p);
19716 dispatch_scan_event(p, tCOMMENT);
19717 fallthru = TRUE;
19718 /* fall through */
19719 case '\n':
19720 p->token_seen = token_seen;
19721 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
19722 !IS_lex_state(EXPR_LABELED));
19723 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
19724 if (!fallthru) {
19725 dispatch_scan_event(p, tIGNORED_NL);
19726 }
19727 fallthru = FALSE;
19728 if (!c && p->ctxt.in_kwarg) {
19729 goto normal_newline;
19730 }
19731 goto retry;
19732 }
19733 while (1) {
19734 switch (c = nextc(p)) {
19735 case ' ': case '\t': case '\f': case '\r':
19736 case '\13': /* '\v' */
19737 space_seen = 1;
19738 break;
19739 case '#':
19740 pushback(p, c);
19741 if (space_seen) {
19742 dispatch_scan_event(p, tSP);
19743 token_flush(p);
19744 }
19745 goto retry;
19746 case '&':
19747 case '.': {
19748 dispatch_delayed_token(p, tIGNORED_NL);
19749 if (peek(p, '.') == (c == '&')) {
19750 pushback(p, c);
19751 dispatch_scan_event(p, tSP);
19752 goto retry;
19753 }
19754 }
19755 default:
19756 p->ruby_sourceline--;
19757 p->lex.nextline = p->lex.lastline;
19758 case -1: /* EOF no decrement*/
19759 lex_goto_eol(p);
19760 if (c != -1) {
19761 p->lex.ptok = p->lex.pcur;
19762 }
19763 goto normal_newline;
19764 }
19765 }
19766 normal_newline:
19767 p->command_start = TRUE;
19768 SET_LEX_STATE(EXPR_BEG);
19769 return '\n';
19770
19771 case '*':
19772 if ((c = nextc(p)) == '*') {
19773 if ((c = nextc(p)) == '=') {
19774 set_yylval_id(idPow);
19775 SET_LEX_STATE(EXPR_BEG);
19776 return tOP_ASGN;
19777 }
19778 pushback(p, c);
19779 if (IS_SPCARG(c)) {
19780 rb_warning0("`**' interpreted as argument prefix");
19781 c = tDSTAR;
19782 }
19783 else if (IS_BEG()) {
19784 c = tDSTAR;
19785 }
19786 else {
19787 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
19788 }
19789 }
19790 else {
19791 if (c == '=') {
19792 set_yylval_id('*');
19793 SET_LEX_STATE(EXPR_BEG);
19794 return tOP_ASGN;
19795 }
19796 pushback(p, c);
19797 if (IS_SPCARG(c)) {
19798 rb_warning0("`*' interpreted as argument prefix");
19799 c = tSTAR;
19800 }
19801 else if (IS_BEG()) {
19802 c = tSTAR;
19803 }
19804 else {
19805 c = warn_balanced('*', "*", "argument prefix");
19806 }
19807 }
19808 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19809 return c;
19810
19811 case '!':
19812 c = nextc(p);
19813 if (IS_AFTER_OPERATOR()) {
19814 SET_LEX_STATE(EXPR_ARG);
19815 if (c == '@') {
19816 return '!';
19817 }
19818 }
19819 else {
19820 SET_LEX_STATE(EXPR_BEG);
19821 }
19822 if (c == '=') {
19823 return tNEQ;
19824 }
19825 if (c == '~') {
19826 return tNMATCH;
19827 }
19828 pushback(p, c);
19829 return '!';
19830
19831 case '=':
19832 if (was_bol(p)) {
19833 /* skip embedded rd document */
19834 if (word_match_p(p, "begin", 5)) {
19835 int first_p = TRUE;
19836
19837 lex_goto_eol(p);
19838 dispatch_scan_event(p, tEMBDOC_BEG);
19839 for (;;) {
19840 lex_goto_eol(p);
19841 if (!first_p) {
19842 dispatch_scan_event(p, tEMBDOC);
19843 }
19844 first_p = FALSE;
19845 c = nextc(p);
19846 if (c == -1) {
19847 compile_error(p, "embedded document meets end of file");
19848 return 0;
19849 }
19850 if (c == '=' && word_match_p(p, "end", 3)) {
19851 break;
19852 }
19853 pushback(p, c);
19854 }
19855 lex_goto_eol(p);
19856 dispatch_scan_event(p, tEMBDOC_END);
19857 goto retry;
19858 }
19859 }
19860
19861 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19862 if ((c = nextc(p)) == '=') {
19863 if ((c = nextc(p)) == '=') {
19864 return tEQQ;
19865 }
19866 pushback(p, c);
19867 return tEQ;
19868 }
19869 if (c == '~') {
19870 return tMATCH;
19871 }
19872 else if (c == '>') {
19873 return tASSOC;
19874 }
19875 pushback(p, c);
19876 return '=';
19877
19878 case '<':
19879 c = nextc(p);
19880 if (c == '<' &&
19881 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
19882 !IS_END() &&
19883 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
19884 int token = heredoc_identifier(p);
19885 if (token) return token < 0 ? 0 : token;
19886 }
19887 if (IS_AFTER_OPERATOR()) {
19888 SET_LEX_STATE(EXPR_ARG);
19889 }
19890 else {
19891 if (IS_lex_state(EXPR_CLASS))
19892 p->command_start = TRUE;
19893 SET_LEX_STATE(EXPR_BEG);
19894 }
19895 if (c == '=') {
19896 if ((c = nextc(p)) == '>') {
19897 return tCMP;
19898 }
19899 pushback(p, c);
19900 return tLEQ;
19901 }
19902 if (c == '<') {
19903 if ((c = nextc(p)) == '=') {
19904 set_yylval_id(idLTLT);
19905 SET_LEX_STATE(EXPR_BEG);
19906 return tOP_ASGN;
19907 }
19908 pushback(p, c);
19909 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
19910 }
19911 pushback(p, c);
19912 return '<';
19913
19914 case '>':
19915 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19916 if ((c = nextc(p)) == '=') {
19917 return tGEQ;
19918 }
19919 if (c == '>') {
19920 if ((c = nextc(p)) == '=') {
19921 set_yylval_id(idGTGT);
19922 SET_LEX_STATE(EXPR_BEG);
19923 return tOP_ASGN;
19924 }
19925 pushback(p, c);
19926 return tRSHFT;
19927 }
19928 pushback(p, c);
19929 return '>';
19930
19931 case '"':
19932 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
19933 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
19934 p->lex.ptok = p->lex.pcur-1;
19935 return tSTRING_BEG;
19936
19937 case '`':
19938 if (IS_lex_state(EXPR_FNAME)) {
19939 SET_LEX_STATE(EXPR_ENDFN);
19940 return c;
19941 }
19942 if (IS_lex_state(EXPR_DOT)) {
19943 if (cmd_state)
19944 SET_LEX_STATE(EXPR_CMDARG);
19945 else
19946 SET_LEX_STATE(EXPR_ARG);
19947 return c;
19948 }
19949 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
19950 return tXSTRING_BEG;
19951
19952 case '\'':
19953 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
19954 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
19955 p->lex.ptok = p->lex.pcur-1;
19956 return tSTRING_BEG;
19957
19958 case '?':
19959 return parse_qmark(p, space_seen);
19960
19961 case '&':
19962 if ((c = nextc(p)) == '&') {
19963 SET_LEX_STATE(EXPR_BEG);
19964 if ((c = nextc(p)) == '=') {
19965 set_yylval_id(idANDOP);
19966 SET_LEX_STATE(EXPR_BEG);
19967 return tOP_ASGN;
19968 }
19969 pushback(p, c);
19970 return tANDOP;
19971 }
19972 else if (c == '=') {
19973 set_yylval_id('&');
19974 SET_LEX_STATE(EXPR_BEG);
19975 return tOP_ASGN;
19976 }
19977 else if (c == '.') {
19978 set_yylval_id(idANDDOT);
19979 SET_LEX_STATE(EXPR_DOT);
19980 return tANDDOT;
19981 }
19982 pushback(p, c);
19983 if (IS_SPCARG(c)) {
19984 if ((c != ':') ||
19985 (c = peekc_n(p, 1)) == -1 ||
19986 !(c == '\'' || c == '"' ||
19987 is_identchar((p->lex.pcur+1), p->lex.pend, p->enc))) {
19988 rb_warning0("`&' interpreted as argument prefix");
19989 }
19990 c = tAMPER;
19991 }
19992 else if (IS_BEG()) {
19993 c = tAMPER;
19994 }
19995 else {
19996 c = warn_balanced('&', "&", "argument prefix");
19997 }
19998 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
19999 return c;
20000
20001 case '|':
20002 if ((c = nextc(p)) == '|') {
20003 SET_LEX_STATE(EXPR_BEG);
20004 if ((c = nextc(p)) == '=') {
20005 set_yylval_id(idOROP);
20006 SET_LEX_STATE(EXPR_BEG);
20007 return tOP_ASGN;
20008 }
20009 pushback(p, c);
20010 if (IS_lex_state_for(last_state, EXPR_BEG)) {
20011 c = '|';
20012 pushback(p, '|');
20013 return c;
20014 }
20015 return tOROP;
20016 }
20017 if (c == '=') {
20018 set_yylval_id('|');
20019 SET_LEX_STATE(EXPR_BEG);
20020 return tOP_ASGN;
20021 }
20022 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
20023 pushback(p, c);
20024 return '|';
20025
20026 case '+':
20027 c = nextc(p);
20028 if (IS_AFTER_OPERATOR()) {
20029 SET_LEX_STATE(EXPR_ARG);
20030 if (c == '@') {
20031 return tUPLUS;
20032 }
20033 pushback(p, c);
20034 return '+';
20035 }
20036 if (c == '=') {
20037 set_yylval_id('+');
20038 SET_LEX_STATE(EXPR_BEG);
20039 return tOP_ASGN;
20040 }
20041 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
20042 SET_LEX_STATE(EXPR_BEG);
20043 pushback(p, c);
20044 if (c != -1 && ISDIGIT(c)) {
20045 return parse_numeric(p, '+');
20046 }
20047 return tUPLUS;
20048 }
20049 SET_LEX_STATE(EXPR_BEG);
20050 pushback(p, c);
20051 return warn_balanced('+', "+", "unary operator");
20052
20053 case '-':
20054 c = nextc(p);
20055 if (IS_AFTER_OPERATOR()) {
20056 SET_LEX_STATE(EXPR_ARG);
20057 if (c == '@') {
20058 return tUMINUS;
20059 }
20060 pushback(p, c);
20061 return '-';
20062 }
20063 if (c == '=') {
20064 set_yylval_id('-');
20065 SET_LEX_STATE(EXPR_BEG);
20066 return tOP_ASGN;
20067 }
20068 if (c == '>') {
20069 SET_LEX_STATE(EXPR_ENDFN);
20070 return tLAMBDA;
20071 }
20072 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
20073 SET_LEX_STATE(EXPR_BEG);
20074 pushback(p, c);
20075 if (c != -1 && ISDIGIT(c)) {
20076 return tUMINUS_NUM;
20077 }
20078 return tUMINUS;
20079 }
20080 SET_LEX_STATE(EXPR_BEG);
20081 pushback(p, c);
20082 return warn_balanced('-', "-", "unary operator");
20083
20084 case '.': {
20085 int is_beg = IS_BEG();
20086 SET_LEX_STATE(EXPR_BEG);
20087 if ((c = nextc(p)) == '.') {
20088 if ((c = nextc(p)) == '.') {
20089 if (p->ctxt.in_argdef) {
20090 SET_LEX_STATE(EXPR_ENDARG);
20091 return tBDOT3;
20092 }
20093 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
20094 rb_warn0("... at EOL, should be parenthesized?");
20095 }
20096 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
20097 if (IS_lex_state_for(last_state, EXPR_LABEL))
20098 return tDOT3;
20099 }
20100 return is_beg ? tBDOT3 : tDOT3;
20101 }
20102 pushback(p, c);
20103 return is_beg ? tBDOT2 : tDOT2;
20104 }
20105 pushback(p, c);
20106 if (c != -1 && ISDIGIT(c)) {
20107 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
20108 parse_numeric(p, '.');
20109 if (ISDIGIT(prev)) {
20110 yyerror0("unexpected fraction part after numeric literal");
20111 }
20112 else {
20113 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
20114 }
20115 SET_LEX_STATE(EXPR_END);
20116 p->lex.ptok = p->lex.pcur;
20117 goto retry;
20118 }
20119 set_yylval_id('.');
20120 SET_LEX_STATE(EXPR_DOT);
20121 return '.';
20122 }
20123
20124 case '0': case '1': case '2': case '3': case '4':
20125 case '5': case '6': case '7': case '8': case '9':
20126 return parse_numeric(p, c);
20127
20128 case ')':
20129 COND_POP();
20130 CMDARG_POP();
20131 SET_LEX_STATE(EXPR_ENDFN);
20132 p->lex.paren_nest--;
20133 return c;
20134
20135 case ']':
20136 COND_POP();
20137 CMDARG_POP();
20138 SET_LEX_STATE(EXPR_END);
20139 p->lex.paren_nest--;
20140 return c;
20141
20142 case '}':
20143 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
20144 if (!p->lex.brace_nest--) return tSTRING_DEND;
20145 COND_POP();
20146 CMDARG_POP();
20147 SET_LEX_STATE(EXPR_END);
20148 p->lex.paren_nest--;
20149 return c;
20150
20151 case ':':
20152 c = nextc(p);
20153 if (c == ':') {
20154 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
20155 SET_LEX_STATE(EXPR_BEG);
20156 return tCOLON3;
20157 }
20158 set_yylval_id(idCOLON2);
20159 SET_LEX_STATE(EXPR_DOT);
20160 return tCOLON2;
20161 }
20162 if (IS_END() || ISSPACE(c) || c == '#') {
20163 pushback(p, c);
20164 c = warn_balanced(':', ":", "symbol literal");
20165 SET_LEX_STATE(EXPR_BEG);
20166 return c;
20167 }
20168 switch (c) {
20169 case '\'':
20170 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
20171 break;
20172 case '"':
20173 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
20174 break;
20175 default:
20176 pushback(p, c);
20177 break;
20178 }
20179 SET_LEX_STATE(EXPR_FNAME);
20180 return tSYMBEG;
20181
20182 case '/':
20183 if (IS_BEG()) {
20184 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
20185 return tREGEXP_BEG;
20186 }
20187 if ((c = nextc(p)) == '=') {
20188 set_yylval_id('/');
20189 SET_LEX_STATE(EXPR_BEG);
20190 return tOP_ASGN;
20191 }
20192 pushback(p, c);
20193 if (IS_SPCARG(c)) {
20194 arg_ambiguous(p, '/');
20195 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
20196 return tREGEXP_BEG;
20197 }
20198 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20199 return warn_balanced('/', "/", "regexp literal");
20200
20201 case '^':
20202 if ((c = nextc(p)) == '=') {
20203 set_yylval_id('^');
20204 SET_LEX_STATE(EXPR_BEG);
20205 return tOP_ASGN;
20206 }
20207 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
20208 pushback(p, c);
20209 return '^';
20210
20211 case ';':
20212 SET_LEX_STATE(EXPR_BEG);
20213 p->command_start = TRUE;
20214 return ';';
20215
20216 case ',':
20217 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20218 return ',';
20219
20220 case '~':
20221 if (IS_AFTER_OPERATOR()) {
20222 if ((c = nextc(p)) != '@') {
20223 pushback(p, c);
20224 }
20225 SET_LEX_STATE(EXPR_ARG);
20226 }
20227 else {
20228 SET_LEX_STATE(EXPR_BEG);
20229 }
20230 return '~';
20231
20232 case '(':
20233 if (IS_BEG()) {
20234 c = tLPAREN;
20235 }
20236 else if (!space_seen) {
20237 /* foo( ... ) => method call, no ambiguity */
20238 }
20239 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
20240 c = tLPAREN_ARG;
20241 }
20242 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
20243 rb_warning0("parentheses after method name is interpreted as "
20244 "an argument list, not a decomposed argument");
20245 }
20246 p->lex.paren_nest++;
20247 COND_PUSH(0);
20248 CMDARG_PUSH(0);
20249 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20250 return c;
20251
20252 case '[':
20253 p->lex.paren_nest++;
20254 if (IS_AFTER_OPERATOR()) {
20255 if ((c = nextc(p)) == ']') {
20256 p->lex.paren_nest--;
20257 SET_LEX_STATE(EXPR_ARG);
20258 if ((c = nextc(p)) == '=') {
20259 return tASET;
20260 }
20261 pushback(p, c);
20262 return tAREF;
20263 }
20264 pushback(p, c);
20265 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
20266 return '[';
20267 }
20268 else if (IS_BEG()) {
20269 c = tLBRACK;
20270 }
20271 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
20272 c = tLBRACK;
20273 }
20274 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20275 COND_PUSH(0);
20276 CMDARG_PUSH(0);
20277 return c;
20278
20279 case '{':
20280 ++p->lex.brace_nest;
20281 if (lambda_beginning_p())
20282 c = tLAMBEG;
20283 else if (IS_lex_state(EXPR_LABELED))
20284 c = tLBRACE; /* hash */
20285 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
20286 c = '{'; /* block (primary) */
20287 else if (IS_lex_state(EXPR_ENDARG))
20288 c = tLBRACE_ARG; /* block (expr) */
20289 else
20290 c = tLBRACE; /* hash */
20291 if (c != tLBRACE) {
20292 p->command_start = TRUE;
20293 SET_LEX_STATE(EXPR_BEG);
20294 }
20295 else {
20296 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
20297 }
20298 ++p->lex.paren_nest; /* after lambda_beginning_p() */
20299 COND_PUSH(0);
20300 CMDARG_PUSH(0);
20301 return c;
20302
20303 case '\\':
20304 c = nextc(p);
20305 if (c == '\n') {
20306 space_seen = 1;
20307 dispatch_scan_event(p, tSP);
20308 goto retry; /* skip \\n */
20309 }
20310 if (c == ' ') return tSP;
20311 if (ISSPACE(c)) return c;
20312 pushback(p, c);
20313 return '\\';
20314
20315 case '%':
20316 return parse_percent(p, space_seen, last_state);
20317
20318 case '$':
20319 return parse_gvar(p, last_state);
20320
20321 case '@':
20322 return parse_atmark(p, last_state);
20323
20324 case '_':
20325 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
20326 p->ruby__end__seen = 1;
20327 p->eofp = 1;
20328#ifndef RIPPER
20329 return -1;
20330#else
20331 lex_goto_eol(p);
20332 dispatch_scan_event(p, k__END__);
20333 return 0;
20334#endif
20335 }
20336 newtok(p);
20337 break;
20338
20339 default:
20340 if (!parser_is_identchar(p)) {
20341 compile_error(p, "Invalid char `\\x%02X' in expression", c);
20342 token_flush(p);
20343 goto retry;
20344 }
20345
20346 newtok(p);
20347 break;
20348 }
20349
20350 return parse_ident(p, c, cmd_state);
20351}
20352
20353static enum yytokentype
20354yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
20355{
20356 enum yytokentype t;
20357
20358 p->lval = lval;
20359 lval->val = Qundef;
20360 p->yylloc = yylloc;
20361
20362 t = parser_yylex(p);
20363
20364 if (has_delayed_token(p))
20365 dispatch_delayed_token(p, t);
20366 else if (t != 0)
20367 dispatch_scan_event(p, t);
20368
20369 return t;
20370}
20371
20372#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
20373
20374static NODE*
20375node_newnode(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2, const rb_code_location_t *loc)
20376{
20377 NODE *n = rb_ast_newnode(p->ast, type);
20378
20379 rb_node_init(n, type, a0, a1, a2);
20380
20381 nd_set_loc(n, loc);
20382 nd_set_node_id(n, parser_get_node_id(p));
20383 return n;
20384}
20385
20386static NODE *
20387nd_set_loc(NODE *nd, const YYLTYPE *loc)
20388{
20389 nd->nd_loc = *loc;
20390 nd_set_line(nd, loc->beg_pos.lineno);
20391 return nd;
20392}
20393
20394#ifndef RIPPER
20395static enum node_type
20396nodetype(NODE *node) /* for debug */
20397{
20398 return (enum node_type)nd_type(node);
20399}
20400
20401static int
20402nodeline(NODE *node)
20403{
20404 return nd_line(node);
20405}
20406
20407static NODE*
20408newline_node(NODE *node)
20409{
20410 if (node) {
20411 node = remove_begin(node);
20412 node->flags |= NODE_FL_NEWLINE;
20413 }
20414 return node;
20415}
20416
20417static void
20418fixpos(NODE *node, NODE *orig)
20419{
20420 if (!node) return;
20421 if (!orig) return;
20422 nd_set_line(node, nd_line(orig));
20423}
20424
20425static void
20426parser_warning(struct parser_params *p, NODE *node, const char *mesg)
20427{
20428 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
20429}
20430
20431static void
20432parser_warn(struct parser_params *p, NODE *node, const char *mesg)
20433{
20434 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
20435}
20436
20437static NODE*
20438block_append(struct parser_params *p, NODE *head, NODE *tail)
20439{
20440 NODE *end, *h = head, *nd;
20441
20442 if (tail == 0) return head;
20443
20444 if (h == 0) return tail;
20445 switch (nd_type(h)) {
20446 case NODE_LIT:
20447 case NODE_STR:
20448 case NODE_SELF:
20449 case NODE_TRUE:
20450 case NODE_FALSE:
20451 case NODE_NIL:
20452 parser_warning(p, h, "unused literal ignored");
20453 return tail;
20454 default:
20455 h = end = NEW_BLOCK(head, &head->nd_loc);
20456 end->nd_end = end;
20457 head = end;
20458 break;
20459 case NODE_BLOCK:
20460 end = h->nd_end;
20461 break;
20462 }
20463
20464 nd = end->nd_head;
20465 switch (nd_type(nd)) {
20466 case NODE_RETURN:
20467 case NODE_BREAK:
20468 case NODE_NEXT:
20469 case NODE_REDO:
20470 case NODE_RETRY:
20471 if (RTEST(ruby_verbose)) {
20472 parser_warning(p, tail, "statement not reached");
20473 }
20474 break;
20475
20476 default:
20477 break;
20478 }
20479
20480 if (!nd_type_p(tail, NODE_BLOCK)) {
20481 tail = NEW_BLOCK(tail, &tail->nd_loc);
20482 tail->nd_end = tail;
20483 }
20484 end->nd_next = tail;
20485 h->nd_end = tail->nd_end;
20486 nd_set_last_loc(head, nd_last_loc(tail));
20487 return head;
20488}
20489
20490/* append item to the list */
20491static NODE*
20492list_append(struct parser_params *p, NODE *list, NODE *item)
20493{
20494 NODE *last;
20495
20496 if (list == 0) return NEW_LIST(item, &item->nd_loc);
20497 if (list->nd_next) {
20498 last = list->nd_next->nd_end;
20499 }
20500 else {
20501 last = list;
20502 }
20503
20504 list->nd_alen += 1;
20505 last->nd_next = NEW_LIST(item, &item->nd_loc);
20506 list->nd_next->nd_end = last->nd_next;
20507
20508 nd_set_last_loc(list, nd_last_loc(item));
20509
20510 return list;
20511}
20512
20513/* concat two lists */
20514static NODE*
20515list_concat(NODE *head, NODE *tail)
20516{
20517 NODE *last;
20518
20519 if (head->nd_next) {
20520 last = head->nd_next->nd_end;
20521 }
20522 else {
20523 last = head;
20524 }
20525
20526 head->nd_alen += tail->nd_alen;
20527 last->nd_next = tail;
20528 if (tail->nd_next) {
20529 head->nd_next->nd_end = tail->nd_next->nd_end;
20530 }
20531 else {
20532 head->nd_next->nd_end = tail;
20533 }
20534
20535 nd_set_last_loc(head, nd_last_loc(tail));
20536
20537 return head;
20538}
20539
20540static int
20541literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
20542{
20543 if (NIL_P(tail)) return 1;
20544 if (!rb_enc_compatible(head, tail)) {
20545 compile_error(p, "string literal encodings differ (%s / %s)",
20546 rb_enc_name(rb_enc_get(head)),
20547 rb_enc_name(rb_enc_get(tail)));
20548 rb_str_resize(head, 0);
20549 rb_str_resize(tail, 0);
20550 return 0;
20551 }
20552 rb_str_buf_append(head, tail);
20553 return 1;
20554}
20555
20556static VALUE
20557string_literal_head(enum node_type htype, NODE *head)
20558{
20559 if (htype != NODE_DSTR) return Qfalse;
20560 if (head->nd_next) {
20561 head = head->nd_next->nd_end->nd_head;
20562 if (!head || !nd_type_p(head, NODE_STR)) return Qfalse;
20563 }
20564 const VALUE lit = head->nd_lit;
20565 ASSUME(lit != Qfalse);
20566 return lit;
20567}
20568
20569/* concat two string literals */
20570static NODE *
20571literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
20572{
20573 enum node_type htype;
20574 VALUE lit;
20575
20576 if (!head) return tail;
20577 if (!tail) return head;
20578
20579 htype = nd_type(head);
20580 if (htype == NODE_EVSTR) {
20581 head = new_dstr(p, head, loc);
20582 htype = NODE_DSTR;
20583 }
20584 if (p->heredoc_indent > 0) {
20585 switch (htype) {
20586 case NODE_STR:
20587 nd_set_type(head, NODE_DSTR);
20588 case NODE_DSTR:
20589 return list_append(p, head, tail);
20590 default:
20591 break;
20592 }
20593 }
20594 switch (nd_type(tail)) {
20595 case NODE_STR:
20596 if ((lit = string_literal_head(htype, head)) != Qfalse) {
20597 htype = NODE_STR;
20598 }
20599 else {
20600 lit = head->nd_lit;
20601 }
20602 if (htype == NODE_STR) {
20603 if (!literal_concat0(p, lit, tail->nd_lit)) {
20604 error:
20605 rb_discard_node(p, head);
20606 rb_discard_node(p, tail);
20607 return 0;
20608 }
20609 rb_discard_node(p, tail);
20610 }
20611 else {
20612 list_append(p, head, tail);
20613 }
20614 break;
20615
20616 case NODE_DSTR:
20617 if (htype == NODE_STR) {
20618 if (!literal_concat0(p, head->nd_lit, tail->nd_lit))
20619 goto error;
20620 tail->nd_lit = head->nd_lit;
20621 rb_discard_node(p, head);
20622 head = tail;
20623 }
20624 else if (NIL_P(tail->nd_lit)) {
20625 append:
20626 head->nd_alen += tail->nd_alen - 1;
20627 if (!head->nd_next) {
20628 head->nd_next = tail->nd_next;
20629 }
20630 else if (tail->nd_next) {
20631 head->nd_next->nd_end->nd_next = tail->nd_next;
20632 head->nd_next->nd_end = tail->nd_next->nd_end;
20633 }
20634 rb_discard_node(p, tail);
20635 }
20636 else if ((lit = string_literal_head(htype, head)) != Qfalse) {
20637 if (!literal_concat0(p, lit, tail->nd_lit))
20638 goto error;
20639 tail->nd_lit = Qnil;
20640 goto append;
20641 }
20642 else {
20643 list_concat(head, NEW_NODE(NODE_LIST, NEW_STR(tail->nd_lit, loc), tail->nd_alen, tail->nd_next, loc));
20644 }
20645 break;
20646
20647 case NODE_EVSTR:
20648 if (htype == NODE_STR) {
20649 nd_set_type(head, NODE_DSTR);
20650 head->nd_alen = 1;
20651 }
20652 list_append(p, head, tail);
20653 break;
20654 }
20655 return head;
20656}
20657
20658static NODE *
20659evstr2dstr(struct parser_params *p, NODE *node)
20660{
20661 if (nd_type_p(node, NODE_EVSTR)) {
20662 node = new_dstr(p, node, &node->nd_loc);
20663 }
20664 return node;
20665}
20666
20667static NODE *
20668new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
20669{
20670 NODE *head = node;
20671
20672 if (node) {
20673 switch (nd_type(node)) {
20674 case NODE_STR:
20675 nd_set_type(node, NODE_DSTR);
20676 return node;
20677 case NODE_DSTR:
20678 break;
20679 case NODE_EVSTR:
20680 return node;
20681 }
20682 }
20683 return NEW_EVSTR(head, loc);
20684}
20685
20686static NODE *
20687new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
20688{
20689 VALUE lit = STR_NEW0();
20690 NODE *dstr = NEW_DSTR(lit, loc);
20691 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
20692 return list_append(p, dstr, node);
20693}
20694
20695static NODE *
20696call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
20697 const YYLTYPE *op_loc, const YYLTYPE *loc)
20698{
20699 NODE *expr;
20700 value_expr(recv);
20701 value_expr(arg1);
20702 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
20703 nd_set_line(expr, op_loc->beg_pos.lineno);
20704 return expr;
20705}
20706
20707static NODE *
20708call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
20709{
20710 NODE *opcall;
20711 value_expr(recv);
20712 opcall = NEW_OPCALL(recv, id, 0, loc);
20713 nd_set_line(opcall, op_loc->beg_pos.lineno);
20714 return opcall;
20715}
20716
20717static NODE *
20718new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
20719{
20720 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
20721 nd_set_line(qcall, op_loc->beg_pos.lineno);
20722 return qcall;
20723}
20724
20725static NODE*
20726new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
20727{
20728 NODE *ret;
20729 if (block) block_dup_check(p, args, block);
20730 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
20731 if (block) ret = method_add_block(p, ret, block, loc);
20732 fixpos(ret, recv);
20733 return ret;
20734}
20735
20736#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? (node)->nd_body : node)
20737static NODE*
20738match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
20739{
20740 NODE *n;
20741 int line = op_loc->beg_pos.lineno;
20742
20743 value_expr(node1);
20744 value_expr(node2);
20745 if (node1 && (n = nd_once_body(node1)) != 0) {
20746 switch (nd_type(n)) {
20747 case NODE_DREGX:
20748 {
20749 NODE *match = NEW_MATCH2(node1, node2, loc);
20750 nd_set_line(match, line);
20751 return match;
20752 }
20753
20754 case NODE_LIT:
20755 if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
20756 const VALUE lit = n->nd_lit;
20757 NODE *match = NEW_MATCH2(node1, node2, loc);
20758 match->nd_args = reg_named_capture_assign(p, lit, loc);
20759 nd_set_line(match, line);
20760 return match;
20761 }
20762 }
20763 }
20764
20765 if (node2 && (n = nd_once_body(node2)) != 0) {
20766 NODE *match3;
20767
20768 switch (nd_type(n)) {
20769 case NODE_LIT:
20770 if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
20771 /* fallthru */
20772 case NODE_DREGX:
20773 match3 = NEW_MATCH3(node2, node1, loc);
20774 return match3;
20775 }
20776 }
20777
20778 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
20779 nd_set_line(n, line);
20780 return n;
20781}
20782
20783# if WARN_PAST_SCOPE
20784static int
20785past_dvar_p(struct parser_params *p, ID id)
20786{
20787 struct vtable *past = p->lvtbl->past;
20788 while (past) {
20789 if (vtable_included(past, id)) return 1;
20790 past = past->prev;
20791 }
20792 return 0;
20793}
20794# endif
20795
20796static int
20797numparam_nested_p(struct parser_params *p)
20798{
20799 struct local_vars *local = p->lvtbl;
20800 NODE *outer = local->numparam.outer;
20801 NODE *inner = local->numparam.inner;
20802 if (outer || inner) {
20803 NODE *used = outer ? outer : inner;
20804 compile_error(p, "numbered parameter is already used in\n"
20805 "%s:%d: %s block here",
20806 p->ruby_sourcefile, nd_line(used),
20807 outer ? "outer" : "inner");
20808 parser_show_error_line(p, &used->nd_loc);
20809 return 1;
20810 }
20811 return 0;
20812}
20813
20814static NODE*
20815gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
20816{
20817 ID *vidp = NULL;
20818 NODE *node;
20819 switch (id) {
20820 case keyword_self:
20821 return NEW_SELF(loc);
20822 case keyword_nil:
20823 return NEW_NIL(loc);
20824 case keyword_true:
20825 return NEW_TRUE(loc);
20826 case keyword_false:
20827 return NEW_FALSE(loc);
20828 case keyword__FILE__:
20829 {
20830 VALUE file = p->ruby_sourcefile_string;
20831 if (NIL_P(file))
20832 file = rb_str_new(0, 0);
20833 else
20834 file = rb_str_dup(file);
20835 node = NEW_STR(file, loc);
20836 RB_OBJ_WRITTEN(p->ast, Qnil, file);
20837 }
20838 return node;
20839 case keyword__LINE__:
20840 return NEW_LIT(INT2FIX(p->tokline), loc);
20841 case keyword__ENCODING__:
20842 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
20843 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
20844 return node;
20845
20846 }
20847 switch (id_type(id)) {
20848 case ID_LOCAL:
20849 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
20850 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
20851 if (id == p->cur_arg) {
20852 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
20853 return 0;
20854 }
20855 if (vidp) *vidp |= LVAR_USED;
20856 node = NEW_DVAR(id, loc);
20857 return node;
20858 }
20859 if (local_id_ref(p, id, &vidp)) {
20860 if (id == p->cur_arg) {
20861 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
20862 return 0;
20863 }
20864 if (vidp) *vidp |= LVAR_USED;
20865 node = NEW_LVAR(id, loc);
20866 return node;
20867 }
20868 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
20869 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
20870 if (numparam_nested_p(p)) return 0;
20871 node = NEW_DVAR(id, loc);
20872 struct local_vars *local = p->lvtbl;
20873 if (!local->numparam.current) local->numparam.current = node;
20874 return node;
20875 }
20876# if WARN_PAST_SCOPE
20877 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
20878 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
20879 }
20880# endif
20881 /* method call without arguments */
20882 return NEW_VCALL(id, loc);
20883 case ID_GLOBAL:
20884 return NEW_GVAR(id, loc);
20885 case ID_INSTANCE:
20886 return NEW_IVAR(id, loc);
20887 case ID_CONST:
20888 return NEW_CONST(id, loc);
20889 case ID_CLASS:
20890 return NEW_CVAR(id, loc);
20891 }
20892 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
20893 return 0;
20894}
20895
20896static NODE *
20897opt_arg_append(NODE *opt_list, NODE *opt)
20898{
20899 NODE *opts = opt_list;
20900 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
20901
20902 while (opts->nd_next) {
20903 opts = opts->nd_next;
20904 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
20905 }
20906 opts->nd_next = opt;
20907
20908 return opt_list;
20909}
20910
20911static NODE *
20912kwd_append(NODE *kwlist, NODE *kw)
20913{
20914 if (kwlist) {
20915 opt_arg_append(kwlist, kw);
20916 }
20917 return kwlist;
20918}
20919
20920static NODE *
20921new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
20922{
20923 return NEW_DEFINED(remove_begin_all(expr), loc);
20924}
20925
20926static NODE*
20927symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
20928{
20929 enum node_type type = nd_type(symbol);
20930 switch (type) {
20931 case NODE_DSTR:
20932 nd_set_type(symbol, NODE_DSYM);
20933 break;
20934 case NODE_STR:
20935 nd_set_type(symbol, NODE_LIT);
20936 RB_OBJ_WRITTEN(p->ast, Qnil, symbol->nd_lit = rb_str_intern(symbol->nd_lit));
20937 break;
20938 default:
20939 compile_error(p, "unexpected node as symbol: %s", ruby_node_name(type));
20940 }
20941 return list_append(p, symbols, symbol);
20942}
20943
20944static NODE *
20945new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
20946{
20947 NODE *list, *prev;
20948 VALUE lit;
20949
20950 if (!node) {
20951 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
20952 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
20953 return node;
20954 }
20955 switch (nd_type(node)) {
20956 case NODE_STR:
20957 {
20958 VALUE src = node->nd_lit;
20959 nd_set_type(node, NODE_LIT);
20960 nd_set_loc(node, loc);
20961 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
20962 }
20963 break;
20964 default:
20965 lit = STR_NEW0();
20966 node = NEW_NODE(NODE_DSTR, lit, 1, NEW_LIST(node, loc), loc);
20967 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
20968 /* fall through */
20969 case NODE_DSTR:
20970 nd_set_type(node, NODE_DREGX);
20971 nd_set_loc(node, loc);
20972 node->nd_cflag = options & RE_OPTION_MASK;
20973 if (!NIL_P(node->nd_lit)) reg_fragment_check(p, node->nd_lit, options);
20974 for (list = (prev = node)->nd_next; list; list = list->nd_next) {
20975 NODE *frag = list->nd_head;
20976 enum node_type type = nd_type(frag);
20977 if (type == NODE_STR || (type == NODE_DSTR && !frag->nd_next)) {
20978 VALUE tail = frag->nd_lit;
20979 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(prev->nd_lit)) {
20980 VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
20981 if (!literal_concat0(p, lit, tail)) {
20982 return NEW_NIL(loc); /* dummy node on error */
20983 }
20984 rb_str_resize(tail, 0);
20985 prev->nd_next = list->nd_next;
20986 rb_discard_node(p, list->nd_head);
20987 rb_discard_node(p, list);
20988 list = prev;
20989 }
20990 else {
20991 prev = list;
20992 }
20993 }
20994 else {
20995 prev = 0;
20996 }
20997 }
20998 if (!node->nd_next) {
20999 VALUE src = node->nd_lit;
21000 nd_set_type(node, NODE_LIT);
21001 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
21002 }
21003 if (options & RE_OPTION_ONCE) {
21004 node = NEW_NODE(NODE_ONCE, 0, node, 0, loc);
21005 }
21006 break;
21007 }
21008 return node;
21009}
21010
21011static NODE *
21012new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
21013{
21014 if (!k) return 0;
21015 return NEW_KW_ARG(0, (k), loc);
21016}
21017
21018static NODE *
21019new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
21020{
21021 if (!node) {
21022 VALUE lit = STR_NEW0();
21023 NODE *xstr = NEW_XSTR(lit, loc);
21024 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
21025 return xstr;
21026 }
21027 switch (nd_type(node)) {
21028 case NODE_STR:
21029 nd_set_type(node, NODE_XSTR);
21030 nd_set_loc(node, loc);
21031 break;
21032 case NODE_DSTR:
21033 nd_set_type(node, NODE_DXSTR);
21034 nd_set_loc(node, loc);
21035 break;
21036 default:
21037 node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node, loc), loc);
21038 break;
21039 }
21040 return node;
21041}
21042
21043static void
21044check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
21045{
21046 VALUE lit;
21047
21048 if (!arg || !p->case_labels) return;
21049
21050 lit = rb_node_case_when_optimizable_literal(arg);
21051 if (UNDEF_P(lit)) return;
21052 if (nd_type_p(arg, NODE_STR)) {
21053 RB_OBJ_WRITTEN(p->ast, Qnil, arg->nd_lit = lit);
21054 }
21055
21056 if (NIL_P(p->case_labels)) {
21057 p->case_labels = rb_obj_hide(rb_hash_new());
21058 }
21059 else {
21060 VALUE line = rb_hash_lookup(p->case_labels, lit);
21061 if (!NIL_P(line)) {
21062 rb_warning1("duplicated `when' clause with line %d is ignored",
21063 WARN_IVAL(line));
21064 return;
21065 }
21066 }
21067 rb_hash_aset(p->case_labels, lit, INT2NUM(p->ruby_sourceline));
21068}
21069
21070#else /* !RIPPER */
21071static int
21072id_is_var(struct parser_params *p, ID id)
21073{
21074 if (is_notop_id(id)) {
21075 switch (id & ID_SCOPE_MASK) {
21076 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
21077 return 1;
21078 case ID_LOCAL:
21079 if (dyna_in_block(p)) {
21080 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
21081 }
21082 if (local_id(p, id)) return 1;
21083 /* method call without arguments */
21084 return 0;
21085 }
21086 }
21087 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
21088 return 0;
21089}
21090
21091static VALUE
21092new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
21093{
21094 VALUE src = 0, err;
21095 int options = 0;
21096 if (ripper_is_node_yylval(re)) {
21097 src = RNODE(re)->nd_cval;
21098 re = RNODE(re)->nd_rval;
21099 }
21100 if (ripper_is_node_yylval(opt)) {
21101 options = (int)RNODE(opt)->nd_tag;
21102 opt = RNODE(opt)->nd_rval;
21103 }
21104 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
21105 compile_error(p, "%"PRIsVALUE, err);
21106 }
21107 return dispatch2(regexp_literal, re, opt);
21108}
21109#endif /* !RIPPER */
21110
21111static inline enum lex_state_e
21112parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
21113{
21114 if (p->debug) {
21115 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
21116 }
21117 return p->lex.state = ls;
21118}
21119
21120#ifndef RIPPER
21121static const char rb_parser_lex_state_names[][8] = {
21122 "BEG", "END", "ENDARG", "ENDFN", "ARG",
21123 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
21124 "LABEL", "LABELED","FITEM",
21125};
21126
21127static VALUE
21128append_lex_state_name(enum lex_state_e state, VALUE buf)
21129{
21130 int i, sep = 0;
21131 unsigned int mask = 1;
21132 static const char none[] = "NONE";
21133
21134 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
21135 if ((unsigned)state & mask) {
21136 if (sep) {
21137 rb_str_cat(buf, "|", 1);
21138 }
21139 sep = 1;
21140 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
21141 }
21142 }
21143 if (!sep) {
21144 rb_str_cat(buf, none, sizeof(none)-1);
21145 }
21146 return buf;
21147}
21148
21149static void
21150flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
21151{
21152 VALUE mesg = p->debug_buffer;
21153
21154 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
21155 p->debug_buffer = Qnil;
21156 rb_io_puts(1, &mesg, out);
21157 }
21158 if (!NIL_P(str) && RSTRING_LEN(str)) {
21159 rb_io_write(p->debug_output, str);
21160 }
21161}
21162
21163enum lex_state_e
21164rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
21165 enum lex_state_e to, int line)
21166{
21167 VALUE mesg;
21168 mesg = rb_str_new_cstr("lex_state: ");
21169 append_lex_state_name(from, mesg);
21170 rb_str_cat_cstr(mesg, " -> ");
21171 append_lex_state_name(to, mesg);
21172 rb_str_catf(mesg, " at line %d\n", line);
21173 flush_debug_buffer(p, p->debug_output, mesg);
21174 return to;
21175}
21176
21177VALUE
21178rb_parser_lex_state_name(enum lex_state_e state)
21179{
21180 return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
21181}
21182
21183static void
21184append_bitstack_value(stack_type stack, VALUE mesg)
21185{
21186 if (stack == 0) {
21187 rb_str_cat_cstr(mesg, "0");
21188 }
21189 else {
21190 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
21191 for (; mask && !(stack & mask); mask >>= 1) continue;
21192 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
21193 }
21194}
21195
21196void
21197rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
21198 const char *name, int line)
21199{
21200 VALUE mesg = rb_sprintf("%s: ", name);
21201 append_bitstack_value(stack, mesg);
21202 rb_str_catf(mesg, " at line %d\n", line);
21203 flush_debug_buffer(p, p->debug_output, mesg);
21204}
21205
21206void
21207rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
21208{
21209 va_list ap;
21210 VALUE mesg = rb_str_new_cstr("internal parser error: ");
21211
21212 va_start(ap, fmt);
21213 rb_str_vcatf(mesg, fmt, ap);
21214 va_end(ap);
21215 yyerror0(RSTRING_PTR(mesg));
21216 RB_GC_GUARD(mesg);
21217
21218 mesg = rb_str_new(0, 0);
21219 append_lex_state_name(p->lex.state, mesg);
21220 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
21221 rb_str_resize(mesg, 0);
21222 append_bitstack_value(p->cond_stack, mesg);
21223 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
21224 rb_str_resize(mesg, 0);
21225 append_bitstack_value(p->cmdarg_stack, mesg);
21226 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
21227 if (p->debug_output == rb_ractor_stdout())
21228 p->debug_output = rb_ractor_stderr();
21229 p->debug = TRUE;
21230}
21231
21232static YYLTYPE *
21233rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
21234{
21235 yylloc->beg_pos.lineno = sourceline;
21236 yylloc->beg_pos.column = beg_pos;
21237 yylloc->end_pos.lineno = sourceline;
21238 yylloc->end_pos.column = end_pos;
21239 return yylloc;
21240}
21241
21242YYLTYPE *
21243rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
21244{
21245 int sourceline = here->sourceline;
21246 int beg_pos = (int)here->offset - here->quote
21247 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
21248 int end_pos = (int)here->offset + here->length + here->quote;
21249
21250 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21251}
21252
21253YYLTYPE *
21254rb_parser_set_location_of_delayed_token(struct parser_params *p, YYLTYPE *yylloc)
21255{
21256 yylloc->beg_pos.lineno = p->delayed.beg_line;
21257 yylloc->beg_pos.column = p->delayed.beg_col;
21258 yylloc->end_pos.lineno = p->delayed.end_line;
21259 yylloc->end_pos.column = p->delayed.end_col;
21260
21261 return yylloc;
21262}
21263
21264YYLTYPE *
21265rb_parser_set_location_of_heredoc_end(struct parser_params *p, YYLTYPE *yylloc)
21266{
21267 int sourceline = p->ruby_sourceline;
21268 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21269 int end_pos = (int)(p->lex.pend - p->lex.pbeg);
21270 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21271}
21272
21273YYLTYPE *
21274rb_parser_set_location_of_dummy_end(struct parser_params *p, YYLTYPE *yylloc)
21275{
21276 yylloc->end_pos = yylloc->beg_pos;
21277
21278 return yylloc;
21279}
21280
21281YYLTYPE *
21282rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
21283{
21284 int sourceline = p->ruby_sourceline;
21285 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21286 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
21287 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21288}
21289
21290YYLTYPE *
21291rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
21292{
21293 int sourceline = p->ruby_sourceline;
21294 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
21295 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
21296 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
21297}
21298#endif /* !RIPPER */
21299
21300static int
21301assignable0(struct parser_params *p, ID id, const char **err)
21302{
21303 if (!id) return -1;
21304 switch (id) {
21305 case keyword_self:
21306 *err = "Can't change the value of self";
21307 return -1;
21308 case keyword_nil:
21309 *err = "Can't assign to nil";
21310 return -1;
21311 case keyword_true:
21312 *err = "Can't assign to true";
21313 return -1;
21314 case keyword_false:
21315 *err = "Can't assign to false";
21316 return -1;
21317 case keyword__FILE__:
21318 *err = "Can't assign to __FILE__";
21319 return -1;
21320 case keyword__LINE__:
21321 *err = "Can't assign to __LINE__";
21322 return -1;
21323 case keyword__ENCODING__:
21324 *err = "Can't assign to __ENCODING__";
21325 return -1;
21326 }
21327 switch (id_type(id)) {
21328 case ID_LOCAL:
21329 if (dyna_in_block(p)) {
21330 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
21331 compile_error(p, "Can't assign to numbered parameter _%d",
21332 NUMPARAM_ID_TO_IDX(id));
21333 return -1;
21334 }
21335 if (dvar_curr(p, id)) return NODE_DASGN;
21336 if (dvar_defined(p, id)) return NODE_DASGN;
21337 if (local_id(p, id)) return NODE_LASGN;
21338 dyna_var(p, id);
21339 return NODE_DASGN;
21340 }
21341 else {
21342 if (!local_id(p, id)) local_var(p, id);
21343 return NODE_LASGN;
21344 }
21345 break;
21346 case ID_GLOBAL: return NODE_GASGN;
21347 case ID_INSTANCE: return NODE_IASGN;
21348 case ID_CONST:
21349 if (!p->ctxt.in_def) return NODE_CDECL;
21350 *err = "dynamic constant assignment";
21351 return -1;
21352 case ID_CLASS: return NODE_CVASGN;
21353 default:
21354 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
21355 }
21356 return -1;
21357}
21358
21359#ifndef RIPPER
21360static NODE*
21361assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
21362{
21363 const char *err = 0;
21364 int node_type = assignable0(p, id, &err);
21365 switch (node_type) {
21366 case NODE_DASGN: return NEW_DASGN(id, val, loc);
21367 case NODE_LASGN: return NEW_LASGN(id, val, loc);
21368 case NODE_GASGN: return NEW_GASGN(id, val, loc);
21369 case NODE_IASGN: return NEW_IASGN(id, val, loc);
21370 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
21371 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
21372 }
21373 if (err) yyerror1(loc, err);
21374 return NEW_BEGIN(0, loc);
21375}
21376#else
21377static VALUE
21378assignable(struct parser_params *p, VALUE lhs)
21379{
21380 const char *err = 0;
21381 assignable0(p, get_id(lhs), &err);
21382 if (err) lhs = assign_error(p, err, lhs);
21383 return lhs;
21384}
21385#endif
21386
21387static int
21388is_private_local_id(ID name)
21389{
21390 VALUE s;
21391 if (name == idUScore) return 1;
21392 if (!is_local_id(name)) return 0;
21393 s = rb_id2str(name);
21394 if (!s) return 0;
21395 return RSTRING_PTR(s)[0] == '_';
21396}
21397
21398static int
21399shadowing_lvar_0(struct parser_params *p, ID name)
21400{
21401 if (dyna_in_block(p)) {
21402 if (dvar_curr(p, name)) {
21403 if (is_private_local_id(name)) return 1;
21404 yyerror0("duplicated argument name");
21405 }
21406 else if (dvar_defined(p, name) || local_id(p, name)) {
21407 vtable_add(p->lvtbl->vars, name);
21408 if (p->lvtbl->used) {
21409 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
21410 }
21411 return 0;
21412 }
21413 }
21414 else {
21415 if (local_id(p, name)) {
21416 if (is_private_local_id(name)) return 1;
21417 yyerror0("duplicated argument name");
21418 }
21419 }
21420 return 1;
21421}
21422
21423static ID
21424shadowing_lvar(struct parser_params *p, ID name)
21425{
21426 shadowing_lvar_0(p, name);
21427 return name;
21428}
21429
21430static void
21431new_bv(struct parser_params *p, ID name)
21432{
21433 if (!name) return;
21434 if (!is_local_id(name)) {
21435 compile_error(p, "invalid local variable - %"PRIsVALUE,
21436 rb_id2str(name));
21437 return;
21438 }
21439 if (!shadowing_lvar_0(p, name)) return;
21440 dyna_var(p, name);
21441}
21442
21443#ifndef RIPPER
21444static NODE *
21445aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
21446{
21447 return NEW_ATTRASGN(recv, tASET, idx, loc);
21448}
21449
21450static void
21451block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
21452{
21453 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
21454 compile_error(p, "both block arg and actual block given");
21455 }
21456}
21457
21458static NODE *
21459attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
21460{
21461 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
21462 return NEW_ATTRASGN(recv, id, 0, loc);
21463}
21464
21465static void
21466rb_backref_error(struct parser_params *p, NODE *node)
21467{
21468 switch (nd_type(node)) {
21469 case NODE_NTH_REF:
21470 compile_error(p, "Can't set variable $%ld", node->nd_nth);
21471 break;
21472 case NODE_BACK_REF:
21473 compile_error(p, "Can't set variable $%c", (int)node->nd_nth);
21474 break;
21475 }
21476}
21477#else
21478static VALUE
21479backref_error(struct parser_params *p, NODE *ref, VALUE expr)
21480{
21481 VALUE mesg = rb_str_new_cstr("Can't set variable ");
21482 rb_str_append(mesg, ref->nd_cval);
21483 return dispatch2(assign_error, mesg, expr);
21484}
21485#endif
21486
21487#ifndef RIPPER
21488static NODE *
21489arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
21490{
21491 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
21492 switch (nd_type(node1)) {
21493 case NODE_LIST:
21494 return list_append(p, node1, node2);
21495 case NODE_BLOCK_PASS:
21496 node1->nd_head = arg_append(p, node1->nd_head, node2, loc);
21497 node1->nd_loc.end_pos = node1->nd_head->nd_loc.end_pos;
21498 return node1;
21499 case NODE_ARGSPUSH:
21500 node1->nd_body = list_append(p, NEW_LIST(node1->nd_body, &node1->nd_body->nd_loc), node2);
21501 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
21502 nd_set_type(node1, NODE_ARGSCAT);
21503 return node1;
21504 case NODE_ARGSCAT:
21505 if (!nd_type_p(node1->nd_body, NODE_LIST)) break;
21506 node1->nd_body = list_append(p, node1->nd_body, node2);
21507 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
21508 return node1;
21509 }
21510 return NEW_ARGSPUSH(node1, node2, loc);
21511}
21512
21513static NODE *
21514arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
21515{
21516 if (!node2) return node1;
21517 switch (nd_type(node1)) {
21518 case NODE_BLOCK_PASS:
21519 if (node1->nd_head)
21520 node1->nd_head = arg_concat(p, node1->nd_head, node2, loc);
21521 else
21522 node1->nd_head = NEW_LIST(node2, loc);
21523 return node1;
21524 case NODE_ARGSPUSH:
21525 if (!nd_type_p(node2, NODE_LIST)) break;
21526 node1->nd_body = list_concat(NEW_LIST(node1->nd_body, loc), node2);
21527 nd_set_type(node1, NODE_ARGSCAT);
21528 return node1;
21529 case NODE_ARGSCAT:
21530 if (!nd_type_p(node2, NODE_LIST) ||
21531 !nd_type_p(node1->nd_body, NODE_LIST)) break;
21532 node1->nd_body = list_concat(node1->nd_body, node2);
21533 return node1;
21534 }
21535 return NEW_ARGSCAT(node1, node2, loc);
21536}
21537
21538static NODE *
21539last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
21540{
21541 NODE *n1;
21542 if ((n1 = splat_array(args)) != 0) {
21543 return list_append(p, n1, last_arg);
21544 }
21545 return arg_append(p, args, last_arg, loc);
21546}
21547
21548static NODE *
21549rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
21550{
21551 NODE *n1;
21552 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
21553 return list_concat(n1, rest_arg);
21554 }
21555 return arg_concat(p, args, rest_arg, loc);
21556}
21557
21558static NODE *
21559splat_array(NODE* node)
21560{
21561 if (nd_type_p(node, NODE_SPLAT)) node = node->nd_head;
21562 if (nd_type_p(node, NODE_LIST)) return node;
21563 return 0;
21564}
21565
21566static void
21567mark_lvar_used(struct parser_params *p, NODE *rhs)
21568{
21569 ID *vidp = NULL;
21570 if (!rhs) return;
21571 switch (nd_type(rhs)) {
21572 case NODE_LASGN:
21573 if (local_id_ref(p, rhs->nd_vid, &vidp)) {
21574 if (vidp) *vidp |= LVAR_USED;
21575 }
21576 break;
21577 case NODE_DASGN:
21578 if (dvar_defined_ref(p, rhs->nd_vid, &vidp)) {
21579 if (vidp) *vidp |= LVAR_USED;
21580 }
21581 break;
21582#if 0
21583 case NODE_MASGN:
21584 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
21585 mark_lvar_used(p, rhs->nd_head);
21586 }
21587 break;
21588#endif
21589 }
21590}
21591
21592static NODE *
21593const_decl_path(struct parser_params *p, NODE **dest)
21594{
21595 NODE *n = *dest;
21596 if (!nd_type_p(n, NODE_CALL)) {
21597 const YYLTYPE *loc = &n->nd_loc;
21598 VALUE path;
21599 if (n->nd_vid) {
21600 path = rb_id2str(n->nd_vid);
21601 }
21602 else {
21603 n = n->nd_else;
21604 path = rb_ary_new();
21605 for (; n && nd_type_p(n, NODE_COLON2); n = n->nd_head) {
21606 rb_ary_push(path, rb_id2str(n->nd_mid));
21607 }
21608 if (n && nd_type_p(n, NODE_CONST)) {
21609 // Const::Name
21610 rb_ary_push(path, rb_id2str(n->nd_vid));
21611 }
21612 else if (n && nd_type_p(n, NODE_COLON3)) {
21613 // ::Const::Name
21614 rb_ary_push(path, rb_str_new(0, 0));
21615 }
21616 else {
21617 // expression::Name
21618 rb_ary_push(path, rb_str_new_cstr("..."));
21619 }
21620 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
21621 path = rb_fstring(path);
21622 }
21623 *dest = n = NEW_LIT(path, loc);
21624 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
21625 }
21626 return n;
21627}
21628
21629extern VALUE rb_mRubyVMFrozenCore;
21630
21631static NODE *
21632make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
21633{
21634 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
21635
21636 if (copy) {
21637 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
21638 NEW_LIST(value, loc), loc);
21639 }
21640 else {
21641 return NEW_CALL(fcore, rb_intern("make_shareable"),
21642 NEW_LIST(value, loc), loc);
21643 }
21644}
21645
21646static NODE *
21647ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
21648{
21649 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
21650 NODE *args = NEW_LIST(value, loc);
21651 args = list_append(p, args, const_decl_path(p, dest));
21652 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
21653}
21654
21655static int is_static_content(NODE *node);
21656
21657static VALUE
21658shareable_literal_value(NODE *node)
21659{
21660 if (!node) return Qnil;
21661 enum node_type type = nd_type(node);
21662 switch (type) {
21663 case NODE_TRUE:
21664 return Qtrue;
21665 case NODE_FALSE:
21666 return Qfalse;
21667 case NODE_NIL:
21668 return Qnil;
21669 case NODE_LIT:
21670 return node->nd_lit;
21671 default:
21672 return Qundef;
21673 }
21674}
21675
21676#ifndef SHAREABLE_BARE_EXPRESSION
21677#define SHAREABLE_BARE_EXPRESSION 1
21678#endif
21679
21680static NODE *
21681shareable_literal_constant(struct parser_params *p, enum shareability shareable,
21682 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
21683{
21684# define shareable_literal_constant_next(n) \
21685 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
21686 VALUE lit = Qnil;
21687
21688 if (!value) return 0;
21689 enum node_type type = nd_type(value);
21690 switch (type) {
21691 case NODE_TRUE:
21692 case NODE_FALSE:
21693 case NODE_NIL:
21694 case NODE_LIT:
21695 return value;
21696
21697 case NODE_DSTR:
21698 if (shareable == shareable_literal) {
21699 value = NEW_CALL(value, idUMinus, 0, loc);
21700 }
21701 return value;
21702
21703 case NODE_STR:
21704 lit = rb_fstring(value->nd_lit);
21705 nd_set_type(value, NODE_LIT);
21706 RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
21707 return value;
21708
21709 case NODE_ZLIST:
21710 lit = rb_ary_new();
21711 OBJ_FREEZE_RAW(lit);
21712 NODE *n = NEW_LIT(lit, loc);
21713 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
21714 return n;
21715
21716 case NODE_LIST:
21717 lit = rb_ary_new();
21718 for (NODE *n = value; n; n = n->nd_next) {
21719 NODE *elt = n->nd_head;
21720 if (elt) {
21721 elt = shareable_literal_constant_next(elt);
21722 if (elt) {
21723 n->nd_head = elt;
21724 }
21725 else if (RTEST(lit)) {
21726 rb_ary_clear(lit);
21727 lit = Qfalse;
21728 }
21729 }
21730 if (RTEST(lit)) {
21731 VALUE e = shareable_literal_value(elt);
21732 if (!UNDEF_P(e)) {
21733 rb_ary_push(lit, e);
21734 }
21735 else {
21736 rb_ary_clear(lit);
21737 lit = Qnil; /* make shareable at runtime */
21738 }
21739 }
21740 }
21741 break;
21742
21743 case NODE_HASH:
21744 if (!value->nd_brace) return 0;
21745 lit = rb_hash_new();
21746 for (NODE *n = value->nd_head; n; n = n->nd_next->nd_next) {
21747 NODE *key = n->nd_head;
21748 NODE *val = n->nd_next->nd_head;
21749 if (key) {
21750 key = shareable_literal_constant_next(key);
21751 if (key) {
21752 n->nd_head = key;
21753 }
21754 else if (RTEST(lit)) {
21755 rb_hash_clear(lit);
21756 lit = Qfalse;
21757 }
21758 }
21759 if (val) {
21760 val = shareable_literal_constant_next(val);
21761 if (val) {
21762 n->nd_next->nd_head = val;
21763 }
21764 else if (RTEST(lit)) {
21765 rb_hash_clear(lit);
21766 lit = Qfalse;
21767 }
21768 }
21769 if (RTEST(lit)) {
21770 VALUE k = shareable_literal_value(key);
21771 VALUE v = shareable_literal_value(val);
21772 if (!UNDEF_P(k) && !UNDEF_P(v)) {
21773 rb_hash_aset(lit, k, v);
21774 }
21775 else {
21776 rb_hash_clear(lit);
21777 lit = Qnil; /* make shareable at runtime */
21778 }
21779 }
21780 }
21781 break;
21782
21783 default:
21784 if (shareable == shareable_literal &&
21785 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
21786 return ensure_shareable_node(p, dest, value, loc);
21787 }
21788 return 0;
21789 }
21790
21791 /* Array or Hash */
21792 if (!lit) return 0;
21793 if (NIL_P(lit)) {
21794 // if shareable_literal, all elements should have been ensured
21795 // as shareable
21796 value = make_shareable_node(p, value, false, loc);
21797 }
21798 else {
21799 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
21800 RB_OBJ_WRITTEN(p->ast, Qnil, value->nd_lit);
21801 }
21802
21803 return value;
21804# undef shareable_literal_constant_next
21805}
21806
21807static NODE *
21808shareable_constant_value(struct parser_params *p, enum shareability shareable,
21809 NODE *lhs, NODE *value, const YYLTYPE *loc)
21810{
21811 if (!value) return 0;
21812 switch (shareable) {
21813 case shareable_none:
21814 return value;
21815
21816 case shareable_literal:
21817 {
21818 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
21819 if (lit) return lit;
21820 return value;
21821 }
21822 break;
21823
21824 case shareable_copy:
21825 case shareable_everything:
21826 {
21827 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
21828 if (lit) return lit;
21829 return make_shareable_node(p, value, shareable == shareable_copy, loc);
21830 }
21831 break;
21832
21833 default:
21835 }
21836}
21837
21838static NODE *
21839node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
21840{
21841 if (!lhs) return 0;
21842
21843 switch (nd_type(lhs)) {
21844 case NODE_CDECL:
21845 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
21846 /* fallthru */
21847
21848 case NODE_GASGN:
21849 case NODE_IASGN:
21850 case NODE_LASGN:
21851 case NODE_DASGN:
21852 case NODE_MASGN:
21853 case NODE_CVASGN:
21854 lhs->nd_value = rhs;
21855 nd_set_loc(lhs, loc);
21856 break;
21857
21858 case NODE_ATTRASGN:
21859 lhs->nd_args = arg_append(p, lhs->nd_args, rhs, loc);
21860 nd_set_loc(lhs, loc);
21861 break;
21862
21863 default:
21864 /* should not happen */
21865 break;
21866 }
21867
21868 return lhs;
21869}
21870
21871static NODE *
21872value_expr_check(struct parser_params *p, NODE *node)
21873{
21874 NODE *void_node = 0, *vn;
21875
21876 if (!node) {
21877 rb_warning0("empty expression");
21878 }
21879 while (node) {
21880 switch (nd_type(node)) {
21881 case NODE_RETURN:
21882 case NODE_BREAK:
21883 case NODE_NEXT:
21884 case NODE_REDO:
21885 case NODE_RETRY:
21886 return void_node ? void_node : node;
21887
21888 case NODE_CASE3:
21889 if (!node->nd_body || !nd_type_p(node->nd_body, NODE_IN)) {
21890 compile_error(p, "unexpected node");
21891 return NULL;
21892 }
21893 if (node->nd_body->nd_body) {
21894 return NULL;
21895 }
21896 /* single line pattern matching */
21897 return void_node ? void_node : node;
21898
21899 case NODE_BLOCK:
21900 while (node->nd_next) {
21901 node = node->nd_next;
21902 }
21903 node = node->nd_head;
21904 break;
21905
21906 case NODE_BEGIN:
21907 node = node->nd_body;
21908 break;
21909
21910 case NODE_IF:
21911 case NODE_UNLESS:
21912 if (!node->nd_body) {
21913 return NULL;
21914 }
21915 else if (!node->nd_else) {
21916 return NULL;
21917 }
21918 vn = value_expr_check(p, node->nd_body);
21919 if (!vn) return NULL;
21920 if (!void_node) void_node = vn;
21921 node = node->nd_else;
21922 break;
21923
21924 case NODE_AND:
21925 case NODE_OR:
21926 node = node->nd_1st;
21927 break;
21928
21929 case NODE_LASGN:
21930 case NODE_DASGN:
21931 case NODE_MASGN:
21932 mark_lvar_used(p, node);
21933 return NULL;
21934
21935 default:
21936 return NULL;
21937 }
21938 }
21939
21940 return NULL;
21941}
21942
21943static int
21944value_expr_gen(struct parser_params *p, NODE *node)
21945{
21946 NODE *void_node = value_expr_check(p, node);
21947 if (void_node) {
21948 yyerror1(&void_node->nd_loc, "void value expression");
21949 /* or "control never reach"? */
21950 return FALSE;
21951 }
21952 return TRUE;
21953}
21954static void
21955void_expr(struct parser_params *p, NODE *node)
21956{
21957 const char *useless = 0;
21958
21959 if (!RTEST(ruby_verbose)) return;
21960
21961 if (!node || !(node = nd_once_body(node))) return;
21962 switch (nd_type(node)) {
21963 case NODE_OPCALL:
21964 switch (node->nd_mid) {
21965 case '+':
21966 case '-':
21967 case '*':
21968 case '/':
21969 case '%':
21970 case tPOW:
21971 case tUPLUS:
21972 case tUMINUS:
21973 case '|':
21974 case '^':
21975 case '&':
21976 case tCMP:
21977 case '>':
21978 case tGEQ:
21979 case '<':
21980 case tLEQ:
21981 case tEQ:
21982 case tNEQ:
21983 useless = rb_id2name(node->nd_mid);
21984 break;
21985 }
21986 break;
21987
21988 case NODE_LVAR:
21989 case NODE_DVAR:
21990 case NODE_GVAR:
21991 case NODE_IVAR:
21992 case NODE_CVAR:
21993 case NODE_NTH_REF:
21994 case NODE_BACK_REF:
21995 useless = "a variable";
21996 break;
21997 case NODE_CONST:
21998 useless = "a constant";
21999 break;
22000 case NODE_LIT:
22001 case NODE_STR:
22002 case NODE_DSTR:
22003 case NODE_DREGX:
22004 useless = "a literal";
22005 break;
22006 case NODE_COLON2:
22007 case NODE_COLON3:
22008 useless = "::";
22009 break;
22010 case NODE_DOT2:
22011 useless = "..";
22012 break;
22013 case NODE_DOT3:
22014 useless = "...";
22015 break;
22016 case NODE_SELF:
22017 useless = "self";
22018 break;
22019 case NODE_NIL:
22020 useless = "nil";
22021 break;
22022 case NODE_TRUE:
22023 useless = "true";
22024 break;
22025 case NODE_FALSE:
22026 useless = "false";
22027 break;
22028 case NODE_DEFINED:
22029 useless = "defined?";
22030 break;
22031 }
22032
22033 if (useless) {
22034 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
22035 }
22036}
22037
22038static NODE *
22039void_stmts(struct parser_params *p, NODE *node)
22040{
22041 NODE *const n = node;
22042 if (!RTEST(ruby_verbose)) return n;
22043 if (!node) return n;
22044 if (!nd_type_p(node, NODE_BLOCK)) return n;
22045
22046 while (node->nd_next) {
22047 void_expr(p, node->nd_head);
22048 node = node->nd_next;
22049 }
22050 return n;
22051}
22052
22053static NODE *
22054remove_begin(NODE *node)
22055{
22056 NODE **n = &node, *n1 = node;
22057 while (n1 && nd_type_p(n1, NODE_BEGIN) && n1->nd_body) {
22058 *n = n1 = n1->nd_body;
22059 }
22060 return node;
22061}
22062
22063static NODE *
22064remove_begin_all(NODE *node)
22065{
22066 NODE **n = &node, *n1 = node;
22067 while (n1 && nd_type_p(n1, NODE_BEGIN)) {
22068 *n = n1 = n1->nd_body;
22069 }
22070 return node;
22071}
22072
22073static void
22074reduce_nodes(struct parser_params *p, NODE **body)
22075{
22076 NODE *node = *body;
22077
22078 if (!node) {
22079 *body = NEW_NIL(&NULL_LOC);
22080 return;
22081 }
22082#define subnodes(n1, n2) \
22083 ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
22084 (!node->n2) ? (body = &node->n1, 1) : \
22085 (reduce_nodes(p, &node->n1), body = &node->n2, 1))
22086
22087 while (node) {
22088 int newline = (int)(node->flags & NODE_FL_NEWLINE);
22089 switch (nd_type(node)) {
22090 end:
22091 case NODE_NIL:
22092 *body = 0;
22093 return;
22094 case NODE_RETURN:
22095 *body = node = node->nd_stts;
22096 if (newline && node) node->flags |= NODE_FL_NEWLINE;
22097 continue;
22098 case NODE_BEGIN:
22099 *body = node = node->nd_body;
22100 if (newline && node) node->flags |= NODE_FL_NEWLINE;
22101 continue;
22102 case NODE_BLOCK:
22103 body = &node->nd_end->nd_head;
22104 break;
22105 case NODE_IF:
22106 case NODE_UNLESS:
22107 if (subnodes(nd_body, nd_else)) break;
22108 return;
22109 case NODE_CASE:
22110 body = &node->nd_body;
22111 break;
22112 case NODE_WHEN:
22113 if (!subnodes(nd_body, nd_next)) goto end;
22114 break;
22115 case NODE_ENSURE:
22116 if (!subnodes(nd_head, nd_resq)) goto end;
22117 break;
22118 case NODE_RESCUE:
22119 if (node->nd_else) {
22120 body = &node->nd_resq;
22121 break;
22122 }
22123 if (!subnodes(nd_head, nd_resq)) goto end;
22124 break;
22125 default:
22126 return;
22127 }
22128 node = *body;
22129 if (newline && node) node->flags |= NODE_FL_NEWLINE;
22130 }
22131
22132#undef subnodes
22133}
22134
22135static int
22136is_static_content(NODE *node)
22137{
22138 if (!node) return 1;
22139 switch (nd_type(node)) {
22140 case NODE_HASH:
22141 if (!(node = node->nd_head)) break;
22142 case NODE_LIST:
22143 do {
22144 if (!is_static_content(node->nd_head)) return 0;
22145 } while ((node = node->nd_next) != 0);
22146 case NODE_LIT:
22147 case NODE_STR:
22148 case NODE_NIL:
22149 case NODE_TRUE:
22150 case NODE_FALSE:
22151 case NODE_ZLIST:
22152 break;
22153 default:
22154 return 0;
22155 }
22156 return 1;
22157}
22158
22159static int
22160assign_in_cond(struct parser_params *p, NODE *node)
22161{
22162 switch (nd_type(node)) {
22163 case NODE_MASGN:
22164 case NODE_LASGN:
22165 case NODE_DASGN:
22166 case NODE_GASGN:
22167 case NODE_IASGN:
22168 break;
22169
22170 default:
22171 return 0;
22172 }
22173
22174 if (!node->nd_value) return 1;
22175 if (is_static_content(node->nd_value)) {
22176 /* reports always */
22177 parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
22178 }
22179 return 1;
22180}
22181
22182enum cond_type {
22183 COND_IN_OP,
22184 COND_IN_COND,
22185 COND_IN_FF
22186};
22187
22188#define SWITCH_BY_COND_TYPE(t, w, arg) \
22189 switch (t) { \
22190 case COND_IN_OP: break; \
22191 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
22192 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
22193 }
22194
22195static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
22196
22197static NODE*
22198range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22199{
22200 enum node_type type;
22201
22202 if (node == 0) return 0;
22203
22204 type = nd_type(node);
22205 value_expr(node);
22206 if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
22207 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
22208 ID lineno = rb_intern("$.");
22209 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
22210 }
22211 return cond0(p, node, COND_IN_FF, loc);
22212}
22213
22214static NODE*
22215cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc)
22216{
22217 if (node == 0) return 0;
22218 if (!(node = nd_once_body(node))) return 0;
22219 assign_in_cond(p, node);
22220
22221 switch (nd_type(node)) {
22222 case NODE_DSTR:
22223 case NODE_EVSTR:
22224 case NODE_STR:
22225 SWITCH_BY_COND_TYPE(type, warn, "string ")
22226 break;
22227
22228 case NODE_DREGX:
22229 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
22230
22231 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
22232
22233 case NODE_AND:
22234 case NODE_OR:
22235 node->nd_1st = cond0(p, node->nd_1st, COND_IN_COND, loc);
22236 node->nd_2nd = cond0(p, node->nd_2nd, COND_IN_COND, loc);
22237 break;
22238
22239 case NODE_DOT2:
22240 case NODE_DOT3:
22241 node->nd_beg = range_op(p, node->nd_beg, loc);
22242 node->nd_end = range_op(p, node->nd_end, loc);
22243 if (nd_type_p(node, NODE_DOT2)) nd_set_type(node,NODE_FLIP2);
22244 else if (nd_type_p(node, NODE_DOT3)) nd_set_type(node, NODE_FLIP3);
22245 break;
22246
22247 case NODE_DSYM:
22248 warn_symbol:
22249 SWITCH_BY_COND_TYPE(type, warning, "symbol ")
22250 break;
22251
22252 case NODE_LIT:
22253 if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
22254 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
22255 nd_set_type(node, NODE_MATCH);
22256 }
22257 else if (node->nd_lit == Qtrue ||
22258 node->nd_lit == Qfalse) {
22259 /* booleans are OK, e.g., while true */
22260 }
22261 else if (SYMBOL_P(node->nd_lit)) {
22262 goto warn_symbol;
22263 }
22264 else {
22265 SWITCH_BY_COND_TYPE(type, warning, "")
22266 }
22267 default:
22268 break;
22269 }
22270 return node;
22271}
22272
22273static NODE*
22274cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22275{
22276 if (node == 0) return 0;
22277 return cond0(p, node, COND_IN_COND, loc);
22278}
22279
22280static NODE*
22281method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22282{
22283 if (node == 0) return 0;
22284 return cond0(p, node, COND_IN_OP, loc);
22285}
22286
22287static NODE*
22288new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
22289{
22290 YYLTYPE loc = {*pos, *pos};
22291 return NEW_NIL(&loc);
22292}
22293
22294static NODE*
22295new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
22296{
22297 if (!cc) return right;
22298 cc = cond0(p, cc, COND_IN_COND, loc);
22299 return newline_node(NEW_IF(cc, left, right, loc));
22300}
22301
22302static NODE*
22303new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
22304{
22305 if (!cc) return right;
22306 cc = cond0(p, cc, COND_IN_COND, loc);
22307 return newline_node(NEW_UNLESS(cc, left, right, loc));
22308}
22309
22310static NODE*
22311logop(struct parser_params *p, ID id, NODE *left, NODE *right,
22312 const YYLTYPE *op_loc, const YYLTYPE *loc)
22313{
22314 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
22315 NODE *op;
22316 value_expr(left);
22317 if (left && nd_type_p(left, type)) {
22318 NODE *node = left, *second;
22319 while ((second = node->nd_2nd) != 0 && nd_type_p(second, type)) {
22320 node = second;
22321 }
22322 node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
22323 nd_set_line(node->nd_2nd, op_loc->beg_pos.lineno);
22324 left->nd_loc.end_pos = loc->end_pos;
22325 return left;
22326 }
22327 op = NEW_NODE(type, left, right, 0, loc);
22328 nd_set_line(op, op_loc->beg_pos.lineno);
22329 return op;
22330}
22331
22332static void
22333no_blockarg(struct parser_params *p, NODE *node)
22334{
22335 if (nd_type_p(node, NODE_BLOCK_PASS)) {
22336 compile_error(p, "block argument should not be given");
22337 }
22338}
22339
22340static NODE *
22341ret_args(struct parser_params *p, NODE *node)
22342{
22343 if (node) {
22344 no_blockarg(p, node);
22345 if (nd_type_p(node, NODE_LIST)) {
22346 if (node->nd_next == 0) {
22347 node = node->nd_head;
22348 }
22349 else {
22350 nd_set_type(node, NODE_VALUES);
22351 }
22352 }
22353 }
22354 return node;
22355}
22356
22357static NODE *
22358new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22359{
22360 if (node) no_blockarg(p, node);
22361
22362 return NEW_YIELD(node, loc);
22363}
22364
22365static VALUE
22366negate_lit(struct parser_params *p, VALUE lit)
22367{
22368 if (FIXNUM_P(lit)) {
22369 return LONG2FIX(-FIX2LONG(lit));
22370 }
22371 if (SPECIAL_CONST_P(lit)) {
22372#if USE_FLONUM
22373 if (FLONUM_P(lit)) {
22374 return DBL2NUM(-RFLOAT_VALUE(lit));
22375 }
22376#endif
22377 goto unknown;
22378 }
22379 switch (BUILTIN_TYPE(lit)) {
22380 case T_BIGNUM:
22381 BIGNUM_NEGATE(lit);
22382 lit = rb_big_norm(lit);
22383 break;
22384 case T_RATIONAL:
22385 RATIONAL_SET_NUM(lit, negate_lit(p, RRATIONAL(lit)->num));
22386 break;
22387 case T_COMPLEX:
22388 RCOMPLEX_SET_REAL(lit, negate_lit(p, RCOMPLEX(lit)->real));
22389 RCOMPLEX_SET_IMAG(lit, negate_lit(p, RCOMPLEX(lit)->imag));
22390 break;
22391 case T_FLOAT:
22392 lit = DBL2NUM(-RFLOAT_VALUE(lit));
22393 break;
22394 unknown:
22395 default:
22396 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
22397 rb_builtin_class_name(lit));
22398 break;
22399 }
22400 return lit;
22401}
22402
22403static NODE *
22404arg_blk_pass(NODE *node1, NODE *node2)
22405{
22406 if (node2) {
22407 if (!node1) return node2;
22408 node2->nd_head = node1;
22409 nd_set_first_lineno(node2, nd_first_lineno(node1));
22410 nd_set_first_column(node2, nd_first_column(node1));
22411 return node2;
22412 }
22413 return node1;
22414}
22415
22416static bool
22417args_info_empty_p(struct rb_args_info *args)
22418{
22419 if (args->pre_args_num) return false;
22420 if (args->post_args_num) return false;
22421 if (args->rest_arg) return false;
22422 if (args->opt_args) return false;
22423 if (args->block_arg) return false;
22424 if (args->kw_args) return false;
22425 if (args->kw_rest_arg) return false;
22426 return true;
22427}
22428
22429static NODE*
22430new_args(struct parser_params *p, NODE *pre_args, NODE *opt_args, ID rest_arg, NODE *post_args, NODE *tail, const YYLTYPE *loc)
22431{
22432 int saved_line = p->ruby_sourceline;
22433 struct rb_args_info *args = tail->nd_ainfo;
22434
22435 if (args->forwarding) {
22436 if (rest_arg) {
22437 yyerror1(&tail->nd_loc, "... after rest argument");
22438 return tail;
22439 }
22440 rest_arg = idFWD_REST;
22441 }
22442
22443 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
22444 args->pre_init = pre_args ? pre_args->nd_next : 0;
22445
22446 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
22447 args->post_init = post_args ? post_args->nd_next : 0;
22448 args->first_post_arg = post_args ? post_args->nd_pid : 0;
22449
22450 args->rest_arg = rest_arg;
22451
22452 args->opt_args = opt_args;
22453
22454#ifdef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
22455 args->ruby2_keywords = args->forwarding;
22456#else
22457 args->ruby2_keywords = 0;
22458#endif
22459
22460 p->ruby_sourceline = saved_line;
22461 nd_set_loc(tail, loc);
22462
22463 return tail;
22464}
22465
22466static NODE*
22467new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
22468{
22469 int saved_line = p->ruby_sourceline;
22470 NODE *node;
22471 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
22472 struct rb_args_info *args = ZALLOC(struct rb_args_info);
22473 rb_imemo_tmpbuf_set_ptr(tmpbuf, args);
22474 args->imemo = tmpbuf;
22475 node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
22476 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
22477 if (p->error_p) return node;
22478
22479 args->block_arg = block;
22480 args->kw_args = kw_args;
22481
22482 if (kw_args) {
22483 /*
22484 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
22485 * variable order: k1, kr1, k2, &b, internal_id, krest
22486 * #=> <reorder>
22487 * variable order: kr1, k1, k2, internal_id, krest, &b
22488 */
22489 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
22490 struct vtable *vtargs = p->lvtbl->args;
22491 NODE *kwn = kw_args;
22492
22493 if (block) block = vtargs->tbl[vtargs->pos-1];
22494 vtable_pop(vtargs, !!block + !!kw_rest_arg);
22495 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
22496 while (kwn) {
22497 if (!NODE_REQUIRED_KEYWORD_P(kwn->nd_body))
22498 --kw_vars;
22499 --required_kw_vars;
22500 kwn = kwn->nd_next;
22501 }
22502
22503 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
22504 ID vid = kwn->nd_body->nd_vid;
22505 if (NODE_REQUIRED_KEYWORD_P(kwn->nd_body)) {
22506 *required_kw_vars++ = vid;
22507 }
22508 else {
22509 *kw_vars++ = vid;
22510 }
22511 }
22512
22513 arg_var(p, kw_bits);
22514 if (kw_rest_arg) arg_var(p, kw_rest_arg);
22515 if (block) arg_var(p, block);
22516
22517 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
22518 args->kw_rest_arg->nd_cflag = kw_bits;
22519 }
22520 else if (kw_rest_arg == idNil) {
22521 args->no_kwarg = 1;
22522 }
22523 else if (kw_rest_arg) {
22524 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
22525 }
22526
22527 p->ruby_sourceline = saved_line;
22528 return node;
22529}
22530
22531static NODE *
22532args_with_numbered(struct parser_params *p, NODE *args, int max_numparam)
22533{
22534 if (max_numparam > NO_PARAM) {
22535 if (!args) {
22536 YYLTYPE loc = RUBY_INIT_YYLLOC();
22537 args = new_args_tail(p, 0, 0, 0, 0);
22538 nd_set_loc(args, &loc);
22539 }
22540 args->nd_ainfo->pre_args_num = max_numparam;
22541 }
22542 return args;
22543}
22544
22545static NODE*
22546new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
22547{
22548 struct rb_ary_pattern_info *apinfo = aryptn->nd_apinfo;
22549
22550 aryptn->nd_pconst = constant;
22551
22552 if (pre_arg) {
22553 NODE *pre_args = NEW_LIST(pre_arg, loc);
22554 if (apinfo->pre_args) {
22555 apinfo->pre_args = list_concat(pre_args, apinfo->pre_args);
22556 }
22557 else {
22558 apinfo->pre_args = pre_args;
22559 }
22560 }
22561 return aryptn;
22562}
22563
22564static NODE*
22565new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc)
22566{
22567 int saved_line = p->ruby_sourceline;
22568 NODE *node;
22569 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
22570 struct rb_ary_pattern_info *apinfo = ZALLOC(struct rb_ary_pattern_info);
22571 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
22572 node = NEW_NODE(NODE_ARYPTN, 0, tmpbuf, apinfo, loc);
22573 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
22574
22575 apinfo->pre_args = pre_args;
22576
22577 if (has_rest) {
22578 if (rest_arg) {
22579 apinfo->rest_arg = assignable(p, rest_arg, 0, loc);
22580 }
22581 else {
22582 apinfo->rest_arg = NODE_SPECIAL_NO_NAME_REST;
22583 }
22584 }
22585 else {
22586 apinfo->rest_arg = NULL;
22587 }
22588
22589 apinfo->post_args = post_args;
22590
22591 p->ruby_sourceline = saved_line;
22592 return node;
22593}
22594
22595static NODE*
22596new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
22597{
22598 fndptn->nd_pconst = constant;
22599
22600 return fndptn;
22601}
22602
22603static NODE*
22604new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc)
22605{
22606 int saved_line = p->ruby_sourceline;
22607 NODE *node;
22608 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
22609 struct rb_fnd_pattern_info *fpinfo = ZALLOC(struct rb_fnd_pattern_info);
22610 rb_imemo_tmpbuf_set_ptr(tmpbuf, fpinfo);
22611 node = NEW_NODE(NODE_FNDPTN, 0, tmpbuf, fpinfo, loc);
22612 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
22613
22614 fpinfo->pre_rest_arg = pre_rest_arg ? assignable(p, pre_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
22615 fpinfo->args = args;
22616 fpinfo->post_rest_arg = post_rest_arg ? assignable(p, post_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
22617
22618 p->ruby_sourceline = saved_line;
22619 return node;
22620}
22621
22622static NODE*
22623new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
22624{
22625 hshptn->nd_pconst = constant;
22626 return hshptn;
22627}
22628
22629static NODE*
22630new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
22631{
22632 int saved_line = p->ruby_sourceline;
22633 NODE *node, *kw_rest_arg_node;
22634
22635 if (kw_rest_arg == idNil) {
22636 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
22637 }
22638 else if (kw_rest_arg) {
22639 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
22640 }
22641 else {
22642 kw_rest_arg_node = NULL;
22643 }
22644
22645 node = NEW_NODE(NODE_HSHPTN, 0, kw_args, kw_rest_arg_node, loc);
22646
22647 p->ruby_sourceline = saved_line;
22648 return node;
22649}
22650
22651static NODE*
22652dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
22653{
22654 VALUE lit;
22655
22656 if (!node) {
22657 return NEW_LIT(ID2SYM(idNULL), loc);
22658 }
22659
22660 switch (nd_type(node)) {
22661 case NODE_DSTR:
22662 nd_set_type(node, NODE_DSYM);
22663 nd_set_loc(node, loc);
22664 break;
22665 case NODE_STR:
22666 lit = node->nd_lit;
22667 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = ID2SYM(rb_intern_str(lit)));
22668 nd_set_type(node, NODE_LIT);
22669 nd_set_loc(node, loc);
22670 break;
22671 default:
22672 node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node, loc), loc);
22673 break;
22674 }
22675 return node;
22676}
22677
22678static int
22679append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
22680{
22681 NODE *node = (NODE *)v;
22682 NODE **result = (NODE **)h;
22683 node->nd_alen = 2;
22684 node->nd_next->nd_end = node->nd_next;
22685 node->nd_next->nd_next = 0;
22686 if (*result)
22687 list_concat(*result, node);
22688 else
22689 *result = node;
22690 return ST_CONTINUE;
22691}
22692
22693static bool
22694hash_literal_key_p(VALUE k)
22695{
22696 switch (OBJ_BUILTIN_TYPE(k)) {
22697 case T_NODE:
22698 return false;
22699 default:
22700 return true;
22701 }
22702}
22703
22704static int
22705literal_cmp(VALUE val, VALUE lit)
22706{
22707 if (val == lit) return 0;
22708 if (!hash_literal_key_p(val) || !hash_literal_key_p(lit)) return -1;
22709 return rb_iseq_cdhash_cmp(val, lit);
22710}
22711
22712static st_index_t
22713literal_hash(VALUE a)
22714{
22715 if (!hash_literal_key_p(a)) return (st_index_t)a;
22716 return rb_iseq_cdhash_hash(a);
22717}
22718
22719static const struct st_hash_type literal_type = {
22720 literal_cmp,
22721 literal_hash,
22722};
22723
22724static NODE *
22725remove_duplicate_keys(struct parser_params *p, NODE *hash)
22726{
22727 st_table *literal_keys = st_init_table_with_size(&literal_type, hash->nd_alen / 2);
22728 NODE *result = 0;
22729 NODE *last_expr = 0;
22730 rb_code_location_t loc = hash->nd_loc;
22731 while (hash && hash->nd_head && hash->nd_next) {
22732 NODE *head = hash->nd_head;
22733 NODE *value = hash->nd_next;
22734 NODE *next = value->nd_next;
22735 st_data_t key = (st_data_t)head;
22736 st_data_t data;
22737 value->nd_next = 0;
22738 if (nd_type_p(head, NODE_LIT) &&
22739 st_delete(literal_keys, (key = (st_data_t)head->nd_lit, &key), &data)) {
22740 NODE *dup_value = ((NODE *)data)->nd_next;
22741 rb_compile_warn(p->ruby_sourcefile, nd_line((NODE *)data),
22742 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
22743 head->nd_lit, nd_line(head));
22744 if (dup_value == last_expr) {
22745 value->nd_head = block_append(p, dup_value->nd_head, value->nd_head);
22746 }
22747 else {
22748 last_expr->nd_head = block_append(p, dup_value->nd_head, last_expr->nd_head);
22749 }
22750 }
22751 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
22752 last_expr = nd_type_p(head, NODE_LIT) ? value : head;
22753 hash = next;
22754 }
22755 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
22756 st_free_table(literal_keys);
22757 if (hash) {
22758 if (!result) result = hash;
22759 else list_concat(result, hash);
22760 }
22761 result->nd_loc = loc;
22762 return result;
22763}
22764
22765static NODE *
22766new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
22767{
22768 if (hash) hash = remove_duplicate_keys(p, hash);
22769 return NEW_HASH(hash, loc);
22770}
22771#endif
22772
22773static void
22774error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
22775{
22776 if (is_private_local_id(id)) {
22777 return;
22778 }
22779 if (st_is_member(p->pvtbl, id)) {
22780 yyerror1(loc, "duplicated variable name");
22781 }
22782 else {
22783 st_insert(p->pvtbl, (st_data_t)id, 0);
22784 }
22785}
22786
22787static void
22788error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
22789{
22790 if (!p->pktbl) {
22791 p->pktbl = st_init_numtable();
22792 }
22793 else if (st_is_member(p->pktbl, key)) {
22794 yyerror1(loc, "duplicated key name");
22795 return;
22796 }
22797 st_insert(p->pktbl, (st_data_t)key, 0);
22798}
22799
22800#ifndef RIPPER
22801static NODE *
22802new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
22803{
22804 return NEW_HASH(hash, loc);
22805}
22806#endif /* !RIPPER */
22807
22808#ifndef RIPPER
22809static NODE *
22810new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
22811{
22812 NODE *asgn;
22813
22814 if (lhs) {
22815 ID vid = lhs->nd_vid;
22816 YYLTYPE lhs_loc = lhs->nd_loc;
22817 int shareable = ctxt.shareable_constant_value;
22818 if (shareable) {
22819 switch (nd_type(lhs)) {
22820 case NODE_CDECL:
22821 case NODE_COLON2:
22822 case NODE_COLON3:
22823 break;
22824 default:
22825 shareable = 0;
22826 break;
22827 }
22828 }
22829 if (op == tOROP) {
22830 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
22831 lhs->nd_value = rhs;
22832 nd_set_loc(lhs, loc);
22833 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
22834 if (is_notop_id(vid)) {
22835 switch (id_type(vid)) {
22836 case ID_GLOBAL:
22837 case ID_INSTANCE:
22838 case ID_CLASS:
22839 asgn->nd_aid = vid;
22840 }
22841 }
22842 }
22843 else if (op == tANDOP) {
22844 if (shareable) {
22845 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
22846 }
22847 lhs->nd_value = rhs;
22848 nd_set_loc(lhs, loc);
22849 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
22850 }
22851 else {
22852 asgn = lhs;
22853 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
22854 if (shareable) {
22855 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
22856 }
22857 asgn->nd_value = rhs;
22858 nd_set_loc(asgn, loc);
22859 }
22860 }
22861 else {
22862 asgn = NEW_BEGIN(0, loc);
22863 }
22864 return asgn;
22865}
22866
22867static NODE *
22868new_ary_op_assign(struct parser_params *p, NODE *ary,
22869 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
22870{
22871 NODE *asgn;
22872
22873 args = make_list(args, args_loc);
22874 if (nd_type_p(args, NODE_BLOCK_PASS)) {
22875 args = NEW_ARGSCAT(args, rhs, loc);
22876 }
22877 else {
22878 args = arg_concat(p, args, rhs, loc);
22879 }
22880 asgn = NEW_OP_ASGN1(ary, op, args, loc);
22881 fixpos(asgn, ary);
22882 return asgn;
22883}
22884
22885static NODE *
22886new_attr_op_assign(struct parser_params *p, NODE *lhs,
22887 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
22888{
22889 NODE *asgn;
22890
22891 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
22892 fixpos(asgn, lhs);
22893 return asgn;
22894}
22895
22896static NODE *
22897new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
22898{
22899 NODE *asgn;
22900
22901 if (lhs) {
22902 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
22903 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
22904 }
22905 else {
22906 asgn = NEW_BEGIN(0, loc);
22907 }
22908 fixpos(asgn, lhs);
22909 return asgn;
22910}
22911
22912static NODE *
22913const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
22914{
22915 if (p->ctxt.in_def) {
22916 yyerror1(loc, "dynamic constant assignment");
22917 }
22918 return NEW_CDECL(0, 0, (path), loc);
22919}
22920#else
22921static VALUE
22922const_decl(struct parser_params *p, VALUE path)
22923{
22924 if (p->ctxt.in_def) {
22925 path = assign_error(p, "dynamic constant assignment", path);
22926 }
22927 return path;
22928}
22929
22930static VALUE
22931assign_error(struct parser_params *p, const char *mesg, VALUE a)
22932{
22933 a = dispatch2(assign_error, ERR_MESG(), a);
22934 ripper_error(p);
22935 return a;
22936}
22937
22938static VALUE
22939var_field(struct parser_params *p, VALUE a)
22940{
22941 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
22942}
22943#endif
22944
22945#ifndef RIPPER
22946static NODE *
22947new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
22948{
22949 NODE *result = head;
22950 if (rescue) {
22951 NODE *tmp = rescue_else ? rescue_else : rescue;
22952 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
22953
22954 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
22955 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
22956 }
22957 else if (rescue_else) {
22958 result = block_append(p, result, rescue_else);
22959 }
22960 if (ensure) {
22961 result = NEW_ENSURE(result, ensure, loc);
22962 }
22963 fixpos(result, head);
22964 return result;
22965}
22966#endif
22967
22968static void
22969warn_unused_var(struct parser_params *p, struct local_vars *local)
22970{
22971 int cnt;
22972
22973 if (!local->used) return;
22974 cnt = local->used->pos;
22975 if (cnt != local->vars->pos) {
22976 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
22977 }
22978#ifndef RIPPER
22979 ID *v = local->vars->tbl;
22980 ID *u = local->used->tbl;
22981 for (int i = 0; i < cnt; ++i) {
22982 if (!v[i] || (u[i] & LVAR_USED)) continue;
22983 if (is_private_local_id(v[i])) continue;
22984 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
22985 }
22986#endif
22987}
22988
22989static void
22990local_push(struct parser_params *p, int toplevel_scope)
22991{
22992 struct local_vars *local;
22993 int inherits_dvars = toplevel_scope && compile_for_eval;
22994 int warn_unused_vars = RTEST(ruby_verbose);
22995
22996 local = ALLOC(struct local_vars);
22997 local->prev = p->lvtbl;
22998 local->args = vtable_alloc(0);
22999 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
23000#ifndef RIPPER
23001 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
23002 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
23003 local->numparam.outer = 0;
23004 local->numparam.inner = 0;
23005 local->numparam.current = 0;
23006#endif
23007 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
23008
23009# if WARN_PAST_SCOPE
23010 local->past = 0;
23011# endif
23012 CMDARG_PUSH(0);
23013 COND_PUSH(0);
23014 p->lvtbl = local;
23015}
23016
23017static void
23018local_pop(struct parser_params *p)
23019{
23020 struct local_vars *local = p->lvtbl->prev;
23021 if (p->lvtbl->used) {
23022 warn_unused_var(p, p->lvtbl);
23023 vtable_free(p->lvtbl->used);
23024 }
23025# if WARN_PAST_SCOPE
23026 while (p->lvtbl->past) {
23027 struct vtable *past = p->lvtbl->past;
23028 p->lvtbl->past = past->prev;
23029 vtable_free(past);
23030 }
23031# endif
23032 vtable_free(p->lvtbl->args);
23033 vtable_free(p->lvtbl->vars);
23034 CMDARG_POP();
23035 COND_POP();
23036 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
23037 p->lvtbl = local;
23038}
23039
23040#ifndef RIPPER
23041static rb_ast_id_table_t *
23042local_tbl(struct parser_params *p)
23043{
23044 int cnt_args = vtable_size(p->lvtbl->args);
23045 int cnt_vars = vtable_size(p->lvtbl->vars);
23046 int cnt = cnt_args + cnt_vars;
23047 int i, j;
23048 rb_ast_id_table_t *tbl;
23049
23050 if (cnt <= 0) return 0;
23051 tbl = rb_ast_new_local_table(p->ast, cnt);
23052 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
23053 /* remove IDs duplicated to warn shadowing */
23054 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
23055 ID id = p->lvtbl->vars->tbl[i];
23056 if (!vtable_included(p->lvtbl->args, id)) {
23057 tbl->ids[j++] = id;
23058 }
23059 }
23060 if (j < cnt) {
23061 tbl = rb_ast_resize_latest_local_table(p->ast, j);
23062 }
23063
23064 return tbl;
23065}
23066
23067static NODE*
23068node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc)
23069{
23071 NODE *n;
23072
23073 a0 = local_tbl(p);
23074 n = NEW_NODE(type, a0, a1, a2, loc);
23075 return n;
23076}
23077
23078#endif
23079
23080static void
23081numparam_name(struct parser_params *p, ID id)
23082{
23083 if (!NUMPARAM_ID_P(id)) return;
23084 compile_error(p, "_%d is reserved for numbered parameter",
23085 NUMPARAM_ID_TO_IDX(id));
23086}
23087
23088static void
23089arg_var(struct parser_params *p, ID id)
23090{
23091 numparam_name(p, id);
23092 vtable_add(p->lvtbl->args, id);
23093}
23094
23095static void
23096local_var(struct parser_params *p, ID id)
23097{
23098 numparam_name(p, id);
23099 vtable_add(p->lvtbl->vars, id);
23100 if (p->lvtbl->used) {
23101 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
23102 }
23103}
23104
23105static int
23106local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
23107{
23108 struct vtable *vars, *args, *used;
23109
23110 vars = p->lvtbl->vars;
23111 args = p->lvtbl->args;
23112 used = p->lvtbl->used;
23113
23114 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
23115 vars = vars->prev;
23116 args = args->prev;
23117 if (used) used = used->prev;
23118 }
23119
23120 if (vars && vars->prev == DVARS_INHERIT) {
23121 return rb_local_defined(id, p->parent_iseq);
23122 }
23123 else if (vtable_included(args, id)) {
23124 return 1;
23125 }
23126 else {
23127 int i = vtable_included(vars, id);
23128 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
23129 return i != 0;
23130 }
23131}
23132
23133static int
23134local_id(struct parser_params *p, ID id)
23135{
23136 return local_id_ref(p, id, NULL);
23137}
23138
23139static int
23140check_forwarding_args(struct parser_params *p)
23141{
23142 if (local_id(p, idFWD_ALL)) return TRUE;
23143 compile_error(p, "unexpected ...");
23144 return FALSE;
23145}
23146
23147static void
23148add_forwarding_args(struct parser_params *p)
23149{
23150 arg_var(p, idFWD_REST);
23151#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
23152 arg_var(p, idFWD_KWREST);
23153#endif
23154 arg_var(p, idFWD_BLOCK);
23155 arg_var(p, idFWD_ALL);
23156}
23157
23158#ifndef RIPPER
23159static NODE *
23160new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
23161{
23162 NODE *rest = NEW_LVAR(idFWD_REST, loc);
23163#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
23164 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
23165#endif
23166 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
23167 NODE *args = leading ? rest_arg_append(p, leading, rest, argsloc) : NEW_SPLAT(rest, loc);
23168#ifndef FORWARD_ARGS_WITH_RUBY2_KEYWORDS
23169 args = arg_append(p, args, new_hash(p, kwrest, loc), loc);
23170#endif
23171 return arg_blk_pass(args, block);
23172}
23173#endif
23174
23175static NODE *
23176numparam_push(struct parser_params *p)
23177{
23178#ifndef RIPPER
23179 struct local_vars *local = p->lvtbl;
23180 NODE *inner = local->numparam.inner;
23181 if (!local->numparam.outer) {
23182 local->numparam.outer = local->numparam.current;
23183 }
23184 local->numparam.inner = 0;
23185 local->numparam.current = 0;
23186 return inner;
23187#else
23188 return 0;
23189#endif
23190}
23191
23192static void
23193numparam_pop(struct parser_params *p, NODE *prev_inner)
23194{
23195#ifndef RIPPER
23196 struct local_vars *local = p->lvtbl;
23197 if (prev_inner) {
23198 /* prefer first one */
23199 local->numparam.inner = prev_inner;
23200 }
23201 else if (local->numparam.current) {
23202 /* current and inner are exclusive */
23203 local->numparam.inner = local->numparam.current;
23204 }
23205 if (p->max_numparam > NO_PARAM) {
23206 /* current and outer are exclusive */
23207 local->numparam.current = local->numparam.outer;
23208 local->numparam.outer = 0;
23209 }
23210 else {
23211 /* no numbered parameter */
23212 local->numparam.current = 0;
23213 }
23214#endif
23215}
23216
23217static const struct vtable *
23218dyna_push(struct parser_params *p)
23219{
23220 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
23221 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
23222 if (p->lvtbl->used) {
23223 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
23224 }
23225 return p->lvtbl->args;
23226}
23227
23228static void
23229dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
23230{
23231 struct vtable *tmp = *vtblp;
23232 *vtblp = tmp->prev;
23233# if WARN_PAST_SCOPE
23234 if (p->past_scope_enabled) {
23235 tmp->prev = p->lvtbl->past;
23236 p->lvtbl->past = tmp;
23237 return;
23238 }
23239# endif
23240 vtable_free(tmp);
23241}
23242
23243static void
23244dyna_pop_1(struct parser_params *p)
23245{
23246 struct vtable *tmp;
23247
23248 if ((tmp = p->lvtbl->used) != 0) {
23249 warn_unused_var(p, p->lvtbl);
23250 p->lvtbl->used = p->lvtbl->used->prev;
23251 vtable_free(tmp);
23252 }
23253 dyna_pop_vtable(p, &p->lvtbl->args);
23254 dyna_pop_vtable(p, &p->lvtbl->vars);
23255}
23256
23257static void
23258dyna_pop(struct parser_params *p, const struct vtable *lvargs)
23259{
23260 while (p->lvtbl->args != lvargs) {
23261 dyna_pop_1(p);
23262 if (!p->lvtbl->args) {
23263 struct local_vars *local = p->lvtbl->prev;
23264 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
23265 p->lvtbl = local;
23266 }
23267 }
23268 dyna_pop_1(p);
23269}
23270
23271static int
23272dyna_in_block(struct parser_params *p)
23273{
23274 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
23275}
23276
23277static int
23278dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
23279{
23280 struct vtable *vars, *args, *used;
23281 int i;
23282
23283 args = p->lvtbl->args;
23284 vars = p->lvtbl->vars;
23285 used = p->lvtbl->used;
23286
23287 while (!DVARS_TERMINAL_P(vars)) {
23288 if (vtable_included(args, id)) {
23289 return 1;
23290 }
23291 if ((i = vtable_included(vars, id)) != 0) {
23292 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
23293 return 1;
23294 }
23295 args = args->prev;
23296 vars = vars->prev;
23297 if (!vidrefp) used = 0;
23298 if (used) used = used->prev;
23299 }
23300
23301 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
23302 return rb_dvar_defined(id, p->parent_iseq);
23303 }
23304
23305 return 0;
23306}
23307
23308static int
23309dvar_defined(struct parser_params *p, ID id)
23310{
23311 return dvar_defined_ref(p, id, NULL);
23312}
23313
23314static int
23315dvar_curr(struct parser_params *p, ID id)
23316{
23317 return (vtable_included(p->lvtbl->args, id) ||
23318 vtable_included(p->lvtbl->vars, id));
23319}
23320
23321static void
23322reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
23323{
23324 compile_error(p,
23325 "regexp encoding option '%c' differs from source encoding '%s'",
23326 c, rb_enc_name(rb_enc_get(str)));
23327}
23328
23329#ifndef RIPPER
23330int
23331rb_reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
23332{
23333 int c = RE_OPTION_ENCODING_IDX(options);
23334
23335 if (c) {
23336 int opt, idx;
23337 rb_char_to_option_kcode(c, &opt, &idx);
23338 if (idx != ENCODING_GET(str) &&
23339 !is_ascii_string(str)) {
23340 goto error;
23341 }
23342 ENCODING_SET(str, idx);
23343 }
23344 else if (RE_OPTION_ENCODING_NONE(options)) {
23345 if (!ENCODING_IS_ASCII8BIT(str) &&
23346 !is_ascii_string(str)) {
23347 c = 'n';
23348 goto error;
23349 }
23350 rb_enc_associate(str, rb_ascii8bit_encoding());
23351 }
23352 else if (rb_is_usascii_enc(p->enc)) {
23353 if (!is_ascii_string(str)) {
23354 /* raise in re.c */
23355 rb_enc_associate(str, rb_usascii_encoding());
23356 }
23357 else {
23358 rb_enc_associate(str, rb_ascii8bit_encoding());
23359 }
23360 }
23361 return 0;
23362
23363 error:
23364 return c;
23365}
23366
23367static void
23368reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
23369{
23370 int c = rb_reg_fragment_setenc(p, str, options);
23371 if (c) reg_fragment_enc_error(p, str, c);
23372}
23373
23374static int
23375reg_fragment_check(struct parser_params* p, VALUE str, int options)
23376{
23377 VALUE err;
23378 reg_fragment_setenc(p, str, options);
23379 err = rb_reg_check_preprocess(str);
23380 if (err != Qnil) {
23381 err = rb_obj_as_string(err);
23382 compile_error(p, "%"PRIsVALUE, err);
23383 return 0;
23384 }
23385 return 1;
23386}
23387
23388typedef struct {
23389 struct parser_params* parser;
23390 rb_encoding *enc;
23391 NODE *succ_block;
23392 const YYLTYPE *loc;
23394
23395static int
23396reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
23397 int back_num, int *back_refs, OnigRegex regex, void *arg0)
23398{
23400 struct parser_params* p = arg->parser;
23401 rb_encoding *enc = arg->enc;
23402 long len = name_end - name;
23403 const char *s = (const char *)name;
23404 ID var;
23405 NODE *node, *succ;
23406
23407 if (!len) return ST_CONTINUE;
23408 if (rb_enc_symname_type(s, len, enc, (1U<<ID_LOCAL)) != ID_LOCAL)
23409 return ST_CONTINUE;
23410
23411 var = intern_cstr(s, len, enc);
23412 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
23413 if (!lvar_defined(p, var)) return ST_CONTINUE;
23414 }
23415 node = node_assign(p, assignable(p, var, 0, arg->loc), NEW_LIT(ID2SYM(var), arg->loc), NO_LEX_CTXT, arg->loc);
23416 succ = arg->succ_block;
23417 if (!succ) succ = NEW_BEGIN(0, arg->loc);
23418 succ = block_append(p, succ, node);
23419 arg->succ_block = succ;
23420 return ST_CONTINUE;
23421}
23422
23423static NODE *
23424reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
23425{
23427
23428 arg.parser = p;
23429 arg.enc = rb_enc_get(regexp);
23430 arg.succ_block = 0;
23431 arg.loc = loc;
23432 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
23433
23434 if (!arg.succ_block) return 0;
23435 return arg.succ_block->nd_next;
23436}
23437
23438static VALUE
23439parser_reg_compile(struct parser_params* p, VALUE str, int options)
23440{
23441 reg_fragment_setenc(p, str, options);
23442 return rb_parser_reg_compile(p, str, options);
23443}
23444
23445VALUE
23446rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
23447{
23448 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
23449}
23450
23451static VALUE
23452reg_compile(struct parser_params* p, VALUE str, int options)
23453{
23454 VALUE re;
23455 VALUE err;
23456
23457 err = rb_errinfo();
23458 re = parser_reg_compile(p, str, options);
23459 if (NIL_P(re)) {
23460 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
23461 rb_set_errinfo(err);
23462 compile_error(p, "%"PRIsVALUE, m);
23463 return Qnil;
23464 }
23465 return re;
23466}
23467#else
23468static VALUE
23469parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
23470{
23471 VALUE err = rb_errinfo();
23472 VALUE re;
23473 str = ripper_is_node_yylval(str) ? RNODE(str)->nd_cval : str;
23474 int c = rb_reg_fragment_setenc(p, str, options);
23475 if (c) reg_fragment_enc_error(p, str, c);
23476 re = rb_parser_reg_compile(p, str, options);
23477 if (NIL_P(re)) {
23478 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
23479 rb_set_errinfo(err);
23480 }
23481 return re;
23482}
23483#endif
23484
23485#ifndef RIPPER
23486void
23487rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
23488{
23489 struct parser_params *p;
23490 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23491 p->do_print = print;
23492 p->do_loop = loop;
23493 p->do_chomp = chomp;
23494 p->do_split = split;
23495}
23496
23497static NODE *
23498parser_append_options(struct parser_params *p, NODE *node)
23499{
23500 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
23501 const YYLTYPE *const LOC = &default_location;
23502
23503 if (p->do_print) {
23504 NODE *print = NEW_FCALL(rb_intern("print"),
23505 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
23506 LOC);
23507 node = block_append(p, node, print);
23508 }
23509
23510 if (p->do_loop) {
23511 NODE *irs = NEW_LIST(NEW_GVAR(rb_intern("$/"), LOC), LOC);
23512
23513 if (p->do_split) {
23514 ID ifs = rb_intern("$;");
23515 ID fields = rb_intern("$F");
23516 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
23517 NODE *split = NEW_GASGN(fields,
23518 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
23519 rb_intern("split"), args, LOC),
23520 LOC);
23521 node = block_append(p, split, node);
23522 }
23523 if (p->do_chomp) {
23524 NODE *chomp = NEW_LIT(ID2SYM(rb_intern("chomp")), LOC);
23525 chomp = list_append(p, NEW_LIST(chomp, LOC), NEW_TRUE(LOC));
23526 irs = list_append(p, irs, NEW_HASH(chomp, LOC));
23527 }
23528
23529 node = NEW_WHILE(NEW_FCALL(idGets, irs, LOC), node, 1, LOC);
23530 }
23531
23532 return node;
23533}
23534
23535void
23536rb_init_parse(void)
23537{
23538 /* just to suppress unused-function warnings */
23539 (void)nodetype;
23540 (void)nodeline;
23541}
23542
23543static ID
23544internal_id(struct parser_params *p)
23545{
23546 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
23547}
23548#endif /* !RIPPER */
23549
23550static void
23551parser_initialize(struct parser_params *p)
23552{
23553 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
23554 p->command_start = TRUE;
23555 p->ruby_sourcefile_string = Qnil;
23556 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
23557 p->node_id = 0;
23558 p->delayed.token = Qnil;
23559#ifdef RIPPER
23560 p->result = Qnil;
23561 p->parsing_thread = Qnil;
23562#else
23563 p->error_buffer = Qfalse;
23564 p->end_expect_token_locations = Qnil;
23565 p->token_id = 0;
23566 p->tokens = Qnil;
23567#endif
23568 p->debug_buffer = Qnil;
23569 p->debug_output = rb_ractor_stdout();
23570 p->enc = rb_utf8_encoding();
23571}
23572
23573#ifdef RIPPER
23574#define parser_mark ripper_parser_mark
23575#define parser_free ripper_parser_free
23576#endif
23577
23578static void
23579parser_mark(void *ptr)
23580{
23581 struct parser_params *p = (struct parser_params*)ptr;
23582
23583 rb_gc_mark(p->lex.input);
23584 rb_gc_mark(p->lex.lastline);
23585 rb_gc_mark(p->lex.nextline);
23586 rb_gc_mark(p->ruby_sourcefile_string);
23587 rb_gc_mark((VALUE)p->lex.strterm);
23588 rb_gc_mark((VALUE)p->ast);
23589 rb_gc_mark(p->case_labels);
23590 rb_gc_mark(p->delayed.token);
23591#ifndef RIPPER
23592 rb_gc_mark(p->debug_lines);
23593 rb_gc_mark(p->compile_option);
23594 rb_gc_mark(p->error_buffer);
23595 rb_gc_mark(p->end_expect_token_locations);
23596 rb_gc_mark(p->tokens);
23597#else
23598 rb_gc_mark(p->value);
23599 rb_gc_mark(p->result);
23600 rb_gc_mark(p->parsing_thread);
23601#endif
23602 rb_gc_mark(p->debug_buffer);
23603 rb_gc_mark(p->debug_output);
23604#ifdef YYMALLOC
23605 rb_gc_mark((VALUE)p->heap);
23606#endif
23607}
23608
23609static void
23610parser_free(void *ptr)
23611{
23612 struct parser_params *p = (struct parser_params*)ptr;
23613 struct local_vars *local, *prev;
23614
23615 if (p->tokenbuf) {
23616 ruby_sized_xfree(p->tokenbuf, p->toksiz);
23617 }
23618 for (local = p->lvtbl; local; local = prev) {
23619 if (local->vars) xfree(local->vars);
23620 prev = local->prev;
23621 xfree(local);
23622 }
23623 {
23624 token_info *ptinfo;
23625 while ((ptinfo = p->token_info) != 0) {
23626 p->token_info = ptinfo->next;
23627 xfree(ptinfo);
23628 }
23629 }
23630 xfree(ptr);
23631}
23632
23633static size_t
23634parser_memsize(const void *ptr)
23635{
23636 struct parser_params *p = (struct parser_params*)ptr;
23637 struct local_vars *local;
23638 size_t size = sizeof(*p);
23639
23640 size += p->toksiz;
23641 for (local = p->lvtbl; local; local = local->prev) {
23642 size += sizeof(*local);
23643 if (local->vars) size += local->vars->capa * sizeof(ID);
23644 }
23645 return size;
23646}
23647
23648static const rb_data_type_t parser_data_type = {
23649#ifndef RIPPER
23650 "parser",
23651#else
23652 "ripper",
23653#endif
23654 {
23655 parser_mark,
23656 parser_free,
23657 parser_memsize,
23658 },
23659 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
23660};
23661
23662#ifndef RIPPER
23663#undef rb_reserved_word
23664
23665const struct kwtable *
23666rb_reserved_word(const char *str, unsigned int len)
23667{
23668 return reserved_word(str, len);
23669}
23670
23671VALUE
23672rb_parser_new(void)
23673{
23674 struct parser_params *p;
23675 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
23676 &parser_data_type, p);
23677 parser_initialize(p);
23678 return parser;
23679}
23680
23681VALUE
23682rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
23683{
23684 struct parser_params *p;
23685
23686 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23687 p->error_buffer = main ? Qfalse : Qnil;
23688 p->parent_iseq = base;
23689 return vparser;
23690}
23691
23692void
23693rb_parser_keep_script_lines(VALUE vparser)
23694{
23695 struct parser_params *p;
23696
23697 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23698 p->keep_script_lines = 1;
23699}
23700
23701void
23702rb_parser_error_tolerant(VALUE vparser)
23703{
23704 struct parser_params *p;
23705
23706 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23707 p->error_tolerant = 1;
23708 p->end_expect_token_locations = rb_ary_new();
23709}
23710
23711void
23712rb_parser_keep_tokens(VALUE vparser)
23713{
23714 struct parser_params *p;
23715
23716 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23717 p->keep_tokens = 1;
23718 p->tokens = rb_ary_new();
23719}
23720
23721#endif
23722
23723#ifdef RIPPER
23724#define rb_parser_end_seen_p ripper_parser_end_seen_p
23725#define rb_parser_encoding ripper_parser_encoding
23726#define rb_parser_get_yydebug ripper_parser_get_yydebug
23727#define rb_parser_set_yydebug ripper_parser_set_yydebug
23728#define rb_parser_get_debug_output ripper_parser_get_debug_output
23729#define rb_parser_set_debug_output ripper_parser_set_debug_output
23730static VALUE ripper_parser_end_seen_p(VALUE vparser);
23731static VALUE ripper_parser_encoding(VALUE vparser);
23732static VALUE ripper_parser_get_yydebug(VALUE self);
23733static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
23734static VALUE ripper_parser_get_debug_output(VALUE self);
23735static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output);
23736
23737/*
23738 * call-seq:
23739 * ripper.error? -> Boolean
23740 *
23741 * Return true if parsed source has errors.
23742 */
23743static VALUE
23744ripper_error_p(VALUE vparser)
23745{
23746 struct parser_params *p;
23747
23748 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23749 return RBOOL(p->error_p);
23750}
23751#endif
23752
23753/*
23754 * call-seq:
23755 * ripper.end_seen? -> Boolean
23756 *
23757 * Return true if parsed source ended by +\_\_END\_\_+.
23758 */
23759VALUE
23760rb_parser_end_seen_p(VALUE vparser)
23761{
23762 struct parser_params *p;
23763
23764 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23765 return RBOOL(p->ruby__end__seen);
23766}
23767
23768/*
23769 * call-seq:
23770 * ripper.encoding -> encoding
23771 *
23772 * Return encoding of the source.
23773 */
23774VALUE
23775rb_parser_encoding(VALUE vparser)
23776{
23777 struct parser_params *p;
23778
23779 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
23780 return rb_enc_from_encoding(p->enc);
23781}
23782
23783#ifdef RIPPER
23784/*
23785 * call-seq:
23786 * ripper.yydebug -> true or false
23787 *
23788 * Get yydebug.
23789 */
23790VALUE
23791rb_parser_get_yydebug(VALUE self)
23792{
23793 struct parser_params *p;
23794
23795 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23796 return RBOOL(p->debug);
23797}
23798#endif
23799
23800/*
23801 * call-seq:
23802 * ripper.yydebug = flag
23803 *
23804 * Set yydebug.
23805 */
23806VALUE
23807rb_parser_set_yydebug(VALUE self, VALUE flag)
23808{
23809 struct parser_params *p;
23810
23811 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23812 p->debug = RTEST(flag);
23813 return flag;
23814}
23815
23816/*
23817 * call-seq:
23818 * ripper.debug_output -> obj
23819 *
23820 * Get debug output.
23821 */
23822VALUE
23823rb_parser_get_debug_output(VALUE self)
23824{
23825 struct parser_params *p;
23826
23827 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23828 return p->debug_output;
23829}
23830
23831/*
23832 * call-seq:
23833 * ripper.debug_output = obj
23834 *
23835 * Set debug output.
23836 */
23837VALUE
23838rb_parser_set_debug_output(VALUE self, VALUE output)
23839{
23840 struct parser_params *p;
23841
23842 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
23843 return p->debug_output = output;
23844}
23845
23846#ifndef RIPPER
23847#ifdef YYMALLOC
23848#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
23849/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
23850 * potential memory leak */
23851#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
23852#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
23853 (new)->cnt = (cnt), (ptr))
23854
23855void *
23856rb_parser_malloc(struct parser_params *p, size_t size)
23857{
23858 size_t cnt = HEAPCNT(1, size);
23859 rb_imemo_tmpbuf_t *n = NEWHEAP();
23860 void *ptr = xmalloc(size);
23861
23862 return ADD2HEAP(n, cnt, ptr);
23863}
23864
23865void *
23866rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
23867{
23868 size_t cnt = HEAPCNT(nelem, size);
23869 rb_imemo_tmpbuf_t *n = NEWHEAP();
23870 void *ptr = xcalloc(nelem, size);
23871
23872 return ADD2HEAP(n, cnt, ptr);
23873}
23874
23875void *
23876rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
23877{
23879 size_t cnt = HEAPCNT(1, size);
23880
23881 if (ptr && (n = p->heap) != NULL) {
23882 do {
23883 if (n->ptr == ptr) {
23884 n->ptr = ptr = xrealloc(ptr, size);
23885 if (n->cnt) n->cnt = cnt;
23886 return ptr;
23887 }
23888 } while ((n = n->next) != NULL);
23889 }
23890 n = NEWHEAP();
23891 ptr = xrealloc(ptr, size);
23892 return ADD2HEAP(n, cnt, ptr);
23893}
23894
23895void
23896rb_parser_free(struct parser_params *p, void *ptr)
23897{
23898 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
23899
23900 while ((n = *prev) != NULL) {
23901 if (n->ptr == ptr) {
23902 *prev = n->next;
23903 break;
23904 }
23905 prev = &n->next;
23906 }
23907}
23908#endif
23909
23910void
23911rb_parser_printf(struct parser_params *p, const char *fmt, ...)
23912{
23913 va_list ap;
23914 VALUE mesg = p->debug_buffer;
23915
23916 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
23917 va_start(ap, fmt);
23918 rb_str_vcatf(mesg, fmt, ap);
23919 va_end(ap);
23920 if (RSTRING_END(mesg)[-1] == '\n') {
23921 rb_io_write(p->debug_output, mesg);
23922 p->debug_buffer = Qnil;
23923 }
23924}
23925
23926static void
23927parser_compile_error(struct parser_params *p, const char *fmt, ...)
23928{
23929 va_list ap;
23930
23931 rb_io_flush(p->debug_output);
23932 p->error_p = 1;
23933 va_start(ap, fmt);
23934 p->error_buffer =
23935 rb_syntax_error_append(p->error_buffer,
23936 p->ruby_sourcefile_string,
23937 p->ruby_sourceline,
23938 rb_long2int(p->lex.pcur - p->lex.pbeg),
23939 p->enc, fmt, ap);
23940 va_end(ap);
23941}
23942
23943static size_t
23944count_char(const char *str, int c)
23945{
23946 int n = 0;
23947 while (str[n] == c) ++n;
23948 return n;
23949}
23950
23951/*
23952 * strip enclosing double-quotes, same as the default yytnamerr except
23953 * for that single-quotes matching back-quotes do not stop stripping.
23954 *
23955 * "\"`class' keyword\"" => "`class' keyword"
23956 */
23957RUBY_FUNC_EXPORTED size_t
23958rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
23959{
23960 if (*yystr == '"') {
23961 size_t yyn = 0, bquote = 0;
23962 const char *yyp = yystr;
23963
23964 while (*++yyp) {
23965 switch (*yyp) {
23966 case '`':
23967 if (!bquote) {
23968 bquote = count_char(yyp+1, '`') + 1;
23969 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
23970 yyn += bquote;
23971 yyp += bquote - 1;
23972 break;
23973 }
23974 goto default_char;
23975
23976 case '\'':
23977 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
23978 if (yyres) memcpy(yyres + yyn, yyp, bquote);
23979 yyn += bquote;
23980 yyp += bquote - 1;
23981 bquote = 0;
23982 break;
23983 }
23984 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
23985 if (yyres) memcpy(yyres + yyn, yyp, 3);
23986 yyn += 3;
23987 yyp += 2;
23988 break;
23989 }
23990 goto do_not_strip_quotes;
23991
23992 case ',':
23993 goto do_not_strip_quotes;
23994
23995 case '\\':
23996 if (*++yyp != '\\')
23997 goto do_not_strip_quotes;
23998 /* Fall through. */
23999 default_char:
24000 default:
24001 if (yyres)
24002 yyres[yyn] = *yyp;
24003 yyn++;
24004 break;
24005
24006 case '"':
24007 case '\0':
24008 if (yyres)
24009 yyres[yyn] = '\0';
24010 return yyn;
24011 }
24012 }
24013 do_not_strip_quotes: ;
24014 }
24015
24016 if (!yyres) return strlen(yystr);
24017
24018 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
24019}
24020#endif
24021
24022#ifdef RIPPER
24023#ifdef RIPPER_DEBUG
24024/* :nodoc: */
24025static VALUE
24026ripper_validate_object(VALUE self, VALUE x)
24027{
24028 if (x == Qfalse) return x;
24029 if (x == Qtrue) return x;
24030 if (NIL_P(x)) return x;
24031 if (UNDEF_P(x))
24032 rb_raise(rb_eArgError, "Qundef given");
24033 if (FIXNUM_P(x)) return x;
24034 if (SYMBOL_P(x)) return x;
24035 switch (BUILTIN_TYPE(x)) {
24036 case T_STRING:
24037 case T_OBJECT:
24038 case T_ARRAY:
24039 case T_BIGNUM:
24040 case T_FLOAT:
24041 case T_COMPLEX:
24042 case T_RATIONAL:
24043 break;
24044 case T_NODE:
24045 if (!nd_type_p((NODE *)x, NODE_RIPPER)) {
24046 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
24047 }
24048 x = ((NODE *)x)->nd_rval;
24049 break;
24050 default:
24051 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
24052 (void *)x, rb_obj_classname(x));
24053 }
24054 if (!RBASIC_CLASS(x)) {
24055 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
24056 (void *)x, rb_builtin_type_name(TYPE(x)));
24057 }
24058 return x;
24059}
24060#endif
24061
24062#define validate(x) ((x) = get_value(x))
24063
24064static VALUE
24065ripper_dispatch0(struct parser_params *p, ID mid)
24066{
24067 return rb_funcall(p->value, mid, 0);
24068}
24069
24070static VALUE
24071ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
24072{
24073 validate(a);
24074 return rb_funcall(p->value, mid, 1, a);
24075}
24076
24077static VALUE
24078ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
24079{
24080 validate(a);
24081 validate(b);
24082 return rb_funcall(p->value, mid, 2, a, b);
24083}
24084
24085static VALUE
24086ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
24087{
24088 validate(a);
24089 validate(b);
24090 validate(c);
24091 return rb_funcall(p->value, mid, 3, a, b, c);
24092}
24093
24094static VALUE
24095ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
24096{
24097 validate(a);
24098 validate(b);
24099 validate(c);
24100 validate(d);
24101 return rb_funcall(p->value, mid, 4, a, b, c, d);
24102}
24103
24104static VALUE
24105ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
24106{
24107 validate(a);
24108 validate(b);
24109 validate(c);
24110 validate(d);
24111 validate(e);
24112 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
24113}
24114
24115static VALUE
24116ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
24117{
24118 validate(a);
24119 validate(b);
24120 validate(c);
24121 validate(d);
24122 validate(e);
24123 validate(f);
24124 validate(g);
24125 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
24126}
24127
24128static ID
24129ripper_get_id(VALUE v)
24130{
24131 NODE *nd;
24132 if (!RB_TYPE_P(v, T_NODE)) return 0;
24133 nd = (NODE *)v;
24134 if (!nd_type_p(nd, NODE_RIPPER)) return 0;
24135 return nd->nd_vid;
24136}
24137
24138static VALUE
24139ripper_get_value(VALUE v)
24140{
24141 NODE *nd;
24142 if (UNDEF_P(v)) return Qnil;
24143 if (!RB_TYPE_P(v, T_NODE)) return v;
24144 nd = (NODE *)v;
24145 if (!nd_type_p(nd, NODE_RIPPER)) return Qnil;
24146 return nd->nd_rval;
24147}
24148
24149static void
24150ripper_error(struct parser_params *p)
24151{
24152 p->error_p = TRUE;
24153}
24154
24155static void
24156ripper_compile_error(struct parser_params *p, const char *fmt, ...)
24157{
24158 VALUE str;
24159 va_list args;
24160
24161 va_start(args, fmt);
24162 str = rb_vsprintf(fmt, args);
24163 va_end(args);
24164 rb_funcall(p->value, rb_intern("compile_error"), 1, str);
24165 ripper_error(p);
24166}
24167
24168static VALUE
24169ripper_lex_get_generic(struct parser_params *p, VALUE src)
24170{
24171 VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
24172 if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
24174 "gets returned %"PRIsVALUE" (expected String or nil)",
24175 rb_obj_class(line));
24176 }
24177 return line;
24178}
24179
24180static VALUE
24181ripper_lex_io_get(struct parser_params *p, VALUE src)
24182{
24183 return rb_io_gets(src);
24184}
24185
24186static VALUE
24187ripper_s_allocate(VALUE klass)
24188{
24189 struct parser_params *p;
24190 VALUE self = TypedData_Make_Struct(klass, struct parser_params,
24191 &parser_data_type, p);
24192 p->value = self;
24193 return self;
24194}
24195
24196#define ripper_initialized_p(r) ((r)->lex.input != 0)
24197
24198/*
24199 * call-seq:
24200 * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
24201 *
24202 * Create a new Ripper object.
24203 * _src_ must be a String, an IO, or an Object which has #gets method.
24204 *
24205 * This method does not starts parsing.
24206 * See also Ripper#parse and Ripper.parse.
24207 */
24208static VALUE
24209ripper_initialize(int argc, VALUE *argv, VALUE self)
24210{
24211 struct parser_params *p;
24212 VALUE src, fname, lineno;
24213
24214 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24215 rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
24216 if (RB_TYPE_P(src, T_FILE)) {
24217 p->lex.gets = ripper_lex_io_get;
24218 }
24219 else if (rb_respond_to(src, id_gets)) {
24220 p->lex.gets = ripper_lex_get_generic;
24221 }
24222 else {
24223 StringValue(src);
24224 p->lex.gets = lex_get_str;
24225 }
24226 p->lex.input = src;
24227 p->eofp = 0;
24228 if (NIL_P(fname)) {
24229 fname = STR_NEW2("(ripper)");
24230 OBJ_FREEZE(fname);
24231 }
24232 else {
24233 StringValueCStr(fname);
24234 fname = rb_str_new_frozen(fname);
24235 }
24236 parser_initialize(p);
24237
24238 p->ruby_sourcefile_string = fname;
24239 p->ruby_sourcefile = RSTRING_PTR(fname);
24240 p->ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
24241
24242 return Qnil;
24243}
24244
24245static VALUE
24246ripper_parse0(VALUE parser_v)
24247{
24248 struct parser_params *p;
24249
24250 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
24251 parser_prepare(p);
24252 p->ast = rb_ast_new();
24253 ripper_yyparse((void*)p);
24254 rb_ast_dispose(p->ast);
24255 p->ast = 0;
24256 return p->result;
24257}
24258
24259static VALUE
24260ripper_ensure(VALUE parser_v)
24261{
24262 struct parser_params *p;
24263
24264 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
24265 p->parsing_thread = Qnil;
24266 return Qnil;
24267}
24268
24269/*
24270 * call-seq:
24271 * ripper.parse
24272 *
24273 * Start parsing and returns the value of the root action.
24274 */
24275static VALUE
24276ripper_parse(VALUE self)
24277{
24278 struct parser_params *p;
24279
24280 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24281 if (!ripper_initialized_p(p)) {
24282 rb_raise(rb_eArgError, "method called for uninitialized object");
24283 }
24284 if (!NIL_P(p->parsing_thread)) {
24285 if (p->parsing_thread == rb_thread_current())
24286 rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
24287 else
24288 rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
24289 }
24290 p->parsing_thread = rb_thread_current();
24291 rb_ensure(ripper_parse0, self, ripper_ensure, self);
24292
24293 return p->result;
24294}
24295
24296/*
24297 * call-seq:
24298 * ripper.column -> Integer
24299 *
24300 * Return column number of current parsing line.
24301 * This number starts from 0.
24302 */
24303static VALUE
24304ripper_column(VALUE self)
24305{
24306 struct parser_params *p;
24307 long col;
24308
24309 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24310 if (!ripper_initialized_p(p)) {
24311 rb_raise(rb_eArgError, "method called for uninitialized object");
24312 }
24313 if (NIL_P(p->parsing_thread)) return Qnil;
24314 col = p->lex.ptok - p->lex.pbeg;
24315 return LONG2NUM(col);
24316}
24317
24318/*
24319 * call-seq:
24320 * ripper.filename -> String
24321 *
24322 * Return current parsing filename.
24323 */
24324static VALUE
24325ripper_filename(VALUE self)
24326{
24327 struct parser_params *p;
24328
24329 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24330 if (!ripper_initialized_p(p)) {
24331 rb_raise(rb_eArgError, "method called for uninitialized object");
24332 }
24333 return p->ruby_sourcefile_string;
24334}
24335
24336/*
24337 * call-seq:
24338 * ripper.lineno -> Integer
24339 *
24340 * Return line number of current parsing line.
24341 * This number starts from 1.
24342 */
24343static VALUE
24344ripper_lineno(VALUE self)
24345{
24346 struct parser_params *p;
24347
24348 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24349 if (!ripper_initialized_p(p)) {
24350 rb_raise(rb_eArgError, "method called for uninitialized object");
24351 }
24352 if (NIL_P(p->parsing_thread)) return Qnil;
24353 return INT2NUM(p->ruby_sourceline);
24354}
24355
24356/*
24357 * call-seq:
24358 * ripper.state -> Integer
24359 *
24360 * Return scanner state of current token.
24361 */
24362static VALUE
24363ripper_state(VALUE self)
24364{
24365 struct parser_params *p;
24366
24367 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24368 if (!ripper_initialized_p(p)) {
24369 rb_raise(rb_eArgError, "method called for uninitialized object");
24370 }
24371 if (NIL_P(p->parsing_thread)) return Qnil;
24372 return INT2NUM(p->lex.state);
24373}
24374
24375/*
24376 * call-seq:
24377 * ripper.token -> String
24378 *
24379 * Return the current token string.
24380 */
24381static VALUE
24382ripper_token(VALUE self)
24383{
24384 struct parser_params *p;
24385 long pos, len;
24386
24387 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
24388 if (!ripper_initialized_p(p)) {
24389 rb_raise(rb_eArgError, "method called for uninitialized object");
24390 }
24391 if (NIL_P(p->parsing_thread)) return Qnil;
24392 pos = p->lex.ptok - p->lex.pbeg;
24393 len = p->lex.pcur - p->lex.ptok;
24394 return rb_str_subseq(p->lex.lastline, pos, len);
24395}
24396
24397#ifdef RIPPER_DEBUG
24398/* :nodoc: */
24399static VALUE
24400ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
24401{
24402 StringValue(msg);
24403 if (UNDEF_P(obj)) {
24404 rb_raise(rb_eArgError, "%"PRIsVALUE, msg);
24405 }
24406 return Qnil;
24407}
24408
24409/* :nodoc: */
24410static VALUE
24411ripper_value(VALUE self, VALUE obj)
24412{
24413 return ULONG2NUM(obj);
24414}
24415#endif
24416
24417/*
24418 * call-seq:
24419 * Ripper.lex_state_name(integer) -> string
24420 *
24421 * Returns a string representation of lex_state.
24422 */
24423static VALUE
24424ripper_lex_state_name(VALUE self, VALUE state)
24425{
24426 return rb_parser_lex_state_name(NUM2INT(state));
24427}
24428
24429void
24430Init_ripper(void)
24431{
24432 ripper_init_eventids1();
24433 ripper_init_eventids2();
24434 id_warn = rb_intern_const("warn");
24435 id_warning = rb_intern_const("warning");
24436 id_gets = rb_intern_const("gets");
24437 id_assoc = rb_intern_const("=>");
24438
24439 (void)yystpcpy; /* may not used in newer bison */
24440
24441 InitVM(ripper);
24442}
24443
24444void
24445InitVM_ripper(void)
24446{
24447 VALUE Ripper;
24448
24449 Ripper = rb_define_class("Ripper", rb_cObject);
24450 /* version of Ripper */
24451 rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
24452 rb_define_alloc_func(Ripper, ripper_s_allocate);
24453 rb_define_method(Ripper, "initialize", ripper_initialize, -1);
24454 rb_define_method(Ripper, "parse", ripper_parse, 0);
24455 rb_define_method(Ripper, "column", ripper_column, 0);
24456 rb_define_method(Ripper, "filename", ripper_filename, 0);
24457 rb_define_method(Ripper, "lineno", ripper_lineno, 0);
24458 rb_define_method(Ripper, "state", ripper_state, 0);
24459 rb_define_method(Ripper, "token", ripper_token, 0);
24460 rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
24461 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
24462 rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
24463 rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
24464 rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0);
24465 rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1);
24466 rb_define_method(Ripper, "error?", ripper_error_p, 0);
24467#ifdef RIPPER_DEBUG
24468 rb_define_method(Ripper, "assert_Qundef", ripper_assert_Qundef, 2);
24469 rb_define_method(Ripper, "rawVALUE", ripper_value, 1);
24470 rb_define_method(Ripper, "validate_object", ripper_validate_object, 1);
24471#endif
24472
24473 rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
24474 rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
24475
24476 rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
24477
24478<% @exprs.each do |expr, desc| -%>
24479 /* <%=desc%> */
24480 rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
24481<% end %>
24482 ripper_init_eventids1_table(Ripper);
24483 ripper_init_eventids2_table(Ripper);
24484
24485# if 0
24486 /* Hack to let RDoc document SCRIPT_LINES__ */
24487
24488 /*
24489 * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
24490 * after the assignment will be added as an Array of lines with the file
24491 * name as the key.
24492 */
24493 rb_define_global_const("SCRIPT_LINES__", Qnil);
24494#endif
24495
24496}
24497#endif /* RIPPER */
24498
24499/*
24500 * Local variables:
24501 * mode: c
24502 * c-file-style: "ruby"
24503 * End:
24504 */
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
Definition: cxxanyargs.hpp:670
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
Definition: cxxanyargs.hpp:685
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
Definition: cxxanyargs.hpp:677
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
Definition: class.c:888
#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 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:3148
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:684
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:1876
#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:3199
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_ensure(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*e_proc)(VALUE), VALUE data2)
An equivalent to ensure clause.
Definition: eval.c:993
VALUE rb_errinfo(void)
This is the same as $! in Ruby.
Definition: eval.c:1870
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:1980
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:190
VALUE rb_obj_freeze(VALUE obj)
Just calls rb_obj_freeze_inline() inside.
Definition: object.c:1182
#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.
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:3260
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_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:1154
VALUE rb_io_gets(VALUE io)
Reads a "line" from the given IO.
Definition: io.c:4216
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:8899
VALUE rb_io_write(VALUE io, VALUE str)
Writes the given string to the given IO.
Definition: io.c:2264
VALUE rb_io_flush(VALUE io)
Flushes any buffered data within the passed IO to the underlying operating system.
Definition: io.c:2368
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:114
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:3323
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:2825
#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:3149
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:3291
void rb_str_set_len(VALUE str, long len)
Overwrites the length of the string.
Definition: string.c:3019
#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:3036
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:844
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:2788
VALUE rb_attr_get(VALUE obj, ID name)
Identical to rb_ivar_get()
Definition: variable.c:1223
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:2889
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:3197
int rb_respond_to(VALUE obj, ID mid)
Queries if the object responds to the method.
Definition: vm_method.c:2823
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:782
const char * rb_id2name(ID id)
Retrieves the name mapped to the given id.
Definition: symbol.c:959
ID rb_intern_str(VALUE str)
Identical to rb_intern(), except it takes an instance of rb_cString.
Definition: symbol.c:795
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:3439
void rb_define_const(VALUE klass, const char *name, VALUE val)
Defines a Ruby level constant under a namespace.
Definition: variable.c:3427
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.
Definition: cxxanyargs.hpp:56
#define RARRAY_LEN
Just another name of rb_array_len.
Definition: rarray.h:68
#define RARRAY_AREF(a, i)
Definition: rarray.h:583
#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
#define RSTRING_GETMEM(str, ptrvar, lenvar)
Convenient macro to obtain the contents and length at once.
Definition: rstring.h:574
#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:322
#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: parse.h:214
Definition: lex.c:34
Definition: st.h:79
Definition: parse.c:272
Definition: parse.h:192
uintptr_t VALUE
Type that represents a Ruby object.
Definition: value.h:40
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition: value.h:52
#define RBIMPL_WARNING_IGNORED(flag)
Suppresses a warning.
Definition: warning_push.h:80
#define RBIMPL_WARNING_PUSH()
Pushes compiler warning state.
Definition: warning_push.h:55
#define RBIMPL_WARNING_POP()
Pops compiler warning state.
Definition: warning_push.h:62