Ruby 3.1.4p223 (2023-03-30 revision HEAD)
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 12 "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/error.h"
95#include "internal/hash.h"
96#include "internal/imemo.h"
97#include "internal/io.h"
98#include "internal/numeric.h"
99#include "internal/parse.h"
100#include "internal/rational.h"
101#include "internal/re.h"
102#include "internal/symbol.h"
103#include "internal/thread.h"
104#include "internal/variable.h"
105#include "node.h"
106#include "probes.h"
107#include "regenc.h"
108#include "ruby/encoding.h"
109#include "ruby/regex.h"
110#include "ruby/ruby.h"
111#include "ruby/st.h"
112#include "ruby/util.h"
113#include "ruby/ractor.h"
114#include "symbol.h"
115
116enum shareability {
117 shareable_none,
118 shareable_literal,
119 shareable_copy,
120 shareable_everything,
121};
122
123struct lex_context {
124 unsigned int in_defined: 1;
125 unsigned int in_kwarg: 1;
126 unsigned int in_argdef: 1;
127 unsigned int in_def: 1;
128 unsigned int in_class: 1;
129 BITFIELD(enum shareability, shareable_constant_value, 2);
130};
131
132#include "parse.h"
133
134#define NO_LEX_CTXT (struct lex_context){0}
135
136#define AREF(ary, i) RARRAY_AREF(ary, i)
137
138#ifndef WARN_PAST_SCOPE
139# define WARN_PAST_SCOPE 0
140#endif
141
142#define TAB_WIDTH 8
143
144#define yydebug (p->debug) /* disable the global variable definition */
145
146#define YYMALLOC(size) rb_parser_malloc(p, (size))
147#define YYREALLOC(ptr, size) rb_parser_realloc(p, (ptr), (size))
148#define YYCALLOC(nelem, size) rb_parser_calloc(p, (nelem), (size))
149#define YYFREE(ptr) rb_parser_free(p, (ptr))
150#define YYFPRINTF rb_parser_printf
151#define YY_LOCATION_PRINT(File, loc) \
152 rb_parser_printf(p, "%d.%d-%d.%d", \
153 (loc).beg_pos.lineno, (loc).beg_pos.column,\
154 (loc).end_pos.lineno, (loc).end_pos.column)
155#define YYLLOC_DEFAULT(Current, Rhs, N) \
156 do \
157 if (N) \
158 { \
159 (Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
160 (Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
161 } \
162 else \
163 { \
164 (Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
165 (Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
166 } \
167 while (0)
168#define YY_(Msgid) \
169 (((Msgid)[0] == 'm') && (strcmp((Msgid), "memory exhausted") == 0) ? \
170 "nesting too deep" : (Msgid))
171
172#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
173 rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
174#define RUBY_SET_YYLLOC_OF_NONE(Current) \
175 rb_parser_set_location_of_none(p, &(Current))
176#define RUBY_SET_YYLLOC(Current) \
177 rb_parser_set_location(p, &(Current))
178#define RUBY_INIT_YYLLOC() \
179 { \
180 {p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
181 {p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
182 }
183
184enum lex_state_bits {
185 EXPR_BEG_bit, /* ignore newline, +/- is a sign. */
186 EXPR_END_bit, /* newline significant, +/- is an operator. */
187 EXPR_ENDARG_bit, /* ditto, and unbound braces. */
188 EXPR_ENDFN_bit, /* ditto, and unbound braces. */
189 EXPR_ARG_bit, /* newline significant, +/- is an operator. */
190 EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */
191 EXPR_MID_bit, /* newline significant, +/- is an operator. */
192 EXPR_FNAME_bit, /* ignore newline, no reserved words. */
193 EXPR_DOT_bit, /* right after `.' or `::', no reserved words. */
194 EXPR_CLASS_bit, /* immediate after `class', no here document. */
195 EXPR_LABEL_bit, /* flag bit, label is allowed. */
196 EXPR_LABELED_bit, /* flag bit, just after a label. */
197 EXPR_FITEM_bit, /* symbol literal as FNAME. */
198 EXPR_MAX_STATE
199};
200/* examine combinations */
201enum lex_state_e {
202#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit)
203 DEF_EXPR(BEG),
204 DEF_EXPR(END),
205 DEF_EXPR(ENDARG),
206 DEF_EXPR(ENDFN),
207 DEF_EXPR(ARG),
208 DEF_EXPR(CMDARG),
209 DEF_EXPR(MID),
210 DEF_EXPR(FNAME),
211 DEF_EXPR(DOT),
212 DEF_EXPR(CLASS),
213 DEF_EXPR(LABEL),
214 DEF_EXPR(LABELED),
215 DEF_EXPR(FITEM),
216 EXPR_VALUE = EXPR_BEG,
217 EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS),
218 EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG),
219 EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN),
220 EXPR_NONE = 0
221};
222#define IS_lex_state_for(x, ls) ((x) & (ls))
223#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
224#define IS_lex_state(ls) IS_lex_state_for(p->lex.state, (ls))
225#define IS_lex_state_all(ls) IS_lex_state_all_for(p->lex.state, (ls))
226
227# define SET_LEX_STATE(ls) \
228 parser_set_lex_state(p, ls, __LINE__)
229static inline enum lex_state_e parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line);
230
231typedef VALUE stack_type;
232
233static const rb_code_location_t NULL_LOC = { {0, -1}, {0, -1} };
234
235# define SHOW_BITSTACK(stack, name) (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
236# define BITSTACK_PUSH(stack, n) (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
237# define BITSTACK_POP(stack) (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
238# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
239# define BITSTACK_SET(stack, n) ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
240
241/* A flag to identify keyword_do_cond, "do" keyword after condition expression.
242 Examples: `while ... do`, `until ... do`, and `for ... in ... do` */
243#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
244#define COND_POP() BITSTACK_POP(cond_stack)
245#define COND_P() BITSTACK_SET_P(cond_stack)
246#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
247
248/* A flag to identify keyword_do_block; "do" keyword after command_call.
249 Example: `foo 1, 2 do`. */
250#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
251#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
252#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
253#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
254
255struct vtable {
256 ID *tbl;
257 int pos;
258 int capa;
259 struct vtable *prev;
260};
261
262struct local_vars {
263 struct vtable *args;
264 struct vtable *vars;
265 struct vtable *used;
266# if WARN_PAST_SCOPE
267 struct vtable *past;
268# endif
269 struct local_vars *prev;
270# ifndef RIPPER
271 struct {
272 NODE *outer, *inner, *current;
273 } numparam;
274# endif
275};
276
277enum {
278 ORDINAL_PARAM = -1,
279 NO_PARAM = 0,
280 NUMPARAM_MAX = 9,
281};
282
283#define NUMPARAM_ID_P(id) numparam_id_p(id)
284#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1)
285#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1))
286static int
287numparam_id_p(ID id)
288{
289 if (!is_local_id(id)) return 0;
290 unsigned int idx = NUMPARAM_ID_TO_IDX(id);
291 return idx > 0 && idx <= NUMPARAM_MAX;
292}
293static void numparam_name(struct parser_params *p, ID id);
294
295#define DVARS_INHERIT ((void*)1)
296#define DVARS_TOPSCOPE NULL
297#define DVARS_TERMINAL_P(tbl) ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
298
299typedef struct token_info {
300 const char *token;
302 int indent;
303 int nonspc;
304 struct token_info *next;
305} token_info;
306
307typedef struct rb_strterm_struct rb_strterm_t;
308
309/*
310 Structure of Lexer Buffer:
311
312 lex.pbeg lex.ptok lex.pcur lex.pend
313 | | | |
314 |------------+------------+------------|
315 |<---------->|
316 token
317*/
318struct parser_params {
319 rb_imemo_tmpbuf_t *heap;
320
321 YYSTYPE *lval;
322
323 struct {
324 rb_strterm_t *strterm;
325 VALUE (*gets)(struct parser_params*,VALUE);
326 VALUE input;
327 VALUE prevline;
328 VALUE lastline;
329 VALUE nextline;
330 const char *pbeg;
331 const char *pcur;
332 const char *pend;
333 const char *ptok;
334 union {
335 long ptr;
336 VALUE (*call)(VALUE, int);
337 } gets_;
338 enum lex_state_e state;
339 /* track the nest level of any parens "()[]{}" */
340 int paren_nest;
341 /* keep p->lex.paren_nest at the beginning of lambda "->" to detect tLAMBEG and keyword_do_LAMBDA */
342 int lpar_beg;
343 /* track the nest level of only braces "{}" */
344 int brace_nest;
345 } lex;
346 stack_type cond_stack;
347 stack_type cmdarg_stack;
348 int tokidx;
349 int toksiz;
350 int tokline;
351 int heredoc_end;
352 int heredoc_indent;
353 int heredoc_line_indent;
354 char *tokenbuf;
355 struct local_vars *lvtbl;
356 st_table *pvtbl;
357 st_table *pktbl;
358 int line_count;
359 int ruby_sourceline; /* current line no. */
360 const char *ruby_sourcefile; /* current source file */
361 VALUE ruby_sourcefile_string;
362 rb_encoding *enc;
364 VALUE case_labels;
365 VALUE compile_option;
366
367 VALUE debug_buffer;
368 VALUE debug_output;
369
370 ID cur_arg;
371
372 rb_ast_t *ast;
373 int node_id;
374
375 int max_numparam;
376
377 struct lex_context ctxt;
378
379 unsigned int command_start:1;
380 unsigned int eofp: 1;
381 unsigned int ruby__end__seen: 1;
382 unsigned int debug: 1;
383 unsigned int has_shebang: 1;
384 unsigned int token_seen: 1;
385 unsigned int token_info_enabled: 1;
386# if WARN_PAST_SCOPE
387 unsigned int past_scope_enabled: 1;
388# endif
389 unsigned int error_p: 1;
390 unsigned int cr_seen: 1;
391
392#ifndef RIPPER
393 /* Ruby core only */
394
395 unsigned int do_print: 1;
396 unsigned int do_loop: 1;
397 unsigned int do_chomp: 1;
398 unsigned int do_split: 1;
399 unsigned int keep_script_lines: 1;
400
401 NODE *eval_tree_begin;
402 NODE *eval_tree;
403 VALUE error_buffer;
404 VALUE debug_lines;
405 const struct rb_iseq_struct *parent_iseq;
406#else
407 /* Ripper only */
408
409 struct {
410 VALUE token;
411 int line;
412 int col;
413 } delayed;
414
415 VALUE value;
416 VALUE result;
417 VALUE parsing_thread;
418#endif
419};
420
421#define intern_cstr(n,l,en) rb_intern3(n,l,en)
422
423#define STR_NEW(ptr,len) rb_enc_str_new((ptr),(len),p->enc)
424#define STR_NEW0() rb_enc_str_new(0,0,p->enc)
425#define STR_NEW2(ptr) rb_enc_str_new((ptr),strlen(ptr),p->enc)
426#define STR_NEW3(ptr,len,e,func) parser_str_new((ptr),(len),(e),(func),p->enc)
427#define TOK_INTERN() intern_cstr(tok(p), toklen(p), p->enc)
428
429static st_table *
430push_pvtbl(struct parser_params *p)
431{
432 st_table *tbl = p->pvtbl;
433 p->pvtbl = st_init_numtable();
434 return tbl;
435}
436
437static void
438pop_pvtbl(struct parser_params *p, st_table *tbl)
439{
440 st_free_table(p->pvtbl);
441 p->pvtbl = tbl;
442}
443
444static st_table *
445push_pktbl(struct parser_params *p)
446{
447 st_table *tbl = p->pktbl;
448 p->pktbl = 0;
449 return tbl;
450}
451
452static void
453pop_pktbl(struct parser_params *p, st_table *tbl)
454{
455 if (p->pktbl) st_free_table(p->pktbl);
456 p->pktbl = tbl;
457}
458
459RBIMPL_ATTR_NONNULL((1, 2, 3))
460static int parser_yyerror(struct parser_params*, const YYLTYPE *yylloc, const char*);
462static int parser_yyerror0(struct parser_params*, const char*);
463#define yyerror0(msg) parser_yyerror0(p, (msg))
464#define yyerror1(loc, msg) parser_yyerror(p, (loc), (msg))
465#define yyerror(yylloc, p, msg) parser_yyerror(p, yylloc, msg)
466#define token_flush(ptr) ((ptr)->lex.ptok = (ptr)->lex.pcur)
467
468static void token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc);
469static void token_info_push(struct parser_params*, const char *token, const rb_code_location_t *loc);
470static void token_info_pop(struct parser_params*, const char *token, const rb_code_location_t *loc);
471static void token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc);
472static void token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos);
473
474#ifdef RIPPER
475#define compile_for_eval (0)
476#else
477#define compile_for_eval (p->parent_iseq != 0)
478#endif
479
480#define token_column ((int)(p->lex.ptok - p->lex.pbeg))
481
482#define CALL_Q_P(q) ((q) == TOKEN2VAL(tANDDOT))
483#define NODE_CALL_Q(q) (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
484#define NEW_QCALL(q,r,m,a,loc) NEW_NODE(NODE_CALL_Q(q),r,m,a,loc)
485
486#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
487
488#define ANON_BLOCK_ID '&'
489
490static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
491
492#ifndef RIPPER
493static inline void
494rb_discard_node(struct parser_params *p, NODE *n)
495{
496 rb_ast_delete_node(p->ast, n);
497}
498#endif
499
500#ifdef RIPPER
501static inline VALUE
502add_mark_object(struct parser_params *p, VALUE obj)
503{
504 if (!SPECIAL_CONST_P(obj)
505 && !RB_TYPE_P(obj, T_NODE) /* Ripper jumbles NODE objects and other objects... */
506 ) {
507 rb_ast_add_mark_object(p->ast, obj);
508 }
509 return obj;
510}
511#else
512static NODE* node_newnode_with_locals(struct parser_params *, enum node_type, VALUE, VALUE, const rb_code_location_t*);
513#endif
514
515static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE, const rb_code_location_t*);
516#define rb_node_newnode(type, a1, a2, a3, loc) node_newnode(p, (type), (a1), (a2), (a3), (loc))
517
518static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
519
520static int
521parser_get_node_id(struct parser_params *p)
522{
523 int node_id = p->node_id;
524 p->node_id++;
525 return node_id;
526}
527
528#ifndef RIPPER
529static inline void
530set_line_body(NODE *body, int line)
531{
532 if (!body) return;
533 switch (nd_type(body)) {
534 case NODE_RESCUE:
535 case NODE_ENSURE:
536 nd_set_line(body, line);
537 }
538}
539
540#define yyparse ruby_yyparse
541
542static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
543static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
544#define new_nil(loc) NEW_NIL(loc)
545static NODE *new_nil_at(struct parser_params *p, const rb_code_position_t *pos);
546static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
547static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
548static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
549
550static NODE *newline_node(NODE*);
551static void fixpos(NODE*,NODE*);
552
553static int value_expr_gen(struct parser_params*,NODE*);
554static void void_expr(struct parser_params*,NODE*);
555static NODE *remove_begin(NODE*);
556static NODE *remove_begin_all(NODE*);
557#define value_expr(node) value_expr_gen(p, (node))
558static NODE *void_stmts(struct parser_params*,NODE*);
559static void reduce_nodes(struct parser_params*,NODE**);
560static void block_dup_check(struct parser_params*,NODE*,NODE*);
561
562static NODE *block_append(struct parser_params*,NODE*,NODE*);
563static NODE *list_append(struct parser_params*,NODE*,NODE*);
564static NODE *list_concat(NODE*,NODE*);
565static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
566static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
567static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
568static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
569static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
570static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
571static NODE *evstr2dstr(struct parser_params*,NODE*);
572static NODE *splat_array(NODE*);
573static void mark_lvar_used(struct parser_params *p, NODE *rhs);
574
575static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
576static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
577static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
578static 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);
579static 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;}
580
581static bool args_info_empty_p(struct rb_args_info *args);
582static NODE *new_args(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*,const YYLTYPE*);
583static NODE *new_args_tail(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
584static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
585static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc);
586static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
587static NODE *new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc);
588static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
589static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
590
591static NODE *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
592static NODE *args_with_numbered(struct parser_params*,NODE*,int);
593
594static VALUE negate_lit(struct parser_params*, VALUE);
595static NODE *ret_args(struct parser_params*,NODE*);
596static NODE *arg_blk_pass(NODE*,NODE*);
597static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
598static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
599
600static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
601static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
602
603static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
604static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
605
606static void rb_backref_error(struct parser_params*,NODE*);
607static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
608
609static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
610static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
611static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
612static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
613static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
614
615static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
616
617static NODE *opt_arg_append(NODE*, NODE*);
618static NODE *kwd_append(NODE*, NODE*);
619
620static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
621static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
622
623static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
624
625static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
626
627#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
628
629static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
630
631static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
632
633static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
634
635static rb_ast_id_table_t *local_tbl(struct parser_params*);
636
637static VALUE reg_compile(struct parser_params*, VALUE, int);
638static void reg_fragment_setenc(struct parser_params*, VALUE, int);
639static int reg_fragment_check(struct parser_params*, VALUE, int);
640static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
641
642static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
643static NODE *heredoc_dedent(struct parser_params*,NODE*);
644
645static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
646
647#define get_id(id) (id)
648#define get_value(val) (val)
649#define get_num(num) (num)
650#else /* RIPPER */
651#define NODE_RIPPER NODE_CDECL
652#define NEW_RIPPER(a,b,c,loc) (VALUE)NEW_CDECL(a,b,c,loc)
653
654static inline int ripper_is_node_yylval(VALUE n);
655
656static inline VALUE
657ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
658{
659 if (ripper_is_node_yylval(c)) c = RNODE(c)->nd_cval;
660 add_mark_object(p, b);
661 add_mark_object(p, c);
662 return NEW_RIPPER(a, b, c, &NULL_LOC);
663}
664
665static inline int
666ripper_is_node_yylval(VALUE n)
667{
668 return RB_TYPE_P(n, T_NODE) && nd_type_p(RNODE(n), NODE_RIPPER);
669}
670
671#define value_expr(node) ((void)(node))
672#define remove_begin(node) (node)
673#define void_stmts(p,x) (x)
674#define rb_dvar_defined(id, base) 0
675#define rb_local_defined(id, base) 0
676static ID ripper_get_id(VALUE);
677#define get_id(id) ripper_get_id(id)
678static VALUE ripper_get_value(VALUE);
679#define get_value(val) ripper_get_value(val)
680#define get_num(num) (int)get_id(num)
681static VALUE assignable(struct parser_params*,VALUE);
682static int id_is_var(struct parser_params *p, ID id);
683
684#define method_cond(p,node,loc) (node)
685#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
686#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
687#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
688#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
689
690#define new_nil(loc) Qnil
691
692static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
693
694static VALUE const_decl(struct parser_params *p, VALUE path);
695
696static VALUE var_field(struct parser_params *p, VALUE a);
697static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
698
699static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
700
701static VALUE backref_error(struct parser_params*, NODE *, VALUE);
702#endif /* !RIPPER */
703
704/* forward declaration */
706
707RUBY_SYMBOL_EXPORT_BEGIN
708VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
709int rb_reg_fragment_setenc(struct parser_params*, VALUE, int);
710enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
711VALUE rb_parser_lex_state_name(enum lex_state_e state);
712void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
713PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
714YYLTYPE *rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
715YYLTYPE *rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc);
716YYLTYPE *rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc);
717RUBY_SYMBOL_EXPORT_END
718
719static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
720static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
721#ifndef RIPPER
722static ID formal_argument(struct parser_params*, ID);
723#else
724static ID formal_argument(struct parser_params*, VALUE);
725#endif
726static ID shadowing_lvar(struct parser_params*,ID);
727static void new_bv(struct parser_params*,ID);
728
729static void local_push(struct parser_params*,int);
730static void local_pop(struct parser_params*);
731static void local_var(struct parser_params*, ID);
732static void arg_var(struct parser_params*, ID);
733static int local_id(struct parser_params *p, ID id);
734static int local_id_ref(struct parser_params*, ID, ID **);
735#ifndef RIPPER
736static ID internal_id(struct parser_params*);
737static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
738#endif
739static int check_forwarding_args(struct parser_params*);
740static void add_forwarding_args(struct parser_params *p);
741
742static const struct vtable *dyna_push(struct parser_params *);
743static void dyna_pop(struct parser_params*, const struct vtable *);
744static int dyna_in_block(struct parser_params*);
745#define dyna_var(p, id) local_var(p, id)
746static int dvar_defined(struct parser_params*, ID);
747static int dvar_defined_ref(struct parser_params*, ID, ID**);
748static int dvar_curr(struct parser_params*,ID);
749
750static int lvar_defined(struct parser_params*, ID);
751
752static NODE *numparam_push(struct parser_params *p);
753static void numparam_pop(struct parser_params *p, NODE *prev_inner);
754
755#ifdef RIPPER
756# define METHOD_NOT idNOT
757#else
758# define METHOD_NOT '!'
759#endif
760
761#define idFWD_REST '*'
762#ifdef RUBY3_KEYWORDS
763#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
764#else
765#define idFWD_KWREST 0
766#endif
767#define idFWD_BLOCK '&'
768
769#define RE_OPTION_ONCE (1<<16)
770#define RE_OPTION_ENCODING_SHIFT 8
771#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
772#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
773#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
774#define RE_OPTION_MASK 0xff
775#define RE_OPTION_ARG_ENCODING_NONE 32
776
777/* structs for managing terminator of string literal and heredocment */
778typedef struct rb_strterm_literal_struct {
779 union {
780 VALUE dummy;
781 long nest;
782 } u0;
783 union {
784 VALUE dummy;
785 long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
786 } u1;
787 union {
788 VALUE dummy;
789 long paren; /* '(' of `%q(...)` */
790 } u2;
791 union {
792 VALUE dummy;
793 long term; /* ')' of `%q(...)` */
794 } u3;
796
797#define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
798
800 VALUE lastline; /* the string of line that contains `<<"END"` */
801 long offset; /* the column of END in `<<"END"` */
802 int sourceline; /* lineno of the line that contains `<<"END"` */
803 unsigned length /* the length of END in `<<"END"` */
804#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
805 : HERETERM_LENGTH_BITS
806# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
807#else
808# define HERETERM_LENGTH_MAX UINT_MAX
809#endif
810 ;
811#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
812 unsigned quote: 1;
813 unsigned func: 8;
814#else
815 uint8_t quote;
816 uint8_t func;
817#endif
818};
819STATIC_ASSERT(rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t) <= 4 * SIZEOF_VALUE);
820
821#define STRTERM_HEREDOC IMEMO_FL_USER0
822
823struct rb_strterm_struct {
824 VALUE flags;
825 union {
826 rb_strterm_literal_t literal;
827 rb_strterm_heredoc_t heredoc;
828 } u;
829};
830
831#ifndef RIPPER
832void
833rb_strterm_mark(VALUE obj)
834{
835 rb_strterm_t *strterm = (rb_strterm_t*)obj;
836 if (RBASIC(obj)->flags & STRTERM_HEREDOC) {
837 rb_strterm_heredoc_t *heredoc = &strterm->u.heredoc;
838 rb_gc_mark(heredoc->lastline);
839 }
840}
841#endif
842
843#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
844size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
845
846#define TOKEN2ID(tok) ( \
847 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
848 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
849 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
850 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
851 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
852 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
853 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
854
855/****** Ripper *******/
856
857#ifdef RIPPER
858#define RIPPER_VERSION "0.1.0"
859
860static inline VALUE intern_sym(const char *name);
861
862#include "eventids1.c"
863#include "eventids2.c"
864
865static VALUE ripper_dispatch0(struct parser_params*,ID);
866static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
867static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
868static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
869static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
870static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
871static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
872static void ripper_error(struct parser_params *p);
873
874#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
875#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
876#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
877#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
878#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
879#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
880#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))
881
882#define yyparse ripper_yyparse
883
884#define ID2VAL(id) STATIC_ID2SYM(id)
885#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
886#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
887
888#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
889 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
890
891#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
892
893static inline VALUE
894new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
895{
896 NODE *t = (NODE *)tail;
897 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value, block = t->u3.value;
898 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, escape_Qundef(block));
899}
900
901static inline VALUE
902new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
903{
904 NODE *t = rb_node_newnode(NODE_ARGS_AUX, kw_args, kw_rest_arg, block, &NULL_LOC);
905 add_mark_object(p, kw_args);
906 add_mark_object(p, kw_rest_arg);
907 add_mark_object(p, block);
908 return (VALUE)t;
909}
910
911static inline VALUE
912args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
913{
914 return args;
915}
916
917static VALUE
918new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
919{
920 NODE *t = (NODE *)aryptn;
921 VALUE pre_args = t->u1.value, rest_arg = t->u2.value, post_args = t->u3.value;
922
923 if (!NIL_P(pre_arg)) {
924 if (!NIL_P(pre_args)) {
925 rb_ary_unshift(pre_args, pre_arg);
926 }
927 else {
928 pre_args = rb_ary_new_from_args(1, pre_arg);
929 }
930 }
931 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
932}
933
934static VALUE
935new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
936{
937 NODE *t;
938
939 if (has_rest) {
940 rest_arg = dispatch1(var_field, rest_arg ? rest_arg : Qnil);
941 }
942 else {
943 rest_arg = Qnil;
944 }
945
946 t = rb_node_newnode(NODE_ARYPTN, pre_args, rest_arg, post_args, &NULL_LOC);
947 add_mark_object(p, pre_args);
948 add_mark_object(p, rest_arg);
949 add_mark_object(p, post_args);
950 return (VALUE)t;
951}
952
953static VALUE
954new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YYLTYPE *loc)
955{
956 NODE *t = (NODE *)fndptn;
957 VALUE pre_rest_arg = t->u1.value, args = t->u2.value, post_rest_arg = t->u3.value;
958
959 return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg);
960}
961
962static VALUE
963new_find_pattern_tail(struct parser_params *p, VALUE pre_rest_arg, VALUE args, VALUE post_rest_arg, const YYLTYPE *loc)
964{
965 NODE *t;
966
967 pre_rest_arg = dispatch1(var_field, pre_rest_arg ? pre_rest_arg : Qnil);
968 post_rest_arg = dispatch1(var_field, post_rest_arg ? post_rest_arg : Qnil);
969
970 t = rb_node_newnode(NODE_FNDPTN, pre_rest_arg, args, post_rest_arg, &NULL_LOC);
971 add_mark_object(p, pre_rest_arg);
972 add_mark_object(p, args);
973 add_mark_object(p, post_rest_arg);
974 return (VALUE)t;
975}
976
977#define new_hash(p,h,l) rb_ary_new_from_args(0)
978
979static VALUE
980new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
981{
982 return ary;
983}
984
985static VALUE
986new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
987{
988 NODE *t = (NODE *)hshptn;
989 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value;
990 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
991}
992
993static VALUE
994new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
995{
996 NODE *t;
997 if (kw_rest_arg) {
998 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
999 }
1000 else {
1001 kw_rest_arg = Qnil;
1002 }
1003 t = rb_node_newnode(NODE_HSHPTN, kw_args, kw_rest_arg, 0, &NULL_LOC);
1004
1005 add_mark_object(p, kw_args);
1006 add_mark_object(p, kw_rest_arg);
1007 return (VALUE)t;
1008}
1009
1010#define new_defined(p,expr,loc) dispatch1(defined, (expr))
1011
1012static VALUE heredoc_dedent(struct parser_params*,VALUE);
1013
1014#else
1015#define ID2VAL(id) (id)
1016#define TOKEN2VAL(t) ID2VAL(t)
1017#define KWD2EID(t, v) keyword_##t
1018
1019static NODE *
1020set_defun_body(struct parser_params *p, NODE *n, NODE *args, NODE *body, const YYLTYPE *loc)
1021{
1022 body = remove_begin(body);
1023 reduce_nodes(p, &body);
1024 n->nd_defn = NEW_SCOPE(args, body, loc);
1025 n->nd_loc = *loc;
1026 nd_set_line(n->nd_defn, loc->end_pos.lineno);
1027 set_line_body(body, loc->beg_pos.lineno);
1028 return n;
1029}
1030
1031static NODE *
1032rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1033 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1034{
1035 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1036 rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1037 loc.beg_pos = arg_loc->beg_pos;
1038 return NEW_RESCUE(arg, rescue, 0, &loc);
1039}
1040
1041#endif /* RIPPER */
1042
1043static void
1044restore_defun(struct parser_params *p, NODE *name)
1045{
1046 YYSTYPE c = {.val = name->nd_cval};
1047 p->cur_arg = name->nd_vid;
1048 p->ctxt.in_def = c.ctxt.in_def;
1049 p->ctxt.shareable_constant_value = c.ctxt.shareable_constant_value;
1050}
1051
1052static void
1053endless_method_name(struct parser_params *p, NODE *defn, const YYLTYPE *loc)
1054{
1055#ifdef RIPPER
1056 defn = defn->nd_defn;
1057#endif
1058 ID mid = defn->nd_mid;
1059 if (is_attrset_id(mid)) {
1060 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1061 }
1062 token_info_drop(p, "def", loc->beg_pos);
1063}
1064
1065#ifndef RIPPER
1066# define Qnone 0
1067# define Qnull 0
1068# define ifndef_ripper(x) (x)
1069#else
1070# define Qnone Qnil
1071# define Qnull Qundef
1072# define ifndef_ripper(x)
1073#endif
1074
1075# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1076# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1077# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1078# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1079# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1080# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1081# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1082# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1083# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1084# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1085# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1086# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1087# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1088# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1089# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1090# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1091# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1092# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1093# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1094# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1095#ifdef RIPPER
1096static ID id_warn, id_warning, id_gets, id_assoc;
1097# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1098# define WARN_S_L(s,l) STR_NEW(s,l)
1099# define WARN_S(s) STR_NEW2(s)
1100# define WARN_I(i) INT2NUM(i)
1101# define WARN_ID(i) rb_id2str(i)
1102# define WARN_IVAL(i) i
1103# define PRIsWARN "s"
1104# define rb_warn0L_experimental(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1105# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1106# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1107# ifdef HAVE_VA_ARGS_MACRO
1108# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1109# else
1110# define WARN_CALL rb_funcall
1111# endif
1112# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1113# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1114# ifdef HAVE_VA_ARGS_MACRO
1115# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1116# else
1117# define WARNING_CALL rb_funcall
1118# endif
1119PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1120# define compile_error ripper_compile_error
1121#else
1122# define WARN_S_L(s,l) s
1123# define WARN_S(s) s
1124# define WARN_I(i) i
1125# define WARN_ID(i) rb_id2name(i)
1126# define WARN_IVAL(i) NUM2INT(i)
1127# define PRIsWARN PRIsVALUE
1128# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1129# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1130# define WARN_CALL rb_compile_warn
1131# define rb_warn0L_experimental(l,fmt) rb_category_compile_warn(RB_WARN_CATEGORY_EXPERIMENTAL, WARN_ARGS_L(l, fmt, 1))
1132# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1133# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1134# define WARNING_CALL rb_compile_warning
1135PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1136# define compile_error parser_compile_error
1137#endif
1138
1139#define WARN_EOL(tok) \
1140 (looking_at_eol_p(p) ? \
1141 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1142 (void)0)
1143static int looking_at_eol_p(struct parser_params *p);
1144
1145#line 1146 "parse.c"
1146
1147# ifndef YY_CAST
1148# ifdef __cplusplus
1149# define YY_CAST(Type, Val) static_cast<Type> (Val)
1150# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1151# else
1152# define YY_CAST(Type, Val) ((Type) (Val))
1153# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1154# endif
1155# endif
1156# ifndef YY_NULLPTR
1157# if defined __cplusplus
1158# if 201103L <= __cplusplus
1159# define YY_NULLPTR nullptr
1160# else
1161# define YY_NULLPTR 0
1162# endif
1163# else
1164# define YY_NULLPTR ((void*)0)
1165# endif
1166# endif
1167
1168/* Use api.header.include to #include this header
1169 instead of duplicating it here. */
1170#ifndef YY_YY_Y_TAB_H_INCLUDED
1171# define YY_YY_Y_TAB_H_INCLUDED
1172/* Debug traces. */
1173#ifndef YYDEBUG
1174# define YYDEBUG 0
1175#endif
1176#if YYDEBUG
1177#ifndef yydebug
1178extern int yydebug;
1179#endif
1180#endif
1181
1182/* Token kinds. */
1183#ifndef YYTOKENTYPE
1184# define YYTOKENTYPE
1185 enum yytokentype
1186 {
1187 YYEMPTY = -2,
1188 END_OF_INPUT = 0, /* "end-of-input" */
1189 YYerror = 256, /* error */
1190 YYUNDEF = 257, /* "invalid token" */
1191 keyword_class = 258, /* "`class'" */
1192 keyword_module = 259, /* "`module'" */
1193 keyword_def = 260, /* "`def'" */
1194 keyword_undef = 261, /* "`undef'" */
1195 keyword_begin = 262, /* "`begin'" */
1196 keyword_rescue = 263, /* "`rescue'" */
1197 keyword_ensure = 264, /* "`ensure'" */
1198 keyword_end = 265, /* "`end'" */
1199 keyword_if = 266, /* "`if'" */
1200 keyword_unless = 267, /* "`unless'" */
1201 keyword_then = 268, /* "`then'" */
1202 keyword_elsif = 269, /* "`elsif'" */
1203 keyword_else = 270, /* "`else'" */
1204 keyword_case = 271, /* "`case'" */
1205 keyword_when = 272, /* "`when'" */
1206 keyword_while = 273, /* "`while'" */
1207 keyword_until = 274, /* "`until'" */
1208 keyword_for = 275, /* "`for'" */
1209 keyword_break = 276, /* "`break'" */
1210 keyword_next = 277, /* "`next'" */
1211 keyword_redo = 278, /* "`redo'" */
1212 keyword_retry = 279, /* "`retry'" */
1213 keyword_in = 280, /* "`in'" */
1214 keyword_do = 281, /* "`do'" */
1215 keyword_do_cond = 282, /* "`do' for condition" */
1216 keyword_do_block = 283, /* "`do' for block" */
1217 keyword_do_LAMBDA = 284, /* "`do' for lambda" */
1218 keyword_return = 285, /* "`return'" */
1219 keyword_yield = 286, /* "`yield'" */
1220 keyword_super = 287, /* "`super'" */
1221 keyword_self = 288, /* "`self'" */
1222 keyword_nil = 289, /* "`nil'" */
1223 keyword_true = 290, /* "`true'" */
1224 keyword_false = 291, /* "`false'" */
1225 keyword_and = 292, /* "`and'" */
1226 keyword_or = 293, /* "`or'" */
1227 keyword_not = 294, /* "`not'" */
1228 modifier_if = 295, /* "`if' modifier" */
1229 modifier_unless = 296, /* "`unless' modifier" */
1230 modifier_while = 297, /* "`while' modifier" */
1231 modifier_until = 298, /* "`until' modifier" */
1232 modifier_rescue = 299, /* "`rescue' modifier" */
1233 keyword_alias = 300, /* "`alias'" */
1234 keyword_defined = 301, /* "`defined?'" */
1235 keyword_BEGIN = 302, /* "`BEGIN'" */
1236 keyword_END = 303, /* "`END'" */
1237 keyword__LINE__ = 304, /* "`__LINE__'" */
1238 keyword__FILE__ = 305, /* "`__FILE__'" */
1239 keyword__ENCODING__ = 306, /* "`__ENCODING__'" */
1240 tIDENTIFIER = 307, /* "local variable or method" */
1241 tFID = 308, /* "method" */
1242 tGVAR = 309, /* "global variable" */
1243 tIVAR = 310, /* "instance variable" */
1244 tCONSTANT = 311, /* "constant" */
1245 tCVAR = 312, /* "class variable" */
1246 tLABEL = 313, /* "label" */
1247 tINTEGER = 314, /* "integer literal" */
1248 tFLOAT = 315, /* "float literal" */
1249 tRATIONAL = 316, /* "rational literal" */
1250 tIMAGINARY = 317, /* "imaginary literal" */
1251 tCHAR = 318, /* "char literal" */
1252 tNTH_REF = 319, /* "numbered reference" */
1253 tBACK_REF = 320, /* "back reference" */
1254 tSTRING_CONTENT = 321, /* "literal content" */
1255 tREGEXP_END = 322, /* tREGEXP_END */
1256 tSP = 323, /* "escaped space" */
1257 tUPLUS = 132, /* "unary+" */
1258 tUMINUS = 133, /* "unary-" */
1259 tPOW = 134, /* "**" */
1260 tCMP = 135, /* "<=>" */
1261 tEQ = 140, /* "==" */
1262 tEQQ = 141, /* "===" */
1263 tNEQ = 142, /* "!=" */
1264 tGEQ = 139, /* ">=" */
1265 tLEQ = 138, /* "<=" */
1266 tANDOP = 148, /* "&&" */
1267 tOROP = 149, /* "||" */
1268 tMATCH = 143, /* "=~" */
1269 tNMATCH = 144, /* "!~" */
1270 tDOT2 = 128, /* ".." */
1271 tDOT3 = 129, /* "..." */
1272 tBDOT2 = 130, /* "(.." */
1273 tBDOT3 = 131, /* "(..." */
1274 tAREF = 145, /* "[]" */
1275 tASET = 146, /* "[]=" */
1276 tLSHFT = 136, /* "<<" */
1277 tRSHFT = 137, /* ">>" */
1278 tANDDOT = 150, /* "&." */
1279 tCOLON2 = 147, /* "::" */
1280 tCOLON3 = 324, /* ":: at EXPR_BEG" */
1281 tOP_ASGN = 325, /* "operator-assignment" */
1282 tASSOC = 326, /* "=>" */
1283 tLPAREN = 327, /* "(" */
1284 tLPAREN_ARG = 328, /* "( arg" */
1285 tRPAREN = 329, /* ")" */
1286 tLBRACK = 330, /* "[" */
1287 tLBRACE = 331, /* "{" */
1288 tLBRACE_ARG = 332, /* "{ arg" */
1289 tSTAR = 333, /* "*" */
1290 tDSTAR = 334, /* "**arg" */
1291 tAMPER = 335, /* "&" */
1292 tLAMBDA = 336, /* "->" */
1293 tSYMBEG = 337, /* "symbol literal" */
1294 tSTRING_BEG = 338, /* "string literal" */
1295 tXSTRING_BEG = 339, /* "backtick literal" */
1296 tREGEXP_BEG = 340, /* "regexp literal" */
1297 tWORDS_BEG = 341, /* "word list" */
1298 tQWORDS_BEG = 342, /* "verbatim word list" */
1299 tSYMBOLS_BEG = 343, /* "symbol list" */
1300 tQSYMBOLS_BEG = 344, /* "verbatim symbol list" */
1301 tSTRING_END = 345, /* "terminator" */
1302 tSTRING_DEND = 346, /* "'}'" */
1303 tSTRING_DBEG = 347, /* tSTRING_DBEG */
1304 tSTRING_DVAR = 348, /* tSTRING_DVAR */
1305 tLAMBEG = 349, /* tLAMBEG */
1306 tLABEL_END = 350, /* tLABEL_END */
1307 tLOWEST = 351, /* tLOWEST */
1308 tUMINUS_NUM = 352, /* tUMINUS_NUM */
1309 tLAST_TOKEN = 353 /* tLAST_TOKEN */
1310 };
1311 typedef enum yytokentype yytoken_kind_t;
1312#endif
1313
1314/* Value type. */
1315#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1316union YYSTYPE
1317{
1318#line 1126 "parse.y"
1319
1320 VALUE val;
1321 NODE *node;
1322 ID id;
1323 int num;
1324 st_table *tbl;
1325 const struct vtable *vars;
1326 struct rb_strterm_struct *strterm;
1327 struct lex_context ctxt;
1328
1329#line 1328 "parse.c"
1330
1331};
1332typedef union YYSTYPE YYSTYPE;
1333# define YYSTYPE_IS_TRIVIAL 1
1334# define YYSTYPE_IS_DECLARED 1
1335#endif
1336
1337/* Location type. */
1338#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
1339typedef struct YYLTYPE YYLTYPE;
1340struct YYLTYPE
1341{
1342 int first_line;
1343 int first_column;
1344 int last_line;
1345 int last_column;
1346};
1347# define YYLTYPE_IS_DECLARED 1
1348# define YYLTYPE_IS_TRIVIAL 1
1349#endif
1350
1351
1352
1353
1354int yyparse (struct parser_params *p);
1355
1356
1357#endif /* !YY_YY_Y_TAB_H_INCLUDED */
1358/* Symbol kind. */
1359enum yysymbol_kind_t
1360{
1361 YYSYMBOL_YYEMPTY = -2,
1362 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1363 YYSYMBOL_YYerror = 1, /* error */
1364 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1365 YYSYMBOL_keyword_class = 3, /* "`class'" */
1366 YYSYMBOL_keyword_module = 4, /* "`module'" */
1367 YYSYMBOL_keyword_def = 5, /* "`def'" */
1368 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
1369 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
1370 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
1371 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
1372 YYSYMBOL_keyword_end = 10, /* "`end'" */
1373 YYSYMBOL_keyword_if = 11, /* "`if'" */
1374 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
1375 YYSYMBOL_keyword_then = 13, /* "`then'" */
1376 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
1377 YYSYMBOL_keyword_else = 15, /* "`else'" */
1378 YYSYMBOL_keyword_case = 16, /* "`case'" */
1379 YYSYMBOL_keyword_when = 17, /* "`when'" */
1380 YYSYMBOL_keyword_while = 18, /* "`while'" */
1381 YYSYMBOL_keyword_until = 19, /* "`until'" */
1382 YYSYMBOL_keyword_for = 20, /* "`for'" */
1383 YYSYMBOL_keyword_break = 21, /* "`break'" */
1384 YYSYMBOL_keyword_next = 22, /* "`next'" */
1385 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
1386 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
1387 YYSYMBOL_keyword_in = 25, /* "`in'" */
1388 YYSYMBOL_keyword_do = 26, /* "`do'" */
1389 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
1390 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
1391 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
1392 YYSYMBOL_keyword_return = 30, /* "`return'" */
1393 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
1394 YYSYMBOL_keyword_super = 32, /* "`super'" */
1395 YYSYMBOL_keyword_self = 33, /* "`self'" */
1396 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
1397 YYSYMBOL_keyword_true = 35, /* "`true'" */
1398 YYSYMBOL_keyword_false = 36, /* "`false'" */
1399 YYSYMBOL_keyword_and = 37, /* "`and'" */
1400 YYSYMBOL_keyword_or = 38, /* "`or'" */
1401 YYSYMBOL_keyword_not = 39, /* "`not'" */
1402 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
1403 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
1404 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
1405 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
1406 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
1407 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
1408 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
1409 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
1410 YYSYMBOL_keyword_END = 48, /* "`END'" */
1411 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
1412 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
1413 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
1414 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
1415 YYSYMBOL_tFID = 53, /* "method" */
1416 YYSYMBOL_tGVAR = 54, /* "global variable" */
1417 YYSYMBOL_tIVAR = 55, /* "instance variable" */
1418 YYSYMBOL_tCONSTANT = 56, /* "constant" */
1419 YYSYMBOL_tCVAR = 57, /* "class variable" */
1420 YYSYMBOL_tLABEL = 58, /* "label" */
1421 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
1422 YYSYMBOL_tFLOAT = 60, /* "float literal" */
1423 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
1424 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
1425 YYSYMBOL_tCHAR = 63, /* "char literal" */
1426 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
1427 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
1428 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
1429 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
1430 YYSYMBOL_68_ = 68, /* '.' */
1431 YYSYMBOL_69_backslash_ = 69, /* "backslash" */
1432 YYSYMBOL_tSP = 70, /* "escaped space" */
1433 YYSYMBOL_71_escaped_horizontal_tab_ = 71, /* "escaped horizontal tab" */
1434 YYSYMBOL_72_escaped_form_feed_ = 72, /* "escaped form feed" */
1435 YYSYMBOL_73_escaped_carriage_return_ = 73, /* "escaped carriage return" */
1436 YYSYMBOL_74_escaped_vertical_tab_ = 74, /* "escaped vertical tab" */
1437 YYSYMBOL_tUPLUS = 75, /* "unary+" */
1438 YYSYMBOL_tUMINUS = 76, /* "unary-" */
1439 YYSYMBOL_tPOW = 77, /* "**" */
1440 YYSYMBOL_tCMP = 78, /* "<=>" */
1441 YYSYMBOL_tEQ = 79, /* "==" */
1442 YYSYMBOL_tEQQ = 80, /* "===" */
1443 YYSYMBOL_tNEQ = 81, /* "!=" */
1444 YYSYMBOL_tGEQ = 82, /* ">=" */
1445 YYSYMBOL_tLEQ = 83, /* "<=" */
1446 YYSYMBOL_tANDOP = 84, /* "&&" */
1447 YYSYMBOL_tOROP = 85, /* "||" */
1448 YYSYMBOL_tMATCH = 86, /* "=~" */
1449 YYSYMBOL_tNMATCH = 87, /* "!~" */
1450 YYSYMBOL_tDOT2 = 88, /* ".." */
1451 YYSYMBOL_tDOT3 = 89, /* "..." */
1452 YYSYMBOL_tBDOT2 = 90, /* "(.." */
1453 YYSYMBOL_tBDOT3 = 91, /* "(..." */
1454 YYSYMBOL_tAREF = 92, /* "[]" */
1455 YYSYMBOL_tASET = 93, /* "[]=" */
1456 YYSYMBOL_tLSHFT = 94, /* "<<" */
1457 YYSYMBOL_tRSHFT = 95, /* ">>" */
1458 YYSYMBOL_tANDDOT = 96, /* "&." */
1459 YYSYMBOL_tCOLON2 = 97, /* "::" */
1460 YYSYMBOL_tCOLON3 = 98, /* ":: at EXPR_BEG" */
1461 YYSYMBOL_tOP_ASGN = 99, /* "operator-assignment" */
1462 YYSYMBOL_tASSOC = 100, /* "=>" */
1463 YYSYMBOL_tLPAREN = 101, /* "(" */
1464 YYSYMBOL_tLPAREN_ARG = 102, /* "( arg" */
1465 YYSYMBOL_tRPAREN = 103, /* ")" */
1466 YYSYMBOL_tLBRACK = 104, /* "[" */
1467 YYSYMBOL_tLBRACE = 105, /* "{" */
1468 YYSYMBOL_tLBRACE_ARG = 106, /* "{ arg" */
1469 YYSYMBOL_tSTAR = 107, /* "*" */
1470 YYSYMBOL_tDSTAR = 108, /* "**arg" */
1471 YYSYMBOL_tAMPER = 109, /* "&" */
1472 YYSYMBOL_tLAMBDA = 110, /* "->" */
1473 YYSYMBOL_tSYMBEG = 111, /* "symbol literal" */
1474 YYSYMBOL_tSTRING_BEG = 112, /* "string literal" */
1475 YYSYMBOL_tXSTRING_BEG = 113, /* "backtick literal" */
1476 YYSYMBOL_tREGEXP_BEG = 114, /* "regexp literal" */
1477 YYSYMBOL_tWORDS_BEG = 115, /* "word list" */
1478 YYSYMBOL_tQWORDS_BEG = 116, /* "verbatim word list" */
1479 YYSYMBOL_tSYMBOLS_BEG = 117, /* "symbol list" */
1480 YYSYMBOL_tQSYMBOLS_BEG = 118, /* "verbatim symbol list" */
1481 YYSYMBOL_tSTRING_END = 119, /* "terminator" */
1482 YYSYMBOL_tSTRING_DEND = 120, /* "'}'" */
1483 YYSYMBOL_tSTRING_DBEG = 121, /* tSTRING_DBEG */
1484 YYSYMBOL_tSTRING_DVAR = 122, /* tSTRING_DVAR */
1485 YYSYMBOL_tLAMBEG = 123, /* tLAMBEG */
1486 YYSYMBOL_tLABEL_END = 124, /* tLABEL_END */
1487 YYSYMBOL_tLOWEST = 125, /* tLOWEST */
1488 YYSYMBOL_126_ = 126, /* '=' */
1489 YYSYMBOL_127_ = 127, /* '?' */
1490 YYSYMBOL_128_ = 128, /* ':' */
1491 YYSYMBOL_129_ = 129, /* '>' */
1492 YYSYMBOL_130_ = 130, /* '<' */
1493 YYSYMBOL_131_ = 131, /* '|' */
1494 YYSYMBOL_132_ = 132, /* '^' */
1495 YYSYMBOL_133_ = 133, /* '&' */
1496 YYSYMBOL_134_ = 134, /* '+' */
1497 YYSYMBOL_135_ = 135, /* '-' */
1498 YYSYMBOL_136_ = 136, /* '*' */
1499 YYSYMBOL_137_ = 137, /* '/' */
1500 YYSYMBOL_138_ = 138, /* '%' */
1501 YYSYMBOL_tUMINUS_NUM = 139, /* tUMINUS_NUM */
1502 YYSYMBOL_140_ = 140, /* '!' */
1503 YYSYMBOL_141_ = 141, /* '~' */
1504 YYSYMBOL_tLAST_TOKEN = 142, /* tLAST_TOKEN */
1505 YYSYMBOL_143_ = 143, /* '{' */
1506 YYSYMBOL_144_ = 144, /* '}' */
1507 YYSYMBOL_145_ = 145, /* '[' */
1508 YYSYMBOL_146_ = 146, /* ',' */
1509 YYSYMBOL_147_ = 147, /* '`' */
1510 YYSYMBOL_148_ = 148, /* '(' */
1511 YYSYMBOL_149_ = 149, /* ')' */
1512 YYSYMBOL_150_ = 150, /* ']' */
1513 YYSYMBOL_151_ = 151, /* ';' */
1514 YYSYMBOL_152_ = 152, /* ' ' */
1515 YYSYMBOL_153_n_ = 153, /* '\n' */
1516 YYSYMBOL_YYACCEPT = 154, /* $accept */
1517 YYSYMBOL_program = 155, /* program */
1518 YYSYMBOL_156_1 = 156, /* $@1 */
1519 YYSYMBOL_top_compstmt = 157, /* top_compstmt */
1520 YYSYMBOL_top_stmts = 158, /* top_stmts */
1521 YYSYMBOL_top_stmt = 159, /* top_stmt */
1522 YYSYMBOL_begin_block = 160, /* begin_block */
1523 YYSYMBOL_bodystmt = 161, /* bodystmt */
1524 YYSYMBOL_162_2 = 162, /* $@2 */
1525 YYSYMBOL_compstmt = 163, /* compstmt */
1526 YYSYMBOL_stmts = 164, /* stmts */
1527 YYSYMBOL_stmt_or_begin = 165, /* stmt_or_begin */
1528 YYSYMBOL_166_3 = 166, /* $@3 */
1529 YYSYMBOL_stmt = 167, /* stmt */
1530 YYSYMBOL_168_4 = 168, /* $@4 */
1531 YYSYMBOL_command_asgn = 169, /* command_asgn */
1532 YYSYMBOL_command_rhs = 170, /* command_rhs */
1533 YYSYMBOL_expr = 171, /* expr */
1534 YYSYMBOL_172_5 = 172, /* @5 */
1535 YYSYMBOL_173_6 = 173, /* @6 */
1536 YYSYMBOL_174_7 = 174, /* @7 */
1537 YYSYMBOL_175_8 = 175, /* @8 */
1538 YYSYMBOL_def_name = 176, /* def_name */
1539 YYSYMBOL_defn_head = 177, /* defn_head */
1540 YYSYMBOL_defs_head = 178, /* defs_head */
1541 YYSYMBOL_179_9 = 179, /* $@9 */
1542 YYSYMBOL_expr_value = 180, /* expr_value */
1543 YYSYMBOL_expr_value_do = 181, /* expr_value_do */
1544 YYSYMBOL_182_10 = 182, /* $@10 */
1545 YYSYMBOL_183_11 = 183, /* $@11 */
1546 YYSYMBOL_command_call = 184, /* command_call */
1547 YYSYMBOL_block_command = 185, /* block_command */
1548 YYSYMBOL_cmd_brace_block = 186, /* cmd_brace_block */
1549 YYSYMBOL_fcall = 187, /* fcall */
1550 YYSYMBOL_command = 188, /* command */
1551 YYSYMBOL_mlhs = 189, /* mlhs */
1552 YYSYMBOL_mlhs_inner = 190, /* mlhs_inner */
1553 YYSYMBOL_mlhs_basic = 191, /* mlhs_basic */
1554 YYSYMBOL_mlhs_item = 192, /* mlhs_item */
1555 YYSYMBOL_mlhs_head = 193, /* mlhs_head */
1556 YYSYMBOL_mlhs_post = 194, /* mlhs_post */
1557 YYSYMBOL_mlhs_node = 195, /* mlhs_node */
1558 YYSYMBOL_lhs = 196, /* lhs */
1559 YYSYMBOL_cname = 197, /* cname */
1560 YYSYMBOL_cpath = 198, /* cpath */
1561 YYSYMBOL_fname = 199, /* fname */
1562 YYSYMBOL_fitem = 200, /* fitem */
1563 YYSYMBOL_undef_list = 201, /* undef_list */
1564 YYSYMBOL_202_12 = 202, /* $@12 */
1565 YYSYMBOL_op = 203, /* op */
1566 YYSYMBOL_reswords = 204, /* reswords */
1567 YYSYMBOL_arg = 205, /* arg */
1568 YYSYMBOL_206_13 = 206, /* $@13 */
1569 YYSYMBOL_relop = 207, /* relop */
1570 YYSYMBOL_rel_expr = 208, /* rel_expr */
1571 YYSYMBOL_lex_ctxt = 209, /* lex_ctxt */
1572 YYSYMBOL_arg_value = 210, /* arg_value */
1573 YYSYMBOL_aref_args = 211, /* aref_args */
1574 YYSYMBOL_arg_rhs = 212, /* arg_rhs */
1575 YYSYMBOL_paren_args = 213, /* paren_args */
1576 YYSYMBOL_opt_paren_args = 214, /* opt_paren_args */
1577 YYSYMBOL_opt_call_args = 215, /* opt_call_args */
1578 YYSYMBOL_call_args = 216, /* call_args */
1579 YYSYMBOL_command_args = 217, /* command_args */
1580 YYSYMBOL_218_14 = 218, /* $@14 */
1581 YYSYMBOL_block_arg = 219, /* block_arg */
1582 YYSYMBOL_opt_block_arg = 220, /* opt_block_arg */
1583 YYSYMBOL_args = 221, /* args */
1584 YYSYMBOL_mrhs_arg = 222, /* mrhs_arg */
1585 YYSYMBOL_mrhs = 223, /* mrhs */
1586 YYSYMBOL_primary = 224, /* primary */
1587 YYSYMBOL_225_15 = 225, /* $@15 */
1588 YYSYMBOL_226_16 = 226, /* $@16 */
1589 YYSYMBOL_227_17 = 227, /* $@17 */
1590 YYSYMBOL_228_18 = 228, /* $@18 */
1591 YYSYMBOL_229_19 = 229, /* @19 */
1592 YYSYMBOL_230_20 = 230, /* @20 */
1593 YYSYMBOL_231_21 = 231, /* $@21 */
1594 YYSYMBOL_232_22 = 232, /* $@22 */
1595 YYSYMBOL_233_23 = 233, /* $@23 */
1596 YYSYMBOL_primary_value = 234, /* primary_value */
1597 YYSYMBOL_k_begin = 235, /* k_begin */
1598 YYSYMBOL_k_if = 236, /* k_if */
1599 YYSYMBOL_k_unless = 237, /* k_unless */
1600 YYSYMBOL_k_while = 238, /* k_while */
1601 YYSYMBOL_k_until = 239, /* k_until */
1602 YYSYMBOL_k_case = 240, /* k_case */
1603 YYSYMBOL_k_for = 241, /* k_for */
1604 YYSYMBOL_k_class = 242, /* k_class */
1605 YYSYMBOL_k_module = 243, /* k_module */
1606 YYSYMBOL_k_def = 244, /* k_def */
1607 YYSYMBOL_k_do = 245, /* k_do */
1608 YYSYMBOL_k_do_block = 246, /* k_do_block */
1609 YYSYMBOL_k_rescue = 247, /* k_rescue */
1610 YYSYMBOL_k_ensure = 248, /* k_ensure */
1611 YYSYMBOL_k_when = 249, /* k_when */
1612 YYSYMBOL_k_else = 250, /* k_else */
1613 YYSYMBOL_k_elsif = 251, /* k_elsif */
1614 YYSYMBOL_k_end = 252, /* k_end */
1615 YYSYMBOL_k_return = 253, /* k_return */
1616 YYSYMBOL_then = 254, /* then */
1617 YYSYMBOL_do = 255, /* do */
1618 YYSYMBOL_if_tail = 256, /* if_tail */
1619 YYSYMBOL_opt_else = 257, /* opt_else */
1620 YYSYMBOL_for_var = 258, /* for_var */
1621 YYSYMBOL_f_marg = 259, /* f_marg */
1622 YYSYMBOL_f_marg_list = 260, /* f_marg_list */
1623 YYSYMBOL_f_margs = 261, /* f_margs */
1624 YYSYMBOL_f_rest_marg = 262, /* f_rest_marg */
1625 YYSYMBOL_f_any_kwrest = 263, /* f_any_kwrest */
1626 YYSYMBOL_f_eq = 264, /* f_eq */
1627 YYSYMBOL_265_24 = 265, /* $@24 */
1628 YYSYMBOL_block_args_tail = 266, /* block_args_tail */
1629 YYSYMBOL_opt_block_args_tail = 267, /* opt_block_args_tail */
1630 YYSYMBOL_excessed_comma = 268, /* excessed_comma */
1631 YYSYMBOL_block_param = 269, /* block_param */
1632 YYSYMBOL_opt_block_param = 270, /* opt_block_param */
1633 YYSYMBOL_block_param_def = 271, /* block_param_def */
1634 YYSYMBOL_opt_bv_decl = 272, /* opt_bv_decl */
1635 YYSYMBOL_bv_decls = 273, /* bv_decls */
1636 YYSYMBOL_bvar = 274, /* bvar */
1637 YYSYMBOL_lambda = 275, /* lambda */
1638 YYSYMBOL_276_25 = 276, /* @25 */
1639 YYSYMBOL_277_26 = 277, /* @26 */
1640 YYSYMBOL_278_27 = 278, /* @27 */
1641 YYSYMBOL_279_28 = 279, /* $@28 */
1642 YYSYMBOL_f_larglist = 280, /* f_larglist */
1643 YYSYMBOL_lambda_body = 281, /* lambda_body */
1644 YYSYMBOL_do_block = 282, /* do_block */
1645 YYSYMBOL_block_call = 283, /* block_call */
1646 YYSYMBOL_method_call = 284, /* method_call */
1647 YYSYMBOL_brace_block = 285, /* brace_block */
1648 YYSYMBOL_brace_body = 286, /* brace_body */
1649 YYSYMBOL_287_29 = 287, /* @29 */
1650 YYSYMBOL_288_30 = 288, /* @30 */
1651 YYSYMBOL_289_31 = 289, /* @31 */
1652 YYSYMBOL_do_body = 290, /* do_body */
1653 YYSYMBOL_291_32 = 291, /* @32 */
1654 YYSYMBOL_292_33 = 292, /* @33 */
1655 YYSYMBOL_293_34 = 293, /* @34 */
1656 YYSYMBOL_case_args = 294, /* case_args */
1657 YYSYMBOL_case_body = 295, /* case_body */
1658 YYSYMBOL_cases = 296, /* cases */
1659 YYSYMBOL_p_case_body = 297, /* p_case_body */
1660 YYSYMBOL_298_35 = 298, /* @35 */
1661 YYSYMBOL_299_36 = 299, /* @36 */
1662 YYSYMBOL_300_37 = 300, /* $@37 */
1663 YYSYMBOL_p_cases = 301, /* p_cases */
1664 YYSYMBOL_p_top_expr = 302, /* p_top_expr */
1665 YYSYMBOL_p_top_expr_body = 303, /* p_top_expr_body */
1666 YYSYMBOL_p_expr = 304, /* p_expr */
1667 YYSYMBOL_p_as = 305, /* p_as */
1668 YYSYMBOL_p_alt = 306, /* p_alt */
1669 YYSYMBOL_p_lparen = 307, /* p_lparen */
1670 YYSYMBOL_p_lbracket = 308, /* p_lbracket */
1671 YYSYMBOL_p_expr_basic = 309, /* p_expr_basic */
1672 YYSYMBOL_310_38 = 310, /* @38 */
1673 YYSYMBOL_311_39 = 311, /* @39 */
1674 YYSYMBOL_p_args = 312, /* p_args */
1675 YYSYMBOL_p_args_head = 313, /* p_args_head */
1676 YYSYMBOL_p_args_tail = 314, /* p_args_tail */
1677 YYSYMBOL_p_find = 315, /* p_find */
1678 YYSYMBOL_p_rest = 316, /* p_rest */
1679 YYSYMBOL_p_args_post = 317, /* p_args_post */
1680 YYSYMBOL_p_arg = 318, /* p_arg */
1681 YYSYMBOL_p_kwargs = 319, /* p_kwargs */
1682 YYSYMBOL_p_kwarg = 320, /* p_kwarg */
1683 YYSYMBOL_p_kw = 321, /* p_kw */
1684 YYSYMBOL_p_kw_label = 322, /* p_kw_label */
1685 YYSYMBOL_p_kwrest = 323, /* p_kwrest */
1686 YYSYMBOL_p_kwnorest = 324, /* p_kwnorest */
1687 YYSYMBOL_p_any_kwrest = 325, /* p_any_kwrest */
1688 YYSYMBOL_p_value = 326, /* p_value */
1689 YYSYMBOL_p_primitive = 327, /* p_primitive */
1690 YYSYMBOL_p_variable = 328, /* p_variable */
1691 YYSYMBOL_p_var_ref = 329, /* p_var_ref */
1692 YYSYMBOL_p_expr_ref = 330, /* p_expr_ref */
1693 YYSYMBOL_p_const = 331, /* p_const */
1694 YYSYMBOL_opt_rescue = 332, /* opt_rescue */
1695 YYSYMBOL_exc_list = 333, /* exc_list */
1696 YYSYMBOL_exc_var = 334, /* exc_var */
1697 YYSYMBOL_opt_ensure = 335, /* opt_ensure */
1698 YYSYMBOL_literal = 336, /* literal */
1699 YYSYMBOL_strings = 337, /* strings */
1700 YYSYMBOL_string = 338, /* string */
1701 YYSYMBOL_string1 = 339, /* string1 */
1702 YYSYMBOL_xstring = 340, /* xstring */
1703 YYSYMBOL_regexp = 341, /* regexp */
1704 YYSYMBOL_words = 342, /* words */
1705 YYSYMBOL_word_list = 343, /* word_list */
1706 YYSYMBOL_word = 344, /* word */
1707 YYSYMBOL_symbols = 345, /* symbols */
1708 YYSYMBOL_symbol_list = 346, /* symbol_list */
1709 YYSYMBOL_qwords = 347, /* qwords */
1710 YYSYMBOL_qsymbols = 348, /* qsymbols */
1711 YYSYMBOL_qword_list = 349, /* qword_list */
1712 YYSYMBOL_qsym_list = 350, /* qsym_list */
1713 YYSYMBOL_string_contents = 351, /* string_contents */
1714 YYSYMBOL_xstring_contents = 352, /* xstring_contents */
1715 YYSYMBOL_regexp_contents = 353, /* regexp_contents */
1716 YYSYMBOL_string_content = 354, /* string_content */
1717 YYSYMBOL_355_40 = 355, /* @40 */
1718 YYSYMBOL_356_41 = 356, /* $@41 */
1719 YYSYMBOL_357_42 = 357, /* @42 */
1720 YYSYMBOL_358_43 = 358, /* @43 */
1721 YYSYMBOL_359_44 = 359, /* @44 */
1722 YYSYMBOL_360_45 = 360, /* @45 */
1723 YYSYMBOL_string_dvar = 361, /* string_dvar */
1724 YYSYMBOL_symbol = 362, /* symbol */
1725 YYSYMBOL_ssym = 363, /* ssym */
1726 YYSYMBOL_sym = 364, /* sym */
1727 YYSYMBOL_dsym = 365, /* dsym */
1728 YYSYMBOL_numeric = 366, /* numeric */
1729 YYSYMBOL_simple_numeric = 367, /* simple_numeric */
1730 YYSYMBOL_nonlocal_var = 368, /* nonlocal_var */
1731 YYSYMBOL_user_variable = 369, /* user_variable */
1732 YYSYMBOL_keyword_variable = 370, /* keyword_variable */
1733 YYSYMBOL_var_ref = 371, /* var_ref */
1734 YYSYMBOL_var_lhs = 372, /* var_lhs */
1735 YYSYMBOL_backref = 373, /* backref */
1736 YYSYMBOL_superclass = 374, /* superclass */
1737 YYSYMBOL_375_46 = 375, /* $@46 */
1738 YYSYMBOL_f_opt_paren_args = 376, /* f_opt_paren_args */
1739 YYSYMBOL_f_paren_args = 377, /* f_paren_args */
1740 YYSYMBOL_f_arglist = 378, /* f_arglist */
1741 YYSYMBOL_379_47 = 379, /* @47 */
1742 YYSYMBOL_args_tail = 380, /* args_tail */
1743 YYSYMBOL_opt_args_tail = 381, /* opt_args_tail */
1744 YYSYMBOL_f_args = 382, /* f_args */
1745 YYSYMBOL_args_forward = 383, /* args_forward */
1746 YYSYMBOL_f_bad_arg = 384, /* f_bad_arg */
1747 YYSYMBOL_f_norm_arg = 385, /* f_norm_arg */
1748 YYSYMBOL_f_arg_asgn = 386, /* f_arg_asgn */
1749 YYSYMBOL_f_arg_item = 387, /* f_arg_item */
1750 YYSYMBOL_f_arg = 388, /* f_arg */
1751 YYSYMBOL_f_label = 389, /* f_label */
1752 YYSYMBOL_f_kw = 390, /* f_kw */
1753 YYSYMBOL_f_block_kw = 391, /* f_block_kw */
1754 YYSYMBOL_f_block_kwarg = 392, /* f_block_kwarg */
1755 YYSYMBOL_f_kwarg = 393, /* f_kwarg */
1756 YYSYMBOL_kwrest_mark = 394, /* kwrest_mark */
1757 YYSYMBOL_f_no_kwarg = 395, /* f_no_kwarg */
1758 YYSYMBOL_f_kwrest = 396, /* f_kwrest */
1759 YYSYMBOL_f_opt = 397, /* f_opt */
1760 YYSYMBOL_f_block_opt = 398, /* f_block_opt */
1761 YYSYMBOL_f_block_optarg = 399, /* f_block_optarg */
1762 YYSYMBOL_f_optarg = 400, /* f_optarg */
1763 YYSYMBOL_restarg_mark = 401, /* restarg_mark */
1764 YYSYMBOL_f_rest_arg = 402, /* f_rest_arg */
1765 YYSYMBOL_blkarg_mark = 403, /* blkarg_mark */
1766 YYSYMBOL_f_block_arg = 404, /* f_block_arg */
1767 YYSYMBOL_opt_f_block_arg = 405, /* opt_f_block_arg */
1768 YYSYMBOL_singleton = 406, /* singleton */
1769 YYSYMBOL_407_48 = 407, /* $@48 */
1770 YYSYMBOL_assoc_list = 408, /* assoc_list */
1771 YYSYMBOL_assocs = 409, /* assocs */
1772 YYSYMBOL_assoc = 410, /* assoc */
1773 YYSYMBOL_operation = 411, /* operation */
1774 YYSYMBOL_operation2 = 412, /* operation2 */
1775 YYSYMBOL_operation3 = 413, /* operation3 */
1776 YYSYMBOL_dot_or_colon = 414, /* dot_or_colon */
1777 YYSYMBOL_call_op = 415, /* call_op */
1778 YYSYMBOL_call_op2 = 416, /* call_op2 */
1779 YYSYMBOL_opt_terms = 417, /* opt_terms */
1780 YYSYMBOL_opt_nl = 418, /* opt_nl */
1781 YYSYMBOL_rparen = 419, /* rparen */
1782 YYSYMBOL_rbracket = 420, /* rbracket */
1783 YYSYMBOL_rbrace = 421, /* rbrace */
1784 YYSYMBOL_trailer = 422, /* trailer */
1785 YYSYMBOL_term = 423, /* term */
1786 YYSYMBOL_terms = 424, /* terms */
1787 YYSYMBOL_none = 425 /* none */
1788};
1789typedef enum yysymbol_kind_t yysymbol_kind_t;
1790
1791
1792
1793
1794#ifdef short
1795# undef short
1796#endif
1797
1798/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
1799 <limits.h> and (if available) <stdint.h> are included
1800 so that the code can choose integer types of a good width. */
1801
1802#ifndef __PTRDIFF_MAX__
1803# include <limits.h> /* INFRINGES ON USER NAME SPACE */
1804# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
1805# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
1806# define YY_STDINT_H
1807# endif
1808#endif
1809
1810/* Narrow types that promote to a signed type and that can represent a
1811 signed or unsigned integer of at least N bits. In tables they can
1812 save space and decrease cache pressure. Promoting to a signed type
1813 helps avoid bugs in integer arithmetic. */
1814
1815#ifdef __INT_LEAST8_MAX__
1816typedef __INT_LEAST8_TYPE__ yytype_int8;
1817#elif defined YY_STDINT_H
1818typedef int_least8_t yytype_int8;
1819#else
1820typedef signed char yytype_int8;
1821#endif
1822
1823#ifdef __INT_LEAST16_MAX__
1824typedef __INT_LEAST16_TYPE__ yytype_int16;
1825#elif defined YY_STDINT_H
1826typedef int_least16_t yytype_int16;
1827#else
1828typedef short yytype_int16;
1829#endif
1830
1831/* Work around bug in HP-UX 11.23, which defines these macros
1832 incorrectly for preprocessor constants. This workaround can likely
1833 be removed in 2023, as HPE has promised support for HP-UX 11.23
1834 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
1835 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
1836#ifdef __hpux
1837# undef UINT_LEAST8_MAX
1838# undef UINT_LEAST16_MAX
1839# define UINT_LEAST8_MAX 255
1840# define UINT_LEAST16_MAX 65535
1841#endif
1842
1843#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
1844typedef __UINT_LEAST8_TYPE__ yytype_uint8;
1845#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
1846 && UINT_LEAST8_MAX <= INT_MAX)
1847typedef uint_least8_t yytype_uint8;
1848#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
1849typedef unsigned char yytype_uint8;
1850#else
1851typedef short yytype_uint8;
1852#endif
1853
1854#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
1855typedef __UINT_LEAST16_TYPE__ yytype_uint16;
1856#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
1857 && UINT_LEAST16_MAX <= INT_MAX)
1858typedef uint_least16_t yytype_uint16;
1859#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
1860typedef unsigned short yytype_uint16;
1861#else
1862typedef int yytype_uint16;
1863#endif
1864
1865#ifndef YYPTRDIFF_T
1866# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
1867# define YYPTRDIFF_T __PTRDIFF_TYPE__
1868# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
1869# elif defined PTRDIFF_MAX
1870# ifndef ptrdiff_t
1871# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1872# endif
1873# define YYPTRDIFF_T ptrdiff_t
1874# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
1875# else
1876# define YYPTRDIFF_T long
1877# define YYPTRDIFF_MAXIMUM LONG_MAX
1878# endif
1879#endif
1880
1881#ifndef YYSIZE_T
1882# ifdef __SIZE_TYPE__
1883# define YYSIZE_T __SIZE_TYPE__
1884# elif defined size_t
1885# define YYSIZE_T size_t
1886# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
1887# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1888# define YYSIZE_T size_t
1889# else
1890# define YYSIZE_T unsigned
1891# endif
1892#endif
1893
1894#define YYSIZE_MAXIMUM \
1895 YY_CAST (YYPTRDIFF_T, \
1896 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
1897 ? YYPTRDIFF_MAXIMUM \
1898 : YY_CAST (YYSIZE_T, -1)))
1899
1900#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
1901
1902
1903/* Stored state numbers (used for stacks). */
1904typedef yytype_int16 yy_state_t;
1905
1906/* State numbers in computations. */
1907typedef int yy_state_fast_t;
1908
1909#ifndef YY_
1910# if defined YYENABLE_NLS && YYENABLE_NLS
1911# if ENABLE_NLS
1912# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1913# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
1914# endif
1915# endif
1916# ifndef YY_
1917# define YY_(Msgid) Msgid
1918# endif
1919#endif
1920
1921
1922#ifndef YY_ATTRIBUTE_PURE
1923# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
1924# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
1925# else
1926# define YY_ATTRIBUTE_PURE
1927# endif
1928#endif
1929
1930#ifndef YY_ATTRIBUTE_UNUSED
1931# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
1932# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
1933# else
1934# define YY_ATTRIBUTE_UNUSED
1935# endif
1936#endif
1937
1938/* Suppress unused-variable warnings by "using" E. */
1939#if ! defined lint || defined __GNUC__
1940# define YY_USE(E) ((void) (E))
1941#else
1942# define YY_USE(E) /* empty */
1943#endif
1944
1945/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1946#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
1947# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
1948# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1949 _Pragma ("GCC diagnostic push") \
1950 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
1951# else
1952# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1953 _Pragma ("GCC diagnostic push") \
1954 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
1955 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1956# endif
1957# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1958 _Pragma ("GCC diagnostic pop")
1959#else
1960# define YY_INITIAL_VALUE(Value) Value
1961#endif
1962#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1963# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1964# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1965#endif
1966#ifndef YY_INITIAL_VALUE
1967# define YY_INITIAL_VALUE(Value) /* Nothing. */
1968#endif
1969
1970#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
1971# define YY_IGNORE_USELESS_CAST_BEGIN \
1972 _Pragma ("GCC diagnostic push") \
1973 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
1974# define YY_IGNORE_USELESS_CAST_END \
1975 _Pragma ("GCC diagnostic pop")
1976#endif
1977#ifndef YY_IGNORE_USELESS_CAST_BEGIN
1978# define YY_IGNORE_USELESS_CAST_BEGIN
1979# define YY_IGNORE_USELESS_CAST_END
1980#endif
1981
1982
1983#define YY_ASSERT(E) ((void) (0 && (E)))
1984
1985#if 1
1986
1987/* The parser invokes alloca or malloc; define the necessary symbols. */
1988
1989# ifdef YYSTACK_USE_ALLOCA
1990# if YYSTACK_USE_ALLOCA
1991# ifdef __GNUC__
1992# define YYSTACK_ALLOC __builtin_alloca
1993# elif defined __BUILTIN_VA_ARG_INCR
1994# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1995# elif defined _AIX
1996# define YYSTACK_ALLOC __alloca
1997# elif defined _MSC_VER
1998# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1999# define alloca _alloca
2000# else
2001# define YYSTACK_ALLOC alloca
2002# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
2003# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2004 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
2005# ifndef EXIT_SUCCESS
2006# define EXIT_SUCCESS 0
2007# endif
2008# endif
2009# endif
2010# endif
2011# endif
2012
2013# ifdef YYSTACK_ALLOC
2014 /* Pacify GCC's 'empty if-body' warning. */
2015# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
2016# ifndef YYSTACK_ALLOC_MAXIMUM
2017 /* The OS might guarantee only one guard page at the bottom of the stack,
2018 and a page size can be as small as 4096 bytes. So we cannot safely
2019 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2020 to allow for a few compiler-allocated temporary stack slots. */
2021# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2022# endif
2023# else
2024# define YYSTACK_ALLOC YYMALLOC
2025# define YYSTACK_FREE YYFREE
2026# ifndef YYSTACK_ALLOC_MAXIMUM
2027# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2028# endif
2029# if (defined __cplusplus && ! defined EXIT_SUCCESS \
2030 && ! ((defined YYMALLOC || defined malloc) \
2031 && (defined YYFREE || defined free)))
2032# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2033# ifndef EXIT_SUCCESS
2034# define EXIT_SUCCESS 0
2035# endif
2036# endif
2037# ifndef YYMALLOC
2038# define YYMALLOC malloc
2039# if ! defined malloc && ! defined EXIT_SUCCESS
2040void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2041# endif
2042# endif
2043# ifndef YYFREE
2044# define YYFREE free
2045# if ! defined free && ! defined EXIT_SUCCESS
2046void free (void *); /* INFRINGES ON USER NAME SPACE */
2047# endif
2048# endif
2049# endif
2050#endif /* 1 */
2051
2052#if (! defined yyoverflow \
2053 && (! defined __cplusplus \
2054 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
2055 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2056
2057/* A type that is properly aligned for any stack member. */
2058union yyalloc
2059{
2060 yy_state_t yyss_alloc;
2061 YYSTYPE yyvs_alloc;
2062 YYLTYPE yyls_alloc;
2063};
2064
2065/* The size of the maximum gap between one aligned stack and the next. */
2066# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
2067
2068/* The size of an array large to enough to hold all stacks, each with
2069 N elements. */
2070# define YYSTACK_BYTES(N) \
2071 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
2072 + YYSIZEOF (YYLTYPE)) \
2073 + 2 * YYSTACK_GAP_MAXIMUM)
2074
2075# define YYCOPY_NEEDED 1
2076
2077/* Relocate STACK from its old location to the new one. The
2078 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2079 elements in the stack, and YYPTR gives the new location of the
2080 stack. Advance YYPTR to a properly aligned location for the next
2081 stack. */
2082# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2083 do \
2084 { \
2085 YYPTRDIFF_T yynewbytes; \
2086 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2087 Stack = &yyptr->Stack_alloc; \
2088 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
2089 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
2090 } \
2091 while (0)
2092
2093#endif
2094
2095#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
2096/* Copy COUNT objects from SRC to DST. The source and destination do
2097 not overlap. */
2098# ifndef YYCOPY
2099# if defined __GNUC__ && 1 < __GNUC__
2100# define YYCOPY(Dst, Src, Count) \
2101 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
2102# else
2103# define YYCOPY(Dst, Src, Count) \
2104 do \
2105 { \
2106 YYPTRDIFF_T yyi; \
2107 for (yyi = 0; yyi < (Count); yyi++) \
2108 (Dst)[yyi] = (Src)[yyi]; \
2109 } \
2110 while (0)
2111# endif
2112# endif
2113#endif /* !YYCOPY_NEEDED */
2114
2115/* YYFINAL -- State number of the termination state. */
2116#define YYFINAL 3
2117/* YYLAST -- Last index in YYTABLE. */
2118#define YYLAST 15161
2119
2120/* YYNTOKENS -- Number of terminals. */
2121#define YYNTOKENS 154
2122/* YYNNTS -- Number of nonterminals. */
2123#define YYNNTS 272
2124/* YYNRULES -- Number of rules. */
2125#define YYNRULES 785
2126/* YYNSTATES -- Number of states. */
2127#define YYNSTATES 1309
2128
2129/* YYMAXUTOK -- Last valid token kind. */
2130#define YYMAXUTOK 353
2131
2132
2133/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2134 as returned by yylex, with out-of-bounds checking. */
2135#define YYTRANSLATE(YYX) \
2136 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2137 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2138 : YYSYMBOL_YYUNDEF)
2139
2140/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2141 as returned by yylex. */
2142static const yytype_uint8 yytranslate[] =
2143{
2144 0, 2, 2, 2, 2, 2, 2, 2, 2, 71,
2145 153, 74, 72, 73, 2, 2, 2, 2, 2, 2,
2146 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2147 2, 2, 152, 140, 2, 2, 2, 138, 133, 2,
2148 148, 149, 136, 134, 146, 135, 68, 137, 2, 2,
2149 2, 2, 2, 2, 2, 2, 2, 2, 128, 151,
2150 130, 126, 129, 127, 2, 2, 2, 2, 2, 2,
2151 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2152 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2153 2, 145, 69, 150, 132, 2, 147, 2, 2, 2,
2154 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2155 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2156 2, 2, 2, 143, 131, 144, 141, 2, 88, 89,
2157 90, 91, 75, 76, 77, 78, 94, 95, 83, 82,
2158 79, 80, 81, 86, 87, 92, 93, 97, 84, 85,
2159 96, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2160 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2161 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2162 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2163 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2164 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2165 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2166 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2167 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2168 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2169 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2170 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2171 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2172 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2173 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2174 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2175 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2176 65, 66, 67, 70, 98, 99, 100, 101, 102, 103,
2177 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2178 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2179 124, 125, 139, 142
2180};
2181
2182#if YYDEBUG
2183/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2184static const yytype_int16 yyrline[] =
2185{
2186 0, 1327, 1327, 1327, 1353, 1359, 1366, 1373, 1380, 1386,
2187 1387, 1393, 1406, 1404, 1415, 1426, 1432, 1439, 1446, 1453,
2188 1459, 1464, 1463, 1473, 1473, 1480, 1487, 1497, 1506, 1513,
2189 1521, 1529, 1541, 1553, 1563, 1577, 1578, 1586, 1593, 1601,
2190 1608, 1611, 1618, 1625, 1633, 1640, 1647, 1655, 1662, 1673,
2191 1685, 1698, 1712, 1722, 1727, 1736, 1739, 1740, 1744, 1748,
2192 1752, 1757, 1765, 1756, 1779, 1787, 1778, 1800, 1803, 1820,
2193 1830, 1829, 1848, 1855, 1855, 1855, 1861, 1862, 1865, 1866,
2194 1875, 1885, 1895, 1904, 1915, 1922, 1929, 1936, 1943, 1951,
2195 1959, 1966, 1973, 1982, 1983, 1992, 1993, 2002, 2009, 2016,
2196 2023, 2030, 2037, 2044, 2051, 2058, 2065, 2074, 2075, 2084,
2197 2091, 2100, 2107, 2116, 2123, 2130, 2137, 2147, 2154, 2164,
2198 2171, 2178, 2188, 2195, 2202, 2209, 2216, 2223, 2230, 2237,
2199 2244, 2254, 2262, 2265, 2272, 2279, 2288, 2289, 2290, 2291,
2200 2296, 2299, 2306, 2309, 2316, 2316, 2326, 2327, 2328, 2329,
2201 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339,
2202 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349,
2203 2350, 2351, 2352, 2353, 2354, 2355, 2358, 2358, 2358, 2359,
2204 2359, 2360, 2360, 2360, 2361, 2361, 2361, 2361, 2362, 2362,
2205 2362, 2362, 2363, 2363, 2363, 2364, 2364, 2364, 2364, 2365,
2206 2365, 2365, 2365, 2366, 2366, 2366, 2366, 2367, 2367, 2367,
2207 2367, 2368, 2368, 2368, 2368, 2369, 2369, 2372, 2379, 2386,
2208 2393, 2400, 2407, 2414, 2422, 2430, 2438, 2447, 2456, 2464,
2209 2472, 2480, 2488, 2492, 2496, 2500, 2504, 2508, 2512, 2516,
2210 2520, 2524, 2528, 2532, 2536, 2540, 2541, 2545, 2549, 2553,
2211 2557, 2561, 2565, 2569, 2573, 2577, 2581, 2585, 2585, 2590,
2212 2599, 2610, 2622, 2635, 2649, 2655, 2656, 2657, 2658, 2661,
2213 2665, 2672, 2676, 2682, 2689, 2690, 2694, 2701, 2710, 2715,
2214 2725, 2732, 2744, 2758, 2759, 2762, 2763, 2764, 2768, 2775,
2215 2784, 2792, 2799, 2807, 2815, 2819, 2819, 2856, 2863, 2876,
2216 2880, 2887, 2894, 2901, 2908, 2918, 2919, 2923, 2930, 2937,
2217 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955,
2218 2956, 2964, 2963, 2978, 2978, 2985, 2985, 2993, 3001, 3008,
2219 3015, 3022, 3030, 3037, 3044, 3051, 3058, 3058, 3063, 3067,
2220 3071, 3078, 3079, 3087, 3088, 3099, 3110, 3120, 3131, 3130,
2221 3147, 3146, 3161, 3170, 3213, 3212, 3236, 3235, 3258, 3257,
2222 3280, 3292, 3306, 3313, 3320, 3327, 3336, 3343, 3349, 3366,
2223 3372, 3378, 3384, 3390, 3396, 3403, 3410, 3417, 3423, 3429,
2224 3435, 3441, 3447, 3462, 3469, 3475, 3482, 3483, 3484, 3487,
2225 3488, 3491, 3492, 3504, 3505, 3514, 3515, 3518, 3526, 3535,
2226 3542, 3551, 3558, 3565, 3572, 3579, 3588, 3596, 3605, 3606,
2227 3609, 3609, 3611, 3615, 3619, 3623, 3629, 3634, 3639, 3649,
2228 3653, 3657, 3661, 3665, 3669, 3674, 3678, 3682, 3686, 3690,
2229 3694, 3698, 3702, 3706, 3712, 3713, 3719, 3729, 3742, 3746,
2230 3755, 3757, 3761, 3766, 3773, 3779, 3783, 3787, 3772, 3812,
2231 3821, 3832, 3837, 3843, 3853, 3867, 3874, 3881, 3890, 3899,
2232 3907, 3915, 3922, 3930, 3938, 3945, 3952, 3965, 3973, 3983,
2233 3984, 3988, 3983, 4005, 4006, 4010, 4005, 4029, 4037, 4044,
2234 4052, 4061, 4073, 4074, 4078, 4085, 4089, 4077, 4104, 4105,
2235 4108, 4109, 4117, 4127, 4128, 4133, 4141, 4145, 4149, 4155,
2236 4158, 4167, 4170, 4177, 4180, 4181, 4183, 4184, 4185, 4194,
2237 4203, 4212, 4217, 4226, 4235, 4244, 4249, 4253, 4257, 4263,
2238 4262, 4274, 4279, 4279, 4286, 4295, 4299, 4308, 4312, 4316,
2239 4320, 4324, 4327, 4331, 4340, 4344, 4350, 4360, 4364, 4370,
2240 4371, 4380, 4389, 4393, 4397, 4401, 4407, 4409, 4418, 4426,
2241 4440, 4441, 4464, 4468, 4474, 4480, 4481, 4484, 4485, 4494,
2242 4503, 4511, 4519, 4520, 4521, 4522, 4530, 4540, 4541, 4542,
2243 4543, 4544, 4545, 4546, 4547, 4548, 4555, 4558, 4568, 4579,
2244 4588, 4597, 4604, 4611, 4620, 4632, 4635, 4642, 4649, 4652,
2245 4656, 4659, 4666, 4669, 4670, 4673, 4690, 4691, 4692, 4701,
2246 4711, 4720, 4726, 4736, 4742, 4751, 4753, 4762, 4772, 4778,
2247 4787, 4796, 4806, 4812, 4822, 4828, 4838, 4848, 4867, 4873,
2248 4883, 4893, 4934, 4937, 4936, 4953, 4957, 4962, 4966, 4970,
2249 4952, 4991, 4998, 5005, 5012, 5015, 5016, 5019, 5029, 5030,
2250 5031, 5032, 5035, 5045, 5046, 5056, 5057, 5058, 5059, 5062,
2251 5063, 5064, 5067, 5068, 5069, 5070, 5071, 5074, 5075, 5076,
2252 5077, 5078, 5079, 5080, 5083, 5096, 5105, 5112, 5121, 5122,
2253 5126, 5125, 5135, 5143, 5144, 5152, 5164, 5165, 5165, 5181,
2254 5185, 5189, 5193, 5197, 5204, 5209, 5214, 5218, 5222, 5226,
2255 5230, 5234, 5238, 5242, 5246, 5250, 5254, 5258, 5262, 5266,
2256 5271, 5277, 5286, 5295, 5304, 5313, 5324, 5325, 5333, 5342,
2257 5350, 5371, 5373, 5386, 5396, 5405, 5416, 5424, 5434, 5441,
2258 5451, 5458, 5467, 5468, 5471, 5479, 5487, 5497, 5508, 5519,
2259 5526, 5535, 5542, 5551, 5552, 5555, 5563, 5573, 5574, 5577,
2260 5585, 5595, 5599, 5605, 5610, 5610, 5634, 5635, 5644, 5646,
2261 5669, 5680, 5687, 5696, 5704, 5723, 5724, 5725, 5728, 5729,
2262 5730, 5731, 5734, 5735, 5736, 5739, 5740, 5743, 5744, 5747,
2263 5748, 5751, 5752, 5755, 5756, 5759, 5762, 5765, 5768, 5769,
2264 5770, 5773, 5774, 5777, 5778, 5782
2265};
2266#endif
2267
2269#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2270
2271#if 1
2272/* The user-facing name of the symbol whose (internal) number is
2273 YYSYMBOL. No bounds checking. */
2274static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2275
2276/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2277 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2278static const char *const yytname[] =
2279{
2280 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2281 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2282 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2283 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2284 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2285 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2286 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2287 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2288 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2289 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2290 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2291 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2292 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2293 "\"method\"", "\"global variable\"", "\"instance variable\"",
2294 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
2295 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2296 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2297 "\"literal content\"", "tREGEXP_END", "'.'", "\"backslash\"",
2298 "\"escaped space\"", "\"escaped horizontal tab\"",
2299 "\"escaped form feed\"", "\"escaped carriage return\"",
2300 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2301 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2302 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2303 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2304 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2305 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2306 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2307 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2308 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2309 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2310 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tLOWEST", "'='", "'?'", "':'",
2311 "'>'", "'<'", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'",
2312 "tUMINUS_NUM", "'!'", "'~'", "tLAST_TOKEN", "'{'", "'}'", "'['", "','",
2313 "'`'", "'('", "')'", "']'", "';'", "' '", "'\\n'", "$accept", "program",
2314 "$@1", "top_compstmt", "top_stmts", "top_stmt", "begin_block",
2315 "bodystmt", "$@2", "compstmt", "stmts", "stmt_or_begin", "$@3", "stmt",
2316 "$@4", "command_asgn", "command_rhs", "expr", "@5", "@6", "@7", "@8",
2317 "def_name", "defn_head", "defs_head", "$@9", "expr_value",
2318 "expr_value_do", "$@10", "$@11", "command_call", "block_command",
2319 "cmd_brace_block", "fcall", "command", "mlhs", "mlhs_inner",
2320 "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post", "mlhs_node", "lhs",
2321 "cname", "cpath", "fname", "fitem", "undef_list", "$@12", "op",
2322 "reswords", "arg", "$@13", "relop", "rel_expr", "lex_ctxt", "arg_value",
2323 "aref_args", "arg_rhs", "paren_args", "opt_paren_args", "opt_call_args",
2324 "call_args", "command_args", "$@14", "block_arg", "opt_block_arg",
2325 "args", "mrhs_arg", "mrhs", "primary", "$@15", "$@16", "$@17", "$@18",
2326 "@19", "@20", "$@21", "$@22", "$@23", "primary_value", "k_begin", "k_if",
2327 "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
2328 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
2329 "k_when", "k_else", "k_elsif", "k_end", "k_return", "then", "do",
2330 "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list", "f_margs",
2331 "f_rest_marg", "f_any_kwrest", "f_eq", "$@24", "block_args_tail",
2332 "opt_block_args_tail", "excessed_comma", "block_param",
2333 "opt_block_param", "block_param_def", "opt_bv_decl", "bv_decls", "bvar",
2334 "lambda", "@25", "@26", "@27", "$@28", "f_larglist", "lambda_body",
2335 "do_block", "block_call", "method_call", "brace_block", "brace_body",
2336 "@29", "@30", "@31", "do_body", "@32", "@33", "@34", "case_args",
2337 "case_body", "cases", "p_case_body", "@35", "@36", "$@37", "p_cases",
2338 "p_top_expr", "p_top_expr_body", "p_expr", "p_as", "p_alt", "p_lparen",
2339 "p_lbracket", "p_expr_basic", "@38", "@39", "p_args", "p_args_head",
2340 "p_args_tail", "p_find", "p_rest", "p_args_post", "p_arg", "p_kwargs",
2341 "p_kwarg", "p_kw", "p_kw_label", "p_kwrest", "p_kwnorest",
2342 "p_any_kwrest", "p_value", "p_primitive", "p_variable", "p_var_ref",
2343 "p_expr_ref", "p_const", "opt_rescue", "exc_list", "exc_var",
2344 "opt_ensure", "literal", "strings", "string", "string1", "xstring",
2345 "regexp", "words", "word_list", "word", "symbols", "symbol_list",
2346 "qwords", "qsymbols", "qword_list", "qsym_list", "string_contents",
2347 "xstring_contents", "regexp_contents", "string_content", "@40", "$@41",
2348 "@42", "@43", "@44", "@45", "string_dvar", "symbol", "ssym", "sym",
2349 "dsym", "numeric", "simple_numeric", "nonlocal_var", "user_variable",
2350 "keyword_variable", "var_ref", "var_lhs", "backref", "superclass",
2351 "$@46", "f_opt_paren_args", "f_paren_args", "f_arglist", "@47",
2352 "args_tail", "opt_args_tail", "f_args", "args_forward", "f_bad_arg",
2353 "f_norm_arg", "f_arg_asgn", "f_arg_item", "f_arg", "f_label", "f_kw",
2354 "f_block_kw", "f_block_kwarg", "f_kwarg", "kwrest_mark", "f_no_kwarg",
2355 "f_kwrest", "f_opt", "f_block_opt", "f_block_optarg", "f_optarg",
2356 "restarg_mark", "f_rest_arg", "blkarg_mark", "f_block_arg",
2357 "opt_f_block_arg", "singleton", "$@48", "assoc_list", "assocs", "assoc",
2358 "operation", "operation2", "operation3", "dot_or_colon", "call_op",
2359 "call_op2", "opt_terms", "opt_nl", "rparen", "rbracket", "rbrace",
2360 "trailer", "term", "terms", "none", YY_NULLPTR
2361};
2362
2363static const char *
2364yysymbol_name (yysymbol_kind_t yysymbol)
2365{
2366 return yytname[yysymbol];
2367}
2368#endif
2369
2370#define YYPACT_NINF (-1086)
2371
2372#define yypact_value_is_default(Yyn) \
2373 ((Yyn) == YYPACT_NINF)
2374
2375#define YYTABLE_NINF (-786)
2376
2377#define yytable_value_is_error(Yyn) \
2378 ((Yyn) == YYTABLE_NINF)
2379
2380/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2381 STATE-NUM. */
2382static const yytype_int16 yypact[] =
2383{
2384 -1086, 168, 4730, -1086, 10445, -1086, -1086, -1086, 9903, -1086,
2385 -1086, -1086, -1086, -1086, -1086, -1086, 10571, 10571, -1086, -1086,
2386 -1086, 6363, 5922, -1086, -1086, -1086, -1086, 574, 9758, 26,
2387 48, 92, -1086, -1086, -1086, 5187, 6069, -1086, -1086, 5334,
2388 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, 12335, 12335,
2389 12335, 12335, 273, 7958, 10697, 11201, 11579, 10187, -1086, 9613,
2390 -1086, -1086, -1086, 196, 239, 259, 302, 1067, 12461, 12335,
2391 -1086, 418, -1086, 1061, -1086, 774, 345, 345, -1086, -1086,
2392 195, 441, 364, -1086, 404, 12713, -1086, 405, 3899, 546,
2393 317, 329, -1086, 12587, 12587, -1086, -1086, 8940, 12835, 12957,
2394 13079, 9467, 10571, -1086, 70, 122, -1086, -1086, 471, -1086,
2395 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2396 -1086, 52, 353, -1086, 518, 678, -1086, -1086, -1086, -1086,
2397 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2398 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2399 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2400 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2401 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2402 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2403 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2404 -1086, -1086, -1086, -1086, -1086, 486, -1086, -1086, -1086, 505,
2405 12335, 610, 8109, 12335, 12335, 12335, -1086, 12335, 345, 345,
2406 -1086, 552, 5753, 602, -1086, -1086, 592, 369, 274, 454,
2407 641, 464, 615, -1086, -1086, 8814, -1086, 10571, 10823, -1086,
2408 -1086, 9066, -1086, 12587, 618, -1086, 616, 8260, -1086, 8411,
2409 -1086, -1086, 621, 651, 195, -1086, 385, -1086, 736, 5900,
2410 5900, 742, 10697, -1086, 7958, 682, 418, -1086, 1061, 26,
2411 707, -1086, 1061, 26, 699, 85, 617, -1086, 602, 692,
2412 617, -1086, 26, 798, 1067, 13201, 713, 713, 719, -1086,
2413 516, 596, 609, 611, -1086, -1086, -1086, -1086, -1086, 81,
2414 -1086, 453, 501, 470, -1086, -1086, -1086, -1086, 795, -1086,
2415 -1086, -1086, -1086, -1086, -1086, -1086, 9192, 12587, 12587, 12587,
2416 12587, 10697, 12587, 12587, 1785, 748, 754, 7102, 1785, -1086,
2417 761, 7102, -1086, -1086, -1086, 784, -1086, -1086, -1086, -1086,
2418 -1086, 823, -1086, 7958, 10316, 749, 823, -1086, 12335, 12335,
2419 12335, 12335, 12335, -1086, -1086, 12335, 12335, 12335, 12335, 12335,
2420 12335, 12335, 12335, -1086, 12335, -1086, -1086, 12335, 12335, 12335,
2421 12335, 12335, 12335, 12335, 12335, 12335, 12335, -1086, -1086, 13664,
2422 10571, 13754, 7102, 774, 151, 151, 8562, 12587, 8562, 418,
2423 -1086, 753, 844, -1086, -1086, 622, 884, 91, 121, 129,
2424 951, 1040, 12587, 379, -1086, 782, 661, -1086, -1086, -1086,
2425 -1086, 72, 304, 341, 344, 407, 420, 424, 510, 517,
2426 -1086, -1086, -1086, -1086, 548, -1086, -1086, -1086, 15014, -1086,
2427 -1086, 823, 823, -1086, -1086, 544, -1086, -1086, -1086, 904,
2428 804, 806, 823, 12335, 10949, -1086, -1086, 13844, 10571, 13934,
2429 823, 823, 11327, -1086, 26, 791, -1086, -1086, 12335, 26,
2430 -1086, 796, 26, 800, -1086, 159, -1086, -1086, -1086, -1086,
2431 -1086, 9903, -1086, 12335, 808, 813, 13844, 13934, 823, 1061,
2432 48, 26, -1086, -1086, 9318, 815, 26, -1086, -1086, 11453,
2433 -1086, -1086, 11579, -1086, -1086, -1086, 616, 669, -1086, -1086,
2434 821, -1086, 13201, 14024, 10571, 14114, -1086, -1086, -1086, -1086,
2435 -1086, -1086, -1086, -1086, -1086, -1086, -1086, 623, 56, 686,
2436 68, 12335, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2437 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, 1015,
2438 -1086, -1086, -1086, -1086, -1086, 828, -1086, 26, -1086, -1086,
2439 -1086, 843, -1086, 830, 12335, -1086, 832, 108, -1086, -1086,
2440 -1086, 835, 932, 841, 941, -1086, 12461, 987, 992, 418,
2441 12461, 987, 862, -1086, -1086, -1086, 987, -1086, 987, -1086,
2442 11705, -1086, 26, 13201, 875, -1086, 11705, -1086, 736, 6047,
2443 6047, 6047, 6047, 6194, 4208, 6047, 6047, 5900, 5900, 550,
2444 550, -1086, 6485, 1260, 1260, 1391, 386, 386, 736, 736,
2445 736, 1376, 1376, 6510, 5481, 6804, 5628, -1086, 651, -1086,
2446 26, 878, 751, -1086, 768, -1086, -1086, 6216, 987, -1086,
2447 7253, 1009, 7706, 987, 88, 987, 1007, 1020, 130, 14204,
2448 10571, 14294, -1086, 774, -1086, 669, -1086, -1086, -1086, 14384,
2449 10571, 14474, 7102, 12587, -1086, -1086, -1086, -1086, -1086, 3812,
2450 12461, 12461, 9903, 12335, 12335, 12335, 12335, -1086, 12335, 602,
2451 -1086, 615, 5039, 5775, 26, 595, 647, 12335, 12335, -1086,
2452 -1086, -1086, -1086, 11075, -1086, 11327, -1086, -1086, 12587, 5753,
2453 -1086, -1086, 651, 651, 12335, -1086, 261, -1086, -1086, 617,
2454 13201, 821, 403, 65, 26, 257, 298, 1528, -1086, 934,
2455 -1086, 63, -1086, 886, -1086, -1086, 71, 891, -1086, 736,
2456 1015, 1114, -1086, 890, 26, 900, -1086, 209, -1086, -1086,
2457 -1086, 12335, 924, 1785, -1086, -1086, 639, -1086, -1086, -1086,
2458 1785, -1086, -1086, 1696, -1086, -1086, 1011, 5312, -1086, -1086,
2459 -1086, 11831, 659, -1086, -1086, 1012, 5459, -1086, -1086, -1086,
2460 913, -1086, -1086, -1086, 12335, -1086, 914, 916, 1021, -1086,
2461 -1086, 821, 13201, -1086, -1086, 1024, 933, 5165, -1086, -1086,
2462 -1086, 766, 676, 4880, 4880, 935, 823, 823, -1086, 784,
2463 923, 797, 10949, 823, 823, -1086, -1086, 784, -1086, -1086,
2464 801, -1086, 1059, -1086, -1086, -1086, -1086, -1086, -1086, 1020,
2465 987, -1086, 11957, 987, 105, 297, 26, 138, 147, 8562,
2466 418, 12587, 7102, 1081, 65, -1086, 26, 987, 159, 10048,
2467 122, 441, -1086, 5606, -1086, -1086, -1086, -1086, -1086, -1086,
2468 -1086, 823, 823, 787, 823, 823, 26, 929, 159, -1086,
2469 -1086, -1086, 433, 1785, -1086, -1086, -1086, -1086, -1086, -1086,
2470 -1086, -1086, -1086, -1086, -1086, -1086, -1086, 26, -1086, 1015,
2471 -1086, 1091, -1086, -1086, -1086, -1086, -1086, 936, 940, -1086,
2472 1029, 828, 944, -1086, 945, -1086, 944, 12335, 12335, 914,
2473 -1086, 993, -1086, -1086, -1086, 8562, -1086, -1086, -1086, 12335,
2474 12335, 956, -1086, 956, 949, 12083, 10697, 821, 10697, 823,
2475 12335, 14564, 10571, 14654, -1086, -1086, -1086, 4593, 4593, 455,
2476 -1086, 4442, 12, 1045, -1086, 119, -1086, -1086, 215, -1086,
2477 967, -1086, -1086, -1086, 963, -1086, 971, -1086, 13597, -1086,
2478 -1086, -1086, -1086, 876, -1086, -1086, -1086, 38, -1086, -1086,
2479 -1086, -1086, -1086, -1086, -1086, -1086, -1086, 475, -1086, 12335,
2480 12461, 12461, -1086, -1086, 823, 12461, 12461, -1086, -1086, 8562,
2481 12587, 987, -1086, -1086, 987, -1086, -1086, 987, -1086, 12335,
2482 -1086, 118, -1086, 165, 987, 7102, 418, 987, -1086, -1086,
2483 -1086, -1086, -1086, -1086, 12335, 12335, 823, 12335, 12335, -1086,
2484 11327, -1086, 26, 78, -1086, -1086, -1086, 975, 985, 1785,
2485 -1086, 1696, -1086, -1086, 1696, -1086, 1696, -1086, -1086, 5753,
2486 5753, 13323, 151, -1086, -1086, 7832, 5753, 5753, 1232, 8411,
2487 -1086, -1086, 7102, 12335, 989, -1086, -1086, 12461, 5753, 6657,
2488 6951, 26, 793, 803, -1086, -1086, -1086, -1086, 13597, 286,
2489 26, 13478, -1086, 26, 994, -1086, 896, 995, -1086, -1086,
2490 930, -1086, -1086, -1086, -1086, 12587, -1086, 1063, 13564, 13597,
2491 13597, 896, 1033, 4593, 4593, 455, 465, 634, 4880, 4880,
2492 -1086, -1086, 5753, -1086, -1086, -1086, -1086, 12461, -1086, -1086,
2493 -1086, -1086, -1086, 151, -1086, -1086, 4880, -1086, -1086, 12209,
2494 7404, -1086, 987, -1086, -1086, 12335, 1001, 990, 7102, 8411,
2495 -1086, -1086, 1091, 1091, 944, 1008, 944, 944, 1082, -1086,
2496 779, 206, 214, 231, 7102, 1149, 828, -1086, 26, 1031,
2497 843, 1026, 13445, -1086, 1028, -1086, 1035, 1043, -1086, -1086,
2498 -1086, 1047, 827, 36, -1086, 60, 1033, 1049, -1086, -1086,
2499 -1086, 26, -1086, -1086, 1042, -1086, -1086, 1052, -1086, 1056,
2500 -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, 26, 26,
2501 26, 26, 26, 26, -1086, -1086, 7253, 151, 969, 12335,
2502 -1086, 697, -1086, -1086, 1155, 987, 1060, 8688, 985, -1086,
2503 1696, -1086, -1086, -1086, 283, 14744, 10571, 14834, 992, -1086,
2504 -1086, 1044, -1086, 13445, 1358, -1086, -1086, 1152, 788, 639,
2505 -1086, 1358, -1086, 1466, -1086, -1086, 1068, 13597, -1086, 515,
2506 -1086, -1086, 13597, 13564, -1086, -1086, -1086, -1086, -1086, -1086,
2507 801, -1086, 12587, 12587, -1086, -1086, -1086, -1086, -1086, 698,
2508 -1086, -1086, -1086, -1086, 1095, 944, 182, 199, 26, 333,
2509 338, -1086, -1086, 788, -1086, 1071, 1073, -1086, 14924, -1086,
2510 828, 1077, -1086, 1079, 1077, 13597, 1096, 1096, -1086, -1086,
2511 -1086, 7555, -1086, -1086, 1155, -1086, -1086, -1086, 367, 1358,
2512 -1086, 1466, -1086, 1098, 1102, -1086, 1466, -1086, 1466, -1086,
2513 -1086, 1096, 13597, 586, -1086, 1077, 1097, 1077, 1077, -1086,
2514 -1086, -1086, -1086, 1466, -1086, -1086, -1086, 1077, -1086
2515};
2516
2517/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2518 Performed when YYTABLE does not specify something else to do. Zero
2519 means the default is an error. */
2520static const yytype_int16 yydefact[] =
2521{
2522 2, 0, 0, 1, 0, 374, 375, 376, 0, 367,
2523 368, 369, 372, 370, 371, 373, 362, 363, 364, 365,
2524 385, 295, 295, 658, 657, 659, 660, 773, 0, 773,
2525 0, 0, 662, 661, 663, 755, 757, 654, 653, 756,
2526 656, 645, 646, 647, 648, 596, 668, 669, 0, 0,
2527 0, 0, 0, 0, 323, 785, 785, 105, 444, 616,
2528 616, 618, 620, 0, 0, 0, 0, 0, 0, 0,
2529 3, 771, 6, 9, 35, 40, 677, 677, 56, 77,
2530 295, 76, 0, 93, 0, 97, 107, 0, 67, 245,
2531 264, 0, 321, 0, 0, 73, 73, 771, 0, 0,
2532 0, 0, 332, 343, 78, 341, 310, 311, 595, 597,
2533 312, 313, 314, 316, 315, 317, 594, 635, 636, 593,
2534 643, 664, 665, 318, 0, 319, 81, 5, 8, 186,
2535 197, 187, 210, 183, 203, 193, 192, 213, 214, 208,
2536 191, 190, 185, 211, 215, 216, 195, 184, 198, 202,
2537 204, 196, 189, 205, 212, 207, 206, 199, 209, 194,
2538 182, 201, 200, 181, 188, 179, 180, 176, 177, 178,
2539 136, 138, 137, 171, 172, 167, 149, 150, 151, 158,
2540 155, 157, 152, 153, 173, 174, 159, 160, 164, 168,
2541 154, 156, 146, 147, 148, 161, 162, 163, 165, 166,
2542 169, 170, 175, 141, 143, 28, 139, 140, 142, 0,
2543 752, 0, 0, 0, 0, 298, 616, 0, 677, 677,
2544 290, 0, 273, 301, 91, 294, 785, 0, 664, 665,
2545 0, 319, 785, 748, 92, 773, 89, 0, 785, 464,
2546 88, 773, 774, 0, 0, 23, 257, 0, 10, 0,
2547 362, 363, 335, 465, 0, 239, 0, 332, 240, 230,
2548 231, 329, 0, 21, 0, 0, 771, 17, 20, 773,
2549 95, 16, 325, 773, 0, 778, 778, 274, 0, 0,
2550 778, 746, 773, 0, 0, 0, 677, 677, 103, 366,
2551 0, 113, 114, 121, 445, 640, 639, 641, 638, 0,
2552 637, 0, 0, 0, 603, 612, 608, 614, 644, 60,
2553 251, 252, 781, 782, 4, 783, 772, 0, 0, 0,
2554 0, 0, 0, 0, 700, 0, 676, 0, 700, 674,
2555 0, 0, 377, 469, 458, 82, 473, 340, 378, 473,
2556 454, 785, 109, 0, 101, 98, 785, 64, 0, 0,
2557 0, 0, 0, 267, 268, 0, 0, 0, 0, 228,
2558 229, 0, 0, 61, 0, 265, 266, 0, 0, 0,
2559 0, 0, 0, 0, 0, 0, 0, 767, 768, 0,
2560 785, 0, 0, 72, 0, 0, 0, 0, 0, 771,
2561 350, 772, 0, 396, 395, 0, 0, 664, 665, 319,
2562 131, 132, 0, 0, 134, 672, 0, 664, 665, 319,
2563 358, 206, 199, 209, 194, 176, 177, 178, 136, 137,
2564 744, 69, 68, 743, 0, 90, 770, 769, 0, 342,
2565 598, 785, 785, 144, 751, 329, 302, 754, 297, 0,
2566 0, 0, 785, 0, 0, 291, 300, 0, 785, 0,
2567 785, 785, 0, 292, 773, 0, 334, 296, 701, 773,
2568 286, 785, 773, 785, 285, 773, 339, 59, 25, 27,
2569 26, 0, 336, 0, 0, 0, 0, 0, 785, 19,
2570 0, 773, 327, 15, 772, 94, 773, 324, 330, 780,
2571 779, 275, 780, 277, 331, 747, 0, 120, 644, 111,
2572 106, 676, 0, 0, 785, 0, 446, 622, 642, 625,
2573 623, 617, 599, 600, 619, 601, 621, 0, 0, 0,
2574 0, 0, 784, 7, 29, 30, 31, 32, 33, 57,
2575 58, 707, 704, 703, 702, 705, 713, 722, 701, 0,
2576 734, 723, 738, 737, 733, 785, 699, 773, 683, 706,
2577 708, 709, 711, 685, 715, 720, 785, 726, 409, 408,
2578 731, 685, 736, 685, 740, 682, 0, 0, 785, 0,
2579 0, 0, 0, 470, 469, 83, 0, 474, 0, 271,
2580 0, 272, 773, 0, 99, 110, 0, 65, 237, 244,
2581 246, 247, 248, 255, 256, 249, 250, 226, 227, 253,
2582 254, 62, 773, 241, 242, 243, 232, 233, 234, 235,
2583 236, 269, 270, 758, 760, 759, 761, 463, 295, 461,
2584 773, 785, 758, 760, 759, 761, 462, 295, 0, 387,
2585 0, 386, 0, 0, 0, 0, 348, 0, 329, 0,
2586 785, 0, 73, 356, 131, 132, 133, 670, 354, 0,
2587 785, 0, 0, 0, 765, 766, 70, 758, 759, 295,
2588 0, 0, 0, 0, 0, 0, 0, 750, 0, 303,
2589 299, 785, 758, 759, 773, 758, 759, 0, 0, 749,
2590 333, 775, 280, 287, 282, 289, 338, 24, 0, 258,
2591 11, 34, 0, 785, 0, 22, 96, 18, 326, 778,
2592 0, 104, 762, 119, 773, 758, 759, 700, 626, 0,
2593 602, 0, 605, 0, 610, 607, 0, 0, 611, 238,
2594 0, 407, 399, 401, 773, 404, 397, 0, 681, 742,
2595 675, 0, 0, 0, 692, 714, 0, 680, 724, 725,
2596 0, 695, 735, 0, 697, 739, 48, 260, 384, 360,
2597 379, 785, 785, 585, 678, 50, 262, 361, 467, 471,
2598 0, 468, 475, 453, 0, 36, 306, 0, 39, 305,
2599 108, 102, 0, 55, 41, 53, 0, 278, 301, 217,
2600 37, 0, 319, 0, 0, 0, 785, 785, 460, 86,
2601 0, 466, 287, 785, 785, 284, 459, 84, 283, 322,
2602 785, 388, 785, 346, 390, 74, 389, 347, 484, 0,
2603 0, 381, 0, 0, 762, 328, 773, 758, 759, 0,
2604 0, 0, 0, 131, 132, 135, 773, 0, 773, 0,
2605 455, 79, 42, 278, 218, 52, 225, 145, 753, 304,
2606 293, 785, 785, 466, 785, 785, 773, 785, 773, 224,
2607 276, 112, 466, 700, 447, 450, 627, 631, 632, 633,
2608 624, 634, 604, 606, 613, 609, 615, 773, 406, 0,
2609 710, 0, 741, 727, 411, 684, 712, 685, 685, 721,
2610 726, 785, 685, 732, 685, 709, 685, 0, 0, 586,
2611 587, 785, 588, 380, 382, 0, 12, 14, 592, 0,
2612 0, 785, 80, 785, 309, 0, 0, 100, 0, 785,
2613 0, 0, 785, 0, 577, 583, 550, 0, 0, 0,
2614 522, 773, 519, 538, 616, 0, 576, 66, 493, 499,
2615 501, 503, 497, 496, 534, 498, 543, 546, 549, 555,
2616 556, 545, 506, 557, 507, 562, 563, 564, 567, 568,
2617 569, 570, 571, 573, 572, 574, 575, 553, 63, 0,
2618 0, 0, 87, 776, 785, 0, 0, 85, 383, 0,
2619 0, 0, 391, 393, 0, 75, 485, 0, 352, 0,
2620 477, 0, 351, 466, 0, 0, 0, 0, 466, 359,
2621 745, 71, 456, 457, 0, 0, 785, 0, 0, 281,
2622 288, 337, 773, 0, 628, 398, 400, 402, 405, 0,
2623 688, 0, 690, 679, 0, 696, 0, 693, 698, 49,
2624 261, 0, 0, 590, 591, 0, 51, 263, 773, 0,
2625 435, 434, 0, 0, 307, 38, 54, 0, 279, 758,
2626 759, 773, 758, 759, 565, 566, 132, 581, 0, 524,
2627 773, 525, 531, 773, 0, 518, 0, 0, 521, 537,
2628 0, 578, 650, 649, 651, 0, 579, 0, 494, 0,
2629 0, 544, 548, 560, 561, 0, 505, 504, 0, 0,
2630 554, 552, 259, 47, 222, 46, 223, 0, 44, 220,
2631 45, 221, 394, 0, 344, 345, 0, 349, 478, 0,
2632 0, 353, 0, 671, 355, 0, 0, 438, 0, 0,
2633 448, 629, 0, 0, 685, 685, 685, 685, 0, 589,
2634 0, 664, 665, 319, 0, 785, 785, 433, 773, 0,
2635 709, 417, 717, 718, 785, 729, 417, 417, 415, 472,
2636 476, 308, 466, 773, 516, 529, 541, 526, 517, 532,
2637 616, 773, 777, 551, 0, 500, 495, 534, 502, 535,
2638 539, 547, 542, 558, 559, 582, 515, 511, 773, 773,
2639 773, 773, 773, 773, 43, 219, 0, 0, 490, 0,
2640 479, 785, 357, 449, 0, 0, 0, 0, 403, 689,
2641 0, 686, 691, 694, 329, 0, 785, 0, 785, 13,
2642 414, 0, 436, 0, 418, 426, 424, 0, 716, 0,
2643 413, 0, 429, 0, 431, 523, 527, 0, 533, 0,
2644 520, 580, 0, 0, 508, 509, 510, 512, 513, 514,
2645 785, 486, 0, 0, 480, 482, 483, 481, 442, 773,
2646 440, 443, 452, 451, 0, 685, 762, 328, 773, 758,
2647 759, 584, 437, 728, 416, 417, 417, 329, 0, 719,
2648 785, 417, 730, 417, 417, 0, 530, 535, 536, 540,
2649 392, 0, 491, 492, 0, 439, 630, 687, 466, 0,
2650 421, 0, 423, 762, 328, 412, 0, 430, 0, 427,
2651 432, 528, 0, 785, 441, 417, 417, 417, 417, 488,
2652 489, 487, 422, 0, 419, 425, 428, 417, 420
2653};
2654
2655/* YYPGOTO[NTERM-NUM]. */
2656static const yytype_int16 yypgoto[] =
2657{
2658 -1086, -1086, -1086, 997, -1086, 47, 772, -312, -1086, -24,
2659 -1086, 769, -1086, 74, -1086, -427, -543, -32, -1086, -1086,
2660 -1086, -1086, 426, 2327, 2557, -1086, -12, -74, -1086, -1086,
2661 -10, -1086, -640, 1214, -9, 1159, -125, 34, -42, -1086,
2662 -406, 32, 3056, -372, 1160, -55, -15, -1086, -1086, -7,
2663 -1086, 4007, -1086, 1170, -1086, 927, 668, -1086, 714, 8,
2664 604, -377, 97, 6, -1086, -404, -193, 17, -1086, -483,
2665 -19, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2666 918, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086, -1086,
2667 -1086, -1086, -1086, -1086, -1086, -1086, 512, -1086, 811, 1895,
2668 -376, -1086, 35, -777, -1086, -768, -788, 549, 401, -296,
2669 141, -1086, 244, -438, -1086, -1086, 373, -1086, -896, -1086,
2670 3, 1019, -1086, -1086, -1086, -1086, -1086, -1086, 447, -1086,
2671 -1086, -99, 705, -1086, -1086, -1086, 946, -1086, -1086, -1086,
2672 -1086, -762, -1086, -13, -1086, -1086, -1086, -1086, -1086, -728,
2673 -258, -1086, -1086, -1086, -1086, 223, -1086, -1086, -38, -1086,
2674 -715, -829, -963, -613, -750, -119, -1086, 212, -1086, -1086,
2675 -1086, 222, -1086, -774, 230, -1086, -1086, -1086, 101, -1086,
2676 -1086, 176, 1381, 1652, -1086, 1195, 1974, 2151, 2180, -1086,
2677 794, 2262, -1086, 2645, 2678, -1086, -1086, -58, -1086, -1086,
2678 -261, -1086, -1086, -1086, -1086, -1086, -1086, -1086, 9, -1086,
2679 -1086, -1086, -1086, 30, -1086, 3022, 10, 1211, 3297, 1722,
2680 -1086, -1086, 29, 727, 23, -1086, -308, -381, -305, -206,
2681 -1060, -513, -313, -698, -451, -500, 578, 106, -1086, -1086,
2682 -663, -1086, -709, -696, -1085, 113, 585, -1086, -649, -1086,
2683 -433, -532, -1086, -1086, -1086, 43, -402, -1086, -324, -1086,
2684 -1086, -86, -1086, -20, 123, 482, 440, 170, -231, -61,
2685 31, -2
2686};
2687
2688/* YYDEFGOTO[NTERM-NUM]. */
2689static const yytype_int16 yydefgoto[] =
2690{
2691 0, 1, 2, 70, 71, 72, 248, 567, 1025, 568,
2692 266, 267, 480, 268, 471, 74, 774, 75, 601, 784,
2693 587, 783, 421, 218, 219, 829, 384, 386, 387, 975,
2694 78, 79, 575, 254, 81, 82, 269, 83, 84, 85,
2695 500, 86, 221, 404, 405, 203, 204, 205, 662, 616,
2696 207, 88, 473, 375, 89, 580, 223, 274, 779, 617,
2697 796, 459, 460, 236, 237, 225, 445, 621, 768, 769,
2698 90, 382, 273, 486, 688, 809, 637, 822, 820, 652,
2699 256, 92, 93, 94, 95, 96, 97, 98, 99, 100,
2700 101, 336, 339, 751, 895, 812, 969, 970, 749, 257,
2701 630, 805, 971, 972, 396, 722, 723, 724, 725, 545,
2702 731, 732, 1254, 1205, 1206, 1128, 1029, 1030, 1106, 1239,
2703 1240, 103, 294, 506, 707, 1003, 854, 1110, 340, 104,
2704 105, 337, 572, 573, 759, 901, 576, 577, 762, 903,
2705 981, 813, 1237, 810, 976, 1096, 1271, 1301, 1177, 927,
2706 1146, 929, 930, 1078, 1079, 931, 1056, 1048, 1050, 1051,
2707 1052, 933, 934, 1159, 1054, 935, 936, 937, 938, 939,
2708 940, 941, 942, 943, 944, 945, 946, 947, 752, 891,
2709 1022, 897, 106, 107, 108, 109, 110, 111, 112, 517,
2710 711, 113, 519, 114, 115, 518, 520, 299, 302, 303,
2711 511, 709, 708, 856, 1004, 1111, 1187, 860, 116, 117,
2712 300, 118, 119, 120, 1066, 228, 229, 123, 230, 231,
2713 648, 821, 325, 326, 327, 328, 875, 734, 547, 548,
2714 549, 550, 885, 552, 553, 554, 555, 1133, 1134, 556,
2715 557, 558, 559, 560, 1135, 1136, 561, 562, 563, 564,
2716 565, 728, 424, 653, 279, 463, 233, 126, 692, 619,
2717 656, 651, 428, 314, 455, 456, 791, 1058, 491, 631,
2718 391, 271
2719};
2720
2721/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2722 positive, shift that token. If negative, reduce the rule whose
2723 number is the opposite. If YYTABLE_NINF, syntax error. */
2724static const yytype_int16 yytable[] =
2725{
2726 127, 206, 301, 620, 298, 381, 429, 220, 220, 632,
2727 315, 551, 122, 245, 122, 551, 546, 208, 427, 571,
2728 546, 206, 388, 569, 737, 974, 726, 881, 240, 265,
2729 239, 646, 462, 226, 226, 876, 315, 208, 289, 453,
2730 670, 514, 516, 345, 883, 493, 422, 977, 670, 495,
2731 679, 128, 206, 277, 281, 618, 958, 627, 309, 232,
2732 232, 383, 383, 122, 122, 383, 289, 292, 932, 932,
2733 628, 674, 275, 880, 329, 329, 73, 390, 73, 289,
2734 289, 289, 385, 1008, 878, 389, 335, 270, 334, 288,
2735 679, 884, 1053, 220, 206, 292, 701, 308, 276, 280,
2736 331, 1006, 316, 780, 659, 1157, 330, 1108, 398, 408,
2737 408, 408, 1216, 224, 234, 804, -122, 832, 835, 226,
2738 957, 957, 713, 618, 1241, 627, 1262, 704, 272, 507,
2739 -126, 629, 1129, -328, 717, 1075, 1067, 507, 377, 481,
2740 -658, 449, 738, 1044, 1045, 232, -123, 507, 332, 962,
2741 243, -666, 246, 693, -130, -129, -773, 967, 439, 773,
2742 739, -328, -328, -125, 629, 242, 378, 426, 3, -658,
2743 477, 1061, -127, 1062, 1063, 714, 1064, 771, -122, 242,
2744 741, 693, 744, 1076, 509, 510, 1077, 718, 265, 242,
2745 -124, 247, 509, 510, 1262, -126, 322, 323, -113, 425,
2746 508, 1109, 509, 510, 505, 315, 1217, 726, 868, 465,
2747 -328, 467, -128, -759, 1241, 862, 329, 329, 582, -122,
2748 1065, 332, 122, 865, 446, 475, 220, -123, 220, 220,
2749 446, 489, 1201, 773, 773, 249, 464, -113, 490, 312,
2750 265, 313, 331, 499, -130, 127, 483, 440, 441, 1169,
2751 1172, -117, 226, -758, 226, 461, 712, 122, 712, 122,
2752 1268, 239, 334, 816, 1099, 333, 289, -114, 890, 312,
2753 453, 313, 122, 826, 122, -121, -120, 825, 232, 670,
2754 232, 670, -116, 679, -116, 383, 383, 383, 383, 882,
2755 529, 530, 886, -118, 872, 292, -129, 484, 270, 1163,
2756 1164, 1147, 312, 872, 313, 524, 525, 526, 527, 641,
2757 331, -115, 242, 883, 498, 1067, 876, 693, 542, 265,
2758 1160, 73, -128, -118, 1188, 289, 122, 693, 315, 261,
2759 -758, 122, 454, -126, 457, -126, 479, 122, 333, 581,
2760 827, 122, 543, 238, 581, 1006, -125, -759, 304, 1013,
2761 -128, -127, -128, 122, 292, 383, 726, -122, 726, -122,
2762 1115, 1068, 633, 523, 635, -123, 907, -123, 1178, 636,
2763 643, 220, -657, -666, 625, 634, 584, 270, 464, 1137,
2764 -124, 932, -130, -116, -130, -366, 1067, -94, 670, 626,
2765 73, 305, 122, 957, 551, 528, 122, 377, 122, 546,
2766 -122, -657, 855, -116, 1235, 496, -116, -108, 957, -659,
2767 -116, 306, -660, -366, -366, 957, 957, 1083, 1085, 1236,
2768 551, 625, 1088, 1090, -118, 378, 379, 551, -117, 581,
2769 581, 644, -541, 957, -129, 645, -129, 377, -659, 220,
2770 581, -660, 625, -119, -118, -759, 464, -118, 581, 581,
2771 863, -118, -667, 377, 307, 863, 687, 626, -115, 446,
2772 499, 446, -366, 348, 206, 378, 447, 1160, 850, 338,
2773 625, -785, 1160, 1269, 380, -662, 581, 846, 840, -123,
2774 208, 378, 476, 289, -125, 626, -125, 671, -661, -127,
2775 341, -127, -663, 324, 122, 220, 1010, 1012, 625, -114,
2776 1260, 1015, 464, 1017, -662, 1018, 876, 644, 754, 1080,
2777 987, 1046, 292, 626, 448, 1160, 1299, -661, -124, 507,
2778 -124, -663, 372, 373, 374, 928, 928, 1081, 1132, -117,
2779 448, 346, 699, 773, 773, 1041, 507, 515, 773, 773,
2780 551, 499, 1269, 729, 1174, 546, 880, 1047, 1002, -117,
2781 342, -758, -117, -667, 729, 1256, -117, 746, 1114, -115,
2782 1116, 755, 1263, 451, 289, 1117, 753, 507, 819, 312,
2783 765, 313, 512, 806, 509, 510, 775, 1131, -652, -115,
2784 -123, 507, -115, 60, 377, -655, -115, 618, 876, 627,
2785 -130, 509, 510, 292, 1200, 1138, 670, 767, 679, 726,
2786 726, 894, 1210, 767, 1266, 1100, 800, -652, 802, 1267,
2787 773, 808, 378, 503, -655, -773, 654, 431, 242, 446,
2788 513, 828, 509, 510, 789, 798, 788, 348, 353, 354,
2789 1296, 220, 433, 797, 625, 795, 509, 510, 464, 1153,
2790 122, 220, 122, 478, 625, 655, 1124, 837, 464, 626,
2791 775, 775, 1291, 241, 840, 206, 848, 798, 851, 626,
2792 773, 504, 122, 1049, -664, 831, 435, 795, 893, 446,
2793 -129, 208, 468, 1102, 894, 365, 366, -665, 442, -319,
2794 1072, 289, 469, 470, 370, 371, 372, 373, 374, 507,
2795 377, 798, -664, -664, 844, 913, 551, 536, 1212, 1214,
2796 788, 795, 443, 1165, 1132, -665, -665, -319, -319, 1132,
2797 292, 1132, 894, 1132, 811, 1130, 537, 1176, 378, 639,
2798 1140, -125, 241, 466, 278, 785, 847, 242, 1285, 377,
2799 499, 992, 1126, 1189, 1191, 1192, 1193, -329, 444, 1245,
2800 450, -664, 710, 790, 509, 510, 845, 541, 542, 892,
2801 898, 485, 507, 289, -665, 487, -319, 378, 649, 985,
2802 1261, 452, 1264, 492, 472, -329, -329, 640, 767, 235,
2803 490, 1138, 543, -127, 422, 432, 872, 432, 1138, 1132,
2804 1138, 1132, 292, -773, 581, 581, 1132, 242, 1132, 383,
2805 1143, 581, 581, 956, 956, 984, 1185, 790, 973, 238,
2806 973, 1231, -130, 1132, -130, 715, 650, 509, 510, 986,
2807 1049, 322, 323, 348, -329, 968, 894, 1280, 1282, 1248,
2808 1049, 1049, 206, 1287, -121, 1289, 1290, 790, 1295, 122,
2809 1297, 482, 122, -93, 377, 847, 494, 1298, 928, 581,
2810 581, 478, 581, 581, 1274, 446, 1138, 377, 1138, 488,
2811 793, 242, 1307, 1138, 497, 1138, 377, 1302, 1304, 1305,
2812 1306, 324, 378, 911, 1277, 502, 1060, 794, -129, 1308,
2813 1138, 1024, 521, 693, 566, 378, 1195, -125, 434, 729,
2814 -673, 436, 437, 438, 378, 1258, 996, 570, -120, 1023,
2815 574, 1130, 793, 579, -127, 585, 964, -116, 1130, 1031,
2816 638, 1031, 794, 220, 522, 122, 625, 581, 1126, 642,
2817 464, 912, 647, -124, -118, 1126, 122, 1126, 122, -125,
2818 91, 626, 91, -124, 1196, 1103, 964, 956, 956, -127,
2819 664, 956, 665, 650, 227, 227, 680, 1151, 383, 790,
2820 681, 682, 683, -115, 684, 1092, 685, 686, 956, 790,
2821 775, 775, 690, -124, 916, 775, 775, 691, 1093, 1170,
2822 1173, -108, 581, 696, 1073, 1074, 1130, 700, 698, -410,
2823 507, 91, 91, 537, 727, 290, 733, -755, 736, 122,
2824 1035, 740, 1036, 1126, 742, 1126, 227, 743, 857, 858,
2825 1126, 859, 1126, 745, 581, 122, 507, 748, 46, 47,
2826 750, 1125, 289, 290, 541, 1139, 758, 1126, 1150, 1232,
2827 1233, 227, 227, 501, 501, 227, 395, 406, 406, -652,
2828 227, 772, 801, 512, 792, 509, 510, 775, 663, 730,
2829 1156, 1122, 808, 383, 1197, 122, 869, 811, 864, 122,
2830 1168, 1171, 122, 866, 790, 1057, 871, -652, -652, 512,
2831 874, 509, 510, 1154, 1153, 887, 899, 902, 956, 909,
2832 -301, 956, 905, 959, 770, 906, -756, 531, 908, 532,
2833 533, 534, 535, 963, 894, 1000, 1181, 775, 956, 956,
2834 956, 739, 1009, 956, 956, 1186, 1011, 1028, 956, 956,
2835 1014, 1016, 1219, 1021, -755, -302, -652, 1059, 1069, -755,
2836 1198, 317, 318, 319, 320, 321, 956, -762, -655, 1070,
2837 122, 667, 669, 289, 843, 914, 720, 1071, 122, 122,
2838 278, 1112, 721, 898, 729, 1107, 41, 42, 43, 44,
2839 91, 1113, 729, 1067, 122, -303, -655, -655, 1194, 1152,
2840 1149, 1184, 408, 531, 852, 532, 533, 534, 535, -762,
2841 1183, 1107, 1230, 227, 1190, 227, 227, 669, 893, 227,
2842 278, 227, 1202, 1244, 790, 91, 531, 91, 532, 533,
2843 534, 535, 1204, 790, 1209, 1252, 790, -762, -762, 973,
2844 91, 1211, 91, -756, 289, -655, 122, 220, -756, 1213,
2845 625, 1221, 720, -304, 464, 1218, 753, 122, 1222, 790,
2846 383, 383, 1223, 290, 1243, 626, 870, 1238, 1257, 532,
2847 533, 534, 535, 408, 1265, 1276, 80, 1279, 80, 1281,
2848 1272, 1273, 735, 1286, -762, 1288, -762, 956, 973, -758,
2849 80, 80, 956, 956, 91, 227, 227, 227, 227, 91,
2850 227, 227, 1292, 1303, 474, 91, -758, 1293, 766, 91,
2851 -759, 1107, 695, 697, 778, 991, 983, 393, 729, 376,
2852 410, 91, 290, 830, 896, 1270, 988, 80, 80, 867,
2853 1007, 1203, 1127, 586, 1057, 956, 1032, 1294, 993, 760,
2854 1300, 122, 80, 1161, 531, 578, 532, 533, 534, 535,
2855 536, 973, 1158, 1162, 790, 790, 790, 1155, 227, 1251,
2856 91, 1199, 956, 430, 91, 227, 91, 80, 80, 537,
2857 990, 80, 423, 716, 879, 1259, 80, 1255, 877, 0,
2858 227, 1220, 0, 0, 0, 0, 0, 0, 999, 0,
2859 1001, 838, 0, 539, 0, 0, 839, 348, 0, 540,
2860 541, 542, 0, 0, 0, 0, 0, 0, 0, 1005,
2861 0, 669, 0, 278, 361, 362, 0, 0, 660, 661,
2862 0, 1055, 1275, 0, 0, 543, 227, 0, 544, 666,
2863 0, 790, 0, 0, 834, 836, 0, 677, 678, 0,
2864 0, 0, 757, 0, 0, 242, 0, 761, 0, 763,
2865 0, 834, 836, 369, 370, 371, 372, 373, 374, 873,
2866 0, 0, 91, 0, 0, 694, 0, 0, 849, 0,
2867 531, 0, 532, 533, 534, 535, 536, 0, 0, 889,
2868 290, 0, 227, 0, 0, 0, 80, 0, 0, 0,
2869 0, 0, 904, 0, 0, 537, 0, 0, 0, 799,
2870 0, 0, 0, 0, 803, 0, 807, 0, 0, 80,
2871 0, 80, 80, 348, 0, 80, 0, 80, 0, 539,
2872 669, 80, 0, 80, 0, 540, 541, 542, 348, 0,
2873 361, 362, 0, 0, 0, 0, 80, 0, 80, 0,
2874 980, 1142, 0, 0, 227, 361, 362, 0, 227, 0,
2875 1144, 543, 0, 1148, 544, 0, 0, 0, 227, 0,
2876 0, 290, 0, 0, 781, 0, 0, 367, 368, 369,
2877 370, 371, 372, 373, 374, 0, 1166, 0, 531, 0,
2878 532, 533, 534, 535, 536, 370, 371, 372, 373, 374,
2879 80, 80, 80, 80, 80, 80, 80, 80, 0, 0,
2880 0, 80, 0, 537, 0, 80, 0, 0, 91, 0,
2881 91, 0, 0, 0, 0, 0, 0, 80, 227, 1167,
2882 0, 0, 0, 0, 0, 0, 0, 539, 227, 0,
2883 91, 227, 0, 1034, 541, 542, 0, 0, 781, 781,
2884 531, 0, 532, 533, 534, 535, 536, 0, 0, 0,
2885 0, 0, 0, 0, 80, 0, 80, 0, 0, 543,
2886 80, 80, 80, 0, 0, 537, 227, 0, 0, 0,
2887 0, 1227, 1228, 1229, 0, 0, 80, 0, 290, 538,
2888 0, 978, 0, 0, 982, 1215, 0, 0, 0, 539,
2889 0, 0, 0, 0, 0, 540, 541, 542, 989, 0,
2890 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0,
2891 1224, 1225, 1226, 0, 0, 0, 0, 0, 0, 0,
2892 0, 543, 80, 0, 544, 0, 0, 0, 278, 0,
2893 0, 0, 0, 0, 1084, 1086, 853, 0, 0, 1089,
2894 1091, 0, 0, 0, 0, 0, 0, 0, 1278, 0,
2895 290, 0, 0, 0, 0, 0, 0, 0, 80, 0,
2896 0, 1141, 0, 0, 0, 0, 0, 0, 1084, 1086,
2897 0, 1089, 1091, 960, 961, 0, 0, 0, 80, 0,
2898 965, 966, 0, 0, 125, 0, 125, 0, 0, 0,
2899 0, 0, 0, 0, 0, 0, 0, 91, 0, 227,
2900 91, 0, 0, 0, 0, 0, 0, 0, 531, 0,
2901 532, 533, 534, 535, 536, 0, 0, 0, 0, 0,
2902 0, 0, 0, 0, 0, 0, 0, 1180, 994, 995,
2903 0, 997, 998, 537, 0, 125, 125, 0, 0, 293,
2904 80, 0, 1094, 0, 80, 1095, 0, 538, 1097, 0,
2905 0, 0, 0, 0, 80, 1101, 0, 539, 1104, 0,
2906 80, 1175, 926, 926, 541, 542, 0, 293, 0, 0,
2907 0, 0, 0, 91, 0, 0, 0, 0, 0, 1175,
2908 399, 409, 409, 0, 91, 0, 91, 0, 0, 543,
2909 227, 0, 0, 0, 0, 0, 1037, 531, 0, 532,
2910 533, 534, 535, 536, 80, 0, 80, 1234, 0, 0,
2911 0, 0, 0, 0, 80, 0, 0, 0, 0, 0,
2912 0, 0, 537, 0, 80, 0, 80, 80, 0, 0,
2913 0, 0, 0, 0, 80, 80, 538, 0, 781, 781,
2914 0, 0, 0, 781, 781, 0, 539, 91, 227, 0,
2915 0, 1087, 540, 541, 542, 0, 0, 102, 0, 102,
2916 0, 0, 80, 91, 0, 0, 0, 0, 0, 0,
2917 0, 102, 102, 1182, 0, 0, 0, 0, 543, 0,
2918 0, 544, 0, 1105, 0, 0, 0, 0, 0, 0,
2919 0, 0, 0, 0, 125, 0, 926, 926, 0, 1120,
2920 926, 0, 0, 91, 0, 0, 0, 91, 102, 102,
2921 91, 0, 0, 0, 0, 781, 0, 926, 0, 0,
2922 0, 0, 0, 102, 0, 0, 0, 0, 0, 125,
2923 0, 125, 0, 0, 0, 0, 0, 0, 0, 0,
2924 0, 0, 0, 227, 125, 0, 125, 0, 102, 102,
2925 0, 0, 102, 0, 0, 0, 1242, 102, 0, 0,
2926 0, 0, 0, 0, 0, 781, 0, 293, 0, 0,
2927 0, 0, 0, 0, 0, 0, 0, 0, 91, 0,
2928 0, 0, 0, 0, 0, 0, 91, 91, 0, 0,
2929 0, 0, 0, 80, 0, 80, 80, 0, 125, 0,
2930 0, 0, 91, 125, 0, 0, 0, 0, 0, 125,
2931 1208, 0, 0, 125, 0, 0, 0, 0, 0, 0,
2932 0, 0, 0, 0, 0, 125, 293, 926, 0, 0,
2933 926, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2934 0, 0, 0, 0, 0, 0, 0, 926, 926, 926,
2935 0, 0, 926, 926, 91, 0, 0, 926, 926, 0,
2936 0, 0, 0, 0, 125, 91, 0, 102, 125, 80,
2937 125, 0, 0, 0, 227, 926, 0, 0, 0, 0,
2938 80, 1253, 80, 0, 0, 0, 80, 0, 0, 0,
2939 102, 0, 102, 102, 0, 0, 102, 0, 102, 0,
2940 0, 0, 102, 0, 102, 0, 0, 0, 0, 0,
2941 227, 227, 0, 0, 0, 0, 0, 102, 0, 102,
2942 0, 0, 0, 0, 948, 948, 0, 0, 0, 0,
2943 0, 0, 0, 0, 80, 80, 0, 0, 0, 80,
2944 80, 0, 0, 80, 80, 0, 0, 0, 0, 91,
2945 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,
2946 0, 0, 0, 0, 0, 0, 125, 0, 0, 0,
2947 0, 102, 102, 102, 102, 102, 102, 102, 102, 0,
2948 0, 0, 102, 0, 293, 0, 102, 0, 0, 0,
2949 0, 0, 0, 0, 0, 0, 926, 0, 102, 80,
2950 0, 926, 926, 80, 0, 0, 80, 0, 0, 0,
2951 0, 80, 0, 0, 0, 0, 0, 0, 0, 0,
2952 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2953 0, 0, 0, 0, 0, 102, 0, 102, 0, 80,
2954 0, 102, 102, 102, 926, 0, 0, 0, 0, 0,
2955 0, 0, 0, 0, 0, 0, 0, 102, 948, 948,
2956 0, 80, 948, 0, 0, 293, 0, 0, 782, 0,
2957 0, 926, 0, 0, 80, 0, 0, 0, 0, 948,
2958 0, 0, 80, 80, 0, 0, 0, 0, 0, 76,
2959 0, 76, 0, 0, 0, 0, 0, 0, 80, 0,
2960 0, 0, 0, 102, 0, 0, 0, 0, 0, 0,
2961 0, 0, 125, 0, 125, 0, 0, 0, 0, 0,
2962 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2963 0, 0, 0, 0, 125, 0, 0, 0, 0, 102,
2964 76, 76, 782, 782, 286, 0, 0, 0, 0, 0,
2965 80, 0, 0, 0, 0, 0, 0, 0, 0, 102,
2966 0, 80, 0, 0, 0, 0, 0, 0, 0, 0,
2967 80, 0, 286, 0, 0, 0, 0, 0, 0, 0,
2968 0, 0, 293, 0, 0, 286, 286, 286, 0, 948,
2969 0, 861, 948, 0, 0, 949, 949, 0, 0, 0,
2970 0, 0, 0, 0, 0, 0, 80, 80, 0, 948,
2971 948, 948, 0, 0, 948, 948, 0, 0, 0, 948,
2972 948, 102, 0, 0, 0, 102, 0, 0, 0, 0,
2973 0, 0, 0, 0, 0, 102, 0, 948, 0, 0,
2974 0, 102, 0, 0, 0, 80, 0, 0, 0, 0,
2975 0, 0, 0, 0, 293, 0, 0, 0, 0, 0,
2976 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2977 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2978 0, 0, 0, 0, 0, 102, 0, 102, 0, 0,
2979 0, 0, 0, 0, 0, 102, 0, 0, 0, 76,
2980 0, 125, 0, 0, 125, 102, 0, 102, 102, 0,
2981 0, 0, 0, 0, 0, 102, 102, 0, 0, 77,
2982 0, 77, 0, 0, 0, 0, 0, 0, 0, 949,
2983 949, 0, 0, 949, 76, 0, 76, 0, 0, 0,
2984 0, 0, 0, 102, 0, 0, 0, 0, 0, 76,
2985 949, 76, 0, 0, 0, 0, 0, 0, 948, 0,
2986 0, 0, 0, 948, 948, 0, 0, 0, 0, 0,
2987 77, 77, 286, 0, 287, 0, 0, 125, 0, 0,
2988 0, 0, 0, 0, 0, 0, 0, 0, 125, 0,
2989 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2990 0, 0, 287, 76, 0, 0, 948, 0, 76, 0,
2991 0, 0, 0, 0, 76, 287, 287, 287, 76, 0,
2992 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2993 76, 286, 0, 948, 0, 0, 0, 0, 0, 0,
2994 0, 0, 782, 782, 0, 0, 0, 782, 782, 0,
2995 0, 125, 0, 0, 0, 0, 0, 0, 0, 0,
2996 949, 0, 0, 949, 0, 0, 0, 125, 0, 76,
2997 0, 0, 0, 76, 102, 76, 102, 102, 0, 0,
2998 949, 949, 949, 0, 0, 949, 949, 0, 0, 0,
2999 949, 949, 0, 0, 0, 0, 0, 0, 0, 0,
3000 0, 0, 0, 1123, 0, 0, 0, 125, 949, 0,
3001 0, 125, 0, 0, 125, 0, 0, 950, 950, 782,
3002 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
3003 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3004 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3005 102, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3006 0, 102, 0, 102, 77, 0, 77, 102, 0, 782,
3007 0, 76, 0, 0, 0, 0, 0, 0, 0, 77,
3008 0, 77, 125, 0, 0, 0, 0, 0, 0, 286,
3009 125, 125, 0, 0, 0, 0, 0, 0, 0, 0,
3010 0, 0, 287, 0, 0, 0, 125, 0, 0, 0,
3011 0, 0, 0, 0, 409, 102, 102, 0, 0, 0,
3012 102, 102, 0, 0, 102, 102, 0, 0, 0, 949,
3013 0, 0, 0, 77, 949, 949, 0, 0, 77, 0,
3014 102, 0, 0, 0, 77, 0, 0, 0, 77, 0,
3015 0, 950, 950, 0, 0, 950, 0, 0, 125, 0,
3016 77, 287, 0, 0, 0, 0, 0, 0, 0, 125,
3017 286, 0, 950, 76, 0, 0, 0, 949, 0, 0,
3018 102, 0, 0, 0, 102, 409, 0, 102, 0, 0,
3019 0, 0, 102, 0, 951, 951, 0, 0, 0, 77,
3020 0, 0, 0, 77, 949, 77, 0, 0, 0, 0,
3021 0, 0, 0, 0, 0, 0, 0, 76, 0, 76,
3022 102, 0, 0, 952, 952, 0, 0, 0, 0, 0,
3023 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,
3024 0, 0, 102, 0, 0, 0, 0, 76, 76, 0,
3025 0, 0, 0, 125, 0, 102, 0, 0, 0, 0,
3026 0, 0, 0, 102, 102, 0, 0, 0, 0, 0,
3027 0, 0, 0, 0, 0, 0, 0, 0, 0, 102,
3028 0, 0, 950, 0, 121, 950, 121, 286, 0, 0,
3029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3030 0, 77, 950, 950, 950, 953, 953, 950, 950, 0,
3031 0, 0, 950, 950, 0, 0, 0, 0, 87, 287,
3032 87, 0, 0, 0, 0, 0, 0, 0, 951, 951,
3033 950, 102, 951, 0, 0, 121, 121, 0, 0, 291,
3034 0, 0, 102, 0, 0, 0, 0, 0, 0, 951,
3035 0, 102, 0, 0, 0, 0, 0, 952, 952, 286,
3036 0, 952, 0, 0, 0, 0, 0, 291, 0, 87,
3037 87, 0, 0, 0, 0, 0, 0, 0, 952, 0,
3038 397, 407, 407, 407, 0, 0, 0, 102, 102, 0,
3039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3040 287, 0, 0, 77, 0, 0, 76, 0, 0, 76,
3041 0, 0, 0, 0, 394, 0, 0, 0, 0, 0,
3042 0, 0, 0, 0, 0, 0, 102, 0, 0, 0,
3043 0, 0, 0, 0, 0, 0, 0, 0, 0, 953,
3044 953, 0, 0, 953, 0, 0, 0, 77, 0, 77,
3045 0, 950, 0, 0, 0, 0, 950, 950, 0, 951,
3046 953, 0, 951, 0, 0, 0, 0, 0, 0, 77,
3047 0, 0, 0, 0, 0, 0, 0, 77, 77, 951,
3048 951, 951, 76, 0, 951, 951, 0, 0, 952, 951,
3049 951, 952, 0, 76, 121, 76, 0, 0, 0, 950,
3050 0, 0, 0, 0, 0, 0, 0, 951, 952, 952,
3051 952, 0, 0, 952, 952, 0, 0, 287, 952, 952,
3052 0, 0, 0, 0, 0, 0, 950, 0, 87, 121,
3053 0, 121, 0, 0, 0, 0, 952, 0, 0, 0,
3054 0, 0, 0, 0, 121, 0, 121, 76, 76, 0,
3055 0, 0, 76, 76, 0, 0, 76, 0, 0, 124,
3056 0, 124, 0, 87, 0, 87, 0, 291, 0, 0,
3057 953, 0, 76, 953, 0, 0, 0, 0, 87, 0,
3058 87, 0, 0, 0, 0, 0, 0, 0, 0, 287,
3059 953, 953, 953, 0, 0, 953, 953, 0, 121, 0,
3060 953, 953, 0, 121, 0, 0, 0, 0, 286, 121,
3061 124, 124, 76, 121, 0, 0, 76, 0, 953, 76,
3062 0, 0, 0, 0, 76, 121, 291, 0, 951, 0,
3063 0, 0, 87, 951, 951, 0, 77, 87, 0, 77,
3064 0, 0, 0, 87, 0, 0, 0, 87, 0, 0,
3065 0, 0, 0, 0, 0, 0, 0, 952, 0, 87,
3066 0, 0, 952, 952, 121, 0, 0, 0, 121, 0,
3067 121, 0, 0, 0, 76, 0, 951, 0, 0, 0,
3068 0, 0, 0, 0, 0, 0, 0, 76, 954, 954,
3069 0, 0, 0, 0, 0, 76, 76, 0, 87, 0,
3070 0, 0, 87, 951, 87, 952, 0, 0, 0, 0,
3071 0, 76, 77, 0, 0, 0, 0, 0, 0, 286,
3072 0, 955, 955, 77, 0, 77, 0, 0, 0, 0,
3073 0, 0, 952, 0, 0, 0, 0, 0, 0, 953,
3074 0, 0, 0, 0, 953, 953, 0, 0, 0, 0,
3075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3076 0, 0, 0, 76, 0, 0, 121, 0, 0, 124,
3077 0, 0, 0, 0, 76, 0, 0, 77, 77, 0,
3078 0, 0, 77, 77, 291, 0, 77, 953, 0, 0,
3079 286, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3080 87, 0, 77, 0, 124, 0, 124, 0, 0, 0,
3081 0, 0, 0, 0, 953, 0, 0, 0, 0, 124,
3082 0, 124, 954, 954, 0, 0, 954, 0, 0, 0,
3083 0, 0, 0, 0, 0, 0, 0, 0, 287, 0,
3084 0, 0, 77, 954, 0, 0, 77, 0, 0, 77,
3085 0, 0, 0, 0, 77, 955, 955, 0, 76, 955,
3086 0, 0, 0, 0, 0, 291, 0, 0, 0, 0,
3087 0, 0, 0, 124, 0, 0, 955, 0, 124, 0,
3088 0, 0, 0, 0, 124, 0, 0, 0, 124, 0,
3089 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3090 124, 0, 776, 0, 77, 0, 0, 0, 0, 0,
3091 0, 0, 121, 0, 121, 0, 0, 77, 0, 0,
3092 0, 0, 0, 0, 0, 77, 77, 0, 0, 0,
3093 0, 0, 0, 0, 121, 0, 0, 0, 0, 124,
3094 0, 77, 0, 124, 0, 124, 87, 0, 87, 287,
3095 0, 0, 0, 954, 0, 0, 954, 0, 0, 0,
3096 0, 0, 0, 0, 0, 0, 0, 0, 87, 0,
3097 0, 0, 0, 954, 954, 954, 776, 776, 954, 954,
3098 0, 0, 291, 954, 954, 0, 955, 0, 0, 955,
3099 0, 0, 0, 77, 0, 0, 0, 0, 0, 0,
3100 0, 954, 0, 0, 77, 0, 955, 955, 955, 0,
3101 0, 955, 955, 0, 0, 0, 955, 955, 0, 0,
3102 287, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3103 0, 0, 0, 0, 955, 0, 0, 0, 0, 0,
3104 0, 124, 0, 0, 0, 0, 0, 0, 0, 0,
3105 0, 0, 0, 0, 291, 0, 0, 0, 0, 0,
3106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3107 0, 0, -785, 0, 0, 0, 0, 0, 0, 0,
3108 -785, -785, -785, 0, 0, -785, -785, -785, 77, -785,
3109 0, 0, 0, 0, 0, 0, 0, -785, -785, -785,
3110 0, 121, 0, 0, 121, 0, 0, 0, 0, -785,
3111 -785, 0, -785, -785, -785, -785, -785, 0, 0, 0,
3112 0, 0, 954, 0, 0, 0, 0, 954, 954, 0,
3113 0, 0, 0, 0, 0, 87, 0, 0, 87, 0,
3114 -785, 0, 0, 124, 0, 0, 0, 0, 0, 0,
3115 0, 0, 0, 0, 0, 955, 0, 0, 0, 0,
3116 955, 955, 0, 0, 0, 0, 0, 0, -785, -785,
3117 954, 0, 0, 0, 0, 0, 0, 121, 0, 0,
3118 0, 0, 0, 0, 347, 0, 0, 124, 121, 124,
3119 121, 0, -785, 0, 0, 0, 0, 954, 0, 0,
3120 0, 0, 0, 955, 0, 0, 0, 0, 0, 124,
3121 0, 87, 0, 0, 0, -785, -785, 124, 124, 0,
3122 238, -785, 87, -785, 87, -785, 0, 0, 0, 0,
3123 955, 0, 0, 0, 0, 0, 348, 349, 350, 351,
3124 352, 353, 354, 355, 356, 357, 358, 359, 360, 0,
3125 0, 121, 0, 361, 362, 0, 0, 0, 0, 363,
3126 0, 0, 0, 0, 0, 0, 0, 121, 0, 0,
3127 0, 0, 0, 0, 0, 0, 776, 776, 0, 0,
3128 0, 776, 776, 222, 222, 87, 364, 0, 365, 366,
3129 367, 368, 369, 370, 371, 372, 373, 374, 0, 0,
3130 0, 87, 0, 1121, 0, 0, 0, 121, 0, 0,
3131 0, 121, 0, 0, 121, 255, 258, 259, 260, 0,
3132 0, 0, 222, 222, 0, 0, 0, 0, 0, 0,
3133 0, 0, 0, 0, 0, 310, 311, 1119, 0, 0,
3134 0, 87, 0, 0, 0, 87, 0, 0, 87, 0,
3135 0, 0, 0, 776, 0, 0, 0, 0, 0, 0,
3136 0, 0, 0, 0, 0, 0, 0, 0, 0, 222,
3137 0, 0, 0, 0, 0, 0, 124, 0, 0, 124,
3138 0, 0, 121, 0, 0, 0, 0, 0, 0, 0,
3139 121, 121, 0, 0, 0, 0, 0, 0, 0, 0,
3140 0, 0, 0, 776, 0, 0, 121, 0, 0, 0,
3141 0, 0, 0, 0, 407, 0, 87, 0, 0, 0,
3142 0, 0, 0, 0, 87, 87, 0, 0, 0, 0,
3143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3144 87, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3145 0, 0, 124, 0, 0, 0, 0, 0, 121, 0,
3146 0, 0, 0, 124, 0, 124, 0, 0, 0, 121,
3147 0, 0, 0, 0, 0, 0, 0, 222, 0, 0,
3148 222, 222, 222, 0, 310, 407, 0, 0, 0, 0,
3149 0, 0, 87, 0, 0, 0, 0, 0, 0, 0,
3150 0, 0, 222, 87, 222, 222, 0, 0, 0, 0,
3151 0, 0, 0, 0, 0, 0, 0, 124, 124, 0,
3152 0, 0, 124, 124, 0, 0, 124, 0, 0, 0,
3153 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3154 0, 0, 124, 0, 0, 348, 349, 350, 351, 352,
3155 353, 354, 355, 121, 357, 358, 0, 0, 0, 0,
3156 0, 0, 361, 362, 0, 0, 0, 0, 0, 0,
3157 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3158 0, 0, 124, 0, 0, 0, 124, 87, 0, 124,
3159 0, 0, 0, 0, 124, 0, 0, 365, 366, 367,
3160 368, 369, 370, 371, 372, 373, 374, 0, 0, 0,
3161 0, 0, 0, 0, 0, 588, 589, 590, 591, 592,
3162 0, 0, 593, 594, 595, 596, 597, 598, 599, 600,
3163 0, 602, 0, 0, 603, 604, 605, 606, 607, 608,
3164 609, 610, 611, 612, 124, 0, 0, 222, 0, 0,
3165 0, 0, 0, 0, 0, 0, 0, 124, 0, 0,
3166 0, 0, 0, 0, 0, 124, 124, 0, 0, 0,
3167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3168 0, 124, 0, 0, 0, 0, 0, 0, 0, 0,
3169 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3170 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3171 222, 222, 0, 0, 0, 222, 0, 0, 0, 222,
3172 0, 0, 0, 0, 0, 260, 0, 0, 0, 0,
3173 0, 0, 0, 124, 0, 23, 24, 25, 26, 0,
3174 689, 0, 0, 0, 124, 0, 0, 0, 0, 0,
3175 0, 32, 33, 34, 914, 0, 222, 0, 915, 222,
3176 0, 41, 42, 43, 44, 45, 0, 0, 0, 0,
3177 0, 222, 0, 0, 0, 0, 0, 0, 0, 0,
3178 0, 0, 0, 0, 0, 0, 0, 0, 719, 0,
3179 0, 0, 917, 918, 0, 0, 0, 0, 0, 0,
3180 919, 0, 0, 920, 0, 0, 921, 922, 0, 923,
3181 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3182 66, 222, 0, 0, 0, 0, 0, 0, 124, 0,
3183 0, 0, 0, 747, 925, 0, 0, 756, 0, 0,
3184 0, 284, 0, 0, 0, 0, 0, 222, 0, 0,
3185 0, 0, 0, 777, 0, 242, 0, 0, 0, 0,
3186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3187 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3188 0, 0, 0, 0, 0, 0, 23, 24, 25, 26,
3189 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3190 0, 0, 32, 33, 34, 0, 0, 222, 0, 0,
3191 0, 0, 41, 42, 43, 44, 45, 222, 0, 0,
3192 0, 0, 0, 0, 0, 0, 0, 833, 833, 0,
3193 222, 747, 756, 833, 0, 222, 0, 0, 0, 0,
3194 0, 0, 0, 0, 833, 833, 0, 0, 0, 0,
3195 222, 0, 222, 0, 0, 0, 0, 0, 0, 0,
3196 0, 833, 0, 58, 59, 60, 61, 62, 63, 64,
3197 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3198 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3199 -785, 4, 284, 5, 6, 7, 8, 9, 222, 0,
3200 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
3201 15, 16, 17, 18, 19, 0, 0, 0, 222, 0,
3202 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3203 0, 222, 0, 0, 0, 28, 29, 30, 31, 32,
3204 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3205 42, 43, 44, 45, 46, 47, 0, 0, 0, 222,
3206 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3207 0, 0, 0, 0, 0, 0, 0, 0, 0, 222,
3208 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
3209 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
3210 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3211 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3212 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,
3213 68, 69, 0, 0, 0, 0, 0, 0, 0, 0,
3214 0, -785, 0, -785, 0, 0, 0, 0, 0, 0,
3215 0, 0, 0, 0, 1019, 1020, 0, 0, 0, 0,
3216 0, 0, 0, 0, 0, 0, 1026, 1027, 0, 0,
3217 0, 0, 222, 23, 24, 25, 26, 1038, 0, 222,
3218 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,
3219 33, 34, 914, 0, 0, 0, 915, 0, 916, 41,
3220 42, 43, 44, 45, 0, 0, 0, 0, 0, 0,
3221 0, 0, 0, 0, 0, 0, 0, 537, 0, 0,
3222 0, 0, 0, 0, 0, 0, 1082, 833, 833, 0,
3223 917, 918, 833, 833, 0, 0, 0, 0, 919, 0,
3224 0, 920, 0, 0, 921, 922, 222, 923, 541, 0,
3225 58, 59, 924, 61, 62, 63, 64, 65, 66, 0,
3226 0, 833, 833, 0, 833, 833, 0, 222, 0, 0,
3227 0, 0, 925, 0, 0, 0, 0, 0, 0, 284,
3228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3229 0, 0, 0, 0, 0, 0, 0, 0, 0, -762,
3230 222, 0, 0, 0, 833, 0, 0, -762, -762, -762,
3231 0, 0, -762, -762, -762, 0, -762, 0, 0, 0,
3232 0, 0, 0, 0, -762, -762, -762, -762, -762, 0,
3233 0, 0, 0, 0, 0, 0, -762, -762, 0, -762,
3234 -762, -762, -762, -762, 0, 0, 0, 0, 0, 0,
3235 0, 0, 0, 0, 833, 0, 0, 0, 0, 0,
3236 0, 0, 0, 0, 0, 0, 222, -762, 0, 0,
3237 0, 0, 833, 0, 0, 0, -762, -762, -762, -762,
3238 -762, -762, -762, -762, -762, -762, -762, -762, -762, 0,
3239 0, 0, 0, -762, -762, -762, -762, 0, 841, -762,
3240 0, 0, 0, 0, 0, -762, 0, 0, 0, 0,
3241 0, 0, 0, 0, 0, 0, 0, 0, 0, -762,
3242 0, 0, -762, 0, 0, -126, -762, -762, -762, -762,
3243 -762, -762, -762, -762, -762, -762, -762, -762, 0, 0,
3244 0, 0, -762, -762, -762, -762, 222, -652, -762, -762,
3245 -762, 0, -762, 0, 0, -652, -652, -652, 0, 0,
3246 -652, -652, -652, 222, -652, 0, 0, 0, 0, 910,
3247 0, 0, -652, 0, -652, -652, -652, 0, 0, 0,
3248 0, 0, 0, 0, -652, -652, 0, -652, -652, -652,
3249 -652, -652, 0, 0, 0, 0, 0, 0, 0, 0,
3250 0, 0, 348, 349, 350, 351, 352, 353, 354, 355,
3251 356, 357, 358, 359, 360, -652, 0, 0, 0, 361,
3252 362, 0, 0, 0, -652, -652, -652, -652, -652, -652,
3253 -652, -652, -652, -652, -652, -652, -652, 0, 0, 0,
3254 0, -652, -652, -652, -652, 0, -652, -652, 0, 0,
3255 0, 0, 364, -652, 365, 366, 367, 368, 369, 370,
3256 371, 372, 373, 374, 0, 0, 0, -652, 0, 0,
3257 -652, -273, 0, -652, -652, -652, -652, -652, -652, -652,
3258 -652, -652, -652, -652, -652, -652, 0, 0, 0, 0,
3259 0, -652, -652, -652, -655, 0, -652, -652, -652, 0,
3260 -652, 0, -655, -655, -655, 0, 0, -655, -655, -655,
3261 0, -655, 0, 0, 0, 0, 888, 0, 0, -655,
3262 0, -655, -655, -655, 0, 0, 0, 0, 0, 0,
3263 0, -655, -655, 0, -655, -655, -655, -655, -655, 0,
3264 0, 0, 0, 0, 0, 0, 0, 0, 0, 348,
3265 349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
3266 359, 360, -655, 0, 0, 0, 361, 362, 0, 0,
3267 0, -655, -655, -655, -655, -655, -655, -655, -655, -655,
3268 -655, -655, -655, -655, 0, 0, 0, 0, -655, -655,
3269 -655, -655, 0, -655, -655, 0, 0, 0, 0, 364,
3270 -655, 365, 366, 367, 368, 369, 370, 371, 372, 373,
3271 374, 0, 0, 0, -655, 0, 0, -655, 0, 0,
3272 -655, -655, -655, -655, -655, -655, -655, -655, -655, -655,
3273 -655, -655, -655, 0, 0, 0, 0, 0, -655, -655,
3274 -655, -763, 0, -655, -655, -655, 0, -655, 0, -763,
3275 -763, -763, 0, 0, -763, -763, -763, 0, -763, 0,
3276 0, 0, 0, 900, 0, 0, -763, -763, -763, -763,
3277 -763, 0, 0, 0, 0, 0, 0, 0, -763, -763,
3278 0, -763, -763, -763, -763, -763, 0, 0, 0, 0,
3279 0, 0, 0, 0, 0, 0, 348, 349, 350, 351,
3280 352, 353, 354, 355, 356, 357, 358, 359, 360, -763,
3281 0, 0, 0, 361, 362, 0, 0, 0, -763, -763,
3282 -763, -763, -763, -763, -763, -763, -763, -763, -763, -763,
3283 -763, 0, 0, 0, 0, -763, -763, -763, -763, 0,
3284 0, -763, 0, 0, 0, 0, 364, -763, 365, 366,
3285 367, 368, 369, 370, 371, 372, 373, 374, 0, 0,
3286 0, -763, 0, 0, -763, 0, 0, 0, -763, -763,
3287 -763, -763, -763, -763, -763, -763, -763, -763, -763, -763,
3288 0, 0, 0, 0, -763, -763, -763, -763, -764, 0,
3289 -763, -763, -763, 0, -763, 0, -764, -764, -764, 0,
3290 0, -764, -764, -764, 0, -764, 0, 0, 0, 0,
3291 910, 0, 0, -764, -764, -764, -764, -764, 0, 0,
3292 0, 0, 0, 0, 0, -764, -764, 0, -764, -764,
3293 -764, -764, -764, 0, 0, 0, 0, 0, 0, 0,
3294 0, 0, 0, 348, 349, 350, 351, 352, 353, 354,
3295 355, 356, 357, 358, 359, 360, -764, 0, 0, 0,
3296 361, 362, 0, 0, 0, -764, -764, -764, -764, -764,
3297 -764, -764, -764, -764, -764, -764, -764, -764, 0, 0,
3298 0, 0, -764, -764, -764, -764, 0, 0, -764, 0,
3299 0, 0, 0, 364, -764, 365, 366, 367, 368, 369,
3300 370, 371, 372, 373, 374, 0, 0, 0, -764, 0,
3301 0, -764, 0, 0, 0, -764, -764, -764, -764, -764,
3302 -764, -764, -764, -764, -764, -764, -764, 0, 0, 0,
3303 0, -764, -764, -764, -764, -328, 0, -764, -764, -764,
3304 0, -764, 0, -328, -328, -328, 0, 0, -328, -328,
3305 -328, 0, -328, 0, 0, 0, 0, 0, 0, 0,
3306 -328, 0, -328, -328, -328, 0, 0, 0, 0, 0,
3307 0, 0, -328, -328, 0, -328, -328, -328, -328, -328,
3308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3309 348, 349, 350, 351, 352, 353, 354, 355, 356, 357,
3310 358, 359, 360, -328, 0, 0, 0, 361, 362, 0,
3311 0, 0, -328, -328, -328, -328, -328, -328, -328, -328,
3312 -328, -328, -328, -328, -328, 0, 0, 0, 0, -328,
3313 -328, -328, -328, 0, 842, -328, 0, 0, 0, 0,
3314 364, -328, 365, 366, 367, 368, 369, 370, 371, 372,
3315 373, 374, 0, 0, 0, -328, 0, 0, -328, 0,
3316 0, -128, -328, -328, -328, -328, -328, -328, -328, -328,
3317 -328, -328, -328, -328, 0, 0, 0, 0, 0, -328,
3318 -328, -328, -465, 0, -328, -328, -328, 0, -328, 0,
3319 -465, -465, -465, 0, 0, -465, -465, -465, 0, -465,
3320 0, 0, 0, 0, 0, 0, 0, -465, -465, -465,
3321 -465, 0, 0, 0, 0, 0, 0, 0, 0, -465,
3322 -465, 0, -465, -465, -465, -465, -465, 0, 0, 0,
3323 0, 0, 0, 0, 0, 0, 0, 348, 349, 350,
3324 351, 352, 353, 354, 355, 356, 357, 358, -786, -786,
3325 -465, 0, 0, 0, 361, 362, 0, 0, 0, -465,
3326 -465, -465, -465, -465, -465, -465, -465, -465, -465, -465,
3327 -465, -465, 0, 0, 0, 0, -465, -465, -465, -465,
3328 0, 0, -465, 0, 0, 0, 0, 0, -465, 365,
3329 366, 367, 368, 369, 370, 371, 372, 373, 374, 0,
3330 0, 0, -465, 0, 0, 0, 0, 0, 0, -465,
3331 0, -465, -465, -465, -465, -465, -465, -465, -465, -465,
3332 -465, 0, 0, 0, 0, -465, -465, -465, -465, -320,
3333 238, -465, -465, -465, 0, -465, 0, -320, -320, -320,
3334 0, 0, -320, -320, -320, 0, -320, 0, 0, 0,
3335 0, 0, 0, 0, -320, 0, -320, -320, -320, 0,
3336 0, 0, 0, 0, 0, 0, -320, -320, 0, -320,
3337 -320, -320, -320, -320, 0, 0, 0, 0, 0, 0,
3338 0, 0, 0, 0, 348, -786, -786, -786, -786, 353,
3339 354, 0, 0, -786, -786, 0, 0, -320, 0, 0,
3340 0, 361, 362, 0, 0, 0, -320, -320, -320, -320,
3341 -320, -320, -320, -320, -320, -320, -320, -320, -320, 0,
3342 0, 0, 0, -320, -320, -320, -320, 0, 0, -320,
3343 0, 0, 0, 0, 0, -320, 365, 366, 367, 368,
3344 369, 370, 371, 372, 373, 374, 0, 0, 0, -320,
3345 0, 0, -320, 0, 0, 0, -320, -320, -320, -320,
3346 -320, -320, -320, -320, -320, -320, -320, -320, 0, 0,
3347 0, 0, 0, -320, -320, -320, -785, 0, -320, -320,
3348 -320, 0, -320, 0, -785, -785, -785, 0, 0, -785,
3349 -785, -785, 0, -785, 0, 0, 0, 0, 0, 0,
3350 0, -785, -785, -785, -785, 0, 0, 0, 0, 0,
3351 0, 0, 0, -785, -785, 0, -785, -785, -785, -785,
3352 -785, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3353 0, 348, 349, 350, 351, 352, 353, 354, 0, 0,
3354 357, 358, 0, 0, -785, 0, 0, 0, 361, 362,
3355 0, 0, 0, -785, -785, -785, -785, -785, -785, -785,
3356 -785, -785, -785, -785, -785, -785, 0, 0, 0, 0,
3357 -785, -785, -785, -785, 0, 0, -785, 0, 0, 0,
3358 0, 0, -785, 365, 366, 367, 368, 369, 370, 371,
3359 372, 373, 374, 0, 0, 0, -785, 0, 0, 0,
3360 0, 0, 0, -785, 0, -785, -785, -785, -785, -785,
3361 -785, -785, -785, -785, -785, 0, 0, 0, 0, -785,
3362 -785, -785, -785, -335, 238, -785, -785, -785, 0, -785,
3363 0, -335, -335, -335, 0, 0, -335, -335, -335, 0,
3364 -335, 0, 0, 0, 0, 0, 0, 0, -335, 0,
3365 -335, -335, 0, 0, 0, 0, 0, 0, 0, 0,
3366 -335, -335, 0, -335, -335, -335, -335, -335, 0, 0,
3367 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3368 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3369 0, -335, 0, 0, 0, 0, 0, 0, 0, 0,
3370 -335, -335, -335, -335, -335, -335, -335, -335, -335, -335,
3371 -335, -335, -335, 0, 0, 0, 0, -335, -335, -335,
3372 -335, 0, 0, -335, 0, 0, 0, 0, 0, -335,
3373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3374 0, 0, 0, -335, 0, 0, 0, 0, 0, 0,
3375 -335, 0, -335, -335, -335, -335, -335, -335, -335, -335,
3376 -335, -335, 0, 0, 0, 0, 0, -335, -335, -335,
3377 -762, 235, -335, -335, -335, 0, -335, 0, -762, -762,
3378 -762, 0, 0, 0, -762, -762, 0, -762, 0, 0,
3379 0, 0, 0, 0, 0, -762, -762, 0, 0, 0,
3380 0, 0, 0, 0, 0, 0, 0, -762, -762, 0,
3381 -762, -762, -762, -762, -762, 0, 0, 0, 0, 0,
3382 0, 0, 348, 349, 350, 351, 352, 353, 354, 355,
3383 356, 357, 358, 359, 360, 0, 0, 0, -762, 361,
3384 362, 0, 0, 0, 0, 0, 0, -762, -762, -762,
3385 -762, -762, -762, -762, -762, -762, -762, -762, -762, -762,
3386 0, 0, 0, 0, -762, -762, -762, -762, 0, 786,
3387 -762, 0, 364, 0, 365, 366, 367, 368, 369, 370,
3388 371, 372, 373, 374, 0, 0, 0, 0, 0, 0,
3389 -762, 0, 0, 0, 0, 0, -126, -762, 242, -762,
3390 -762, -762, -762, -762, -762, -762, -762, -762, -762, 0,
3391 0, 0, 0, -762, -762, -762, -117, -762, 0, -762,
3392 0, -762, 0, -762, 0, -762, -762, -762, 0, 0,
3393 0, -762, -762, 0, -762, 0, 0, 0, 0, 0,
3394 0, 0, -762, -762, 0, 0, 0, 0, 0, 0,
3395 0, 0, 0, 0, -762, -762, 0, -762, -762, -762,
3396 -762, -762, 0, 0, 0, 0, 0, 0, 0, 0,
3397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3398 0, 0, 0, 0, 0, -762, 0, 0, 0, 0,
3399 0, 0, 0, 0, -762, -762, -762, -762, -762, -762,
3400 -762, -762, -762, -762, -762, -762, -762, 0, 0, 0,
3401 0, -762, -762, -762, -762, 0, 786, -762, 0, 0,
3402 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3403 0, 0, 0, 0, 0, 0, 0, -762, 0, 0,
3404 0, 0, 0, -126, -762, 0, -762, -762, -762, -762,
3405 -762, -762, -762, -762, -762, -762, 0, 0, 0, 0,
3406 -762, -762, -762, -762, -328, 0, -762, 0, -762, 0,
3407 -762, 0, -328, -328, -328, 0, 0, 0, -328, -328,
3408 0, -328, 0, 0, 0, 0, 0, 0, 0, -328,
3409 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3410 0, -328, -328, 0, -328, -328, -328, -328, -328, 0,
3411 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3412 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3413 0, 0, -328, 0, 0, 0, 0, 0, 0, 0,
3414 0, -328, -328, -328, -328, -328, -328, -328, -328, -328,
3415 -328, -328, -328, -328, 0, 0, 0, 0, -328, -328,
3416 -328, -328, 0, 787, -328, 0, 0, 0, 0, 0,
3417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3418 0, 0, 0, 0, -328, 0, 0, 0, 0, 0,
3419 -128, -328, 0, -328, -328, -328, -328, -328, -328, -328,
3420 -328, -328, -328, 0, 0, 0, 0, 0, -328, -328,
3421 -119, -328, 0, -328, 0, -328, 0, -328, 0, -328,
3422 -328, -328, 0, 0, 0, -328, -328, 0, -328, 0,
3423 0, 0, 0, 0, 0, 0, -328, 0, 0, 0,
3424 0, 0, 0, 0, 0, 0, 0, 0, -328, -328,
3425 0, -328, -328, -328, -328, -328, 0, 0, 0, 0,
3426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3427 0, 0, 0, 0, 0, 0, 0, 0, 0, -328,
3428 0, 0, 0, 0, 0, 0, 0, 0, -328, -328,
3429 -328, -328, -328, -328, -328, -328, -328, -328, -328, -328,
3430 -328, 0, 0, 0, 0, -328, -328, -328, -328, 0,
3431 787, -328, 0, 0, 0, 0, 0, 0, 0, 0,
3432 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3433 0, -328, 0, 0, 0, 0, 0, -128, -328, 0,
3434 -328, -328, -328, -328, -328, -328, -328, -328, -328, -328,
3435 0, 0, 0, 0, 0, -328, -328, -328, 0, 0,
3436 -328, 0, -328, 262, -328, 5, 6, 7, 8, 9,
3437 -785, -785, -785, 10, 11, 0, 0, -785, 12, 0,
3438 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3439 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3440 0, 27, 0, 0, 0, 0, 0, 28, 29, 263,
3441 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3442 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3443 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3444 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3445 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3446 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3447 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3448 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3449 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3450 0, 67, 68, 69, 0, 0, 0, 0, 0, 0,
3451 0, 0, 0, -785, 262, -785, 5, 6, 7, 8,
3452 9, 0, 0, -785, 10, 11, 0, -785, -785, 12,
3453 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3454 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3455 0, 0, 27, 0, 0, 0, 0, 0, 28, 29,
3456 263, 31, 32, 33, 34, 35, 36, 37, 38, 39,
3457 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3458 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3459 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3460 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3461 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3462 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3463 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3464 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3465 0, 0, 67, 68, 69, 0, 0, 0, 0, 0,
3466 0, 0, 0, 0, -785, 262, -785, 5, 6, 7,
3467 8, 9, 0, 0, -785, 10, 11, 0, 0, -785,
3468 12, -785, 13, 14, 15, 16, 17, 18, 19, 0,
3469 0, 0, 0, 0, 20, 21, 22, 23, 24, 25,
3470 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3471 29, 263, 31, 32, 33, 34, 35, 36, 37, 38,
3472 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3473 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3474 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3475 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3476 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
3477 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
3478 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3480 0, 0, 0, 67, 68, 69, 0, 0, 0, 0,
3481 0, 0, 0, 0, 0, -785, 262, -785, 5, 6,
3482 7, 8, 9, 0, 0, -785, 10, 11, 0, 0,
3483 -785, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3484 -785, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3485 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
3486 28, 29, 263, 31, 32, 33, 34, 35, 36, 37,
3487 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3488 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3489 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3490 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3491 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3492 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3493 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3495 0, 0, 0, 0, 67, 68, 69, 0, 0, 0,
3496 0, 0, 0, 0, 0, 0, -785, 262, -785, 5,
3497 6, 7, 8, 9, 0, 0, -785, 10, 11, 0,
3498 0, -785, 12, 0, 13, 14, 15, 16, 17, 18,
3499 19, 0, 0, 0, 0, 0, 20, 21, 22, 23,
3500 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3501 0, 28, 29, 263, 31, 32, 33, 34, 35, 36,
3502 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3503 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3504 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3505 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3506 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3507 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3508 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3509 0, 0, 0, 262, 0, 5, 6, 7, 8, 9,
3510 0, -785, -785, 10, 11, 67, 68, 69, 12, 0,
3511 13, 14, 15, 16, 17, 18, 19, -785, 0, -785,
3512 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3513 0, 27, 0, 0, 0, 0, 0, 28, 29, 263,
3514 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3515 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3516 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3517 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3518 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3519 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3520 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3521 66, 0, 0, 0, 0, 0, 0, 0, 0, 262,
3522 0, 5, 6, 7, 8, 9, 0, 0, 0, 10,
3523 11, 67, 68, 69, 12, 0, 13, 14, 15, 16,
3524 17, 18, 19, -785, 0, -785, 0, 0, 20, 21,
3525 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3526 0, 0, 0, 28, 29, 263, 31, 32, 33, 34,
3527 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3528 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3529 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3530 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3531 0, 0, 0, 0, 0, 0, 52, 0, 0, 264,
3532 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3533 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3535 0, 0, 0, 0, 0, 0, 0, 67, 68, 69,
3536 0, 0, 0, 0, 0, 0, 0, -785, 0, -785,
3537 262, -785, 5, 6, 7, 8, 9, 0, 0, 0,
3538 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
3539 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
3540 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
3541 0, 0, 0, 0, 28, 29, 263, 31, 32, 33,
3542 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3543 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3544 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3545 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3546 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3547 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3548 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3549 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3550 0, 0, 0, 0, 0, 0, 0, 0, 67, 68,
3551 69, 0, 0, 0, 0, 0, 0, 0, -785, 0,
3552 -785, 4, -785, 5, 6, 7, 8, 9, 0, 0,
3553 0, 10, 11, 0, 0, 0, 12, 0, 13, 14,
3554 15, 16, 17, 18, 19, 0, 0, 0, 0, 0,
3555 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3556 0, 0, 0, 0, 0, 28, 29, 30, 31, 32,
3557 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3558 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3559 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3561 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
3562 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
3563 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3564 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3565 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,
3566 68, 69, 0, 0, -785, 0, 0, 0, 0, 0,
3567 0, -785, 262, -785, 5, 6, 7, 8, 9, 0,
3568 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
3569 14, 15, 16, 17, 18, 19, 0, 0, 0, 0,
3570 0, 20, 21, 22, 23, 24, 25, 26, 0, 0,
3571 27, 0, 0, 0, 0, 0, 28, 29, 263, 31,
3572 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3573 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3574 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3575 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3576 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3577 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3578 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3580 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3581 67, 68, 69, 0, 0, -785, 0, 0, 0, 0,
3582 0, 0, -785, 262, -785, 5, 6, 7, 8, 9,
3583 0, 0, -785, 10, 11, 0, 0, 0, 12, 0,
3584 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3585 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3586 0, 27, 0, 0, 0, 0, 0, 28, 29, 263,
3587 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3588 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3589 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3590 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3591 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3592 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3593 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3594 66, 0, 0, 0, 0, 0, 0, 0, 0, 262,
3595 0, 5, 6, 7, 8, 9, 0, 0, 0, 10,
3596 11, 67, 68, 69, 12, 0, 13, 14, 15, 16,
3597 17, 18, 19, -785, 0, -785, 0, 0, 20, 21,
3598 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3599 0, 0, 0, 28, 29, 263, 31, 32, 33, 34,
3600 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3601 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3602 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3603 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3604 0, 0, 0, 0, 0, 0, 52, 0, 0, 53,
3605 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3606 60, 61, 62, 63, 64, 65, 66, 0, -785, 0,
3607 0, 0, 0, 0, 0, 0, 0, 5, 6, 7,
3608 0, 9, 0, 0, 0, 10, 11, 67, 68, 69,
3609 12, 0, 13, 14, 15, 16, 17, 18, 19, -785,
3610 0, -785, 0, 0, 20, 21, 22, 23, 24, 25,
3611 26, 0, 0, 209, 0, 0, 0, 0, 0, 0,
3612 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
3613 39, 40, 210, 41, 42, 43, 44, 45, 46, 47,
3614 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3615 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3616 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3617 0, 0, 211, 0, 0, 212, 54, 0, 55, 56,
3618 0, 213, 214, 215, 58, 59, 216, 61, 62, 63,
3619 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3620 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
3621 0, 10, 11, 67, 217, 69, 12, 0, 13, 14,
3622 15, 16, 17, 18, 19, 0, 0, 242, 0, 0,
3623 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3624 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
3625 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3626 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3627 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3629 50, 51, 0, 0, 0, 0, 0, 0, 211, 0,
3630 0, 212, 54, 0, 55, 56, 0, 0, 0, 0,
3631 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3632 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
3633 6, 7, 0, 9, 0, 0, 0, 10, 11, 67,
3634 68, 69, 12, 0, 13, 14, 15, 16, 17, 18,
3635 19, 312, 0, 313, 0, 0, 20, 21, 22, 23,
3636 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3637 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
3638 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3639 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3640 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3641 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3642 0, 0, 0, 0, 211, 0, 0, 212, 54, 0,
3643 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
3644 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3645 0, 0, 0, 0, 0, 5, 6, 7, 8, 9,
3646 0, 0, 0, 10, 11, 67, 68, 69, 12, 0,
3647 13, 14, 15, 16, 17, 18, 19, 0, 0, 242,
3648 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3649 0, 27, 0, 0, 0, 0, 0, 28, 29, 30,
3650 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3651 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3652 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3653 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3654 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3655 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3656 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3657 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3658 0, 5, 6, 7, 8, 9, 0, 0, 0, 10,
3659 11, 67, 68, 69, 12, 0, 13, 14, 15, 16,
3660 17, 18, 19, 522, 0, 0, 0, 0, 20, 21,
3661 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3662 0, 0, 0, 28, 29, 263, 31, 32, 33, 34,
3663 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3664 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3665 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3666 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3667 0, 0, 0, 0, 0, 0, 52, 0, 0, 53,
3668 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3669 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3670 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3671 0, 0, 0, 0, 0, 0, 0, 67, 68, 69,
3672 0, 0, 0, 0, 0, 0, 0, 0, 0, 522,
3673 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
3674 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
3675 149, 150, 151, 152, 0, 0, 0, 153, 154, 155,
3676 411, 412, 413, 414, 160, 161, 162, 0, 0, 0,
3677 0, 0, 163, 164, 165, 166, 415, 416, 417, 418,
3678 171, 37, 38, 419, 40, 0, 0, 0, 0, 0,
3679 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3680 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
3681 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
3682 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
3683 0, 0, 0, 0, 188, 189, 0, 0, 0, 0,
3684 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3685 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
3686 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
3687 0, 0, 0, 0, 202, 420, 129, 130, 131, 132,
3688 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
3689 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
3690 0, 0, 0, 153, 154, 155, 156, 157, 158, 159,
3691 160, 161, 162, 0, 0, 0, 0, 0, 163, 164,
3692 165, 166, 167, 168, 169, 170, 171, 295, 296, 172,
3693 297, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3694 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
3695 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
3696 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
3697 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3698 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
3699 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3700 0, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3701 198, 199, 0, 200, 201, 0, 0, 0, 0, 0,
3702 202, 129, 130, 131, 132, 133, 134, 135, 136, 137,
3703 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
3704 148, 149, 150, 151, 152, 0, 0, 0, 153, 154,
3705 155, 156, 157, 158, 159, 160, 161, 162, 0, 0,
3706 0, 0, 0, 163, 164, 165, 166, 167, 168, 169,
3707 170, 171, 244, 0, 172, 0, 0, 0, 0, 0,
3708 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3709 0, 0, 0, 173, 174, 175, 176, 177, 178, 179,
3710 180, 181, 0, 0, 182, 183, 0, 0, 0, 0,
3711 184, 185, 186, 187, 0, 0, 0, 0, 0, 0,
3712 0, 0, 0, 0, 0, 188, 189, 0, 0, 59,
3713 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3714 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
3715 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
3716 0, 0, 0, 0, 0, 202, 129, 130, 131, 132,
3717 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
3718 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
3719 0, 0, 0, 153, 154, 155, 156, 157, 158, 159,
3720 160, 161, 162, 0, 0, 0, 0, 0, 163, 164,
3721 165, 166, 167, 168, 169, 170, 171, 0, 0, 172,
3722 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3723 0, 0, 0, 0, 0, 0, 0, 0, 173, 174,
3724 175, 176, 177, 178, 179, 180, 181, 0, 0, 182,
3725 183, 0, 0, 0, 0, 184, 185, 186, 187, 0,
3726 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3727 188, 189, 0, 0, 59, 0, 0, 0, 0, 0,
3728 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3729 0, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3730 198, 199, 0, 200, 201, 0, 0, 0, 0, 0,
3731 202, 129, 130, 131, 132, 133, 134, 135, 136, 137,
3732 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
3733 148, 149, 150, 151, 152, 0, 0, 0, 153, 154,
3734 155, 156, 157, 158, 159, 160, 161, 162, 0, 0,
3735 0, 0, 0, 163, 164, 165, 166, 167, 168, 169,
3736 170, 171, 0, 0, 172, 0, 0, 0, 0, 0,
3737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3738 0, 0, 0, 173, 174, 175, 176, 177, 178, 179,
3739 180, 181, 0, 0, 182, 183, 0, 0, 0, 0,
3740 184, 185, 186, 187, 0, 0, 0, 0, 0, 0,
3741 0, 0, 0, 0, 0, 188, 189, 0, 0, 0,
3742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3743 0, 0, 0, 0, 0, 0, 0, 190, 191, 192,
3744 193, 194, 195, 196, 197, 198, 199, 0, 200, 201,
3745 5, 6, 7, 0, 9, 202, 0, 0, 10, 11,
3746 0, 0, 0, 12, 0, 13, 14, 15, 250, 251,
3747 18, 19, 0, 0, 0, 0, 0, 20, 252, 253,
3748 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3749 0, 0, 0, 282, 0, 0, 32, 33, 34, 35,
3750 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3751 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3753 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3754 0, 0, 0, 0, 0, 283, 0, 0, 212, 54,
3755 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
3756 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3757 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
3758 6, 7, 0, 9, 0, 0, 284, 10, 11, 0,
3759 0, 0, 12, 285, 13, 14, 15, 250, 251, 18,
3760 19, 0, 0, 0, 0, 0, 20, 252, 253, 23,
3761 24, 25, 26, 0, 0, 209, 0, 0, 0, 0,
3762 0, 0, 282, 0, 0, 32, 33, 34, 35, 36,
3763 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3764 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3766 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3767 0, 0, 0, 0, 283, 0, 0, 212, 54, 0,
3768 55, 56, 0, 0, 0, 0, 58, 59, 60, 61,
3769 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3770 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3771 7, 8, 9, 0, 0, 284, 10, 11, 0, 0,
3772 0, 12, 583, 13, 14, 15, 16, 17, 18, 19,
3773 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3774 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
3775 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
3776 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3777 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3778 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3779 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3780 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3781 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3782 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3783 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3784 0, 0, 10, 11, 67, 68, 69, 12, 0, 13,
3785 14, 15, 16, 17, 18, 19, 0, 0, 0, 0,
3786 0, 20, 21, 22, 23, 24, 25, 26, 0, 0,
3787 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3788 32, 33, 34, 35, 36, 37, 38, 39, 40, 210,
3789 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3790 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3791 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3792 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3793 0, 0, 212, 54, 0, 55, 56, 0, 213, 214,
3794 215, 58, 59, 216, 61, 62, 63, 64, 65, 66,
3795 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3796 5, 6, 7, 8, 9, 0, 0, 0, 10, 11,
3797 67, 217, 69, 12, 0, 13, 14, 15, 16, 17,
3798 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3799 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
3800 0, 0, 28, 29, 0, 31, 32, 33, 34, 35,
3801 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3802 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3803 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3804 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3805 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
3806 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3807 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3808 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3809 9, 0, 0, 0, 10, 11, 67, 68, 69, 12,
3810 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3811 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3812 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
3813 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3814 40, 210, 41, 42, 43, 44, 45, 46, 47, 0,
3815 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3816 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3817 0, 0, 0, 50, 458, 0, 0, 0, 0, 0,
3818 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
3819 213, 214, 215, 58, 59, 216, 61, 62, 63, 64,
3820 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3821 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3822 10, 11, 67, 217, 69, 12, 0, 13, 14, 15,
3823 250, 251, 18, 19, 0, 0, 0, 0, 0, 20,
3824 252, 253, 23, 24, 25, 26, 0, 0, 209, 0,
3825 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3826 34, 35, 36, 37, 38, 39, 40, 210, 41, 42,
3827 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3828 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3829 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3830 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3831 212, 54, 0, 55, 56, 0, 668, 214, 215, 58,
3832 59, 216, 61, 62, 63, 64, 65, 66, 0, 0,
3833 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3834 7, 0, 9, 0, 0, 0, 10, 11, 67, 217,
3835 69, 12, 0, 13, 14, 15, 250, 251, 18, 19,
3836 0, 0, 0, 0, 0, 20, 252, 253, 23, 24,
3837 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3838 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3839 38, 39, 40, 210, 41, 42, 43, 44, 45, 46,
3840 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3841 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3842 0, 0, 0, 0, 0, 50, 458, 0, 0, 0,
3843 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3844 56, 0, 668, 214, 215, 58, 59, 216, 61, 62,
3845 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3846 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3847 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3848 14, 15, 250, 251, 18, 19, 0, 0, 0, 0,
3849 0, 20, 252, 253, 23, 24, 25, 26, 0, 0,
3850 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3851 32, 33, 34, 35, 36, 37, 38, 39, 40, 210,
3852 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3853 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3855 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3856 0, 0, 212, 54, 0, 55, 56, 0, 213, 214,
3857 0, 58, 59, 216, 61, 62, 63, 64, 65, 66,
3858 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3859 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3860 67, 217, 69, 12, 0, 13, 14, 15, 250, 251,
3861 18, 19, 0, 0, 0, 0, 0, 20, 252, 253,
3862 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3863 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3864 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
3865 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3866 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3867 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3868 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
3869 0, 55, 56, 0, 0, 214, 215, 58, 59, 216,
3870 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3871 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3872 9, 0, 0, 0, 10, 11, 67, 217, 69, 12,
3873 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
3874 0, 0, 0, 20, 252, 253, 23, 24, 25, 26,
3875 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
3876 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3877 40, 210, 41, 42, 43, 44, 45, 46, 47, 0,
3878 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3879 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3880 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3881 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
3882 668, 214, 0, 58, 59, 216, 61, 62, 63, 64,
3883 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3884 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3885 10, 11, 67, 217, 69, 12, 0, 13, 14, 15,
3886 250, 251, 18, 19, 0, 0, 0, 0, 0, 20,
3887 252, 253, 23, 24, 25, 26, 0, 0, 209, 0,
3888 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3889 34, 35, 36, 37, 38, 39, 40, 210, 41, 42,
3890 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3891 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3892 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3893 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3894 212, 54, 0, 55, 56, 0, 0, 214, 0, 58,
3895 59, 216, 61, 62, 63, 64, 65, 66, 0, 0,
3896 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3897 7, 0, 9, 0, 0, 0, 10, 11, 67, 217,
3898 69, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3899 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3900 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3901 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3902 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3903 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3904 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3905 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3906 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3907 56, 0, 764, 0, 0, 58, 59, 60, 61, 62,
3908 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3909 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3910 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3911 14, 15, 250, 251, 18, 19, 0, 0, 0, 0,
3912 0, 20, 252, 253, 23, 24, 25, 26, 0, 0,
3913 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3914 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3915 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3916 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3917 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3918 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3919 0, 0, 212, 54, 0, 55, 56, 0, 764, 0,
3920 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3921 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3922 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3923 67, 217, 69, 12, 0, 13, 14, 15, 250, 251,
3924 18, 19, 0, 0, 0, 0, 0, 20, 252, 253,
3925 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3926 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3927 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3928 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3929 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3930 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3931 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
3932 0, 55, 56, 0, 979, 0, 0, 58, 59, 60,
3933 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3934 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3935 9, 0, 0, 0, 10, 11, 67, 217, 69, 12,
3936 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
3937 0, 0, 0, 20, 252, 253, 23, 24, 25, 26,
3938 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
3939 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3940 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3941 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3942 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3943 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3944 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
3945 1033, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3946 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3947 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3948 10, 11, 67, 217, 69, 12, 0, 13, 14, 15,
3949 250, 251, 18, 19, 0, 0, 0, 0, 0, 20,
3950 252, 253, 23, 24, 25, 26, 0, 0, 209, 0,
3951 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3952 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3953 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3954 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3955 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3956 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3957 212, 54, 0, 55, 56, 0, 1179, 0, 0, 58,
3958 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3959 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3960 7, 0, 9, 0, 0, 0, 10, 11, 67, 217,
3961 69, 12, 0, 13, 14, 15, 250, 251, 18, 19,
3962 0, 0, 0, 0, 0, 20, 252, 253, 23, 24,
3963 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3964 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3965 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3966 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3967 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3968 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3969 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3970 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
3971 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3972 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3973 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3974 14, 15, 16, 17, 18, 19, 0, 0, 0, 0,
3975 0, 20, 21, 22, 23, 24, 25, 26, 0, 0,
3976 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3977 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3978 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3979 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3981 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3982 0, 0, 212, 54, 0, 55, 56, 0, 0, 0,
3983 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3984 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3985 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3986 67, 217, 69, 12, 0, 13, 14, 15, 16, 17,
3987 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3988 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
3989 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3990 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3991 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3992 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3993 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3994 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
3995 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
3996 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3997 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3998 9, 0, 0, 0, 10, 11, 67, 68, 69, 12,
3999 0, 13, 14, 15, 250, 251, 18, 19, 0, 0,
4000 0, 0, 0, 20, 252, 253, 23, 24, 25, 26,
4001 0, 0, 209, 0, 0, 0, 0, 0, 0, 282,
4002 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4003 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4004 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4005 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4006 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4007 0, 283, 0, 0, 343, 54, 0, 55, 56, 0,
4008 344, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4009 65, 66, 0, 0, 0, 0, 0, 0, 5, 6,
4010 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4011 0, 12, 284, 13, 14, 15, 250, 251, 18, 19,
4012 0, 0, 0, 0, 0, 20, 252, 253, 23, 24,
4013 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4014 0, 282, 0, 0, 32, 33, 34, 35, 36, 37,
4015 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4016 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4017 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4018 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4019 0, 0, 0, 392, 0, 0, 53, 54, 0, 55,
4020 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
4021 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
4022 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
4023 0, 0, 0, 12, 284, 13, 14, 15, 250, 251,
4024 18, 19, 0, 0, 0, 0, 0, 20, 252, 253,
4025 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
4026 0, 0, 0, 282, 0, 0, 32, 33, 34, 400,
4027 36, 37, 38, 401, 40, 0, 41, 42, 43, 44,
4028 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
4029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4030 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4031 0, 402, 0, 0, 0, 403, 0, 0, 212, 54,
4032 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
4033 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
4034 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
4035 10, 11, 0, 0, 0, 12, 284, 13, 14, 15,
4036 250, 251, 18, 19, 0, 0, 0, 0, 0, 20,
4037 252, 253, 23, 24, 25, 26, 0, 0, 209, 0,
4038 0, 0, 0, 0, 0, 282, 0, 0, 32, 33,
4039 34, 400, 36, 37, 38, 401, 40, 0, 41, 42,
4040 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
4041 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4043 0, 0, 0, 0, 0, 0, 0, 403, 0, 0,
4044 212, 54, 0, 55, 56, 0, 0, 0, 0, 58,
4045 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
4046 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
4047 0, 0, 10, 11, 0, 0, 0, 12, 284, 13,
4048 14, 15, 250, 251, 18, 19, 0, 0, 0, 0,
4049 0, 20, 252, 253, 23, 24, 25, 26, 0, 0,
4050 209, 0, 0, 0, 0, 0, 0, 282, 0, 0,
4051 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
4052 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
4053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4054 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4055 0, 0, 0, 0, 0, 0, 0, 0, 0, 283,
4056 0, 0, 343, 54, 0, 55, 56, 0, 0, 0,
4057 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
4058 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
4059 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
4060 284, 13, 14, 15, 250, 251, 18, 19, 0, 0,
4061 0, 0, 0, 20, 252, 253, 23, 24, 25, 26,
4062 0, 0, 209, 0, 0, 0, 0, 0, 0, 282,
4063 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
4064 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
4065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4066 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4067 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4068 0, 1118, 0, 0, 212, 54, 0, 55, 56, 0,
4069 0, 0, 0, 58, 59, 60, 61, 62, 63, 64,
4070 65, 66, 0, 0, 0, 0, 0, 0, 5, 6,
4071 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
4072 0, 12, 284, 13, 14, 15, 250, 251, 18, 19,
4073 0, 0, 0, 0, 0, 20, 252, 253, 23, 24,
4074 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
4075 0, 282, 0, 0, 32, 33, 34, 35, 36, 37,
4076 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
4077 47, 23, 24, 25, 26, 0, 0, 0, 0, 0,
4078 0, 0, 0, 0, 0, 0, 0, 32, 33, 34,
4079 914, 0, 0, 0, 915, 0, 0, 41, 42, 43,
4080 44, 45, 0, 1207, 0, 0, 212, 54, 0, 55,
4081 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
4082 63, 64, 65, 66, 0, 0, 0, 0, 917, 918,
4083 0, 0, 0, 0, 0, 0, 919, 0, 0, 920,
4084 0, 0, 921, 922, 284, 1145, 0, 0, 58, 59,
4085 60, 61, 62, 63, 64, 65, 66, 23, 24, 25,
4086 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4087 925, 0, 0, 32, 33, 34, 914, 284, 0, 0,
4088 915, 0, 0, 41, 42, 43, 44, 45, 0, 0,
4089 23, 24, 25, 26, 0, 0, 0, 0, 0, 0,
4090 0, 0, 0, 0, 0, 0, 32, 33, 34, 914,
4091 0, 0, 0, 915, 917, 918, 41, 42, 43, 44,
4092 45, 0, 919, 0, 0, 920, 0, 0, 921, 922,
4093 0, 923, 0, 0, 58, 59, 60, 61, 62, 63,
4094 64, 65, 66, 0, 0, 0, 0, 917, 918, 0,
4095 0, 0, 0, 0, 0, 919, 925, 0, 920, 0,
4096 0, 921, 922, 284, 0, 0, 0, 58, 59, 60,
4097 61, 62, 63, 64, 65, 66, 613, 614, 0, 0,
4098 615, 0, 0, 0, 0, 0, 0, 0, 0, 925,
4099 0, 0, 0, 0, 0, 0, 284, 0, 0, 173,
4100 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4101 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4103 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4105 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4106 197, 198, 199, 0, 200, 201, 622, 623, 0, 0,
4107 624, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4108 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4109 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4110 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4112 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4113 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4114 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4115 197, 198, 199, 0, 200, 201, 672, 614, 0, 0,
4116 673, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4117 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4118 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4119 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4121 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4123 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4124 197, 198, 199, 0, 200, 201, 675, 623, 0, 0,
4125 676, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4126 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4127 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4128 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4130 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4132 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4133 197, 198, 199, 0, 200, 201, 702, 614, 0, 0,
4134 703, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4135 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4136 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4137 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4139 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4141 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4142 197, 198, 199, 0, 200, 201, 705, 623, 0, 0,
4143 706, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4144 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4145 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4146 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4148 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4150 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4151 197, 198, 199, 0, 200, 201, 814, 614, 0, 0,
4152 815, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4153 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4154 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4155 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4156 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4157 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4158 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4159 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4160 197, 198, 199, 0, 200, 201, 817, 623, 0, 0,
4161 818, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4162 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4163 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4164 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4165 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4166 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4168 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4169 197, 198, 199, 0, 200, 201, 823, 614, 0, 0,
4170 824, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4171 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4172 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4173 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4175 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4176 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4177 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4178 197, 198, 199, 0, 200, 201, 657, 623, 0, 0,
4179 658, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4180 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4181 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4182 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4183 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4184 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4186 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4187 197, 198, 199, 0, 200, 201, 1039, 614, 0, 0,
4188 1040, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4189 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4190 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4191 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4192 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4193 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4194 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4195 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4196 197, 198, 199, 0, 200, 201, 1042, 623, 0, 0,
4197 1043, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4198 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4199 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4200 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4201 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4202 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4203 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4204 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4205 197, 198, 199, 0, 200, 201, 1246, 614, 0, 0,
4206 1247, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4207 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4208 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4209 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4210 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4211 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4212 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4213 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4214 197, 198, 199, 0, 200, 201, 1249, 623, 0, 0,
4215 1250, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4216 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4217 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4218 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4220 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4222 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4223 197, 198, 199, 0, 200, 201, 1283, 614, 0, 0,
4224 1284, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4225 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4226 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4227 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4229 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4230 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4231 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4232 197, 198, 199, 0, 200, 201, 657, 623, 0, 0,
4233 658, 202, 238, 0, 0, 0, 0, 0, 0, 0,
4234 0, 0, 0, 0, 0, 0, 0, 0, 0, 173,
4235 174, 175, 176, 177, 178, 179, 180, 181, 0, 0,
4236 182, 183, 0, 0, 0, 0, 184, 185, 186, 187,
4237 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4238 0, 188, 189, 0, 0, 0, 0, 0, 0, 0,
4239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4240 0, 0, 0, 190, 191, 192, 193, 194, 195, 196,
4241 197, 198, 199, 0, 200, 201, 0, 0, 0, 0,
4242 0, 202
4243};
4244
4245static const yytype_int16 yycheck[] =
4246{
4247 2, 8, 60, 380, 59, 91, 105, 16, 17, 385,
4248 71, 324, 2, 28, 4, 328, 324, 8, 104, 331,
4249 328, 28, 96, 328, 556, 802, 539, 736, 22, 53,
4250 22, 403, 238, 16, 17, 733, 97, 28, 57, 232,
4251 444, 302, 303, 85, 740, 276, 101, 809, 452, 280,
4252 452, 4, 59, 55, 56, 379, 784, 381, 68, 16,
4253 17, 93, 94, 53, 54, 97, 85, 57, 783, 784,
4254 382, 448, 55, 736, 76, 77, 2, 97, 4, 98,
4255 99, 100, 94, 871, 733, 97, 80, 53, 80, 57,
4256 492, 740, 921, 102, 101, 85, 502, 67, 55, 56,
4257 77, 869, 71, 586, 428, 1068, 77, 29, 98, 99,
4258 100, 101, 52, 16, 17, 27, 25, 660, 661, 102,
4259 783, 784, 66, 447, 1184, 449, 1211, 504, 54, 66,
4260 25, 13, 1028, 68, 66, 97, 100, 66, 68, 264,
4261 68, 227, 34, 917, 918, 102, 25, 66, 26, 789,
4262 27, 99, 29, 477, 25, 25, 144, 797, 216, 586,
4263 52, 96, 97, 25, 13, 153, 96, 97, 0, 97,
4264 256, 52, 25, 54, 55, 119, 57, 583, 126, 153,
4265 561, 505, 563, 145, 121, 122, 148, 119, 212, 153,
4266 25, 143, 121, 122, 1279, 13, 37, 38, 146, 102,
4267 119, 123, 121, 122, 290, 266, 146, 720, 721, 241,
4268 145, 243, 13, 148, 1274, 152, 218, 219, 343, 13,
4269 101, 26, 212, 152, 226, 249, 235, 13, 237, 238,
4270 232, 146, 1128, 660, 661, 143, 238, 146, 153, 151,
4271 264, 153, 219, 285, 13, 247, 266, 218, 219, 1078,
4272 1079, 146, 235, 148, 237, 238, 517, 247, 519, 249,
4273 1223, 253, 254, 640, 146, 143, 285, 146, 751, 151,
4274 463, 153, 262, 650, 264, 146, 146, 649, 235, 683,
4275 237, 685, 25, 685, 146, 317, 318, 319, 320, 740,
4276 322, 323, 743, 146, 727, 285, 13, 266, 264, 1073,
4277 1074, 1051, 151, 736, 153, 317, 318, 319, 320, 395,
4278 287, 146, 153, 1009, 284, 100, 1014, 641, 109, 343,
4279 1070, 247, 25, 25, 1112, 344, 316, 651, 389, 56,
4280 148, 321, 235, 151, 237, 153, 262, 327, 143, 341,
4281 652, 331, 133, 148, 346, 1113, 13, 148, 152, 881,
4282 151, 13, 153, 343, 344, 387, 869, 151, 871, 153,
4283 1009, 146, 386, 316, 388, 151, 772, 153, 1096, 389,
4284 402, 380, 68, 99, 381, 387, 344, 343, 380, 1028,
4285 13, 1096, 151, 126, 153, 68, 100, 126, 792, 381,
4286 316, 152, 382, 1056, 707, 321, 386, 68, 388, 707,
4287 126, 97, 707, 146, 1181, 282, 149, 146, 1071, 68,
4288 153, 152, 68, 96, 97, 1078, 1079, 960, 961, 1181,
4289 733, 428, 965, 966, 126, 96, 97, 740, 25, 431,
4290 432, 52, 146, 1096, 151, 56, 153, 68, 97, 448,
4291 442, 97, 449, 146, 146, 148, 448, 149, 450, 451,
4292 711, 153, 99, 68, 152, 716, 471, 449, 25, 461,
4293 502, 463, 145, 77, 471, 96, 97, 1217, 699, 28,
4294 477, 126, 1222, 1223, 145, 68, 478, 683, 671, 126,
4295 471, 96, 97, 502, 151, 477, 153, 444, 68, 151,
4296 126, 153, 68, 148, 484, 504, 877, 878, 505, 146,
4297 1209, 882, 504, 884, 97, 886, 1204, 52, 569, 34,
4298 822, 56, 502, 505, 145, 1265, 1293, 97, 151, 66,
4299 153, 97, 136, 137, 138, 783, 784, 52, 1028, 126,
4300 145, 126, 489, 960, 961, 912, 66, 67, 965, 966,
4301 853, 583, 1292, 545, 1087, 853, 1209, 919, 853, 146,
4302 146, 148, 149, 99, 556, 1204, 153, 566, 1009, 126,
4303 1011, 570, 1211, 99, 583, 1016, 568, 66, 642, 151,
4304 580, 153, 119, 634, 121, 122, 586, 1028, 68, 146,
4305 126, 66, 149, 112, 68, 68, 153, 911, 1286, 913,
4306 126, 121, 122, 583, 1126, 1028, 1000, 580, 1000, 1112,
4307 1113, 15, 1134, 586, 1217, 981, 630, 97, 632, 1222,
4308 1037, 25, 96, 97, 97, 150, 68, 99, 153, 621,
4309 119, 653, 121, 122, 618, 627, 618, 77, 82, 83,
4310 1279, 640, 146, 627, 641, 627, 121, 122, 640, 124,
4311 630, 650, 632, 99, 651, 97, 1022, 662, 650, 641,
4312 660, 661, 1265, 148, 847, 662, 688, 659, 700, 651,
4313 1087, 145, 652, 921, 68, 659, 56, 659, 9, 671,
4314 126, 662, 54, 985, 15, 129, 130, 68, 126, 68,
4315 938, 700, 64, 65, 134, 135, 136, 137, 138, 66,
4316 68, 693, 96, 97, 99, 781, 1009, 58, 1136, 1137,
4317 692, 693, 100, 1075, 1204, 96, 97, 96, 97, 1209,
4318 700, 1211, 15, 1213, 17, 1028, 77, 1093, 96, 97,
4319 1032, 126, 148, 241, 56, 602, 683, 153, 1260, 68,
4320 772, 830, 1028, 1114, 1115, 1116, 1117, 68, 146, 1190,
4321 99, 145, 119, 620, 121, 122, 99, 108, 109, 751,
4322 752, 269, 66, 772, 145, 273, 145, 96, 97, 820,
4323 1211, 146, 1213, 146, 148, 96, 97, 145, 751, 148,
4324 153, 1204, 133, 126, 829, 99, 1209, 99, 1211, 1279,
4325 1213, 1281, 772, 149, 786, 787, 1286, 153, 1288, 821,
4326 1048, 793, 794, 783, 784, 819, 1108, 674, 800, 148,
4327 802, 1177, 126, 1303, 126, 119, 145, 121, 122, 821,
4328 1068, 37, 38, 77, 145, 14, 15, 1255, 1256, 1196,
4329 1078, 1079, 829, 1261, 146, 1263, 1264, 704, 1279, 819,
4330 1281, 149, 822, 126, 68, 792, 144, 1288, 1096, 841,
4331 842, 99, 844, 845, 146, 847, 1279, 68, 1281, 150,
4332 99, 153, 1303, 1286, 56, 1288, 68, 1295, 1296, 1297,
4333 1298, 148, 96, 97, 1245, 146, 924, 99, 126, 1307,
4334 1303, 895, 77, 1197, 126, 96, 97, 126, 210, 881,
4335 126, 213, 214, 215, 96, 97, 99, 126, 146, 891,
4336 106, 1204, 99, 70, 126, 146, 99, 146, 1211, 901,
4337 56, 903, 99, 912, 151, 895, 913, 909, 1204, 25,
4338 912, 145, 130, 126, 146, 1211, 906, 1213, 908, 126,
4339 2, 913, 4, 126, 145, 986, 99, 917, 918, 126,
4340 126, 921, 126, 145, 16, 17, 454, 1056, 970, 816,
4341 149, 459, 146, 146, 462, 969, 146, 465, 938, 826,
4342 960, 961, 144, 126, 58, 965, 966, 144, 970, 1078,
4343 1079, 146, 964, 481, 88, 89, 1279, 146, 486, 126,
4344 66, 53, 54, 77, 146, 57, 146, 26, 146, 969,
4345 906, 146, 908, 1279, 52, 1281, 68, 146, 54, 55,
4346 1286, 57, 1288, 52, 996, 985, 66, 10, 64, 65,
4347 8, 1025, 1021, 85, 108, 1029, 144, 1303, 112, 40,
4348 41, 93, 94, 286, 287, 97, 98, 99, 100, 68,
4349 102, 146, 13, 119, 146, 121, 122, 1037, 124, 547,
4350 1068, 1021, 25, 1065, 1120, 1025, 146, 17, 152, 1029,
4351 1078, 1079, 1032, 152, 921, 922, 146, 96, 97, 119,
4352 126, 121, 122, 1065, 124, 44, 44, 144, 1048, 126,
4353 146, 1051, 146, 128, 582, 44, 26, 52, 44, 54,
4354 55, 56, 57, 150, 15, 146, 1100, 1087, 1068, 1069,
4355 1070, 52, 146, 1073, 1074, 1109, 146, 131, 1078, 1079,
4356 146, 146, 1150, 100, 143, 146, 145, 52, 131, 148,
4357 1124, 40, 41, 42, 43, 44, 1096, 26, 68, 146,
4358 1100, 443, 444, 1132, 674, 52, 101, 146, 1108, 1109,
4359 452, 146, 107, 1125, 1126, 1002, 59, 60, 61, 62,
4360 212, 146, 1134, 100, 1124, 146, 96, 97, 56, 144,
4361 146, 151, 1132, 52, 704, 54, 55, 56, 57, 68,
4362 149, 1028, 1176, 235, 146, 237, 238, 489, 9, 241,
4363 492, 243, 131, 1187, 1041, 247, 52, 249, 54, 55,
4364 56, 57, 146, 1050, 146, 131, 1053, 96, 97, 1181,
4365 262, 146, 264, 143, 1203, 145, 1176, 1196, 148, 146,
4366 1197, 149, 101, 146, 1196, 146, 1198, 1187, 146, 1076,
4367 1232, 1233, 146, 285, 144, 1197, 724, 52, 56, 54,
4368 55, 56, 57, 1203, 146, 120, 2, 146, 4, 146,
4369 1232, 1233, 554, 146, 143, 146, 145, 1217, 1230, 148,
4370 16, 17, 1222, 1223, 316, 317, 318, 319, 320, 321,
4371 322, 323, 146, 146, 247, 327, 148, 1271, 580, 331,
4372 148, 1128, 480, 484, 586, 829, 816, 98, 1260, 89,
4373 100, 343, 344, 659, 752, 1230, 826, 53, 54, 720,
4374 869, 1130, 1028, 346, 1151, 1265, 903, 1274, 831, 574,
4375 1293, 1271, 68, 1071, 52, 339, 54, 55, 56, 57,
4376 58, 1293, 1069, 1071, 1171, 1172, 1173, 1067, 380, 1198,
4377 382, 1125, 1292, 108, 386, 387, 388, 93, 94, 77,
4378 828, 97, 101, 519, 736, 1209, 102, 1204, 733, -1,
4379 402, 1151, -1, -1, -1, -1, -1, -1, 846, -1,
4380 848, 663, -1, 101, -1, -1, 668, 77, -1, 107,
4381 108, 109, -1, -1, -1, -1, -1, -1, -1, 867,
4382 -1, 683, -1, 685, 94, 95, -1, -1, 431, 432,
4383 -1, 921, 1239, -1, -1, 133, 448, -1, 136, 442,
4384 -1, 1248, -1, -1, 660, 661, -1, 450, 451, -1,
4385 -1, -1, 571, -1, -1, 153, -1, 576, -1, 578,
4386 -1, 677, 678, 133, 134, 135, 136, 137, 138, 731,
4387 -1, -1, 484, -1, -1, 478, -1, -1, 694, -1,
4388 52, -1, 54, 55, 56, 57, 58, -1, -1, 751,
4389 502, -1, 504, -1, -1, -1, 212, -1, -1, -1,
4390 -1, -1, 764, -1, -1, 77, -1, -1, -1, 628,
4391 -1, -1, -1, -1, 633, -1, 635, -1, -1, 235,
4392 -1, 237, 238, 77, -1, 241, -1, 243, -1, 101,
4393 792, 247, -1, 249, -1, 107, 108, 109, 77, -1,
4394 94, 95, -1, -1, -1, -1, 262, -1, 264, -1,
4395 812, 1041, -1, -1, 566, 94, 95, -1, 570, -1,
4396 1050, 133, -1, 1053, 136, -1, -1, -1, 580, -1,
4397 -1, 583, -1, -1, 586, -1, -1, 131, 132, 133,
4398 134, 135, 136, 137, 138, -1, 1076, -1, 52, -1,
4399 54, 55, 56, 57, 58, 134, 135, 136, 137, 138,
4400 316, 317, 318, 319, 320, 321, 322, 323, -1, -1,
4401 -1, 327, -1, 77, -1, 331, -1, -1, 630, -1,
4402 632, -1, -1, -1, -1, -1, -1, 343, 640, 1077,
4403 -1, -1, -1, -1, -1, -1, -1, 101, 650, -1,
4404 652, 653, -1, 905, 108, 109, -1, -1, 660, 661,
4405 52, -1, 54, 55, 56, 57, 58, -1, -1, -1,
4406 -1, -1, -1, -1, 380, -1, 382, -1, -1, 133,
4407 386, 387, 388, -1, -1, 77, 688, -1, -1, -1,
4408 -1, 1171, 1172, 1173, -1, -1, 402, -1, 700, 91,
4409 -1, 810, -1, -1, 813, 1143, -1, -1, -1, 101,
4410 -1, -1, -1, -1, -1, 107, 108, 109, 827, -1,
4411 -1, -1, -1, -1, -1, -1, -1, 979, -1, -1,
4412 1168, 1169, 1170, -1, -1, -1, -1, -1, -1, -1,
4413 -1, 133, 448, -1, 136, -1, -1, -1, 1000, -1,
4414 -1, -1, -1, -1, 960, 961, 148, -1, -1, 965,
4415 966, -1, -1, -1, -1, -1, -1, -1, 1248, -1,
4416 772, -1, -1, -1, -1, -1, -1, -1, 484, -1,
4417 -1, 1033, -1, -1, -1, -1, -1, -1, 994, 995,
4418 -1, 997, 998, 786, 787, -1, -1, -1, 504, -1,
4419 793, 794, -1, -1, 2, -1, 4, -1, -1, -1,
4420 -1, -1, -1, -1, -1, -1, -1, 819, -1, 821,
4421 822, -1, -1, -1, -1, -1, -1, -1, 52, -1,
4422 54, 55, 56, 57, 58, -1, -1, -1, -1, -1,
4423 -1, -1, -1, -1, -1, -1, -1, 1099, 841, 842,
4424 -1, 844, 845, 77, -1, 53, 54, -1, -1, 57,
4425 566, -1, 971, -1, 570, 974, -1, 91, 977, -1,
4426 -1, -1, -1, -1, 580, 984, -1, 101, 987, -1,
4427 586, 1087, 783, 784, 108, 109, -1, 85, -1, -1,
4428 -1, -1, -1, 895, -1, -1, -1, -1, -1, 1105,
4429 98, 99, 100, -1, 906, -1, 908, -1, -1, 133,
4430 912, -1, -1, -1, -1, -1, 909, 52, -1, 54,
4431 55, 56, 57, 58, 630, -1, 632, 1179, -1, -1,
4432 -1, -1, -1, -1, 640, -1, -1, -1, -1, -1,
4433 -1, -1, 77, -1, 650, -1, 652, 653, -1, -1,
4434 -1, -1, -1, -1, 660, 661, 91, -1, 960, 961,
4435 -1, -1, -1, 965, 966, -1, 101, 969, 970, -1,
4436 -1, 964, 107, 108, 109, -1, -1, 2, -1, 4,
4437 -1, -1, 688, 985, -1, -1, -1, -1, -1, -1,
4438 -1, 16, 17, 1102, -1, -1, -1, -1, 133, -1,
4439 -1, 136, -1, 996, -1, -1, -1, -1, -1, -1,
4440 -1, -1, -1, -1, 212, -1, 917, 918, -1, 1021,
4441 921, -1, -1, 1025, -1, -1, -1, 1029, 53, 54,
4442 1032, -1, -1, -1, -1, 1037, -1, 938, -1, -1,
4443 -1, -1, -1, 68, -1, -1, -1, -1, -1, 247,
4444 -1, 249, -1, -1, -1, -1, -1, -1, -1, -1,
4445 -1, -1, -1, 1065, 262, -1, 264, -1, 93, 94,
4446 -1, -1, 97, -1, -1, -1, 1185, 102, -1, -1,
4447 -1, -1, -1, -1, -1, 1087, -1, 285, -1, -1,
4448 -1, -1, -1, -1, -1, -1, -1, -1, 1100, -1,
4449 -1, -1, -1, -1, -1, -1, 1108, 1109, -1, -1,
4450 -1, -1, -1, 819, -1, 821, 822, -1, 316, -1,
4451 -1, -1, 1124, 321, -1, -1, -1, -1, -1, 327,
4452 1132, -1, -1, 331, -1, -1, -1, -1, -1, -1,
4453 -1, -1, -1, -1, -1, 343, 344, 1048, -1, -1,
4454 1051, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4455 -1, -1, -1, -1, -1, -1, -1, 1068, 1069, 1070,
4456 -1, -1, 1073, 1074, 1176, -1, -1, 1078, 1079, -1,
4457 -1, -1, -1, -1, 382, 1187, -1, 212, 386, 895,
4458 388, -1, -1, -1, 1196, 1096, -1, -1, -1, -1,
4459 906, 1203, 908, -1, -1, -1, 912, -1, -1, -1,
4460 235, -1, 237, 238, -1, -1, 241, -1, 243, -1,
4461 -1, -1, 247, -1, 249, -1, -1, -1, -1, -1,
4462 1232, 1233, -1, -1, -1, -1, -1, 262, -1, 264,
4463 -1, -1, -1, -1, 783, 784, -1, -1, -1, -1,
4464 -1, -1, -1, -1, 960, 961, -1, -1, -1, 965,
4465 966, -1, -1, 969, 970, -1, -1, -1, -1, 1271,
4466 -1, -1, -1, -1, -1, -1, -1, -1, -1, 985,
4467 -1, -1, -1, -1, -1, -1, 484, -1, -1, -1,
4468 -1, 316, 317, 318, 319, 320, 321, 322, 323, -1,
4469 -1, -1, 327, -1, 502, -1, 331, -1, -1, -1,
4470 -1, -1, -1, -1, -1, -1, 1217, -1, 343, 1025,
4471 -1, 1222, 1223, 1029, -1, -1, 1032, -1, -1, -1,
4472 -1, 1037, -1, -1, -1, -1, -1, -1, -1, -1,
4473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4474 -1, -1, -1, -1, -1, 380, -1, 382, -1, 1065,
4475 -1, 386, 387, 388, 1265, -1, -1, -1, -1, -1,
4476 -1, -1, -1, -1, -1, -1, -1, 402, 917, 918,
4477 -1, 1087, 921, -1, -1, 583, -1, -1, 586, -1,
4478 -1, 1292, -1, -1, 1100, -1, -1, -1, -1, 938,
4479 -1, -1, 1108, 1109, -1, -1, -1, -1, -1, 2,
4480 -1, 4, -1, -1, -1, -1, -1, -1, 1124, -1,
4481 -1, -1, -1, 448, -1, -1, -1, -1, -1, -1,
4482 -1, -1, 630, -1, 632, -1, -1, -1, -1, -1,
4483 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4484 -1, -1, -1, -1, 652, -1, -1, -1, -1, 484,
4485 53, 54, 660, 661, 57, -1, -1, -1, -1, -1,
4486 1176, -1, -1, -1, -1, -1, -1, -1, -1, 504,
4487 -1, 1187, -1, -1, -1, -1, -1, -1, -1, -1,
4488 1196, -1, 85, -1, -1, -1, -1, -1, -1, -1,
4489 -1, -1, 700, -1, -1, 98, 99, 100, -1, 1048,
4490 -1, 709, 1051, -1, -1, 783, 784, -1, -1, -1,
4491 -1, -1, -1, -1, -1, -1, 1232, 1233, -1, 1068,
4492 1069, 1070, -1, -1, 1073, 1074, -1, -1, -1, 1078,
4493 1079, 566, -1, -1, -1, 570, -1, -1, -1, -1,
4494 -1, -1, -1, -1, -1, 580, -1, 1096, -1, -1,
4495 -1, 586, -1, -1, -1, 1271, -1, -1, -1, -1,
4496 -1, -1, -1, -1, 772, -1, -1, -1, -1, -1,
4497 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4498 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4499 -1, -1, -1, -1, -1, 630, -1, 632, -1, -1,
4500 -1, -1, -1, -1, -1, 640, -1, -1, -1, 212,
4501 -1, 819, -1, -1, 822, 650, -1, 652, 653, -1,
4502 -1, -1, -1, -1, -1, 660, 661, -1, -1, 2,
4503 -1, 4, -1, -1, -1, -1, -1, -1, -1, 917,
4504 918, -1, -1, 921, 247, -1, 249, -1, -1, -1,
4505 -1, -1, -1, 688, -1, -1, -1, -1, -1, 262,
4506 938, 264, -1, -1, -1, -1, -1, -1, 1217, -1,
4507 -1, -1, -1, 1222, 1223, -1, -1, -1, -1, -1,
4508 53, 54, 285, -1, 57, -1, -1, 895, -1, -1,
4509 -1, -1, -1, -1, -1, -1, -1, -1, 906, -1,
4510 908, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4511 -1, -1, 85, 316, -1, -1, 1265, -1, 321, -1,
4512 -1, -1, -1, -1, 327, 98, 99, 100, 331, -1,
4513 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4514 343, 344, -1, 1292, -1, -1, -1, -1, -1, -1,
4515 -1, -1, 960, 961, -1, -1, -1, 965, 966, -1,
4516 -1, 969, -1, -1, -1, -1, -1, -1, -1, -1,
4517 1048, -1, -1, 1051, -1, -1, -1, 985, -1, 382,
4518 -1, -1, -1, 386, 819, 388, 821, 822, -1, -1,
4519 1068, 1069, 1070, -1, -1, 1073, 1074, -1, -1, -1,
4520 1078, 1079, -1, -1, -1, -1, -1, -1, -1, -1,
4521 -1, -1, -1, 1021, -1, -1, -1, 1025, 1096, -1,
4522 -1, 1029, -1, -1, 1032, -1, -1, 783, 784, 1037,
4523 -1, -1, -1, -1, -1, -1, -1, -1, -1, 212,
4524 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4525 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4526 895, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4527 -1, 906, -1, 908, 247, -1, 249, 912, -1, 1087,
4528 -1, 484, -1, -1, -1, -1, -1, -1, -1, 262,
4529 -1, 264, 1100, -1, -1, -1, -1, -1, -1, 502,
4530 1108, 1109, -1, -1, -1, -1, -1, -1, -1, -1,
4531 -1, -1, 285, -1, -1, -1, 1124, -1, -1, -1,
4532 -1, -1, -1, -1, 1132, 960, 961, -1, -1, -1,
4533 965, 966, -1, -1, 969, 970, -1, -1, -1, 1217,
4534 -1, -1, -1, 316, 1222, 1223, -1, -1, 321, -1,
4535 985, -1, -1, -1, 327, -1, -1, -1, 331, -1,
4536 -1, 917, 918, -1, -1, 921, -1, -1, 1176, -1,
4537 343, 344, -1, -1, -1, -1, -1, -1, -1, 1187,
4538 583, -1, 938, 586, -1, -1, -1, 1265, -1, -1,
4539 1025, -1, -1, -1, 1029, 1203, -1, 1032, -1, -1,
4540 -1, -1, 1037, -1, 783, 784, -1, -1, -1, 382,
4541 -1, -1, -1, 386, 1292, 388, -1, -1, -1, -1,
4542 -1, -1, -1, -1, -1, -1, -1, 630, -1, 632,
4543 1065, -1, -1, 783, 784, -1, -1, -1, -1, -1,
4544 -1, -1, -1, -1, -1, -1, -1, -1, -1, 652,
4545 -1, -1, 1087, -1, -1, -1, -1, 660, 661, -1,
4546 -1, -1, -1, 1271, -1, 1100, -1, -1, -1, -1,
4547 -1, -1, -1, 1108, 1109, -1, -1, -1, -1, -1,
4548 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1124,
4549 -1, -1, 1048, -1, 2, 1051, 4, 700, -1, -1,
4550 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4551 -1, 484, 1068, 1069, 1070, 783, 784, 1073, 1074, -1,
4552 -1, -1, 1078, 1079, -1, -1, -1, -1, 2, 502,
4553 4, -1, -1, -1, -1, -1, -1, -1, 917, 918,
4554 1096, 1176, 921, -1, -1, 53, 54, -1, -1, 57,
4555 -1, -1, 1187, -1, -1, -1, -1, -1, -1, 938,
4556 -1, 1196, -1, -1, -1, -1, -1, 917, 918, 772,
4557 -1, 921, -1, -1, -1, -1, -1, 85, -1, 53,
4558 54, -1, -1, -1, -1, -1, -1, -1, 938, -1,
4559 98, 99, 100, 101, -1, -1, -1, 1232, 1233, -1,
4560 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4561 583, -1, -1, 586, -1, -1, 819, -1, -1, 822,
4562 -1, -1, -1, -1, 98, -1, -1, -1, -1, -1,
4563 -1, -1, -1, -1, -1, -1, 1271, -1, -1, -1,
4564 -1, -1, -1, -1, -1, -1, -1, -1, -1, 917,
4565 918, -1, -1, 921, -1, -1, -1, 630, -1, 632,
4566 -1, 1217, -1, -1, -1, -1, 1222, 1223, -1, 1048,
4567 938, -1, 1051, -1, -1, -1, -1, -1, -1, 652,
4568 -1, -1, -1, -1, -1, -1, -1, 660, 661, 1068,
4569 1069, 1070, 895, -1, 1073, 1074, -1, -1, 1048, 1078,
4570 1079, 1051, -1, 906, 212, 908, -1, -1, -1, 1265,
4571 -1, -1, -1, -1, -1, -1, -1, 1096, 1068, 1069,
4572 1070, -1, -1, 1073, 1074, -1, -1, 700, 1078, 1079,
4573 -1, -1, -1, -1, -1, -1, 1292, -1, 212, 247,
4574 -1, 249, -1, -1, -1, -1, 1096, -1, -1, -1,
4575 -1, -1, -1, -1, 262, -1, 264, 960, 961, -1,
4576 -1, -1, 965, 966, -1, -1, 969, -1, -1, 2,
4577 -1, 4, -1, 247, -1, 249, -1, 285, -1, -1,
4578 1048, -1, 985, 1051, -1, -1, -1, -1, 262, -1,
4579 264, -1, -1, -1, -1, -1, -1, -1, -1, 772,
4580 1068, 1069, 1070, -1, -1, 1073, 1074, -1, 316, -1,
4581 1078, 1079, -1, 321, -1, -1, -1, -1, 1021, 327,
4582 53, 54, 1025, 331, -1, -1, 1029, -1, 1096, 1032,
4583 -1, -1, -1, -1, 1037, 343, 344, -1, 1217, -1,
4584 -1, -1, 316, 1222, 1223, -1, 819, 321, -1, 822,
4585 -1, -1, -1, 327, -1, -1, -1, 331, -1, -1,
4586 -1, -1, -1, -1, -1, -1, -1, 1217, -1, 343,
4587 -1, -1, 1222, 1223, 382, -1, -1, -1, 386, -1,
4588 388, -1, -1, -1, 1087, -1, 1265, -1, -1, -1,
4589 -1, -1, -1, -1, -1, -1, -1, 1100, 783, 784,
4590 -1, -1, -1, -1, -1, 1108, 1109, -1, 382, -1,
4591 -1, -1, 386, 1292, 388, 1265, -1, -1, -1, -1,
4592 -1, 1124, 895, -1, -1, -1, -1, -1, -1, 1132,
4593 -1, 783, 784, 906, -1, 908, -1, -1, -1, -1,
4594 -1, -1, 1292, -1, -1, -1, -1, -1, -1, 1217,
4595 -1, -1, -1, -1, 1222, 1223, -1, -1, -1, -1,
4596 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4597 -1, -1, -1, 1176, -1, -1, 484, -1, -1, 212,
4598 -1, -1, -1, -1, 1187, -1, -1, 960, 961, -1,
4599 -1, -1, 965, 966, 502, -1, 969, 1265, -1, -1,
4600 1203, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4601 484, -1, 985, -1, 247, -1, 249, -1, -1, -1,
4602 -1, -1, -1, -1, 1292, -1, -1, -1, -1, 262,
4603 -1, 264, 917, 918, -1, -1, 921, -1, -1, -1,
4604 -1, -1, -1, -1, -1, -1, -1, -1, 1021, -1,
4605 -1, -1, 1025, 938, -1, -1, 1029, -1, -1, 1032,
4606 -1, -1, -1, -1, 1037, 917, 918, -1, 1271, 921,
4607 -1, -1, -1, -1, -1, 583, -1, -1, -1, -1,
4608 -1, -1, -1, 316, -1, -1, 938, -1, 321, -1,
4609 -1, -1, -1, -1, 327, -1, -1, -1, 331, -1,
4610 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4611 343, -1, 586, -1, 1087, -1, -1, -1, -1, -1,
4612 -1, -1, 630, -1, 632, -1, -1, 1100, -1, -1,
4613 -1, -1, -1, -1, -1, 1108, 1109, -1, -1, -1,
4614 -1, -1, -1, -1, 652, -1, -1, -1, -1, 382,
4615 -1, 1124, -1, 386, -1, 388, 630, -1, 632, 1132,
4616 -1, -1, -1, 1048, -1, -1, 1051, -1, -1, -1,
4617 -1, -1, -1, -1, -1, -1, -1, -1, 652, -1,
4618 -1, -1, -1, 1068, 1069, 1070, 660, 661, 1073, 1074,
4619 -1, -1, 700, 1078, 1079, -1, 1048, -1, -1, 1051,
4620 -1, -1, -1, 1176, -1, -1, -1, -1, -1, -1,
4621 -1, 1096, -1, -1, 1187, -1, 1068, 1069, 1070, -1,
4622 -1, 1073, 1074, -1, -1, -1, 1078, 1079, -1, -1,
4623 1203, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4624 -1, -1, -1, -1, 1096, -1, -1, -1, -1, -1,
4625 -1, 484, -1, -1, -1, -1, -1, -1, -1, -1,
4626 -1, -1, -1, -1, 772, -1, -1, -1, -1, -1,
4627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4628 -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
4629 8, 9, 10, -1, -1, 13, 14, 15, 1271, 17,
4630 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
4631 -1, 819, -1, -1, 822, -1, -1, -1, -1, 37,
4632 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
4633 -1, -1, 1217, -1, -1, -1, -1, 1222, 1223, -1,
4634 -1, -1, -1, -1, -1, 819, -1, -1, 822, -1,
4635 68, -1, -1, 586, -1, -1, -1, -1, -1, -1,
4636 -1, -1, -1, -1, -1, 1217, -1, -1, -1, -1,
4637 1222, 1223, -1, -1, -1, -1, -1, -1, 96, 97,
4638 1265, -1, -1, -1, -1, -1, -1, 895, -1, -1,
4639 -1, -1, -1, -1, 25, -1, -1, 630, 906, 632,
4640 908, -1, 120, -1, -1, -1, -1, 1292, -1, -1,
4641 -1, -1, -1, 1265, -1, -1, -1, -1, -1, 652,
4642 -1, 895, -1, -1, -1, 143, 144, 660, 661, -1,
4643 148, 149, 906, 151, 908, 153, -1, -1, -1, -1,
4644 1292, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4645 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4646 -1, 969, -1, 94, 95, -1, -1, -1, -1, 100,
4647 -1, -1, -1, -1, -1, -1, -1, 985, -1, -1,
4648 -1, -1, -1, -1, -1, -1, 960, 961, -1, -1,
4649 -1, 965, 966, 16, 17, 969, 127, -1, 129, 130,
4650 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4651 -1, 985, -1, 1021, -1, -1, -1, 1025, -1, -1,
4652 -1, 1029, -1, -1, 1032, 48, 49, 50, 51, -1,
4653 -1, -1, 55, 56, -1, -1, -1, -1, -1, -1,
4654 -1, -1, -1, -1, -1, 68, 69, 1021, -1, -1,
4655 -1, 1025, -1, -1, -1, 1029, -1, -1, 1032, -1,
4656 -1, -1, -1, 1037, -1, -1, -1, -1, -1, -1,
4657 -1, -1, -1, -1, -1, -1, -1, -1, -1, 102,
4658 -1, -1, -1, -1, -1, -1, 819, -1, -1, 822,
4659 -1, -1, 1100, -1, -1, -1, -1, -1, -1, -1,
4660 1108, 1109, -1, -1, -1, -1, -1, -1, -1, -1,
4661 -1, -1, -1, 1087, -1, -1, 1124, -1, -1, -1,
4662 -1, -1, -1, -1, 1132, -1, 1100, -1, -1, -1,
4663 -1, -1, -1, -1, 1108, 1109, -1, -1, -1, -1,
4664 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4665 1124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4666 -1, -1, 895, -1, -1, -1, -1, -1, 1176, -1,
4667 -1, -1, -1, 906, -1, 908, -1, -1, -1, 1187,
4668 -1, -1, -1, -1, -1, -1, -1, 210, -1, -1,
4669 213, 214, 215, -1, 217, 1203, -1, -1, -1, -1,
4670 -1, -1, 1176, -1, -1, -1, -1, -1, -1, -1,
4671 -1, -1, 235, 1187, 237, 238, -1, -1, -1, -1,
4672 -1, -1, -1, -1, -1, -1, -1, 960, 961, -1,
4673 -1, -1, 965, 966, -1, -1, 969, -1, -1, -1,
4674 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4675 -1, -1, 985, -1, -1, 77, 78, 79, 80, 81,
4676 82, 83, 84, 1271, 86, 87, -1, -1, -1, -1,
4677 -1, -1, 94, 95, -1, -1, -1, -1, -1, -1,
4678 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4679 -1, -1, 1025, -1, -1, -1, 1029, 1271, -1, 1032,
4680 -1, -1, -1, -1, 1037, -1, -1, 129, 130, 131,
4681 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4682 -1, -1, -1, -1, -1, 348, 349, 350, 351, 352,
4683 -1, -1, 355, 356, 357, 358, 359, 360, 361, 362,
4684 -1, 364, -1, -1, 367, 368, 369, 370, 371, 372,
4685 373, 374, 375, 376, 1087, -1, -1, 380, -1, -1,
4686 -1, -1, -1, -1, -1, -1, -1, 1100, -1, -1,
4687 -1, -1, -1, -1, -1, 1108, 1109, -1, -1, -1,
4688 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4689 -1, 1124, -1, -1, -1, -1, -1, -1, -1, -1,
4690 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4691 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4692 443, 444, -1, -1, -1, 448, -1, -1, -1, 452,
4693 -1, -1, -1, -1, -1, 458, -1, -1, -1, -1,
4694 -1, -1, -1, 1176, -1, 33, 34, 35, 36, -1,
4695 473, -1, -1, -1, 1187, -1, -1, -1, -1, -1,
4696 -1, 49, 50, 51, 52, -1, 489, -1, 56, 492,
4697 -1, 59, 60, 61, 62, 63, -1, -1, -1, -1,
4698 -1, 504, -1, -1, -1, -1, -1, -1, -1, -1,
4699 -1, -1, -1, -1, -1, -1, -1, -1, 521, -1,
4700 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
4701 98, -1, -1, 101, -1, -1, 104, 105, -1, 107,
4702 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
4703 118, 554, -1, -1, -1, -1, -1, -1, 1271, -1,
4704 -1, -1, -1, 566, 132, -1, -1, 570, -1, -1,
4705 -1, 139, -1, -1, -1, -1, -1, 580, -1, -1,
4706 -1, -1, -1, 586, -1, 153, -1, -1, -1, -1,
4707 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4708 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4709 -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
4710 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4711 -1, -1, 49, 50, 51, -1, -1, 640, -1, -1,
4712 -1, -1, 59, 60, 61, 62, 63, 650, -1, -1,
4713 -1, -1, -1, -1, -1, -1, -1, 660, 661, -1,
4714 663, 664, 665, 666, -1, 668, -1, -1, -1, -1,
4715 -1, -1, -1, -1, 677, 678, -1, -1, -1, -1,
4716 683, -1, 685, -1, -1, -1, -1, -1, -1, -1,
4717 -1, 694, -1, 110, 111, 112, 113, 114, 115, 116,
4718 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
4719 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4720 0, 1, 139, 3, 4, 5, 6, 7, 731, -1,
4721 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
4722 20, 21, 22, 23, 24, -1, -1, -1, 751, -1,
4723 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
4724 -1, 764, -1, -1, -1, 45, 46, 47, 48, 49,
4725 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
4726 60, 61, 62, 63, 64, 65, -1, -1, -1, 792,
4727 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
4728 -1, -1, -1, -1, -1, -1, -1, -1, -1, 812,
4729 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
4730 -1, 101, 102, -1, 104, 105, -1, 107, -1, -1,
4731 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4732 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4733 -1, -1, -1, -1, -1, -1, -1, -1, -1, 139,
4734 140, 141, -1, -1, -1, -1, -1, -1, -1, -1,
4735 -1, 151, -1, 153, -1, -1, -1, -1, -1, -1,
4736 -1, -1, -1, -1, 887, 888, -1, -1, -1, -1,
4737 -1, -1, -1, -1, -1, -1, 899, 900, -1, -1,
4738 -1, -1, 905, 33, 34, 35, 36, 910, -1, 912,
4739 -1, -1, -1, -1, -1, -1, -1, -1, -1, 49,
4740 50, 51, 52, -1, -1, -1, 56, -1, 58, 59,
4741 60, 61, 62, 63, -1, -1, -1, -1, -1, -1,
4742 -1, -1, -1, -1, -1, -1, -1, 77, -1, -1,
4743 -1, -1, -1, -1, -1, -1, 959, 960, 961, -1,
4744 90, 91, 965, 966, -1, -1, -1, -1, 98, -1,
4745 -1, 101, -1, -1, 104, 105, 979, 107, 108, -1,
4746 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4747 -1, 994, 995, -1, 997, 998, -1, 1000, -1, -1,
4748 -1, -1, 132, -1, -1, -1, -1, -1, -1, 139,
4749 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4750 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
4751 1033, -1, -1, -1, 1037, -1, -1, 8, 9, 10,
4752 -1, -1, 13, 14, 15, -1, 17, -1, -1, -1,
4753 -1, -1, -1, -1, 25, 26, 27, 28, 29, -1,
4754 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
4755 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4756 -1, -1, -1, -1, 1087, -1, -1, -1, -1, -1,
4757 -1, -1, -1, -1, -1, -1, 1099, 68, -1, -1,
4758 -1, -1, 1105, -1, -1, -1, 77, 78, 79, 80,
4759 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4760 -1, -1, -1, 94, 95, 96, 97, -1, 99, 100,
4761 -1, -1, -1, -1, -1, 106, -1, -1, -1, -1,
4762 -1, -1, -1, -1, -1, -1, -1, -1, -1, 120,
4763 -1, -1, 123, -1, -1, 126, 127, 128, 129, 130,
4764 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4765 -1, -1, 143, 144, 145, 146, 1179, 0, 149, 150,
4766 151, -1, 153, -1, -1, 8, 9, 10, -1, -1,
4767 13, 14, 15, 1196, 17, -1, -1, -1, -1, 44,
4768 -1, -1, 25, -1, 27, 28, 29, -1, -1, -1,
4769 -1, -1, -1, -1, 37, 38, -1, 40, 41, 42,
4770 43, 44, -1, -1, -1, -1, -1, -1, -1, -1,
4771 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4772 85, 86, 87, 88, 89, 68, -1, -1, -1, 94,
4773 95, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4774 83, 84, 85, 86, 87, 88, 89, -1, -1, -1,
4775 -1, 94, 95, 96, 97, -1, 99, 100, -1, -1,
4776 -1, -1, 127, 106, 129, 130, 131, 132, 133, 134,
4777 135, 136, 137, 138, -1, -1, -1, 120, -1, -1,
4778 123, 146, -1, 126, 127, 128, 129, 130, 131, 132,
4779 133, 134, 135, 136, 137, 138, -1, -1, -1, -1,
4780 -1, 144, 145, 146, 0, -1, 149, 150, 151, -1,
4781 153, -1, 8, 9, 10, -1, -1, 13, 14, 15,
4782 -1, 17, -1, -1, -1, -1, 44, -1, -1, 25,
4783 -1, 27, 28, 29, -1, -1, -1, -1, -1, -1,
4784 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
4785 -1, -1, -1, -1, -1, -1, -1, -1, -1, 77,
4786 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
4787 88, 89, 68, -1, -1, -1, 94, 95, -1, -1,
4788 -1, 77, 78, 79, 80, 81, 82, 83, 84, 85,
4789 86, 87, 88, 89, -1, -1, -1, -1, 94, 95,
4790 96, 97, -1, 99, 100, -1, -1, -1, -1, 127,
4791 106, 129, 130, 131, 132, 133, 134, 135, 136, 137,
4792 138, -1, -1, -1, 120, -1, -1, 123, -1, -1,
4793 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
4794 136, 137, 138, -1, -1, -1, -1, -1, 144, 145,
4795 146, 0, -1, 149, 150, 151, -1, 153, -1, 8,
4796 9, 10, -1, -1, 13, 14, 15, -1, 17, -1,
4797 -1, -1, -1, 44, -1, -1, 25, 26, 27, 28,
4798 29, -1, -1, -1, -1, -1, -1, -1, 37, 38,
4799 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
4800 -1, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4801 81, 82, 83, 84, 85, 86, 87, 88, 89, 68,
4802 -1, -1, -1, 94, 95, -1, -1, -1, 77, 78,
4803 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4804 89, -1, -1, -1, -1, 94, 95, 96, 97, -1,
4805 -1, 100, -1, -1, -1, -1, 127, 106, 129, 130,
4806 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4807 -1, 120, -1, -1, 123, -1, -1, -1, 127, 128,
4808 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4809 -1, -1, -1, -1, 143, 144, 145, 146, 0, -1,
4810 149, 150, 151, -1, 153, -1, 8, 9, 10, -1,
4811 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
4812 44, -1, -1, 25, 26, 27, 28, 29, -1, -1,
4813 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
4814 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
4815 -1, -1, -1, 77, 78, 79, 80, 81, 82, 83,
4816 84, 85, 86, 87, 88, 89, 68, -1, -1, -1,
4817 94, 95, -1, -1, -1, 77, 78, 79, 80, 81,
4818 82, 83, 84, 85, 86, 87, 88, 89, -1, -1,
4819 -1, -1, 94, 95, 96, 97, -1, -1, 100, -1,
4820 -1, -1, -1, 127, 106, 129, 130, 131, 132, 133,
4821 134, 135, 136, 137, 138, -1, -1, -1, 120, -1,
4822 -1, 123, -1, -1, -1, 127, 128, 129, 130, 131,
4823 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4824 -1, 143, 144, 145, 146, 0, -1, 149, 150, 151,
4825 -1, 153, -1, 8, 9, 10, -1, -1, 13, 14,
4826 15, -1, 17, -1, -1, -1, -1, -1, -1, -1,
4827 25, -1, 27, 28, 29, -1, -1, -1, -1, -1,
4828 -1, -1, 37, 38, -1, 40, 41, 42, 43, 44,
4829 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4830 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
4831 87, 88, 89, 68, -1, -1, -1, 94, 95, -1,
4832 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4833 85, 86, 87, 88, 89, -1, -1, -1, -1, 94,
4834 95, 96, 97, -1, 99, 100, -1, -1, -1, -1,
4835 127, 106, 129, 130, 131, 132, 133, 134, 135, 136,
4836 137, 138, -1, -1, -1, 120, -1, -1, 123, -1,
4837 -1, 126, 127, 128, 129, 130, 131, 132, 133, 134,
4838 135, 136, 137, 138, -1, -1, -1, -1, -1, 144,
4839 145, 146, 0, -1, 149, 150, 151, -1, 153, -1,
4840 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
4841 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
4842 28, -1, -1, -1, -1, -1, -1, -1, -1, 37,
4843 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
4844 -1, -1, -1, -1, -1, -1, -1, 77, 78, 79,
4845 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4846 68, -1, -1, -1, 94, 95, -1, -1, -1, 77,
4847 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
4848 88, 89, -1, -1, -1, -1, 94, 95, 96, 97,
4849 -1, -1, 100, -1, -1, -1, -1, -1, 106, 129,
4850 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4851 -1, -1, 120, -1, -1, -1, -1, -1, -1, 127,
4852 -1, 129, 130, 131, 132, 133, 134, 135, 136, 137,
4853 138, -1, -1, -1, -1, 143, 144, 145, 146, 0,
4854 148, 149, 150, 151, -1, 153, -1, 8, 9, 10,
4855 -1, -1, 13, 14, 15, -1, 17, -1, -1, -1,
4856 -1, -1, -1, -1, 25, -1, 27, 28, 29, -1,
4857 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
4858 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4859 -1, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4860 83, -1, -1, 86, 87, -1, -1, 68, -1, -1,
4861 -1, 94, 95, -1, -1, -1, 77, 78, 79, 80,
4862 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4863 -1, -1, -1, 94, 95, 96, 97, -1, -1, 100,
4864 -1, -1, -1, -1, -1, 106, 129, 130, 131, 132,
4865 133, 134, 135, 136, 137, 138, -1, -1, -1, 120,
4866 -1, -1, 123, -1, -1, -1, 127, 128, 129, 130,
4867 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4868 -1, -1, -1, 144, 145, 146, 0, -1, 149, 150,
4869 151, -1, 153, -1, 8, 9, 10, -1, -1, 13,
4870 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
4871 -1, 25, 26, 27, 28, -1, -1, -1, -1, -1,
4872 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
4873 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4874 -1, 77, 78, 79, 80, 81, 82, 83, -1, -1,
4875 86, 87, -1, -1, 68, -1, -1, -1, 94, 95,
4876 -1, -1, -1, 77, 78, 79, 80, 81, 82, 83,
4877 84, 85, 86, 87, 88, 89, -1, -1, -1, -1,
4878 94, 95, 96, 97, -1, -1, 100, -1, -1, -1,
4879 -1, -1, 106, 129, 130, 131, 132, 133, 134, 135,
4880 136, 137, 138, -1, -1, -1, 120, -1, -1, -1,
4881 -1, -1, -1, 127, -1, 129, 130, 131, 132, 133,
4882 134, 135, 136, 137, 138, -1, -1, -1, -1, 143,
4883 144, 145, 146, 0, 148, 149, 150, 151, -1, 153,
4884 -1, 8, 9, 10, -1, -1, 13, 14, 15, -1,
4885 17, -1, -1, -1, -1, -1, -1, -1, 25, -1,
4886 27, 28, -1, -1, -1, -1, -1, -1, -1, -1,
4887 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
4888 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4889 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4890 -1, 68, -1, -1, -1, -1, -1, -1, -1, -1,
4891 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
4892 87, 88, 89, -1, -1, -1, -1, 94, 95, 96,
4893 97, -1, -1, 100, -1, -1, -1, -1, -1, 106,
4894 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4895 -1, -1, -1, 120, -1, -1, -1, -1, -1, -1,
4896 127, -1, 129, 130, 131, 132, 133, 134, 135, 136,
4897 137, 138, -1, -1, -1, -1, -1, 144, 145, 146,
4898 0, 148, 149, 150, 151, -1, 153, -1, 8, 9,
4899 10, -1, -1, -1, 14, 15, -1, 17, -1, -1,
4900 -1, -1, -1, -1, -1, 25, 26, -1, -1, -1,
4901 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
4902 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
4903 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4904 85, 86, 87, 88, 89, -1, -1, -1, 68, 94,
4905 95, -1, -1, -1, -1, -1, -1, 77, 78, 79,
4906 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4907 -1, -1, -1, -1, 94, 95, 96, 97, -1, 99,
4908 100, -1, 127, -1, 129, 130, 131, 132, 133, 134,
4909 135, 136, 137, 138, -1, -1, -1, -1, -1, -1,
4910 120, -1, -1, -1, -1, -1, 126, 127, 153, 129,
4911 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4912 -1, -1, -1, 143, 144, 145, 146, 0, -1, 149,
4913 -1, 151, -1, 153, -1, 8, 9, 10, -1, -1,
4914 -1, 14, 15, -1, 17, -1, -1, -1, -1, -1,
4915 -1, -1, 25, 26, -1, -1, -1, -1, -1, -1,
4916 -1, -1, -1, -1, 37, 38, -1, 40, 41, 42,
4917 43, 44, -1, -1, -1, -1, -1, -1, -1, -1,
4918 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4919 -1, -1, -1, -1, -1, 68, -1, -1, -1, -1,
4920 -1, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4921 83, 84, 85, 86, 87, 88, 89, -1, -1, -1,
4922 -1, 94, 95, 96, 97, -1, 99, 100, -1, -1,
4923 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4924 -1, -1, -1, -1, -1, -1, -1, 120, -1, -1,
4925 -1, -1, -1, 126, 127, -1, 129, 130, 131, 132,
4926 133, 134, 135, 136, 137, 138, -1, -1, -1, -1,
4927 143, 144, 145, 146, 0, -1, 149, -1, 151, -1,
4928 153, -1, 8, 9, 10, -1, -1, -1, 14, 15,
4929 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
4930 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4931 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
4932 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4933 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4934 -1, -1, 68, -1, -1, -1, -1, -1, -1, -1,
4935 -1, 77, 78, 79, 80, 81, 82, 83, 84, 85,
4936 86, 87, 88, 89, -1, -1, -1, -1, 94, 95,
4937 96, 97, -1, 99, 100, -1, -1, -1, -1, -1,
4938 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4939 -1, -1, -1, -1, 120, -1, -1, -1, -1, -1,
4940 126, 127, -1, 129, 130, 131, 132, 133, 134, 135,
4941 136, 137, 138, -1, -1, -1, -1, -1, 144, 145,
4942 146, 0, -1, 149, -1, 151, -1, 153, -1, 8,
4943 9, 10, -1, -1, -1, 14, 15, -1, 17, -1,
4944 -1, -1, -1, -1, -1, -1, 25, -1, -1, -1,
4945 -1, -1, -1, -1, -1, -1, -1, -1, 37, 38,
4946 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
4947 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4948 -1, -1, -1, -1, -1, -1, -1, -1, -1, 68,
4949 -1, -1, -1, -1, -1, -1, -1, -1, 77, 78,
4950 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4951 89, -1, -1, -1, -1, 94, 95, 96, 97, -1,
4952 99, 100, -1, -1, -1, -1, -1, -1, -1, -1,
4953 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4954 -1, 120, -1, -1, -1, -1, -1, 126, 127, -1,
4955 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4956 -1, -1, -1, -1, -1, 144, 145, 146, -1, -1,
4957 149, -1, 151, 1, 153, 3, 4, 5, 6, 7,
4958 8, 9, 10, 11, 12, -1, -1, 15, 16, -1,
4959 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
4960 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
4961 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
4962 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
4963 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
4964 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
4965 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4966 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
4967 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
4968 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
4969 118, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4970 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4971 -1, 139, 140, 141, -1, -1, -1, -1, -1, -1,
4972 -1, -1, -1, 151, 1, 153, 3, 4, 5, 6,
4973 7, -1, -1, 10, 11, 12, -1, 14, 15, 16,
4974 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
4975 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
4976 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
4977 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
4978 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
4979 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
4980 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4981 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
4982 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
4983 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
4984 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
4985 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4986 -1, -1, 139, 140, 141, -1, -1, -1, -1, -1,
4987 -1, -1, -1, -1, 151, 1, 153, 3, 4, 5,
4988 6, 7, -1, -1, 10, 11, 12, -1, -1, 15,
4989 16, 17, 18, 19, 20, 21, 22, 23, 24, -1,
4990 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
4991 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
4992 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
4993 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4994 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4995 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4996 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4997 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4998 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
4999 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
5000 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5001 -1, -1, -1, 139, 140, 141, -1, -1, -1, -1,
5002 -1, -1, -1, -1, -1, 151, 1, 153, 3, 4,
5003 5, 6, 7, -1, -1, 10, 11, 12, -1, -1,
5004 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5005 25, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5006 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5007 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
5008 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5009 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5010 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5011 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5012 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5013 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5014 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5015 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5016 -1, -1, -1, -1, 139, 140, 141, -1, -1, -1,
5017 -1, -1, -1, -1, -1, -1, 151, 1, 153, 3,
5018 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
5019 -1, 15, 16, -1, 18, 19, 20, 21, 22, 23,
5020 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
5021 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5022 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
5023 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5024 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5025 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
5026 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
5027 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
5028 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
5029 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
5030 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
5031 -1, 9, 10, 11, 12, 139, 140, 141, 16, -1,
5032 18, 19, 20, 21, 22, 23, 24, 151, -1, 153,
5033 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5034 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5035 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5036 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5037 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
5038 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5039 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
5040 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
5041 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
5042 118, -1, -1, -1, -1, -1, -1, -1, -1, 1,
5043 -1, 3, 4, 5, 6, 7, -1, -1, -1, 11,
5044 12, 139, 140, 141, 16, -1, 18, 19, 20, 21,
5045 22, 23, 24, 151, -1, 153, -1, -1, 30, 31,
5046 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5047 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5048 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5049 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5050 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
5051 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
5052 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
5053 102, -1, 104, 105, -1, 107, -1, -1, 110, 111,
5054 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
5055 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5056 -1, -1, -1, -1, -1, -1, -1, 139, 140, 141,
5057 -1, -1, -1, -1, -1, -1, -1, 149, -1, 151,
5058 1, 153, 3, 4, 5, 6, 7, -1, -1, -1,
5059 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
5060 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5061 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5062 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5063 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5064 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5065 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5066 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5067 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5068 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
5069 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5070 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5071 -1, -1, -1, -1, -1, -1, -1, -1, 139, 140,
5072 141, -1, -1, -1, -1, -1, -1, -1, 149, -1,
5073 151, 1, 153, 3, 4, 5, 6, 7, -1, -1,
5074 -1, 11, 12, -1, -1, -1, 16, -1, 18, 19,
5075 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
5076 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5077 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
5078 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5079 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5080 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
5081 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5082 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
5083 -1, 101, 102, -1, 104, 105, -1, 107, -1, -1,
5084 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
5085 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5086 -1, -1, -1, -1, -1, -1, -1, -1, -1, 139,
5087 140, 141, -1, -1, 144, -1, -1, -1, -1, -1,
5088 -1, 151, 1, 153, 3, 4, 5, 6, 7, -1,
5089 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5090 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5091 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5092 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
5093 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5094 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5095 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5096 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5097 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5098 -1, -1, 101, 102, -1, 104, 105, -1, 107, -1,
5099 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5100 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5101 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5102 139, 140, 141, -1, -1, 144, -1, -1, -1, -1,
5103 -1, -1, 151, 1, 153, 3, 4, 5, 6, 7,
5104 -1, -1, 10, 11, 12, -1, -1, -1, 16, -1,
5105 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
5106 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5107 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5108 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5109 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5110 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
5111 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5112 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
5113 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
5114 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
5115 118, -1, -1, -1, -1, -1, -1, -1, -1, 1,
5116 -1, 3, 4, 5, 6, 7, -1, -1, -1, 11,
5117 12, 139, 140, 141, 16, -1, 18, 19, 20, 21,
5118 22, 23, 24, 151, -1, 153, -1, -1, 30, 31,
5119 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5120 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5121 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5122 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5123 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
5124 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
5125 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
5126 102, -1, 104, 105, -1, 107, -1, -1, 110, 111,
5127 112, 113, 114, 115, 116, 117, 118, -1, 120, -1,
5128 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
5129 -1, 7, -1, -1, -1, 11, 12, 139, 140, 141,
5130 16, -1, 18, 19, 20, 21, 22, 23, 24, 151,
5131 -1, 153, -1, -1, 30, 31, 32, 33, 34, 35,
5132 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
5133 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
5134 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
5135 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5136 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5137 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
5138 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
5139 -1, 107, 108, 109, 110, 111, 112, 113, 114, 115,
5140 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
5141 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
5142 -1, 11, 12, 139, 140, 141, 16, -1, 18, 19,
5143 20, 21, 22, 23, 24, -1, -1, 153, -1, -1,
5144 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5145 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
5146 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5147 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5148 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
5149 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5150 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
5151 -1, 101, 102, -1, 104, 105, -1, -1, -1, -1,
5152 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
5153 -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
5154 4, 5, -1, 7, -1, -1, -1, 11, 12, 139,
5155 140, 141, 16, -1, 18, 19, 20, 21, 22, 23,
5156 24, 151, -1, 153, -1, -1, 30, 31, 32, 33,
5157 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5158 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5159 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5160 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5161 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
5162 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
5163 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
5164 104, 105, -1, -1, -1, -1, 110, 111, 112, 113,
5165 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
5166 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
5167 -1, -1, -1, 11, 12, 139, 140, 141, 16, -1,
5168 18, 19, 20, 21, 22, 23, 24, -1, -1, 153,
5169 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5170 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5171 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5172 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5173 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
5174 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5175 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
5176 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
5177 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
5178 118, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5179 -1, 3, 4, 5, 6, 7, -1, -1, -1, 11,
5180 12, 139, 140, 141, 16, -1, 18, 19, 20, 21,
5181 22, 23, 24, 151, -1, -1, -1, -1, 30, 31,
5182 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
5183 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5184 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
5185 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
5186 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
5187 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
5188 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
5189 102, -1, 104, 105, -1, 107, -1, -1, 110, 111,
5190 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
5191 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5192 -1, -1, -1, -1, -1, -1, -1, 139, 140, 141,
5193 -1, -1, -1, -1, -1, -1, -1, -1, -1, 151,
5194 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
5195 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
5196 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
5197 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
5198 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5199 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
5200 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5201 -1, -1, 75, 76, 77, 78, 79, 80, 81, 82,
5202 83, -1, -1, 86, 87, -1, -1, -1, -1, 92,
5203 93, 94, 95, -1, -1, -1, -1, -1, -1, -1,
5204 -1, -1, -1, -1, 107, 108, -1, -1, -1, -1,
5205 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5206 -1, -1, -1, -1, -1, -1, 129, 130, 131, 132,
5207 133, 134, 135, 136, 137, 138, -1, 140, 141, -1,
5208 -1, -1, -1, -1, 147, 148, 3, 4, 5, 6,
5209 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
5210 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
5211 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5212 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
5213 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
5214 57, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5215 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5216 77, 78, 79, 80, 81, 82, 83, -1, -1, 86,
5217 87, -1, -1, -1, -1, 92, 93, 94, 95, -1,
5218 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5219 107, 108, -1, -1, -1, -1, -1, -1, -1, -1,
5220 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5221 -1, -1, 129, 130, 131, 132, 133, 134, 135, 136,
5222 137, 138, -1, 140, 141, -1, -1, -1, -1, -1,
5223 147, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5224 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
5225 22, 23, 24, 25, 26, -1, -1, -1, 30, 31,
5226 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
5227 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5228 52, 53, 54, -1, 56, -1, -1, -1, -1, -1,
5229 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5230 -1, -1, -1, 75, 76, 77, 78, 79, 80, 81,
5231 82, 83, -1, -1, 86, 87, -1, -1, -1, -1,
5232 92, 93, 94, 95, -1, -1, -1, -1, -1, -1,
5233 -1, -1, -1, -1, -1, 107, 108, -1, -1, 111,
5234 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5235 -1, -1, -1, -1, -1, -1, -1, 129, 130, 131,
5236 132, 133, 134, 135, 136, 137, 138, -1, 140, 141,
5237 -1, -1, -1, -1, -1, 147, 3, 4, 5, 6,
5238 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
5239 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
5240 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5241 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
5242 47, 48, 49, 50, 51, 52, 53, -1, -1, 56,
5243 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5244 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5245 77, 78, 79, 80, 81, 82, 83, -1, -1, 86,
5246 87, -1, -1, -1, -1, 92, 93, 94, 95, -1,
5247 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5248 107, 108, -1, -1, 111, -1, -1, -1, -1, -1,
5249 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5250 -1, -1, 129, 130, 131, 132, 133, 134, 135, 136,
5251 137, 138, -1, 140, 141, -1, -1, -1, -1, -1,
5252 147, 3, 4, 5, 6, 7, 8, 9, 10, 11,
5253 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
5254 22, 23, 24, 25, 26, -1, -1, -1, 30, 31,
5255 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
5256 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
5257 52, 53, -1, -1, 56, -1, -1, -1, -1, -1,
5258 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5259 -1, -1, -1, 75, 76, 77, 78, 79, 80, 81,
5260 82, 83, -1, -1, 86, 87, -1, -1, -1, -1,
5261 92, 93, 94, 95, -1, -1, -1, -1, -1, -1,
5262 -1, -1, -1, -1, -1, 107, 108, -1, -1, -1,
5263 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5264 -1, -1, -1, -1, -1, -1, -1, 129, 130, 131,
5265 132, 133, 134, 135, 136, 137, 138, -1, 140, 141,
5266 3, 4, 5, -1, 7, 147, -1, -1, 11, 12,
5267 -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
5268 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5269 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5270 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5271 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5272 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5275 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5276 -1, 104, 105, -1, -1, -1, -1, 110, 111, 112,
5277 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5278 -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
5279 4, 5, -1, 7, -1, -1, 139, 11, 12, -1,
5280 -1, -1, 16, 146, 18, 19, 20, 21, 22, 23,
5281 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
5282 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
5283 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
5284 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
5285 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
5286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5287 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5288 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
5289 104, 105, -1, -1, -1, -1, 110, 111, 112, 113,
5290 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
5291 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5292 5, 6, 7, -1, -1, 139, 11, 12, -1, -1,
5293 -1, 16, 146, 18, 19, 20, 21, 22, 23, 24,
5294 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5295 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5296 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
5297 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5298 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5299 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5300 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5301 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5302 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5303 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5304 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5305 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5306 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5307 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5308 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5309 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
5310 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5311 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5312 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5313 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5314 -1, -1, 101, 102, -1, 104, 105, -1, 107, 108,
5315 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5317 3, 4, 5, 6, 7, -1, -1, -1, 11, 12,
5318 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5319 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5320 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5321 -1, -1, 45, 46, -1, 48, 49, 50, 51, 52,
5322 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5323 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5324 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5325 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5326 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5327 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
5328 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5329 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5330 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5331 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5332 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5333 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5334 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5335 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
5336 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5338 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5339 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5340 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
5341 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5342 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5343 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5344 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5345 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5346 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5347 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
5348 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5349 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5350 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5351 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5352 101, 102, -1, 104, 105, -1, 107, 108, 109, 110,
5353 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5354 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5355 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5356 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5357 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5358 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5359 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5360 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
5361 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5362 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5363 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5364 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5365 105, -1, 107, 108, 109, 110, 111, 112, 113, 114,
5366 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5367 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5368 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5369 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5370 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5371 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5372 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
5373 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5374 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5375 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5376 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5377 -1, -1, 101, 102, -1, 104, 105, -1, 107, 108,
5378 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5379 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5380 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5381 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5382 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5383 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5384 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5385 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5386 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5387 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5388 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5389 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5390 -1, 104, 105, -1, -1, 108, 109, 110, 111, 112,
5391 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5392 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5393 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5394 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5395 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5396 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5397 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5398 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
5399 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5401 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5402 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5403 107, 108, -1, 110, 111, 112, 113, 114, 115, 116,
5404 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5405 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5406 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5407 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5408 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5409 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5410 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
5411 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5412 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5413 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5414 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5415 101, 102, -1, 104, 105, -1, -1, 108, -1, 110,
5416 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5417 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5418 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5419 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5420 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5421 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5422 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5423 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5424 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5425 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5426 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5427 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5428 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5429 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5430 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5431 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5432 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5433 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5434 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5435 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5436 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5437 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5438 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5439 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5440 -1, -1, 101, 102, -1, 104, 105, -1, 107, -1,
5441 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5442 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5443 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5444 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5445 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5446 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5447 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5448 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5449 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5450 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5451 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5452 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5453 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
5454 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5455 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5456 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5457 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5458 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5459 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5460 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5461 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5462 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5464 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5465 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5466 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5467 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5468 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5469 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5470 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5471 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5472 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5473 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5474 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5475 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5476 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5477 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5478 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
5479 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5480 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5481 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5482 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5483 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5484 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5485 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5486 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5487 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5488 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5489 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5490 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5491 105, -1, -1, -1, -1, 110, 111, 112, 113, 114,
5492 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5493 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5494 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5495 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5496 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5497 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5498 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5499 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5500 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5501 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5502 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5503 -1, -1, 101, 102, -1, 104, 105, -1, -1, -1,
5504 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5505 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5506 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5507 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5508 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5509 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5510 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5511 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5512 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5513 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5514 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5515 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5516 -1, 104, 105, -1, -1, -1, -1, 110, 111, 112,
5517 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5518 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5519 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5520 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5521 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5522 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5523 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5524 57, -1, 59, 60, 61, 62, 63, 64, 65, -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, -1, -1, -1, -1, -1, -1, -1,
5528 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5529 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5530 117, 118, -1, -1, -1, -1, -1, -1, 3, 4,
5531 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5532 -1, 16, 139, 18, 19, 20, 21, 22, 23, 24,
5533 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5534 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5535 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5536 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5537 65, -1, -1, -1, -1, -1, -1, -1, -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, 98, -1, -1, 101, 102, -1, 104,
5541 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5542 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5543 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5544 -1, -1, -1, 16, 139, 18, 19, 20, 21, 22,
5545 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5546 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5547 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5548 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5549 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5550 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5551 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5552 -1, 94, -1, -1, -1, 98, -1, -1, 101, 102,
5553 -1, 104, 105, -1, -1, -1, -1, 110, 111, 112,
5554 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5555 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5556 11, 12, -1, -1, -1, 16, 139, 18, 19, 20,
5557 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5558 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5559 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5560 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5561 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5562 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5563 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5564 -1, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5565 101, 102, -1, 104, 105, -1, -1, -1, -1, 110,
5566 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5567 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5568 -1, -1, 11, 12, -1, -1, -1, 16, 139, 18,
5569 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5570 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5571 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5572 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5573 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5574 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5575 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5576 -1, -1, -1, -1, -1, -1, -1, -1, -1, 98,
5577 -1, -1, 101, 102, -1, 104, 105, -1, -1, -1,
5578 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5579 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5580 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5581 139, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5582 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5583 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5584 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5585 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5586 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5587 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5588 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5589 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5590 -1, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5591 117, 118, -1, -1, -1, -1, -1, -1, 3, 4,
5592 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5593 -1, 16, 139, 18, 19, 20, 21, 22, 23, 24,
5594 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5595 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5596 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5597 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5598 65, 33, 34, 35, 36, -1, -1, -1, -1, -1,
5599 -1, -1, -1, -1, -1, -1, -1, 49, 50, 51,
5600 52, -1, -1, -1, 56, -1, -1, 59, 60, 61,
5601 62, 63, -1, 98, -1, -1, 101, 102, -1, 104,
5602 105, -1, -1, -1, -1, 110, 111, 112, 113, 114,
5603 115, 116, 117, 118, -1, -1, -1, -1, 90, 91,
5604 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
5605 -1, -1, 104, 105, 139, 107, -1, -1, 110, 111,
5606 112, 113, 114, 115, 116, 117, 118, 33, 34, 35,
5607 36, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5608 132, -1, -1, 49, 50, 51, 52, 139, -1, -1,
5609 56, -1, -1, 59, 60, 61, 62, 63, -1, -1,
5610 33, 34, 35, 36, -1, -1, -1, -1, -1, -1,
5611 -1, -1, -1, -1, -1, -1, 49, 50, 51, 52,
5612 -1, -1, -1, 56, 90, 91, 59, 60, 61, 62,
5613 63, -1, 98, -1, -1, 101, -1, -1, 104, 105,
5614 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
5615 116, 117, 118, -1, -1, -1, -1, 90, 91, -1,
5616 -1, -1, -1, -1, -1, 98, 132, -1, 101, -1,
5617 -1, 104, 105, 139, -1, -1, -1, 110, 111, 112,
5618 113, 114, 115, 116, 117, 118, 52, 53, -1, -1,
5619 56, -1, -1, -1, -1, -1, -1, -1, -1, 132,
5620 -1, -1, -1, -1, -1, -1, 139, -1, -1, 75,
5621 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5622 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5623 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5624 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5625 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5626 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5627 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5628 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5629 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5630 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5631 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5632 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5633 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5634 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5635 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5636 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5637 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5638 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5639 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5640 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5642 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5643 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5644 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5645 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5646 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5647 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5648 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5649 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5650 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5651 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5652 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5653 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5654 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5655 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5656 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5657 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5658 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5659 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5660 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5661 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5662 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5663 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5664 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5665 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5666 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5667 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5668 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5669 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5670 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5671 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5672 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5673 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5674 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5675 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5676 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5677 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5678 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5680 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5681 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5682 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5683 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5684 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5685 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5686 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5687 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5688 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5689 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5690 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5691 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5692 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5693 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5694 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5695 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5696 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5697 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5698 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5699 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5700 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5701 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5702 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5703 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5704 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5705 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5706 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5707 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5708 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5709 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5710 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5711 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5712 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5713 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5714 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5715 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5716 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5717 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5718 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5719 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5720 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5721 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5722 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5723 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5724 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5725 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5726 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5727 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5728 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5729 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5730 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5731 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5732 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5733 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5734 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5735 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5736 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5737 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5738 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5739 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5740 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5741 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5742 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5743 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5744 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5745 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5746 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5747 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5748 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5749 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5750 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5751 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5752 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5753 136, 137, 138, -1, 140, 141, 52, 53, -1, -1,
5754 56, 147, 148, -1, -1, -1, -1, -1, -1, -1,
5755 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
5756 76, 77, 78, 79, 80, 81, 82, 83, -1, -1,
5757 86, 87, -1, -1, -1, -1, 92, 93, 94, 95,
5758 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5759 -1, 107, 108, -1, -1, -1, -1, -1, -1, -1,
5760 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5761 -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
5762 136, 137, 138, -1, 140, 141, -1, -1, -1, -1,
5763 -1, 147
5764};
5765
5766/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
5767 state STATE-NUM. */
5768static const yytype_int16 yystos[] =
5769{
5770 0, 155, 156, 0, 1, 3, 4, 5, 6, 7,
5771 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
5772 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
5773 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
5774 57, 59, 60, 61, 62, 63, 64, 65, 75, 76,
5775 90, 91, 98, 101, 102, 104, 105, 107, 110, 111,
5776 112, 113, 114, 115, 116, 117, 118, 139, 140, 141,
5777 157, 158, 159, 167, 169, 171, 177, 178, 184, 185,
5778 187, 188, 189, 191, 192, 193, 195, 196, 205, 208,
5779 224, 234, 235, 236, 237, 238, 239, 240, 241, 242,
5780 243, 244, 253, 275, 283, 284, 336, 337, 338, 339,
5781 340, 341, 342, 345, 347, 348, 362, 363, 365, 366,
5782 367, 369, 370, 371, 372, 373, 411, 425, 159, 3,
5783 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
5784 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
5785 24, 25, 26, 30, 31, 32, 33, 34, 35, 36,
5786 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
5787 52, 53, 56, 75, 76, 77, 78, 79, 80, 81,
5788 82, 83, 86, 87, 92, 93, 94, 95, 107, 108,
5789 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
5790 140, 141, 147, 199, 200, 201, 203, 204, 362, 39,
5791 58, 98, 101, 107, 108, 109, 112, 140, 177, 178,
5792 188, 196, 205, 210, 216, 219, 221, 234, 369, 370,
5793 372, 373, 409, 410, 216, 148, 217, 218, 148, 213,
5794 217, 148, 153, 418, 54, 200, 418, 143, 160, 143,
5795 21, 22, 31, 32, 187, 205, 234, 253, 205, 205,
5796 205, 56, 1, 47, 101, 163, 164, 165, 167, 190,
5797 191, 425, 167, 226, 211, 221, 409, 425, 210, 408,
5798 409, 425, 46, 98, 139, 146, 177, 178, 195, 224,
5799 234, 369, 370, 373, 276, 54, 55, 57, 199, 351,
5800 364, 351, 352, 353, 152, 152, 152, 152, 367, 184,
5801 205, 205, 151, 153, 417, 423, 424, 40, 41, 42,
5802 43, 44, 37, 38, 148, 376, 377, 378, 379, 425,
5803 376, 378, 26, 143, 213, 217, 245, 285, 28, 246,
5804 282, 126, 146, 101, 107, 192, 126, 25, 77, 78,
5805 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
5806 89, 94, 95, 100, 127, 129, 130, 131, 132, 133,
5807 134, 135, 136, 137, 138, 207, 207, 68, 96, 97,
5808 145, 415, 225, 171, 180, 180, 181, 182, 181, 180,
5809 417, 424, 98, 189, 196, 234, 258, 369, 370, 373,
5810 52, 56, 94, 98, 197, 198, 234, 369, 370, 373,
5811 198, 33, 34, 35, 36, 49, 50, 51, 52, 56,
5812 148, 176, 199, 371, 406, 216, 97, 415, 416, 285,
5813 339, 99, 99, 146, 210, 56, 210, 210, 210, 351,
5814 376, 376, 126, 100, 146, 220, 425, 97, 145, 415,
5815 99, 99, 146, 220, 216, 418, 419, 216, 91, 215,
5816 216, 221, 383, 409, 425, 171, 419, 171, 54, 64,
5817 65, 168, 148, 206, 157, 163, 97, 415, 99, 167,
5818 166, 190, 149, 417, 424, 419, 227, 419, 150, 146,
5819 153, 422, 146, 422, 144, 422, 418, 56, 367, 192,
5820 194, 377, 146, 97, 145, 415, 277, 66, 119, 121,
5821 122, 354, 119, 119, 354, 67, 354, 343, 349, 346,
5822 350, 77, 151, 159, 180, 180, 180, 180, 167, 171,
5823 171, 52, 54, 55, 56, 57, 58, 77, 91, 101,
5824 107, 108, 109, 133, 136, 263, 380, 382, 383, 384,
5825 385, 386, 387, 388, 389, 390, 393, 394, 395, 396,
5826 397, 400, 401, 402, 403, 404, 126, 161, 163, 382,
5827 126, 161, 286, 287, 106, 186, 290, 291, 290, 70,
5828 209, 425, 190, 146, 195, 146, 209, 174, 205, 205,
5829 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
5830 205, 172, 205, 205, 205, 205, 205, 205, 205, 205,
5831 205, 205, 205, 52, 53, 56, 203, 213, 412, 413,
5832 215, 221, 52, 53, 56, 203, 213, 412, 161, 13,
5833 254, 423, 254, 163, 180, 163, 417, 230, 56, 97,
5834 145, 415, 25, 171, 52, 56, 197, 130, 374, 97,
5835 145, 415, 233, 407, 68, 97, 414, 52, 56, 412,
5836 209, 209, 202, 124, 126, 126, 209, 210, 107, 210,
5837 219, 409, 52, 56, 215, 52, 56, 209, 209, 410,
5838 419, 149, 419, 146, 419, 146, 419, 200, 228, 205,
5839 144, 144, 412, 412, 209, 160, 419, 165, 419, 409,
5840 146, 194, 52, 56, 215, 52, 56, 278, 356, 355,
5841 119, 344, 354, 66, 119, 119, 344, 66, 119, 205,
5842 101, 107, 259, 260, 261, 262, 385, 146, 405, 425,
5843 419, 264, 265, 146, 381, 210, 146, 405, 34, 52,
5844 146, 381, 52, 146, 381, 52, 188, 205, 10, 252,
5845 8, 247, 332, 425, 423, 188, 205, 252, 144, 288,
5846 286, 252, 292, 252, 107, 184, 210, 221, 222, 223,
5847 419, 194, 146, 169, 170, 184, 196, 205, 210, 212,
5848 223, 234, 373, 175, 173, 418, 99, 99, 213, 217,
5849 418, 420, 146, 99, 99, 213, 214, 217, 425, 252,
5850 163, 13, 163, 252, 27, 255, 423, 252, 25, 229,
5851 297, 17, 249, 295, 52, 56, 215, 52, 56, 181,
5852 232, 375, 231, 52, 56, 197, 215, 161, 171, 179,
5853 214, 217, 170, 205, 212, 170, 212, 200, 210, 210,
5854 220, 99, 99, 420, 99, 99, 383, 409, 171, 212,
5855 422, 192, 420, 148, 280, 382, 357, 54, 55, 57,
5856 361, 373, 152, 354, 152, 152, 152, 261, 385, 146,
5857 419, 146, 404, 210, 126, 380, 387, 400, 402, 390,
5858 394, 396, 388, 397, 402, 386, 388, 44, 44, 210,
5859 223, 333, 425, 9, 15, 248, 250, 335, 425, 44,
5860 44, 289, 144, 293, 210, 146, 44, 194, 44, 126,
5861 44, 97, 145, 415, 52, 56, 58, 90, 91, 98,
5862 101, 104, 105, 107, 112, 132, 275, 303, 304, 305,
5863 306, 309, 314, 315, 316, 319, 320, 321, 322, 323,
5864 324, 325, 326, 327, 328, 329, 330, 331, 336, 337,
5865 340, 341, 342, 345, 347, 348, 370, 394, 303, 128,
5866 209, 209, 186, 150, 99, 209, 209, 186, 14, 250,
5867 251, 256, 257, 425, 257, 183, 298, 295, 252, 107,
5868 210, 294, 252, 420, 163, 423, 180, 161, 420, 252,
5869 419, 176, 285, 282, 209, 209, 99, 209, 209, 419,
5870 146, 419, 382, 279, 358, 419, 259, 262, 260, 146,
5871 381, 146, 381, 405, 146, 381, 146, 381, 381, 205,
5872 205, 100, 334, 425, 163, 162, 205, 205, 131, 270,
5873 271, 425, 270, 107, 210, 167, 167, 209, 205, 52,
5874 56, 215, 52, 56, 327, 327, 56, 197, 311, 304,
5875 312, 313, 314, 315, 318, 420, 310, 418, 421, 52,
5876 351, 52, 54, 55, 57, 101, 368, 100, 146, 131,
5877 146, 146, 304, 88, 89, 97, 145, 148, 307, 308,
5878 34, 52, 205, 170, 212, 170, 212, 209, 170, 212,
5879 170, 212, 163, 180, 252, 252, 299, 252, 210, 146,
5880 254, 252, 161, 423, 252, 209, 272, 418, 29, 123,
5881 281, 359, 146, 146, 388, 402, 388, 388, 98, 196,
5882 234, 369, 370, 373, 254, 163, 263, 266, 269, 272,
5883 386, 388, 389, 391, 392, 398, 399, 402, 404, 163,
5884 161, 210, 420, 304, 420, 107, 304, 318, 420, 146,
5885 112, 319, 144, 124, 180, 328, 312, 316, 309, 317,
5886 318, 321, 325, 327, 327, 197, 420, 419, 312, 315,
5887 319, 312, 315, 319, 170, 212, 254, 302, 303, 107,
5888 210, 163, 252, 149, 151, 161, 163, 360, 260, 381,
5889 146, 381, 381, 381, 56, 97, 145, 415, 163, 335,
5890 405, 272, 131, 264, 146, 267, 268, 98, 234, 146,
5891 405, 146, 267, 146, 267, 419, 52, 146, 146, 351,
5892 421, 149, 146, 146, 419, 419, 419, 420, 420, 420,
5893 163, 254, 40, 41, 210, 257, 295, 296, 52, 273,
5894 274, 384, 252, 144, 163, 388, 52, 56, 215, 52,
5895 56, 332, 131, 234, 266, 399, 402, 56, 97, 391,
5896 396, 388, 398, 402, 388, 146, 317, 317, 316, 318,
5897 256, 300, 180, 180, 146, 418, 120, 381, 420, 146,
5898 267, 146, 267, 52, 56, 405, 146, 267, 146, 267,
5899 267, 317, 146, 163, 274, 388, 402, 388, 388, 257,
5900 297, 301, 267, 146, 267, 267, 267, 388, 267
5901};
5902
5903/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
5904static const yytype_int16 yyr1[] =
5905{
5906 0, 154, 156, 155, 157, 158, 158, 158, 158, 159,
5907 159, 160, 162, 161, 161, 163, 164, 164, 164, 164,
5908 165, 166, 165, 168, 167, 167, 167, 167, 167, 167,
5909 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
5910 167, 169, 169, 169, 169, 169, 169, 169, 169, 169,
5911 169, 169, 169, 170, 170, 170, 171, 171, 171, 171,
5912 171, 172, 173, 171, 174, 175, 171, 171, 176, 177,
5913 179, 178, 180, 182, 183, 181, 184, 184, 185, 185,
5914 186, 187, 188, 188, 188, 188, 188, 188, 188, 188,
5915 188, 188, 188, 189, 189, 190, 190, 191, 191, 191,
5916 191, 191, 191, 191, 191, 191, 191, 192, 192, 193,
5917 193, 194, 194, 195, 195, 195, 195, 195, 195, 195,
5918 195, 195, 196, 196, 196, 196, 196, 196, 196, 196,
5919 196, 197, 197, 198, 198, 198, 199, 199, 199, 199,
5920 199, 200, 200, 201, 202, 201, 203, 203, 203, 203,
5921 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
5922 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
5923 203, 203, 203, 203, 203, 203, 204, 204, 204, 204,
5924 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
5925 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
5926 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
5927 204, 204, 204, 204, 204, 204, 204, 205, 205, 205,
5928 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
5929 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
5930 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
5931 205, 205, 205, 205, 205, 205, 205, 206, 205, 205,
5932 205, 205, 205, 205, 205, 207, 207, 207, 207, 208,
5933 208, 209, 209, 210, 211, 211, 211, 211, 212, 212,
5934 213, 213, 213, 214, 214, 215, 215, 215, 215, 215,
5935 216, 216, 216, 216, 216, 218, 217, 219, 219, 220,
5936 220, 221, 221, 221, 221, 222, 222, 223, 223, 223,
5937 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
5938 224, 225, 224, 226, 224, 227, 224, 224, 224, 224,
5939 224, 224, 224, 224, 224, 224, 228, 224, 224, 224,
5940 224, 224, 224, 224, 224, 224, 224, 224, 229, 224,
5941 230, 224, 224, 224, 231, 224, 232, 224, 233, 224,
5942 224, 224, 224, 224, 224, 224, 234, 235, 236, 237,
5943 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
5944 248, 249, 250, 251, 252, 253, 254, 254, 254, 255,
5945 255, 256, 256, 257, 257, 258, 258, 259, 259, 260,
5946 260, 261, 261, 261, 261, 261, 262, 262, 263, 263,
5947 265, 264, 266, 266, 266, 266, 267, 267, 268, 269,
5948 269, 269, 269, 269, 269, 269, 269, 269, 269, 269,
5949 269, 269, 269, 269, 270, 270, 271, 271, 272, 272,
5950 273, 273, 274, 274, 276, 277, 278, 279, 275, 280,
5951 280, 281, 281, 282, 283, 283, 283, 283, 284, 284,
5952 284, 284, 284, 284, 284, 284, 284, 285, 285, 287,
5953 288, 289, 286, 291, 292, 293, 290, 294, 294, 294,
5954 294, 295, 296, 296, 298, 299, 300, 297, 301, 301,
5955 302, 302, 302, 303, 303, 303, 303, 303, 303, 304,
5956 305, 305, 306, 306, 307, 308, 309, 309, 309, 309,
5957 309, 309, 309, 309, 309, 309, 309, 309, 309, 310,
5958 309, 309, 311, 309, 312, 312, 312, 312, 312, 312,
5959 312, 312, 313, 313, 314, 314, 315, 316, 316, 317,
5960 317, 318, 319, 319, 319, 319, 320, 320, 321, 321,
5961 322, 322, 323, 323, 324, 325, 325, 326, 326, 326,
5962 326, 326, 326, 326, 326, 326, 326, 327, 327, 327,
5963 327, 327, 327, 327, 327, 327, 327, 328, 329, 329,
5964 330, 331, 331, 331, 332, 332, 333, 333, 333, 334,
5965 334, 335, 335, 336, 336, 337, 338, 338, 338, 339,
5966 340, 341, 342, 343, 343, 344, 344, 345, 346, 346,
5967 347, 348, 349, 349, 350, 350, 351, 351, 352, 352,
5968 353, 353, 354, 355, 354, 356, 357, 358, 359, 360,
5969 354, 361, 361, 361, 361, 362, 362, 363, 364, 364,
5970 364, 364, 365, 366, 366, 367, 367, 367, 367, 368,
5971 368, 368, 369, 369, 369, 369, 369, 370, 370, 370,
5972 370, 370, 370, 370, 371, 371, 372, 372, 373, 373,
5973 375, 374, 374, 376, 376, 377, 378, 379, 378, 380,
5974 380, 380, 380, 380, 381, 381, 382, 382, 382, 382,
5975 382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
5976 382, 383, 384, 384, 384, 384, 385, 385, 386, 387,
5977 387, 388, 388, 389, 390, 390, 391, 391, 392, 392,
5978 393, 393, 394, 394, 395, 396, 396, 397, 398, 399,
5979 399, 400, 400, 401, 401, 402, 402, 403, 403, 404,
5980 404, 405, 405, 406, 407, 406, 408, 408, 409, 409,
5981 410, 410, 410, 410, 410, 411, 411, 411, 412, 412,
5982 412, 412, 413, 413, 413, 414, 414, 415, 415, 416,
5983 416, 417, 417, 418, 418, 419, 420, 421, 422, 422,
5984 422, 423, 423, 424, 424, 425
5985};
5986
5987/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
5988static const yytype_int8 yyr2[] =
5989{
5990 0, 2, 0, 2, 2, 1, 1, 3, 2, 1,
5991 2, 3, 0, 6, 3, 2, 1, 1, 3, 2,
5992 1, 0, 3, 0, 4, 3, 3, 3, 2, 3,
5993 3, 3, 3, 3, 4, 1, 4, 4, 6, 4,
5994 1, 4, 4, 7, 6, 6, 6, 6, 4, 6,
5995 4, 6, 4, 1, 3, 1, 1, 3, 3, 3,
5996 2, 0, 0, 5, 0, 0, 5, 1, 1, 2,
5997 0, 5, 1, 0, 0, 4, 1, 1, 1, 4,
5998 3, 1, 2, 3, 4, 5, 4, 5, 2, 2,
5999 2, 2, 2, 1, 3, 1, 3, 1, 2, 3,
6000 5, 2, 4, 2, 4, 1, 3, 1, 3, 2,
6001 3, 1, 3, 1, 1, 4, 3, 3, 3, 3,
6002 2, 1, 1, 1, 4, 3, 3, 3, 3, 2,
6003 1, 1, 1, 2, 1, 3, 1, 1, 1, 1,
6004 1, 1, 1, 1, 0, 4, 1, 1, 1, 1,
6005 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6006 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6007 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6008 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6009 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6010 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6011 1, 1, 1, 1, 1, 1, 1, 4, 4, 7,
6012 6, 6, 6, 6, 5, 4, 3, 3, 2, 2,
6013 2, 2, 3, 3, 3, 3, 3, 3, 4, 2,
6014 2, 3, 3, 3, 3, 1, 3, 3, 3, 3,
6015 3, 2, 2, 3, 3, 3, 3, 0, 4, 6,
6016 4, 6, 4, 6, 1, 1, 1, 1, 1, 3,
6017 3, 1, 1, 1, 1, 2, 4, 2, 1, 3,
6018 3, 5, 3, 1, 1, 1, 1, 2, 4, 2,
6019 1, 2, 2, 4, 1, 0, 2, 2, 1, 2,
6020 1, 1, 2, 3, 4, 1, 1, 3, 4, 2,
6021 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6022 1, 0, 4, 0, 3, 0, 4, 3, 3, 2,
6023 3, 3, 1, 4, 3, 1, 0, 6, 4, 3,
6024 2, 1, 2, 1, 6, 6, 4, 4, 0, 6,
6025 0, 5, 5, 6, 0, 6, 0, 7, 0, 5,
6026 4, 4, 1, 1, 1, 1, 1, 1, 1, 1,
6027 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6028 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
6029 1, 1, 5, 1, 2, 1, 1, 1, 3, 1,
6030 3, 1, 3, 5, 1, 3, 2, 1, 1, 1,
6031 0, 2, 4, 2, 2, 1, 2, 0, 1, 6,
6032 8, 4, 6, 4, 2, 6, 2, 4, 6, 2,
6033 4, 2, 4, 1, 1, 1, 3, 4, 1, 4,
6034 1, 3, 1, 1, 0, 0, 0, 0, 7, 4,
6035 1, 3, 3, 3, 2, 4, 5, 5, 2, 4,
6036 4, 3, 3, 3, 2, 1, 4, 3, 3, 0,
6037 0, 0, 5, 0, 0, 0, 5, 1, 2, 3,
6038 4, 5, 1, 1, 0, 0, 0, 8, 1, 1,
6039 1, 3, 3, 1, 2, 3, 1, 1, 1, 1,
6040 3, 1, 3, 1, 1, 1, 1, 1, 4, 4,
6041 4, 3, 4, 4, 4, 3, 3, 3, 2, 0,
6042 4, 2, 0, 4, 1, 1, 2, 3, 5, 2,
6043 4, 1, 2, 3, 1, 3, 5, 2, 1, 1,
6044 3, 1, 3, 1, 2, 1, 1, 3, 2, 1,
6045 1, 3, 2, 1, 2, 1, 1, 1, 3, 3,
6046 2, 2, 1, 1, 1, 2, 2, 1, 1, 1,
6047 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
6048 4, 2, 3, 1, 6, 1, 1, 1, 1, 2,
6049 1, 2, 1, 1, 1, 1, 1, 1, 2, 3,
6050 3, 3, 4, 0, 3, 1, 2, 4, 0, 3,
6051 4, 4, 0, 3, 0, 3, 0, 2, 0, 2,
6052 0, 2, 1, 0, 3, 0, 0, 0, 0, 0,
6053 8, 1, 1, 1, 1, 1, 1, 2, 1, 1,
6054 1, 1, 3, 1, 2, 1, 1, 1, 1, 1,
6055 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6056 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6057 0, 4, 0, 1, 1, 3, 1, 0, 3, 4,
6058 2, 2, 1, 1, 2, 0, 6, 8, 4, 6,
6059 4, 6, 2, 4, 6, 2, 4, 2, 4, 1,
6060 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6061 3, 1, 3, 1, 2, 1, 2, 1, 1, 3,
6062 1, 3, 1, 1, 2, 2, 1, 3, 3, 1,
6063 3, 1, 3, 1, 1, 2, 1, 1, 1, 2,
6064 1, 2, 1, 1, 0, 4, 1, 2, 1, 3,
6065 3, 2, 1, 4, 2, 1, 1, 1, 1, 1,
6066 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
6067 1, 0, 1, 0, 1, 2, 2, 2, 0, 1,
6068 1, 1, 1, 1, 2, 0
6069};
6070
6071
6072enum { YYENOMEM = -2 };
6073
6074#define yyerrok (yyerrstatus = 0)
6075#define yyclearin (yychar = YYEMPTY)
6076
6077#define YYACCEPT goto yyacceptlab
6078#define YYABORT goto yyabortlab
6079#define YYERROR goto yyerrorlab
6080#define YYNOMEM goto yyexhaustedlab
6081
6082
6083#define YYRECOVERING() (!!yyerrstatus)
6084
6085#define YYBACKUP(Token, Value) \
6086 do \
6087 if (yychar == YYEMPTY) \
6088 { \
6089 yychar = (Token); \
6090 yylval = (Value); \
6091 YYPOPSTACK (yylen); \
6092 yystate = *yyssp; \
6093 goto yybackup; \
6094 } \
6095 else \
6096 { \
6097 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
6098 YYERROR; \
6099 } \
6100 while (0)
6101
6102/* Backward compatibility with an undocumented macro.
6103 Use YYerror or YYUNDEF. */
6104#define YYERRCODE YYUNDEF
6105
6106/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6107 If N is 0, then set CURRENT to the empty location which ends
6108 the previous symbol: RHS[0] (always defined). */
6109
6110#ifndef YYLLOC_DEFAULT
6111# define YYLLOC_DEFAULT(Current, Rhs, N) \
6112 do \
6113 if (N) \
6114 { \
6115 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
6116 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
6117 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
6118 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
6119 } \
6120 else \
6121 { \
6122 (Current).first_line = (Current).last_line = \
6123 YYRHSLOC (Rhs, 0).last_line; \
6124 (Current).first_column = (Current).last_column = \
6125 YYRHSLOC (Rhs, 0).last_column; \
6126 } \
6127 while (0)
6128#endif
6129
6130#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6131
6132
6133/* Enable debugging if requested. */
6134#if YYDEBUG
6135
6136# ifndef YYFPRINTF
6137# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6138# define YYFPRINTF fprintf
6139# endif
6140
6141# define YYDPRINTF(Args) \
6142do { \
6143 if (yydebug) \
6144 YYFPRINTF Args; \
6145} while (0)
6146
6147
6148/* YYLOCATION_PRINT -- Print the location on the stream.
6149 This macro was not mandated originally: define only if we know
6150 we won't break user code: when these are the locations we know. */
6151
6152# ifndef YYLOCATION_PRINT
6153
6154# if defined YY_LOCATION_PRINT
6155
6156 /* Temporary convenience wrapper in case some people defined the
6157 undocumented and private YY_LOCATION_PRINT macros. */
6158# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
6159
6160# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6161
6162/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
6163
6164YY_ATTRIBUTE_UNUSED
6165static int
6166yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
6167{
6168 int res = 0;
6169 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
6170 if (0 <= yylocp->first_line)
6171 {
6172 res += YYFPRINTF (p, "%d", yylocp->first_line);
6173 if (0 <= yylocp->first_column)
6174 res += YYFPRINTF (p, ".%d", yylocp->first_column);
6175 }
6176 if (0 <= yylocp->last_line)
6177 {
6178 if (yylocp->first_line < yylocp->last_line)
6179 {
6180 res += YYFPRINTF (p, "-%d", yylocp->last_line);
6181 if (0 <= end_col)
6182 res += YYFPRINTF (p, ".%d", end_col);
6183 }
6184 else if (0 <= end_col && yylocp->first_column < end_col)
6185 res += YYFPRINTF (p, "-%d", end_col);
6186 }
6187 return res;
6188}
6189
6190# define YYLOCATION_PRINT yy_location_print_
6191
6192 /* Temporary convenience wrapper in case some people defined the
6193 undocumented and private YY_LOCATION_PRINT macros. */
6194# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
6195
6196# else
6197
6198# define YYLOCATION_PRINT(File, Loc) ((void) 0)
6199 /* Temporary convenience wrapper in case some people defined the
6200 undocumented and private YY_LOCATION_PRINT macros. */
6201# define YY_LOCATION_PRINT YYLOCATION_PRINT
6202
6203# endif
6204# endif /* !defined YYLOCATION_PRINT */
6205
6206
6207# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
6208do { \
6209 if (yydebug) \
6210 { \
6211 YYFPRINTF (p, "%s ", Title); \
6212 yy_symbol_print (stderr, \
6213 Kind, Value, Location, p); \
6214 YYFPRINTF (p, "\n"); \
6215 } \
6216} while (0)
6217
6218
6219/*-----------------------------------.
6220| Print this symbol's value on YYO. |
6221`-----------------------------------*/
6222
6223static void
6224yy_symbol_value_print (FILE *yyo,
6225 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6226{
6227 FILE *yyoutput = yyo;
6228 YY_USE (yyoutput);
6229 YY_USE (yylocationp);
6230 YY_USE (p);
6231 if (!yyvaluep)
6232 return;
6233 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6234 switch (yykind)
6235 {
6236 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
6237#line 1090 "parse.y"
6238 {
6239#ifndef RIPPER
6240 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6241#else
6242 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6243#endif
6244}
6245#line 6244 "parse.c"
6246 break;
6247
6248 case YYSYMBOL_tFID: /* "method" */
6249#line 1090 "parse.y"
6250 {
6251#ifndef RIPPER
6252 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6253#else
6254 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6255#endif
6256}
6257#line 6256 "parse.c"
6258 break;
6259
6260 case YYSYMBOL_tGVAR: /* "global variable" */
6261#line 1090 "parse.y"
6262 {
6263#ifndef RIPPER
6264 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6265#else
6266 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6267#endif
6268}
6269#line 6268 "parse.c"
6270 break;
6271
6272 case YYSYMBOL_tIVAR: /* "instance variable" */
6273#line 1090 "parse.y"
6274 {
6275#ifndef RIPPER
6276 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6277#else
6278 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6279#endif
6280}
6281#line 6280 "parse.c"
6282 break;
6283
6284 case YYSYMBOL_tCONSTANT: /* "constant" */
6285#line 1090 "parse.y"
6286 {
6287#ifndef RIPPER
6288 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6289#else
6290 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6291#endif
6292}
6293#line 6292 "parse.c"
6294 break;
6295
6296 case YYSYMBOL_tCVAR: /* "class variable" */
6297#line 1090 "parse.y"
6298 {
6299#ifndef RIPPER
6300 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6301#else
6302 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6303#endif
6304}
6305#line 6304 "parse.c"
6306 break;
6307
6308 case YYSYMBOL_tLABEL: /* "label" */
6309#line 1090 "parse.y"
6310 {
6311#ifndef RIPPER
6312 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6313#else
6314 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6315#endif
6316}
6317#line 6316 "parse.c"
6318 break;
6319
6320 case YYSYMBOL_tINTEGER: /* "integer literal" */
6321#line 1097 "parse.y"
6322 {
6323#ifndef RIPPER
6324 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6325#else
6326 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6327#endif
6328}
6329#line 6328 "parse.c"
6330 break;
6331
6332 case YYSYMBOL_tFLOAT: /* "float literal" */
6333#line 1097 "parse.y"
6334 {
6335#ifndef RIPPER
6336 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6337#else
6338 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6339#endif
6340}
6341#line 6340 "parse.c"
6342 break;
6343
6344 case YYSYMBOL_tRATIONAL: /* "rational literal" */
6345#line 1097 "parse.y"
6346 {
6347#ifndef RIPPER
6348 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6349#else
6350 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6351#endif
6352}
6353#line 6352 "parse.c"
6354 break;
6355
6356 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
6357#line 1097 "parse.y"
6358 {
6359#ifndef RIPPER
6360 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6361#else
6362 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6363#endif
6364}
6365#line 6364 "parse.c"
6366 break;
6367
6368 case YYSYMBOL_tCHAR: /* "char literal" */
6369#line 1097 "parse.y"
6370 {
6371#ifndef RIPPER
6372 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6373#else
6374 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6375#endif
6376}
6377#line 6376 "parse.c"
6378 break;
6379
6380 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
6381#line 1104 "parse.y"
6382 {
6383#ifndef RIPPER
6384 rb_parser_printf(p, "$%ld", ((*yyvaluep).node)->nd_nth);
6385#else
6386 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6387#endif
6388}
6389#line 6388 "parse.c"
6390 break;
6391
6392 case YYSYMBOL_tBACK_REF: /* "back reference" */
6393#line 1111 "parse.y"
6394 {
6395#ifndef RIPPER
6396 rb_parser_printf(p, "$%c", (int)((*yyvaluep).node)->nd_nth);
6397#else
6398 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6399#endif
6400}
6401#line 6400 "parse.c"
6402 break;
6403
6404 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
6405#line 1097 "parse.y"
6406 {
6407#ifndef RIPPER
6408 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6409#else
6410 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6411#endif
6412}
6413#line 6412 "parse.c"
6414 break;
6415
6416 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
6417#line 1090 "parse.y"
6418 {
6419#ifndef RIPPER
6420 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6421#else
6422 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6423#endif
6424}
6425#line 6424 "parse.c"
6426 break;
6427
6428 default:
6429 break;
6430 }
6431 YY_IGNORE_MAYBE_UNINITIALIZED_END
6432}
6433
6434
6435/*---------------------------.
6436| Print this symbol on YYO. |
6437`---------------------------*/
6438
6439static void
6440yy_symbol_print (FILE *yyo,
6441 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6442{
6443 YYFPRINTF (p, "%s %s (",
6444 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
6445
6446 YYLOCATION_PRINT (yyo, yylocationp);
6447 YYFPRINTF (p, ": ");
6448 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
6449 YYFPRINTF (p, ")");
6450}
6451
6452/*------------------------------------------------------------------.
6453| yy_stack_print -- Print the state stack from its BOTTOM up to its |
6454| TOP (included). |
6455`------------------------------------------------------------------*/
6456
6457static void
6458ruby_parser_yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
6459#define yy_stack_print(b, t) ruby_parser_yy_stack_print(b, t, p)
6460{
6461 YYFPRINTF (p, "Stack now");
6462 for (; yybottom <= yytop; yybottom++)
6463 {
6464 int yybot = *yybottom;
6465 YYFPRINTF (p, " %d", yybot);
6466 }
6467 YYFPRINTF (p, "\n");
6468}
6469
6470# define YY_STACK_PRINT(Bottom, Top) \
6471do { \
6472 if (yydebug) \
6473 yy_stack_print ((Bottom), (Top)); \
6474} while (0)
6475
6476
6477/*------------------------------------------------.
6478| Report that the YYRULE is going to be reduced. |
6479`------------------------------------------------*/
6480
6481static void
6482yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
6483 int yyrule, struct parser_params *p)
6484{
6485 int yylno = yyrline[yyrule];
6486 int yynrhs = yyr2[yyrule];
6487 int yyi;
6488 YYFPRINTF (p, "Reducing stack by rule %d (line %d):\n",
6489 yyrule - 1, yylno);
6490 /* The symbols being reduced. */
6491 for (yyi = 0; yyi < yynrhs; yyi++)
6492 {
6493 YYFPRINTF (p, " $%d = ", yyi + 1);
6494 yy_symbol_print (stderr,
6495 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
6496 &yyvsp[(yyi + 1) - (yynrhs)],
6497 &(yylsp[(yyi + 1) - (yynrhs)]), p);
6498 YYFPRINTF (p, "\n");
6499 }
6500}
6501
6502# define YY_REDUCE_PRINT(Rule) \
6503do { \
6504 if (yydebug) \
6505 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
6506} while (0)
6507
6508/* Nonzero means print parse trace. It is left uninitialized so that
6509 multiple parsers can coexist. */
6510#ifndef yydebug
6511int yydebug;
6512#endif
6513#else /* !YYDEBUG */
6514# define YYDPRINTF(Args) ((void) 0)
6515# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
6516# define YY_STACK_PRINT(Bottom, Top)
6517# define YY_REDUCE_PRINT(Rule)
6518#endif /* !YYDEBUG */
6519
6520
6521/* YYINITDEPTH -- initial size of the parser's stacks. */
6522#ifndef YYINITDEPTH
6523# define YYINITDEPTH 200
6524#endif
6525
6526/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
6527 if the built-in stack extension method is used).
6528
6529 Do not make this value too large; the results are undefined if
6530 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
6531 evaluated with infinite-precision integer arithmetic. */
6532
6533#ifndef YYMAXDEPTH
6534# define YYMAXDEPTH 10000
6535#endif
6536
6537
6538/* Context of a parse error. */
6539typedef struct
6540{
6541 yy_state_t *yyssp;
6542 yysymbol_kind_t yytoken;
6543 YYLTYPE *yylloc;
6544} yypcontext_t;
6545
6546/* Put in YYARG at most YYARGN of the expected tokens given the
6547 current YYCTX, and return the number of tokens stored in YYARG. If
6548 YYARG is null, return the number of expected tokens (guaranteed to
6549 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
6550 Return 0 if there are more than YYARGN expected tokens, yet fill
6551 YYARG up to YYARGN. */
6552static int
6553yypcontext_expected_tokens (const yypcontext_t *yyctx,
6554 yysymbol_kind_t yyarg[], int yyargn)
6555{
6556 /* Actual size of YYARG. */
6557 int yycount = 0;
6558 int yyn = yypact[+*yyctx->yyssp];
6559 if (!yypact_value_is_default (yyn))
6560 {
6561 /* Start YYX at -YYN if negative to avoid negative indexes in
6562 YYCHECK. In other words, skip the first -YYN actions for
6563 this state because they are default actions. */
6564 int yyxbegin = yyn < 0 ? -yyn : 0;
6565 /* Stay within bounds of both yycheck and yytname. */
6566 int yychecklim = YYLAST - yyn + 1;
6567 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6568 int yyx;
6569 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6570 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
6571 && !yytable_value_is_error (yytable[yyx + yyn]))
6572 {
6573 if (!yyarg)
6574 ++yycount;
6575 else if (yycount == yyargn)
6576 return 0;
6577 else
6578 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
6579 }
6580 }
6581 if (yyarg && yycount == 0 && 0 < yyargn)
6582 yyarg[0] = YYSYMBOL_YYEMPTY;
6583 return yycount;
6584}
6585
6586
6587
6588
6589#ifndef yystrlen
6590# if defined __GLIBC__ && defined _STRING_H
6591# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
6592# else
6593/* Return the length of YYSTR. */
6594static YYPTRDIFF_T
6595yystrlen (const char *yystr)
6596{
6597 YYPTRDIFF_T yylen;
6598 for (yylen = 0; yystr[yylen]; yylen++)
6599 continue;
6600 return yylen;
6601}
6602# endif
6603#endif
6604
6605#ifndef yystpcpy
6606# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
6607# define yystpcpy stpcpy
6608# else
6609/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
6610 YYDEST. */
6611static char *
6612yystpcpy (char *yydest, const char *yysrc)
6613{
6614 char *yyd = yydest;
6615 const char *yys = yysrc;
6616
6617 while ((*yyd++ = *yys++) != '\0')
6618 continue;
6619
6620 return yyd - 1;
6621}
6622# endif
6623#endif
6624
6625#ifndef yytnamerr
6626/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
6627 quotes and backslashes, so that it's suitable for yyerror. The
6628 heuristic is that double-quoting is unnecessary unless the string
6629 contains an apostrophe, a comma, or backslash (other than
6630 backslash-backslash). YYSTR is taken from yytname. If YYRES is
6631 null, do not copy; instead, return the length of what the result
6632 would have been. */
6633static YYPTRDIFF_T
6634yytnamerr (char *yyres, const char *yystr)
6635{
6636 if (*yystr == '"')
6637 {
6638 YYPTRDIFF_T yyn = 0;
6639 char const *yyp = yystr;
6640 for (;;)
6641 switch (*++yyp)
6642 {
6643 case '\'':
6644 case ',':
6645 goto do_not_strip_quotes;
6646
6647 case '\\':
6648 if (*++yyp != '\\')
6649 goto do_not_strip_quotes;
6650 else
6651 goto append;
6652
6653 append:
6654 default:
6655 if (yyres)
6656 yyres[yyn] = *yyp;
6657 yyn++;
6658 break;
6659
6660 case '"':
6661 if (yyres)
6662 yyres[yyn] = '\0';
6663 return yyn;
6664 }
6665 do_not_strip_quotes: ;
6666 }
6667
6668 if (yyres)
6669 return yystpcpy (yyres, yystr) - yyres;
6670 else
6671 return yystrlen (yystr);
6672}
6673#endif
6674
6675
6676static int
6677yy_syntax_error_arguments (const yypcontext_t *yyctx,
6678 yysymbol_kind_t yyarg[], int yyargn)
6679{
6680 /* Actual size of YYARG. */
6681 int yycount = 0;
6682 /* There are many possibilities here to consider:
6683 - If this state is a consistent state with a default action, then
6684 the only way this function was invoked is if the default action
6685 is an error action. In that case, don't check for expected
6686 tokens because there are none.
6687 - The only way there can be no lookahead present (in yychar) is if
6688 this state is a consistent state with a default action. Thus,
6689 detecting the absence of a lookahead is sufficient to determine
6690 that there is no unexpected or expected token to report. In that
6691 case, just report a simple "syntax error".
6692 - Don't assume there isn't a lookahead just because this state is a
6693 consistent state with a default action. There might have been a
6694 previous inconsistent state, consistent state with a non-default
6695 action, or user semantic action that manipulated yychar.
6696 - Of course, the expected token list depends on states to have
6697 correct lookahead information, and it depends on the parser not
6698 to perform extra reductions after fetching a lookahead from the
6699 scanner and before detecting a syntax error. Thus, state merging
6700 (from LALR or IELR) and default reductions corrupt the expected
6701 token list. However, the list is correct for canonical LR with
6702 one exception: it will still contain any token that will not be
6703 accepted due to an error action in a later state.
6704 */
6705 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
6706 {
6707 int yyn;
6708 if (yyarg)
6709 yyarg[yycount] = yyctx->yytoken;
6710 ++yycount;
6711 yyn = yypcontext_expected_tokens (yyctx,
6712 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
6713 if (yyn == YYENOMEM)
6714 return YYENOMEM;
6715 else
6716 yycount += yyn;
6717 }
6718 return yycount;
6719}
6720
6721/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
6722 about the unexpected token YYTOKEN for the state stack whose top is
6723 YYSSP.
6724
6725 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
6726 not large enough to hold the message. In that case, also set
6727 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
6728 required number of bytes is too large to store. */
6729static int
6730yysyntax_error (struct parser_params *p, YYPTRDIFF_T *yymsg_alloc, char **yymsg,
6731 const yypcontext_t *yyctx)
6732{
6733 enum { YYARGS_MAX = 5 };
6734 /* Internationalized format string. */
6735 const char *yyformat = YY_NULLPTR;
6736 /* Arguments of yyformat: reported tokens (one for the "unexpected",
6737 one per "expected"). */
6738 yysymbol_kind_t yyarg[YYARGS_MAX];
6739 /* Cumulated lengths of YYARG. */
6740 YYPTRDIFF_T yysize = 0;
6741
6742 /* Actual size of YYARG. */
6743 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
6744 if (yycount == YYENOMEM)
6745 return YYENOMEM;
6746
6747 switch (yycount)
6748 {
6749#define YYCASE_(N, S) \
6750 case N: \
6751 yyformat = S; \
6752 break
6753 default: /* Avoid compiler warnings. */
6754 YYCASE_(0, YY_("syntax error"));
6755 YYCASE_(1, YY_("syntax error, unexpected %s"));
6756 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
6757 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
6758 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
6759 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
6760#undef YYCASE_
6761 }
6762
6763 /* Compute error message size. Don't count the "%s"s, but reserve
6764 room for the terminator. */
6765 yysize = yystrlen (yyformat) - 2 * yycount + 1;
6766 {
6767 int yyi;
6768 for (yyi = 0; yyi < yycount; ++yyi)
6769 {
6770 YYPTRDIFF_T yysize1
6771 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
6772 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
6773 yysize = yysize1;
6774 else
6775 return YYENOMEM;
6776 }
6777 }
6778
6779 if (*yymsg_alloc < yysize)
6780 {
6781 *yymsg_alloc = 2 * yysize;
6782 if (! (yysize <= *yymsg_alloc
6783 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
6784 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
6785 return -1;
6786 }
6787
6788 /* Avoid sprintf, as that infringes on the user's name space.
6789 Don't have undefined behavior even if the translation
6790 produced a string with the wrong number of "%s"s. */
6791 {
6792 char *yyp = *yymsg;
6793 int yyi = 0;
6794 while ((*yyp = *yyformat) != '\0')
6795 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
6796 {
6797 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
6798 yyformat += 2;
6799 }
6800 else
6801 {
6802 ++yyp;
6803 ++yyformat;
6804 }
6805 }
6806 return 0;
6807}
6808
6809
6810/*-----------------------------------------------.
6811| Release the memory associated to this symbol. |
6812`-----------------------------------------------*/
6813
6814static void
6815yydestruct (const char *yymsg,
6816 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
6817{
6818 YY_USE (yyvaluep);
6819 YY_USE (yylocationp);
6820 YY_USE (p);
6821 if (!yymsg)
6822 yymsg = "Deleting";
6823 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
6824
6825 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6826 YY_USE (yykind);
6827 YY_IGNORE_MAYBE_UNINITIALIZED_END
6828}
6829
6830
6831
6832
6833
6834
6835/*----------.
6836| yyparse. |
6837`----------*/
6838
6839int
6840yyparse (struct parser_params *p)
6841{
6842/* Lookahead token kind. */
6843int yychar;
6844
6845
6846/* The semantic value of the lookahead symbol. */
6847/* Default value used for initialization, for pacifying older GCCs
6848 or non-GCC compilers. */
6849YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
6850YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
6851
6852/* Location data for the lookahead symbol. */
6853static YYLTYPE yyloc_default
6854# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6855 = { 1, 1, 1, 1 }
6856# endif
6857;
6858YYLTYPE yylloc = yyloc_default;
6859
6860 /* Number of syntax errors so far. */
6861 int yynerrs = 0;
6862
6863 yy_state_fast_t yystate = 0;
6864 /* Number of tokens to shift before error messages enabled. */
6865 int yyerrstatus = 0;
6866
6867 /* Refer to the stacks through separate pointers, to allow yyoverflow
6868 to reallocate them elsewhere. */
6869
6870 /* Their size. */
6871 YYPTRDIFF_T yystacksize = YYINITDEPTH;
6872
6873 /* The state stack: array, bottom, top. */
6874 yy_state_t yyssa[YYINITDEPTH];
6875 yy_state_t *yyss = yyssa;
6876 yy_state_t *yyssp = yyss;
6877
6878 /* The semantic value stack: array, bottom, top. */
6879 YYSTYPE yyvsa[YYINITDEPTH];
6880 YYSTYPE *yyvs = yyvsa;
6881 YYSTYPE *yyvsp = yyvs;
6882
6883 /* The location stack: array, bottom, top. */
6884 YYLTYPE yylsa[YYINITDEPTH];
6885 YYLTYPE *yyls = yylsa;
6886 YYLTYPE *yylsp = yyls;
6887
6888 int yyn;
6889 /* The return value of yyparse. */
6890 int yyresult;
6891 /* Lookahead symbol kind. */
6892 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
6893 /* The variables used to return semantic value and location from the
6894 action routines. */
6895 YYSTYPE yyval;
6896 YYLTYPE yyloc;
6897
6898 /* The locations where the error started and ended. */
6899 YYLTYPE yyerror_range[3];
6900
6901 /* Buffer for error messages, and its allocated size. */
6902 char yymsgbuf[128];
6903 char *yymsg = yymsgbuf;
6904 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
6905
6906#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
6907
6908 /* The number of symbols on the RHS of the reduced rule.
6909 Keep to zero when no symbol should be popped. */
6910 int yylen = 0;
6911
6912 YYDPRINTF ((p, "Starting parse\n"));
6913
6914 yychar = YYEMPTY; /* Cause a token to be read. */
6915
6916
6917/* User initialization code. */
6918#line 1122 "parse.y"
6919{
6920 RUBY_SET_YYLLOC_OF_NONE(yylloc);
6921}
6922
6923#line 6919 "parse.c"
6924
6925 yylsp[0] = yylloc;
6926 goto yysetstate;
6927
6928
6929/*------------------------------------------------------------.
6930| yynewstate -- push a new state, which is found in yystate. |
6931`------------------------------------------------------------*/
6932yynewstate:
6933 /* In all cases, when you get here, the value and location stacks
6934 have just been pushed. So pushing a state here evens the stacks. */
6935 yyssp++;
6936
6937
6938/*--------------------------------------------------------------------.
6939| yysetstate -- set current state (the top of the stack) to yystate. |
6940`--------------------------------------------------------------------*/
6941yysetstate:
6942 YYDPRINTF ((p, "Entering state %d\n", yystate));
6943 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
6944 YY_IGNORE_USELESS_CAST_BEGIN
6945 *yyssp = YY_CAST (yy_state_t, yystate);
6946 YY_IGNORE_USELESS_CAST_END
6947 YY_STACK_PRINT (yyss, yyssp);
6948
6949 if (yyss + yystacksize - 1 <= yyssp)
6950#if !defined yyoverflow && !defined YYSTACK_RELOCATE
6951 YYNOMEM;
6952#else
6953 {
6954 /* Get the current used size of the three stacks, in elements. */
6955 YYPTRDIFF_T yysize = yyssp - yyss + 1;
6956
6957# if defined yyoverflow
6958 {
6959 /* Give user a chance to reallocate the stack. Use copies of
6960 these so that the &'s don't force the real ones into
6961 memory. */
6962 yy_state_t *yyss1 = yyss;
6963 YYSTYPE *yyvs1 = yyvs;
6964 YYLTYPE *yyls1 = yyls;
6965
6966 /* Each stack pointer address is followed by the size of the
6967 data in use in that stack, in bytes. This used to be a
6968 conditional around just the two extra args, but that might
6969 be undefined if yyoverflow is a macro. */
6970 yyoverflow (YY_("memory exhausted"),
6971 &yyss1, yysize * YYSIZEOF (*yyssp),
6972 &yyvs1, yysize * YYSIZEOF (*yyvsp),
6973 &yyls1, yysize * YYSIZEOF (*yylsp),
6974 &yystacksize);
6975 yyss = yyss1;
6976 yyvs = yyvs1;
6977 yyls = yyls1;
6978 }
6979# else /* defined YYSTACK_RELOCATE */
6980 /* Extend the stack our own way. */
6981 if (YYMAXDEPTH <= yystacksize)
6982 YYNOMEM;
6983 yystacksize *= 2;
6984 if (YYMAXDEPTH < yystacksize)
6985 yystacksize = YYMAXDEPTH;
6986
6987 {
6988 yy_state_t *yyss1 = yyss;
6989 union yyalloc *yyptr =
6990 YY_CAST (union yyalloc *,
6991 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
6992 if (! yyptr)
6993 YYNOMEM;
6994 YYSTACK_RELOCATE (yyss_alloc, yyss);
6995 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
6996 YYSTACK_RELOCATE (yyls_alloc, yyls);
6997# undef YYSTACK_RELOCATE
6998 if (yyss1 != yyssa)
6999 YYSTACK_FREE (yyss1);
7000 }
7001# endif
7002
7003 yyssp = yyss + yysize - 1;
7004 yyvsp = yyvs + yysize - 1;
7005 yylsp = yyls + yysize - 1;
7006
7007 YY_IGNORE_USELESS_CAST_BEGIN
7008 YYDPRINTF ((p, "Stack size increased to %ld\n",
7009 YY_CAST (long, yystacksize)));
7010 YY_IGNORE_USELESS_CAST_END
7011
7012 if (yyss + yystacksize - 1 <= yyssp)
7013 YYABORT;
7014 }
7015#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
7016
7017
7018 if (yystate == YYFINAL)
7019 YYACCEPT;
7020
7021 goto yybackup;
7022
7023
7024/*-----------.
7025| yybackup. |
7026`-----------*/
7027yybackup:
7028 /* Do appropriate processing given the current state. Read a
7029 lookahead token if we need one and don't already have one. */
7030
7031 /* First try to decide what to do without reference to lookahead token. */
7032 yyn = yypact[yystate];
7033 if (yypact_value_is_default (yyn))
7034 goto yydefault;
7035
7036 /* Not known => get a lookahead token if don't already have one. */
7037
7038 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
7039 if (yychar == YYEMPTY)
7040 {
7041 YYDPRINTF ((p, "Reading a token\n"));
7042 yychar = yylex (&yylval, &yylloc, p);
7043 }
7044
7045 if (yychar <= END_OF_INPUT)
7046 {
7047 yychar = END_OF_INPUT;
7048 yytoken = YYSYMBOL_YYEOF;
7049 YYDPRINTF ((p, "Now at end of input.\n"));
7050 }
7051 else if (yychar == YYerror)
7052 {
7053 /* The scanner already issued an error message, process directly
7054 to error recovery. But do not keep the error token as
7055 lookahead, it is too special and may lead us to an endless
7056 loop in error recovery. */
7057 yychar = YYUNDEF;
7058 yytoken = YYSYMBOL_YYerror;
7059 yyerror_range[1] = yylloc;
7060 goto yyerrlab1;
7061 }
7062 else
7063 {
7064 yytoken = YYTRANSLATE (yychar);
7065 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
7066 }
7067
7068 /* If the proper action on seeing token YYTOKEN is to reduce or to
7069 detect an error, take that action. */
7070 yyn += yytoken;
7071 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
7072 goto yydefault;
7073 yyn = yytable[yyn];
7074 if (yyn <= 0)
7075 {
7076 if (yytable_value_is_error (yyn))
7077 goto yyerrlab;
7078 yyn = -yyn;
7079 goto yyreduce;
7080 }
7081
7082 /* Count tokens shifted since error; after three, turn off error
7083 status. */
7084 if (yyerrstatus)
7085 yyerrstatus--;
7086
7087 /* Shift the lookahead token. */
7088 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
7089 yystate = yyn;
7090 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
7091 *++yyvsp = yylval;
7092 YY_IGNORE_MAYBE_UNINITIALIZED_END
7093 *++yylsp = yylloc;
7094
7095 /* Discard the shifted token. */
7096 yychar = YYEMPTY;
7097 goto yynewstate;
7098
7099
7100/*-----------------------------------------------------------.
7101| yydefault -- do the default action for the current state. |
7102`-----------------------------------------------------------*/
7103yydefault:
7104 yyn = yydefact[yystate];
7105 if (yyn == 0)
7106 goto yyerrlab;
7107 goto yyreduce;
7108
7109
7110/*-----------------------------.
7111| yyreduce -- do a reduction. |
7112`-----------------------------*/
7113yyreduce:
7114 /* yyn is the number of a rule to reduce with. */
7115 yylen = yyr2[yyn];
7116
7117 /* If YYLEN is nonzero, implement the default value of the action:
7118 '$$ = $1'.
7119
7120 Otherwise, the following line sets YYVAL to garbage.
7121 This behavior is undocumented and Bison
7122 users should not rely upon it. Assigning to YYVAL
7123 unconditionally makes the parser a bit smaller, and it avoids a
7124 GCC warning that YYVAL may be used uninitialized. */
7125 yyval = yyvsp[1-yylen];
7126
7127 /* Default location. */
7128 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
7129 yyerror_range[1] = yyloc;
7130 YY_REDUCE_PRINT (yyn);
7131 switch (yyn)
7132 {
7133 case 2: /* $@1: %empty */
7134#line 1327 "parse.y"
7135 {
7136 SET_LEX_STATE(EXPR_BEG);
7137 local_push(p, ifndef_ripper(1)+0);
7138 }
7139#line 7135 "parse.c"
7140 break;
7141
7142 case 3: /* program: $@1 top_compstmt */
7143#line 1332 "parse.y"
7144 {
7145 /*%%%*/
7146 if ((yyvsp[0].node) && !compile_for_eval) {
7147 NODE *node = (yyvsp[0].node);
7148 /* last expression should not be void */
7149 if (nd_type_p(node, NODE_BLOCK)) {
7150 while (node->nd_next) {
7151 node = node->nd_next;
7152 }
7153 node = node->nd_head;
7154 }
7155 node = remove_begin(node);
7156 void_expr(p, node);
7157 }
7158 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
7159 /*% %*/
7160 /*% ripper[final]: program!($2) %*/
7161 local_pop(p);
7162 }
7163#line 7159 "parse.c"
7164 break;
7165
7166 case 4: /* top_compstmt: top_stmts opt_terms */
7167#line 1354 "parse.y"
7168 {
7169 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
7170 }
7171#line 7167 "parse.c"
7172 break;
7173
7174 case 5: /* top_stmts: none */
7175#line 1360 "parse.y"
7176 {
7177 /*%%%*/
7178 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7179 /*% %*/
7180 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
7181 }
7182#line 7178 "parse.c"
7183 break;
7184
7185 case 6: /* top_stmts: top_stmt */
7186#line 1367 "parse.y"
7187 {
7188 /*%%%*/
7189 (yyval.node) = newline_node((yyvsp[0].node));
7190 /*% %*/
7191 /*% ripper: stmts_add!(stmts_new!, $1) %*/
7192 }
7193#line 7189 "parse.c"
7194 break;
7195
7196 case 7: /* top_stmts: top_stmts terms top_stmt */
7197#line 1374 "parse.y"
7198 {
7199 /*%%%*/
7200 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
7201 /*% %*/
7202 /*% ripper: stmts_add!($1, $3) %*/
7203 }
7204#line 7200 "parse.c"
7205 break;
7206
7207 case 8: /* top_stmts: error top_stmt */
7208#line 1381 "parse.y"
7209 {
7210 (yyval.node) = remove_begin((yyvsp[0].node));
7211 }
7212#line 7208 "parse.c"
7213 break;
7214
7215 case 10: /* top_stmt: "`BEGIN'" begin_block */
7216#line 1388 "parse.y"
7217 {
7218 (yyval.node) = (yyvsp[0].node);
7219 }
7220#line 7216 "parse.c"
7221 break;
7222
7223 case 11: /* begin_block: '{' top_compstmt '}' */
7224#line 1394 "parse.y"
7225 {
7226 /*%%%*/
7227 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
7228 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
7229 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7230 /*% %*/
7231 /*% ripper: BEGIN!($2) %*/
7232 }
7233#line 7229 "parse.c"
7234 break;
7235
7236 case 12: /* $@2: %empty */
7237#line 1406 "parse.y"
7238 {if (!(yyvsp[-1].node)) {yyerror1(&(yylsp[0]), "else without rescue is useless");}}
7239#line 7235 "parse.c"
7240 break;
7241
7242 case 13: /* bodystmt: compstmt opt_rescue k_else $@2 compstmt opt_ensure */
7243#line 1409 "parse.y"
7244 {
7245 /*%%%*/
7246 (yyval.node) = new_bodystmt(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
7247 /*% %*/
7248 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/
7249 }
7250#line 7246 "parse.c"
7251 break;
7252
7253 case 14: /* bodystmt: compstmt opt_rescue opt_ensure */
7254#line 1418 "parse.y"
7255 {
7256 /*%%%*/
7257 (yyval.node) = new_bodystmt(p, (yyvsp[-2].node), (yyvsp[-1].node), 0, (yyvsp[0].node), &(yyloc));
7258 /*% %*/
7259 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/
7260 }
7261#line 7257 "parse.c"
7262 break;
7263
7264 case 15: /* compstmt: stmts opt_terms */
7265#line 1427 "parse.y"
7266 {
7267 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
7268 }
7269#line 7265 "parse.c"
7270 break;
7271
7272 case 16: /* stmts: none */
7273#line 1433 "parse.y"
7274 {
7275 /*%%%*/
7276 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7277 /*% %*/
7278 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
7279 }
7280#line 7276 "parse.c"
7281 break;
7282
7283 case 17: /* stmts: stmt_or_begin */
7284#line 1440 "parse.y"
7285 {
7286 /*%%%*/
7287 (yyval.node) = newline_node((yyvsp[0].node));
7288 /*% %*/
7289 /*% ripper: stmts_add!(stmts_new!, $1) %*/
7290 }
7291#line 7287 "parse.c"
7292 break;
7293
7294 case 18: /* stmts: stmts terms stmt_or_begin */
7295#line 1447 "parse.y"
7296 {
7297 /*%%%*/
7298 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
7299 /*% %*/
7300 /*% ripper: stmts_add!($1, $3) %*/
7301 }
7302#line 7298 "parse.c"
7303 break;
7304
7305 case 19: /* stmts: error stmt */
7306#line 1454 "parse.y"
7307 {
7308 (yyval.node) = remove_begin((yyvsp[0].node));
7309 }
7310#line 7306 "parse.c"
7311 break;
7312
7313 case 20: /* stmt_or_begin: stmt */
7314#line 1460 "parse.y"
7315 {
7316 (yyval.node) = (yyvsp[0].node);
7317 }
7318#line 7314 "parse.c"
7319 break;
7320
7321 case 21: /* $@3: %empty */
7322#line 1464 "parse.y"
7323 {
7324 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
7325 }
7326#line 7322 "parse.c"
7327 break;
7328
7329 case 22: /* stmt_or_begin: "`BEGIN'" $@3 begin_block */
7330#line 1468 "parse.y"
7331 {
7332 (yyval.node) = (yyvsp[0].node);
7333 }
7334#line 7330 "parse.c"
7335 break;
7336
7337 case 23: /* $@4: %empty */
7338#line 1473 "parse.y"
7339 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
7340#line 7336 "parse.c"
7341 break;
7342
7343 case 24: /* stmt: "`alias'" fitem $@4 fitem */
7344#line 1474 "parse.y"
7345 {
7346 /*%%%*/
7347 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7348 /*% %*/
7349 /*% ripper: alias!($2, $4) %*/
7350 }
7351#line 7347 "parse.c"
7352 break;
7353
7354 case 25: /* stmt: "`alias'" "global variable" "global variable" */
7355#line 1481 "parse.y"
7356 {
7357 /*%%%*/
7358 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
7359 /*% %*/
7360 /*% ripper: var_alias!($2, $3) %*/
7361 }
7362#line 7358 "parse.c"
7363 break;
7364
7365 case 26: /* stmt: "`alias'" "global variable" "back reference" */
7366#line 1488 "parse.y"
7367 {
7368 /*%%%*/
7369 char buf[2];
7370 buf[0] = '$';
7371 buf[1] = (char)(yyvsp[0].node)->nd_nth;
7372 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
7373 /*% %*/
7374 /*% ripper: var_alias!($2, $3) %*/
7375 }
7376#line 7372 "parse.c"
7377 break;
7378
7379 case 27: /* stmt: "`alias'" "global variable" "numbered reference" */
7380#line 1498 "parse.y"
7381 {
7382 static const char mesg[] = "can't make alias for the number variables";
7383 /*%%%*/
7384 yyerror1(&(yylsp[0]), mesg);
7385 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7386 /*% %*/
7387 /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/
7388 }
7389#line 7385 "parse.c"
7390 break;
7391
7392 case 28: /* stmt: "`undef'" undef_list */
7393#line 1507 "parse.y"
7394 {
7395 /*%%%*/
7396 (yyval.node) = (yyvsp[0].node);
7397 /*% %*/
7398 /*% ripper: undef!($2) %*/
7399 }
7400#line 7396 "parse.c"
7401 break;
7402
7403 case 29: /* stmt: stmt "`if' modifier" expr_value */
7404#line 1514 "parse.y"
7405 {
7406 /*%%%*/
7407 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
7408 fixpos((yyval.node), (yyvsp[0].node));
7409 /*% %*/
7410 /*% ripper: if_mod!($3, $1) %*/
7411 }
7412#line 7408 "parse.c"
7413 break;
7414
7415 case 30: /* stmt: stmt "`unless' modifier" expr_value */
7416#line 1522 "parse.y"
7417 {
7418 /*%%%*/
7419 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
7420 fixpos((yyval.node), (yyvsp[0].node));
7421 /*% %*/
7422 /*% ripper: unless_mod!($3, $1) %*/
7423 }
7424#line 7420 "parse.c"
7425 break;
7426
7427 case 31: /* stmt: stmt "`while' modifier" expr_value */
7428#line 1530 "parse.y"
7429 {
7430 /*%%%*/
7431 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
7432 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
7433 }
7434 else {
7435 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
7436 }
7437 /*% %*/
7438 /*% ripper: while_mod!($3, $1) %*/
7439 }
7440#line 7436 "parse.c"
7441 break;
7442
7443 case 32: /* stmt: stmt "`until' modifier" expr_value */
7444#line 1542 "parse.y"
7445 {
7446 /*%%%*/
7447 if ((yyvsp[-2].node) && nd_type_p((yyvsp[-2].node), NODE_BEGIN)) {
7448 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
7449 }
7450 else {
7451 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
7452 }
7453 /*% %*/
7454 /*% ripper: until_mod!($3, $1) %*/
7455 }
7456#line 7452 "parse.c"
7457 break;
7458
7459 case 33: /* stmt: stmt "`rescue' modifier" stmt */
7460#line 1554 "parse.y"
7461 {
7462 /*%%%*/
7463 NODE *resq;
7464 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7465 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
7466 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-2].node)), resq, 0, &(yyloc));
7467 /*% %*/
7468 /*% ripper: rescue_mod!($1, $3) %*/
7469 }
7470#line 7466 "parse.c"
7471 break;
7472
7473 case 34: /* stmt: "`END'" '{' compstmt '}' */
7474#line 1564 "parse.y"
7475 {
7476 if (p->ctxt.in_def) {
7477 rb_warn0("END in method; use at_exit");
7478 }
7479 /*%%%*/
7480 {
7481 NODE *scope = NEW_NODE(
7482 NODE_SCOPE, 0 /* tbl */, (yyvsp[-1].node) /* body */, 0 /* args */, &(yyloc));
7483 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
7484 }
7485 /*% %*/
7486 /*% ripper: END!($3) %*/
7487 }
7488#line 7484 "parse.c"
7489 break;
7490
7491 case 36: /* stmt: mlhs '=' lex_ctxt command_call */
7492#line 1579 "parse.y"
7493 {
7494 /*%%%*/
7495 value_expr((yyvsp[0].node));
7496 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7497 /*% %*/
7498 /*% ripper: massign!($1, $4) %*/
7499 }
7500#line 7496 "parse.c"
7501 break;
7502
7503 case 37: /* stmt: lhs '=' lex_ctxt mrhs */
7504#line 1587 "parse.y"
7505 {
7506 /*%%%*/
7507 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7508 /*% %*/
7509 /*% ripper: assign!($1, $4) %*/
7510 }
7511#line 7507 "parse.c"
7512 break;
7513
7514 case 38: /* stmt: mlhs '=' lex_ctxt mrhs_arg "`rescue' modifier" stmt */
7515#line 1594 "parse.y"
7516 {
7517 /*%%%*/
7518 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7519 (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));
7520 /*% %*/
7521 /*% ripper: massign!($1, rescue_mod!($4, $6)) %*/
7522 }
7523#line 7519 "parse.c"
7524 break;
7525
7526 case 39: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
7527#line 1602 "parse.y"
7528 {
7529 /*%%%*/
7530 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7531 /*% %*/
7532 /*% ripper: massign!($1, $4) %*/
7533 }
7534#line 7530 "parse.c"
7535 break;
7536
7537 case 41: /* command_asgn: lhs '=' lex_ctxt command_rhs */
7538#line 1612 "parse.y"
7539 {
7540 /*%%%*/
7541 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7542 /*% %*/
7543 /*% ripper: assign!($1, $4) %*/
7544 }
7545#line 7541 "parse.c"
7546 break;
7547
7548 case 42: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
7549#line 1619 "parse.y"
7550 {
7551 /*%%%*/
7552 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7553 /*% %*/
7554 /*% ripper: opassign!($1, $2, $4) %*/
7555 }
7556#line 7552 "parse.c"
7557 break;
7558
7559 case 43: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
7560#line 1626 "parse.y"
7561 {
7562 /*%%%*/
7563 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
7564 /*% %*/
7565 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
7566
7567 }
7568#line 7564 "parse.c"
7569 break;
7570
7571 case 44: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
7572#line 1634 "parse.y"
7573 {
7574 /*%%%*/
7575 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
7576 /*% %*/
7577 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
7578 }
7579#line 7575 "parse.c"
7580 break;
7581
7582 case 45: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
7583#line 1641 "parse.y"
7584 {
7585 /*%%%*/
7586 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
7587 /*% %*/
7588 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
7589 }
7590#line 7586 "parse.c"
7591 break;
7592
7593 case 46: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
7594#line 1648 "parse.y"
7595 {
7596 /*%%%*/
7597 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
7598 (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));
7599 /*% %*/
7600 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
7601 }
7602#line 7598 "parse.c"
7603 break;
7604
7605 case 47: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
7606#line 1656 "parse.y"
7607 {
7608 /*%%%*/
7609 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
7610 /*% %*/
7611 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/
7612 }
7613#line 7609 "parse.c"
7614 break;
7615
7616 case 48: /* command_asgn: defn_head f_opt_paren_args '=' command */
7617#line 1663 "parse.y"
7618 {
7619 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
7620 restore_defun(p, (yyvsp[-3].node)->nd_defn);
7621 /*%%%*/
7622 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7623 /*% %*/
7624 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
7625 /*% ripper: def!(get_value($1), $2, $4) %*/
7626 local_pop(p);
7627 }
7628#line 7624 "parse.c"
7629 break;
7630
7631 case 49: /* command_asgn: defn_head f_opt_paren_args '=' command "`rescue' modifier" arg */
7632#line 1674 "parse.y"
7633 {
7634 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
7635 restore_defun(p, (yyvsp[-5].node)->nd_defn);
7636 /*%%%*/
7637 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
7638 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
7639 /*% %*/
7640 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
7641 /*% ripper: def!(get_value($1), $2, $4) %*/
7642 local_pop(p);
7643 }
7644#line 7640 "parse.c"
7645 break;
7646
7647 case 50: /* command_asgn: defs_head f_opt_paren_args '=' command */
7648#line 1686 "parse.y"
7649 {
7650 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
7651 restore_defun(p, (yyvsp[-3].node)->nd_defn);
7652 /*%%%*/
7653 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7654 /*%
7655 $1 = get_value($1);
7656 %*/
7657 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
7658 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
7659 local_pop(p);
7660 }
7661#line 7657 "parse.c"
7662 break;
7663
7664 case 51: /* command_asgn: defs_head f_opt_paren_args '=' command "`rescue' modifier" arg */
7665#line 1699 "parse.y"
7666 {
7667 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
7668 restore_defun(p, (yyvsp[-5].node)->nd_defn);
7669 /*%%%*/
7670 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
7671 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
7672 /*%
7673 $1 = get_value($1);
7674 %*/
7675 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
7676 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
7677 local_pop(p);
7678 }
7679#line 7675 "parse.c"
7680 break;
7681
7682 case 52: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
7683#line 1713 "parse.y"
7684 {
7685 /*%%%*/
7686 rb_backref_error(p, (yyvsp[-3].node));
7687 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7688 /*% %*/
7689 /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/
7690 }
7691#line 7687 "parse.c"
7692 break;
7693
7694 case 53: /* command_rhs: command_call */
7695#line 1723 "parse.y"
7696 {
7697 value_expr((yyvsp[0].node));
7698 (yyval.node) = (yyvsp[0].node);
7699 }
7700#line 7696 "parse.c"
7701 break;
7702
7703 case 54: /* command_rhs: command_call "`rescue' modifier" stmt */
7704#line 1728 "parse.y"
7705 {
7706 /*%%%*/
7707 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7708 value_expr((yyvsp[-2].node));
7709 (yyval.node) = NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
7710 /*% %*/
7711 /*% ripper: rescue_mod!($1, $3) %*/
7712 }
7713#line 7709 "parse.c"
7714 break;
7715
7716 case 57: /* expr: expr "`and'" expr */
7717#line 1741 "parse.y"
7718 {
7719 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7720 }
7721#line 7717 "parse.c"
7722 break;
7723
7724 case 58: /* expr: expr "`or'" expr */
7725#line 1745 "parse.y"
7726 {
7727 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7728 }
7729#line 7725 "parse.c"
7730 break;
7731
7732 case 59: /* expr: "`not'" opt_nl expr */
7733#line 1749 "parse.y"
7734 {
7735 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
7736 }
7737#line 7733 "parse.c"
7738 break;
7739
7740 case 60: /* expr: '!' command_call */
7741#line 1753 "parse.y"
7742 {
7743 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
7744 }
7745#line 7741 "parse.c"
7746 break;
7747
7748 case 61: /* @5: %empty */
7749#line 1757 "parse.y"
7750 {
7751 value_expr((yyvsp[-1].node));
7752 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
7753 p->command_start = FALSE;
7754 (yyvsp[0].ctxt) = p->ctxt;
7755 p->ctxt.in_kwarg = 1;
7756 (yyval.tbl) = push_pvtbl(p);
7757 }
7758#line 7754 "parse.c"
7759 break;
7760
7761 case 62: /* @6: %empty */
7762#line 1765 "parse.y"
7763 {
7764 (yyval.tbl) = push_pktbl(p);
7765 }
7766#line 7762 "parse.c"
7767 break;
7768
7769 case 63: /* expr: arg "=>" @5 @6 p_top_expr_body */
7770#line 1769 "parse.y"
7771 {
7772 pop_pktbl(p, (yyvsp[-1].tbl));
7773 pop_pvtbl(p, (yyvsp[-2].tbl));
7774 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
7775 /*%%%*/
7776 (yyval.node) = NEW_CASE3((yyvsp[-4].node), NEW_IN((yyvsp[0].node), 0, 0, &(yylsp[0])), &(yyloc));
7777 /*% %*/
7778 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
7779 }
7780#line 7776 "parse.c"
7781 break;
7782
7783 case 64: /* @7: %empty */
7784#line 1779 "parse.y"
7785 {
7786 value_expr((yyvsp[-1].node));
7787 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
7788 p->command_start = FALSE;
7789 (yyvsp[0].ctxt) = p->ctxt;
7790 p->ctxt.in_kwarg = 1;
7791 (yyval.tbl) = push_pvtbl(p);
7792 }
7793#line 7789 "parse.c"
7794 break;
7795
7796 case 65: /* @8: %empty */
7797#line 1787 "parse.y"
7798 {
7799 (yyval.tbl) = push_pktbl(p);
7800 }
7801#line 7797 "parse.c"
7802 break;
7803
7804 case 66: /* expr: arg "`in'" @7 @8 p_top_expr_body */
7805#line 1791 "parse.y"
7806 {
7807 pop_pktbl(p, (yyvsp[-1].tbl));
7808 pop_pvtbl(p, (yyvsp[-2].tbl));
7809 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
7810 /*%%%*/
7811 (yyval.node) = NEW_CASE3((yyvsp[-4].node), NEW_IN((yyvsp[0].node), NEW_TRUE(&(yylsp[0])), NEW_FALSE(&(yylsp[0])), &(yylsp[0])), &(yyloc));
7812 /*% %*/
7813 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
7814 }
7815#line 7811 "parse.c"
7816 break;
7817
7818 case 68: /* def_name: fname */
7819#line 1804 "parse.y"
7820 {
7821 ID fname = get_id((yyvsp[0].id));
7822 ID cur_arg = p->cur_arg;
7823 YYSTYPE c = {.ctxt = p->ctxt};
7824 numparam_name(p, fname);
7825 local_push(p, 0);
7826 p->cur_arg = 0;
7827 p->ctxt.in_def = 1;
7828 (yyval.node) = NEW_NODE(NODE_SELF, /*vid*/cur_arg, /*mid*/fname, /*cval*/c.val, &(yyloc));
7829 /*%%%*/
7830 /*%
7831 $$ = NEW_RIPPER(fname, get_value($1), $$, &NULL_LOC);
7832 %*/
7833 }
7834#line 7830 "parse.c"
7835 break;
7836
7837 case 69: /* defn_head: k_def def_name */
7838#line 1821 "parse.y"
7839 {
7840 (yyval.node) = (yyvsp[0].node);
7841 /*%%%*/
7842 (yyval.node) = NEW_NODE(NODE_DEFN, 0, (yyval.node)->nd_mid, (yyval.node), &(yyloc));
7843 /*% %*/
7844 }
7845#line 7841 "parse.c"
7846 break;
7847
7848 case 70: /* $@9: %empty */
7849#line 1830 "parse.y"
7850 {
7851 SET_LEX_STATE(EXPR_FNAME);
7852 p->ctxt.in_argdef = 1;
7853 }
7854#line 7850 "parse.c"
7855 break;
7856
7857 case 71: /* defs_head: k_def singleton dot_or_colon $@9 def_name */
7858#line 1835 "parse.y"
7859 {
7860 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
7861 (yyval.node) = (yyvsp[0].node);
7862 /*%%%*/
7863 (yyval.node) = NEW_NODE(NODE_DEFS, (yyvsp[-3].node), (yyval.node)->nd_mid, (yyval.node), &(yyloc));
7864 /*%
7865 VALUE ary = rb_ary_new_from_args(3, $2, $3, get_value($$));
7866 add_mark_object(p, ary);
7867 $<node>$->nd_rval = ary;
7868 %*/
7869 }
7870#line 7866 "parse.c"
7871 break;
7872
7873 case 72: /* expr_value: expr */
7874#line 1849 "parse.y"
7875 {
7876 value_expr((yyvsp[0].node));
7877 (yyval.node) = (yyvsp[0].node);
7878 }
7879#line 7875 "parse.c"
7880 break;
7881
7882 case 73: /* $@10: %empty */
7883#line 1855 "parse.y"
7884 {COND_PUSH(1);}
7885#line 7881 "parse.c"
7886 break;
7887
7888 case 74: /* $@11: %empty */
7889#line 1855 "parse.y"
7890 {COND_POP();}
7891#line 7887 "parse.c"
7892 break;
7893
7894 case 75: /* expr_value_do: $@10 expr_value do $@11 */
7895#line 1856 "parse.y"
7896 {
7897 (yyval.node) = (yyvsp[-2].node);
7898 }
7899#line 7895 "parse.c"
7900 break;
7901
7902 case 79: /* block_command: block_call call_op2 operation2 command_args */
7903#line 1867 "parse.y"
7904 {
7905 /*%%%*/
7906 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7907 /*% %*/
7908 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
7909 }
7910#line 7906 "parse.c"
7911 break;
7912
7913 case 80: /* cmd_brace_block: "{ arg" brace_body '}' */
7914#line 1876 "parse.y"
7915 {
7916 (yyval.node) = (yyvsp[-1].node);
7917 /*%%%*/
7918 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
7919 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
7920 /*% %*/
7921 }
7922#line 7918 "parse.c"
7923 break;
7924
7925 case 81: /* fcall: operation */
7926#line 1886 "parse.y"
7927 {
7928 /*%%%*/
7929 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
7930 nd_set_line((yyval.node), p->tokline);
7931 /*% %*/
7932 /*% ripper: $1 %*/
7933 }
7934#line 7930 "parse.c"
7935 break;
7936
7937 case 82: /* command: fcall command_args */
7938#line 1896 "parse.y"
7939 {
7940 /*%%%*/
7941 (yyvsp[-1].node)->nd_args = (yyvsp[0].node);
7942 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
7943 (yyval.node) = (yyvsp[-1].node);
7944 /*% %*/
7945 /*% ripper: command!($1, $2) %*/
7946 }
7947#line 7943 "parse.c"
7948 break;
7949
7950 case 83: /* command: fcall command_args cmd_brace_block */
7951#line 1905 "parse.y"
7952 {
7953 /*%%%*/
7954 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
7955 (yyvsp[-2].node)->nd_args = (yyvsp[-1].node);
7956 (yyval.node) = method_add_block(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7957 fixpos((yyval.node), (yyvsp[-2].node));
7958 nd_set_last_loc((yyvsp[-2].node), (yylsp[-1]).end_pos);
7959 /*% %*/
7960 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
7961 }
7962#line 7958 "parse.c"
7963 break;
7964
7965 case 84: /* command: primary_value call_op operation2 command_args */
7966#line 1916 "parse.y"
7967 {
7968 /*%%%*/
7969 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
7970 /*% %*/
7971 /*% ripper: command_call!($1, $2, $3, $4) %*/
7972 }
7973#line 7969 "parse.c"
7974 break;
7975
7976 case 85: /* command: primary_value call_op operation2 command_args cmd_brace_block */
7977#line 1923 "parse.y"
7978 {
7979 /*%%%*/
7980 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
7981 /*% %*/
7982 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
7983 }
7984#line 7980 "parse.c"
7985 break;
7986
7987 case 86: /* command: primary_value "::" operation2 command_args */
7988#line 1930 "parse.y"
7989 {
7990 /*%%%*/
7991 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
7992 /*% %*/
7993 /*% ripper: command_call!($1, ID2VAL(idCOLON2), $3, $4) %*/
7994 }
7995#line 7991 "parse.c"
7996 break;
7997
7998 case 87: /* command: primary_value "::" operation2 command_args cmd_brace_block */
7999#line 1937 "parse.y"
8000 {
8001 /*%%%*/
8002 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
8003 /*% %*/
8004 /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/
8005 }
8006#line 8002 "parse.c"
8007 break;
8008
8009 case 88: /* command: "`super'" command_args */
8010#line 1944 "parse.y"
8011 {
8012 /*%%%*/
8013 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
8014 fixpos((yyval.node), (yyvsp[0].node));
8015 /*% %*/
8016 /*% ripper: super!($2) %*/
8017 }
8018#line 8014 "parse.c"
8019 break;
8020
8021 case 89: /* command: "`yield'" command_args */
8022#line 1952 "parse.y"
8023 {
8024 /*%%%*/
8025 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
8026 fixpos((yyval.node), (yyvsp[0].node));
8027 /*% %*/
8028 /*% ripper: yield!($2) %*/
8029 }
8030#line 8026 "parse.c"
8031 break;
8032
8033 case 90: /* command: k_return call_args */
8034#line 1960 "parse.y"
8035 {
8036 /*%%%*/
8037 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
8038 /*% %*/
8039 /*% ripper: return!($2) %*/
8040 }
8041#line 8037 "parse.c"
8042 break;
8043
8044 case 91: /* command: "`break'" call_args */
8045#line 1967 "parse.y"
8046 {
8047 /*%%%*/
8048 (yyval.node) = NEW_BREAK(ret_args(p, (yyvsp[0].node)), &(yyloc));
8049 /*% %*/
8050 /*% ripper: break!($2) %*/
8051 }
8052#line 8048 "parse.c"
8053 break;
8054
8055 case 92: /* command: "`next'" call_args */
8056#line 1974 "parse.y"
8057 {
8058 /*%%%*/
8059 (yyval.node) = NEW_NEXT(ret_args(p, (yyvsp[0].node)), &(yyloc));
8060 /*% %*/
8061 /*% ripper: next!($2) %*/
8062 }
8063#line 8059 "parse.c"
8064 break;
8065
8066 case 94: /* mlhs: "(" mlhs_inner rparen */
8067#line 1984 "parse.y"
8068 {
8069 /*%%%*/
8070 (yyval.node) = (yyvsp[-1].node);
8071 /*% %*/
8072 /*% ripper: mlhs_paren!($2) %*/
8073 }
8074#line 8070 "parse.c"
8075 break;
8076
8077 case 96: /* mlhs_inner: "(" mlhs_inner rparen */
8078#line 1994 "parse.y"
8079 {
8080 /*%%%*/
8081 (yyval.node) = NEW_MASGN(NEW_LIST((yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
8082 /*% %*/
8083 /*% ripper: mlhs_paren!($2) %*/
8084 }
8085#line 8081 "parse.c"
8086 break;
8087
8088 case 97: /* mlhs_basic: mlhs_head */
8089#line 2003 "parse.y"
8090 {
8091 /*%%%*/
8092 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
8093 /*% %*/
8094 /*% ripper: $1 %*/
8095 }
8096#line 8092 "parse.c"
8097 break;
8098
8099 case 98: /* mlhs_basic: mlhs_head mlhs_item */
8100#line 2010 "parse.y"
8101 {
8102 /*%%%*/
8103 (yyval.node) = NEW_MASGN(list_append(p, (yyvsp[-1].node),(yyvsp[0].node)), 0, &(yyloc));
8104 /*% %*/
8105 /*% ripper: mlhs_add!($1, $2) %*/
8106 }
8107#line 8103 "parse.c"
8108 break;
8109
8110 case 99: /* mlhs_basic: mlhs_head "*" mlhs_node */
8111#line 2017 "parse.y"
8112 {
8113 /*%%%*/
8114 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8115 /*% %*/
8116 /*% ripper: mlhs_add_star!($1, $3) %*/
8117 }
8118#line 8114 "parse.c"
8119 break;
8120
8121 case 100: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
8122#line 2024 "parse.y"
8123 {
8124 /*%%%*/
8125 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
8126 /*% %*/
8127 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
8128 }
8129#line 8125 "parse.c"
8130 break;
8131
8132 case 101: /* mlhs_basic: mlhs_head "*" */
8133#line 2031 "parse.y"
8134 {
8135 /*%%%*/
8136 (yyval.node) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
8137 /*% %*/
8138 /*% ripper: mlhs_add_star!($1, Qnil) %*/
8139 }
8140#line 8136 "parse.c"
8141 break;
8142
8143 case 102: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
8144#line 2038 "parse.y"
8145 {
8146 /*%%%*/
8147 (yyval.node) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
8148 /*% %*/
8149 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
8150 }
8151#line 8147 "parse.c"
8152 break;
8153
8154 case 103: /* mlhs_basic: "*" mlhs_node */
8155#line 2045 "parse.y"
8156 {
8157 /*%%%*/
8158 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
8159 /*% %*/
8160 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
8161 }
8162#line 8158 "parse.c"
8163 break;
8164
8165 case 104: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
8166#line 2052 "parse.y"
8167 {
8168 /*%%%*/
8169 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
8170 /*% %*/
8171 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
8172 }
8173#line 8169 "parse.c"
8174 break;
8175
8176 case 105: /* mlhs_basic: "*" */
8177#line 2059 "parse.y"
8178 {
8179 /*%%%*/
8180 (yyval.node) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
8181 /*% %*/
8182 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
8183 }
8184#line 8180 "parse.c"
8185 break;
8186
8187 case 106: /* mlhs_basic: "*" ',' mlhs_post */
8188#line 2066 "parse.y"
8189 {
8190 /*%%%*/
8191 (yyval.node) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
8192 /*% %*/
8193 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
8194 }
8195#line 8191 "parse.c"
8196 break;
8197
8198 case 108: /* mlhs_item: "(" mlhs_inner rparen */
8199#line 2076 "parse.y"
8200 {
8201 /*%%%*/
8202 (yyval.node) = (yyvsp[-1].node);
8203 /*% %*/
8204 /*% ripper: mlhs_paren!($2) %*/
8205 }
8206#line 8202 "parse.c"
8207 break;
8208
8209 case 109: /* mlhs_head: mlhs_item ',' */
8210#line 2085 "parse.y"
8211 {
8212 /*%%%*/
8213 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
8214 /*% %*/
8215 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
8216 }
8217#line 8213 "parse.c"
8218 break;
8219
8220 case 110: /* mlhs_head: mlhs_head mlhs_item ',' */
8221#line 2092 "parse.y"
8222 {
8223 /*%%%*/
8224 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
8225 /*% %*/
8226 /*% ripper: mlhs_add!($1, $2) %*/
8227 }
8228#line 8224 "parse.c"
8229 break;
8230
8231 case 111: /* mlhs_post: mlhs_item */
8232#line 2101 "parse.y"
8233 {
8234 /*%%%*/
8235 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
8236 /*% %*/
8237 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
8238 }
8239#line 8235 "parse.c"
8240 break;
8241
8242 case 112: /* mlhs_post: mlhs_post ',' mlhs_item */
8243#line 2108 "parse.y"
8244 {
8245 /*%%%*/
8246 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
8247 /*% %*/
8248 /*% ripper: mlhs_add!($1, $3) %*/
8249 }
8250#line 8246 "parse.c"
8251 break;
8252
8253 case 113: /* mlhs_node: user_variable */
8254#line 2117 "parse.y"
8255 {
8256 /*%%%*/
8257 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8258 /*% %*/
8259 /*% ripper: assignable(p, var_field(p, $1)) %*/
8260 }
8261#line 8257 "parse.c"
8262 break;
8263
8264 case 114: /* mlhs_node: keyword_variable */
8265#line 2124 "parse.y"
8266 {
8267 /*%%%*/
8268 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8269 /*% %*/
8270 /*% ripper: assignable(p, var_field(p, $1)) %*/
8271 }
8272#line 8268 "parse.c"
8273 break;
8274
8275 case 115: /* mlhs_node: primary_value '[' opt_call_args rbracket */
8276#line 2131 "parse.y"
8277 {
8278 /*%%%*/
8279 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
8280 /*% %*/
8281 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
8282 }
8283#line 8279 "parse.c"
8284 break;
8285
8286 case 116: /* mlhs_node: primary_value call_op "local variable or method" */
8287#line 2138 "parse.y"
8288 {
8289 if ((yyvsp[-1].id) == tANDDOT) {
8290 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
8291 }
8292 /*%%%*/
8293 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8294 /*% %*/
8295 /*% ripper: field!($1, $2, $3) %*/
8296 }
8297#line 8293 "parse.c"
8298 break;
8299
8300 case 117: /* mlhs_node: primary_value "::" "local variable or method" */
8301#line 2148 "parse.y"
8302 {
8303 /*%%%*/
8304 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
8305 /*% %*/
8306 /*% ripper: const_path_field!($1, $3) %*/
8307 }
8308#line 8304 "parse.c"
8309 break;
8310
8311 case 118: /* mlhs_node: primary_value call_op "constant" */
8312#line 2155 "parse.y"
8313 {
8314 if ((yyvsp[-1].id) == tANDDOT) {
8315 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
8316 }
8317 /*%%%*/
8318 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8319 /*% %*/
8320 /*% ripper: field!($1, $2, $3) %*/
8321 }
8322#line 8318 "parse.c"
8323 break;
8324
8325 case 119: /* mlhs_node: primary_value "::" "constant" */
8326#line 2165 "parse.y"
8327 {
8328 /*%%%*/
8329 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
8330 /*% %*/
8331 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
8332 }
8333#line 8329 "parse.c"
8334 break;
8335
8336 case 120: /* mlhs_node: ":: at EXPR_BEG" "constant" */
8337#line 2172 "parse.y"
8338 {
8339 /*%%%*/
8340 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
8341 /*% %*/
8342 /*% ripper: const_decl(p, top_const_field!($2)) %*/
8343 }
8344#line 8340 "parse.c"
8345 break;
8346
8347 case 121: /* mlhs_node: backref */
8348#line 2179 "parse.y"
8349 {
8350 /*%%%*/
8351 rb_backref_error(p, (yyvsp[0].node));
8352 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8353 /*% %*/
8354 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
8355 }
8356#line 8352 "parse.c"
8357 break;
8358
8359 case 122: /* lhs: user_variable */
8360#line 2189 "parse.y"
8361 {
8362 /*%%%*/
8363 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8364 /*% %*/
8365 /*% ripper: assignable(p, var_field(p, $1)) %*/
8366 }
8367#line 8363 "parse.c"
8368 break;
8369
8370 case 123: /* lhs: keyword_variable */
8371#line 2196 "parse.y"
8372 {
8373 /*%%%*/
8374 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8375 /*% %*/
8376 /*% ripper: assignable(p, var_field(p, $1)) %*/
8377 }
8378#line 8374 "parse.c"
8379 break;
8380
8381 case 124: /* lhs: primary_value '[' opt_call_args rbracket */
8382#line 2203 "parse.y"
8383 {
8384 /*%%%*/
8385 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
8386 /*% %*/
8387 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
8388 }
8389#line 8385 "parse.c"
8390 break;
8391
8392 case 125: /* lhs: primary_value call_op "local variable or method" */
8393#line 2210 "parse.y"
8394 {
8395 /*%%%*/
8396 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8397 /*% %*/
8398 /*% ripper: field!($1, $2, $3) %*/
8399 }
8400#line 8396 "parse.c"
8401 break;
8402
8403 case 126: /* lhs: primary_value "::" "local variable or method" */
8404#line 2217 "parse.y"
8405 {
8406 /*%%%*/
8407 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
8408 /*% %*/
8409 /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/
8410 }
8411#line 8407 "parse.c"
8412 break;
8413
8414 case 127: /* lhs: primary_value call_op "constant" */
8415#line 2224 "parse.y"
8416 {
8417 /*%%%*/
8418 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8419 /*% %*/
8420 /*% ripper: field!($1, $2, $3) %*/
8421 }
8422#line 8418 "parse.c"
8423 break;
8424
8425 case 128: /* lhs: primary_value "::" "constant" */
8426#line 2231 "parse.y"
8427 {
8428 /*%%%*/
8429 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
8430 /*% %*/
8431 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
8432 }
8433#line 8429 "parse.c"
8434 break;
8435
8436 case 129: /* lhs: ":: at EXPR_BEG" "constant" */
8437#line 2238 "parse.y"
8438 {
8439 /*%%%*/
8440 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
8441 /*% %*/
8442 /*% ripper: const_decl(p, top_const_field!($2)) %*/
8443 }
8444#line 8440 "parse.c"
8445 break;
8446
8447 case 130: /* lhs: backref */
8448#line 2245 "parse.y"
8449 {
8450 /*%%%*/
8451 rb_backref_error(p, (yyvsp[0].node));
8452 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8453 /*% %*/
8454 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
8455 }
8456#line 8452 "parse.c"
8457 break;
8458
8459 case 131: /* cname: "local variable or method" */
8460#line 2255 "parse.y"
8461 {
8462 static const char mesg[] = "class/module name must be CONSTANT";
8463 /*%%%*/
8464 yyerror1(&(yylsp[0]), mesg);
8465 /*% %*/
8466 /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/
8467 }
8468#line 8464 "parse.c"
8469 break;
8470
8471 case 133: /* cpath: ":: at EXPR_BEG" cname */
8472#line 2266 "parse.y"
8473 {
8474 /*%%%*/
8475 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
8476 /*% %*/
8477 /*% ripper: top_const_ref!($2) %*/
8478 }
8479#line 8475 "parse.c"
8480 break;
8481
8482 case 134: /* cpath: cname */
8483#line 2273 "parse.y"
8484 {
8485 /*%%%*/
8486 (yyval.node) = NEW_COLON2(0, (yyval.node), &(yyloc));
8487 /*% %*/
8488 /*% ripper: const_ref!($1) %*/
8489 }
8490#line 8486 "parse.c"
8491 break;
8492
8493 case 135: /* cpath: primary_value "::" cname */
8494#line 2280 "parse.y"
8495 {
8496 /*%%%*/
8497 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
8498 /*% %*/
8499 /*% ripper: const_path_ref!($1, $3) %*/
8500 }
8501#line 8497 "parse.c"
8502 break;
8503
8504 case 139: /* fname: op */
8505#line 2292 "parse.y"
8506 {
8507 SET_LEX_STATE(EXPR_ENDFN);
8508 (yyval.id) = (yyvsp[0].id);
8509 }
8510#line 8506 "parse.c"
8511 break;
8512
8513 case 141: /* fitem: fname */
8514#line 2300 "parse.y"
8515 {
8516 /*%%%*/
8517 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
8518 /*% %*/
8519 /*% ripper: symbol_literal!($1) %*/
8520 }
8521#line 8517 "parse.c"
8522 break;
8523
8524 case 143: /* undef_list: fitem */
8525#line 2310 "parse.y"
8526 {
8527 /*%%%*/
8528 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
8529 /*% %*/
8530 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
8531 }
8532#line 8528 "parse.c"
8533 break;
8534
8535 case 144: /* $@12: %empty */
8536#line 2316 "parse.y"
8537 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
8538#line 8534 "parse.c"
8539 break;
8540
8541 case 145: /* undef_list: undef_list ',' $@12 fitem */
8542#line 2317 "parse.y"
8543 {
8544 /*%%%*/
8545 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
8546 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
8547 /*% %*/
8548 /*% ripper: rb_ary_push($1, get_value($4)) %*/
8549 }
8550#line 8546 "parse.c"
8551 break;
8552
8553 case 146: /* op: '|' */
8554#line 2326 "parse.y"
8555 { ifndef_ripper((yyval.id) = '|'); }
8556#line 8552 "parse.c"
8557 break;
8558
8559 case 147: /* op: '^' */
8560#line 2327 "parse.y"
8561 { ifndef_ripper((yyval.id) = '^'); }
8562#line 8558 "parse.c"
8563 break;
8564
8565 case 148: /* op: '&' */
8566#line 2328 "parse.y"
8567 { ifndef_ripper((yyval.id) = '&'); }
8568#line 8564 "parse.c"
8569 break;
8570
8571 case 149: /* op: "<=>" */
8572#line 2329 "parse.y"
8573 { ifndef_ripper((yyval.id) = tCMP); }
8574#line 8570 "parse.c"
8575 break;
8576
8577 case 150: /* op: "==" */
8578#line 2330 "parse.y"
8579 { ifndef_ripper((yyval.id) = tEQ); }
8580#line 8576 "parse.c"
8581 break;
8582
8583 case 151: /* op: "===" */
8584#line 2331 "parse.y"
8585 { ifndef_ripper((yyval.id) = tEQQ); }
8586#line 8582 "parse.c"
8587 break;
8588
8589 case 152: /* op: "=~" */
8590#line 2332 "parse.y"
8591 { ifndef_ripper((yyval.id) = tMATCH); }
8592#line 8588 "parse.c"
8593 break;
8594
8595 case 153: /* op: "!~" */
8596#line 2333 "parse.y"
8597 { ifndef_ripper((yyval.id) = tNMATCH); }
8598#line 8594 "parse.c"
8599 break;
8600
8601 case 154: /* op: '>' */
8602#line 2334 "parse.y"
8603 { ifndef_ripper((yyval.id) = '>'); }
8604#line 8600 "parse.c"
8605 break;
8606
8607 case 155: /* op: ">=" */
8608#line 2335 "parse.y"
8609 { ifndef_ripper((yyval.id) = tGEQ); }
8610#line 8606 "parse.c"
8611 break;
8612
8613 case 156: /* op: '<' */
8614#line 2336 "parse.y"
8615 { ifndef_ripper((yyval.id) = '<'); }
8616#line 8612 "parse.c"
8617 break;
8618
8619 case 157: /* op: "<=" */
8620#line 2337 "parse.y"
8621 { ifndef_ripper((yyval.id) = tLEQ); }
8622#line 8618 "parse.c"
8623 break;
8624
8625 case 158: /* op: "!=" */
8626#line 2338 "parse.y"
8627 { ifndef_ripper((yyval.id) = tNEQ); }
8628#line 8624 "parse.c"
8629 break;
8630
8631 case 159: /* op: "<<" */
8632#line 2339 "parse.y"
8633 { ifndef_ripper((yyval.id) = tLSHFT); }
8634#line 8630 "parse.c"
8635 break;
8636
8637 case 160: /* op: ">>" */
8638#line 2340 "parse.y"
8639 { ifndef_ripper((yyval.id) = tRSHFT); }
8640#line 8636 "parse.c"
8641 break;
8642
8643 case 161: /* op: '+' */
8644#line 2341 "parse.y"
8645 { ifndef_ripper((yyval.id) = '+'); }
8646#line 8642 "parse.c"
8647 break;
8648
8649 case 162: /* op: '-' */
8650#line 2342 "parse.y"
8651 { ifndef_ripper((yyval.id) = '-'); }
8652#line 8648 "parse.c"
8653 break;
8654
8655 case 163: /* op: '*' */
8656#line 2343 "parse.y"
8657 { ifndef_ripper((yyval.id) = '*'); }
8658#line 8654 "parse.c"
8659 break;
8660
8661 case 164: /* op: "*" */
8662#line 2344 "parse.y"
8663 { ifndef_ripper((yyval.id) = '*'); }
8664#line 8660 "parse.c"
8665 break;
8666
8667 case 165: /* op: '/' */
8668#line 2345 "parse.y"
8669 { ifndef_ripper((yyval.id) = '/'); }
8670#line 8666 "parse.c"
8671 break;
8672
8673 case 166: /* op: '%' */
8674#line 2346 "parse.y"
8675 { ifndef_ripper((yyval.id) = '%'); }
8676#line 8672 "parse.c"
8677 break;
8678
8679 case 167: /* op: "**" */
8680#line 2347 "parse.y"
8681 { ifndef_ripper((yyval.id) = tPOW); }
8682#line 8678 "parse.c"
8683 break;
8684
8685 case 168: /* op: "**arg" */
8686#line 2348 "parse.y"
8687 { ifndef_ripper((yyval.id) = tDSTAR); }
8688#line 8684 "parse.c"
8689 break;
8690
8691 case 169: /* op: '!' */
8692#line 2349 "parse.y"
8693 { ifndef_ripper((yyval.id) = '!'); }
8694#line 8690 "parse.c"
8695 break;
8696
8697 case 170: /* op: '~' */
8698#line 2350 "parse.y"
8699 { ifndef_ripper((yyval.id) = '~'); }
8700#line 8696 "parse.c"
8701 break;
8702
8703 case 171: /* op: "unary+" */
8704#line 2351 "parse.y"
8705 { ifndef_ripper((yyval.id) = tUPLUS); }
8706#line 8702 "parse.c"
8707 break;
8708
8709 case 172: /* op: "unary-" */
8710#line 2352 "parse.y"
8711 { ifndef_ripper((yyval.id) = tUMINUS); }
8712#line 8708 "parse.c"
8713 break;
8714
8715 case 173: /* op: "[]" */
8716#line 2353 "parse.y"
8717 { ifndef_ripper((yyval.id) = tAREF); }
8718#line 8714 "parse.c"
8719 break;
8720
8721 case 174: /* op: "[]=" */
8722#line 2354 "parse.y"
8723 { ifndef_ripper((yyval.id) = tASET); }
8724#line 8720 "parse.c"
8725 break;
8726
8727 case 175: /* op: '`' */
8728#line 2355 "parse.y"
8729 { ifndef_ripper((yyval.id) = '`'); }
8730#line 8726 "parse.c"
8731 break;
8732
8733 case 217: /* arg: lhs '=' lex_ctxt arg_rhs */
8734#line 2373 "parse.y"
8735 {
8736 /*%%%*/
8737 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8738 /*% %*/
8739 /*% ripper: assign!($1, $4) %*/
8740 }
8741#line 8737 "parse.c"
8742 break;
8743
8744 case 218: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
8745#line 2380 "parse.y"
8746 {
8747 /*%%%*/
8748 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8749 /*% %*/
8750 /*% ripper: opassign!($1, $2, $4) %*/
8751 }
8752#line 8748 "parse.c"
8753 break;
8754
8755 case 219: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
8756#line 2387 "parse.y"
8757 {
8758 /*%%%*/
8759 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
8760 /*% %*/
8761 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
8762 }
8763#line 8759 "parse.c"
8764 break;
8765
8766 case 220: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
8767#line 2394 "parse.y"
8768 {
8769 /*%%%*/
8770 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
8771 /*% %*/
8772 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
8773 }
8774#line 8770 "parse.c"
8775 break;
8776
8777 case 221: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
8778#line 2401 "parse.y"
8779 {
8780 /*%%%*/
8781 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
8782 /*% %*/
8783 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
8784 }
8785#line 8781 "parse.c"
8786 break;
8787
8788 case 222: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
8789#line 2408 "parse.y"
8790 {
8791 /*%%%*/
8792 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
8793 /*% %*/
8794 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/
8795 }
8796#line 8792 "parse.c"
8797 break;
8798
8799 case 223: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
8800#line 2415 "parse.y"
8801 {
8802 /*%%%*/
8803 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
8804 (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));
8805 /*% %*/
8806 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
8807 }
8808#line 8804 "parse.c"
8809 break;
8810
8811 case 224: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
8812#line 2423 "parse.y"
8813 {
8814 /*%%%*/
8815 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-3]));
8816 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8817 /*% %*/
8818 /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
8819 }
8820#line 8816 "parse.c"
8821 break;
8822
8823 case 225: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
8824#line 2431 "parse.y"
8825 {
8826 /*%%%*/
8827 rb_backref_error(p, (yyvsp[-3].node));
8828 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8829 /*% %*/
8830 /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/
8831 }
8832#line 8828 "parse.c"
8833 break;
8834
8835 case 226: /* arg: arg ".." arg */
8836#line 2439 "parse.y"
8837 {
8838 /*%%%*/
8839 value_expr((yyvsp[-2].node));
8840 value_expr((yyvsp[0].node));
8841 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8842 /*% %*/
8843 /*% ripper: dot2!($1, $3) %*/
8844 }
8845#line 8841 "parse.c"
8846 break;
8847
8848 case 227: /* arg: arg "..." arg */
8849#line 2448 "parse.y"
8850 {
8851 /*%%%*/
8852 value_expr((yyvsp[-2].node));
8853 value_expr((yyvsp[0].node));
8854 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8855 /*% %*/
8856 /*% ripper: dot3!($1, $3) %*/
8857 }
8858#line 8854 "parse.c"
8859 break;
8860
8861 case 228: /* arg: arg ".." */
8862#line 2457 "parse.y"
8863 {
8864 /*%%%*/
8865 value_expr((yyvsp[-1].node));
8866 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
8867 /*% %*/
8868 /*% ripper: dot2!($1, Qnil) %*/
8869 }
8870#line 8866 "parse.c"
8871 break;
8872
8873 case 229: /* arg: arg "..." */
8874#line 2465 "parse.y"
8875 {
8876 /*%%%*/
8877 value_expr((yyvsp[-1].node));
8878 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
8879 /*% %*/
8880 /*% ripper: dot3!($1, Qnil) %*/
8881 }
8882#line 8878 "parse.c"
8883 break;
8884
8885 case 230: /* arg: "(.." arg */
8886#line 2473 "parse.y"
8887 {
8888 /*%%%*/
8889 value_expr((yyvsp[0].node));
8890 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
8891 /*% %*/
8892 /*% ripper: dot2!(Qnil, $2) %*/
8893 }
8894#line 8890 "parse.c"
8895 break;
8896
8897 case 231: /* arg: "(..." arg */
8898#line 2481 "parse.y"
8899 {
8900 /*%%%*/
8901 value_expr((yyvsp[0].node));
8902 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
8903 /*% %*/
8904 /*% ripper: dot3!(Qnil, $2) %*/
8905 }
8906#line 8902 "parse.c"
8907 break;
8908
8909 case 232: /* arg: arg '+' arg */
8910#line 2489 "parse.y"
8911 {
8912 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8913 }
8914#line 8910 "parse.c"
8915 break;
8916
8917 case 233: /* arg: arg '-' arg */
8918#line 2493 "parse.y"
8919 {
8920 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8921 }
8922#line 8918 "parse.c"
8923 break;
8924
8925 case 234: /* arg: arg '*' arg */
8926#line 2497 "parse.y"
8927 {
8928 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8929 }
8930#line 8926 "parse.c"
8931 break;
8932
8933 case 235: /* arg: arg '/' arg */
8934#line 2501 "parse.y"
8935 {
8936 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8937 }
8938#line 8934 "parse.c"
8939 break;
8940
8941 case 236: /* arg: arg '%' arg */
8942#line 2505 "parse.y"
8943 {
8944 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8945 }
8946#line 8942 "parse.c"
8947 break;
8948
8949 case 237: /* arg: arg "**" arg */
8950#line 2509 "parse.y"
8951 {
8952 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8953 }
8954#line 8950 "parse.c"
8955 break;
8956
8957 case 238: /* arg: tUMINUS_NUM simple_numeric "**" arg */
8958#line 2513 "parse.y"
8959 {
8960 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
8961 }
8962#line 8958 "parse.c"
8963 break;
8964
8965 case 239: /* arg: "unary+" arg */
8966#line 2517 "parse.y"
8967 {
8968 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
8969 }
8970#line 8966 "parse.c"
8971 break;
8972
8973 case 240: /* arg: "unary-" arg */
8974#line 2521 "parse.y"
8975 {
8976 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
8977 }
8978#line 8974 "parse.c"
8979 break;
8980
8981 case 241: /* arg: arg '|' arg */
8982#line 2525 "parse.y"
8983 {
8984 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8985 }
8986#line 8982 "parse.c"
8987 break;
8988
8989 case 242: /* arg: arg '^' arg */
8990#line 2529 "parse.y"
8991 {
8992 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8993 }
8994#line 8990 "parse.c"
8995 break;
8996
8997 case 243: /* arg: arg '&' arg */
8998#line 2533 "parse.y"
8999 {
9000 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9001 }
9002#line 8998 "parse.c"
9003 break;
9004
9005 case 244: /* arg: arg "<=>" arg */
9006#line 2537 "parse.y"
9007 {
9008 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9009 }
9010#line 9006 "parse.c"
9011 break;
9012
9013 case 246: /* arg: arg "==" arg */
9014#line 2542 "parse.y"
9015 {
9016 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9017 }
9018#line 9014 "parse.c"
9019 break;
9020
9021 case 247: /* arg: arg "===" arg */
9022#line 2546 "parse.y"
9023 {
9024 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9025 }
9026#line 9022 "parse.c"
9027 break;
9028
9029 case 248: /* arg: arg "!=" arg */
9030#line 2550 "parse.y"
9031 {
9032 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9033 }
9034#line 9030 "parse.c"
9035 break;
9036
9037 case 249: /* arg: arg "=~" arg */
9038#line 2554 "parse.y"
9039 {
9040 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9041 }
9042#line 9038 "parse.c"
9043 break;
9044
9045 case 250: /* arg: arg "!~" arg */
9046#line 2558 "parse.y"
9047 {
9048 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9049 }
9050#line 9046 "parse.c"
9051 break;
9052
9053 case 251: /* arg: '!' arg */
9054#line 2562 "parse.y"
9055 {
9056 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
9057 }
9058#line 9054 "parse.c"
9059 break;
9060
9061 case 252: /* arg: '~' arg */
9062#line 2566 "parse.y"
9063 {
9064 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
9065 }
9066#line 9062 "parse.c"
9067 break;
9068
9069 case 253: /* arg: arg "<<" arg */
9070#line 2570 "parse.y"
9071 {
9072 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9073 }
9074#line 9070 "parse.c"
9075 break;
9076
9077 case 254: /* arg: arg ">>" arg */
9078#line 2574 "parse.y"
9079 {
9080 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9081 }
9082#line 9078 "parse.c"
9083 break;
9084
9085 case 255: /* arg: arg "&&" arg */
9086#line 2578 "parse.y"
9087 {
9088 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9089 }
9090#line 9086 "parse.c"
9091 break;
9092
9093 case 256: /* arg: arg "||" arg */
9094#line 2582 "parse.y"
9095 {
9096 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9097 }
9098#line 9094 "parse.c"
9099 break;
9100
9101 case 257: /* $@13: %empty */
9102#line 2585 "parse.y"
9103 {p->ctxt.in_defined = 1;}
9104#line 9100 "parse.c"
9105 break;
9106
9107 case 258: /* arg: "`defined?'" opt_nl $@13 arg */
9108#line 2586 "parse.y"
9109 {
9110 p->ctxt.in_defined = 0;
9111 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
9112 }
9113#line 9109 "parse.c"
9114 break;
9115
9116 case 259: /* arg: arg '?' arg opt_nl ':' arg */
9117#line 2591 "parse.y"
9118 {
9119 /*%%%*/
9120 value_expr((yyvsp[-5].node));
9121 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
9122 fixpos((yyval.node), (yyvsp[-5].node));
9123 /*% %*/
9124 /*% ripper: ifop!($1, $3, $6) %*/
9125 }
9126#line 9122 "parse.c"
9127 break;
9128
9129 case 260: /* arg: defn_head f_opt_paren_args '=' arg */
9130#line 2600 "parse.y"
9131 {
9132 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
9133 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9134 /*%%%*/
9135 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9136 /*% %*/
9137 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
9138 /*% ripper: def!(get_value($1), $2, $4) %*/
9139 local_pop(p);
9140 }
9141#line 9137 "parse.c"
9142 break;
9143
9144 case 261: /* arg: defn_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
9145#line 2611 "parse.y"
9146 {
9147 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
9148 restore_defun(p, (yyvsp[-5].node)->nd_defn);
9149 /*%%%*/
9150 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9151 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
9152 /*% %*/
9153 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
9154 /*% ripper: def!(get_value($1), $2, $4) %*/
9155 local_pop(p);
9156 }
9157#line 9153 "parse.c"
9158 break;
9159
9160 case 262: /* arg: defs_head f_opt_paren_args '=' arg */
9161#line 2623 "parse.y"
9162 {
9163 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
9164 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9165 /*%%%*/
9166 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9167 /*%
9168 $1 = get_value($1);
9169 %*/
9170 /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
9171 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
9172 local_pop(p);
9173 }
9174#line 9170 "parse.c"
9175 break;
9176
9177 case 263: /* arg: defs_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
9178#line 2636 "parse.y"
9179 {
9180 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
9181 restore_defun(p, (yyvsp[-5].node)->nd_defn);
9182 /*%%%*/
9183 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9184 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
9185 /*%
9186 $1 = get_value($1);
9187 %*/
9188 /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
9189 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
9190 local_pop(p);
9191 }
9192#line 9188 "parse.c"
9193 break;
9194
9195 case 264: /* arg: primary */
9196#line 2650 "parse.y"
9197 {
9198 (yyval.node) = (yyvsp[0].node);
9199 }
9200#line 9196 "parse.c"
9201 break;
9202
9203 case 265: /* relop: '>' */
9204#line 2655 "parse.y"
9205 {(yyval.id) = '>';}
9206#line 9202 "parse.c"
9207 break;
9208
9209 case 266: /* relop: '<' */
9210#line 2656 "parse.y"
9211 {(yyval.id) = '<';}
9212#line 9208 "parse.c"
9213 break;
9214
9215 case 267: /* relop: ">=" */
9216#line 2657 "parse.y"
9217 {(yyval.id) = idGE;}
9218#line 9214 "parse.c"
9219 break;
9220
9221 case 268: /* relop: "<=" */
9222#line 2658 "parse.y"
9223 {(yyval.id) = idLE;}
9224#line 9220 "parse.c"
9225 break;
9226
9227 case 269: /* rel_expr: arg relop arg */
9228#line 2662 "parse.y"
9229 {
9230 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9231 }
9232#line 9228 "parse.c"
9233 break;
9234
9235 case 270: /* rel_expr: rel_expr relop arg */
9236#line 2666 "parse.y"
9237 {
9238 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
9239 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
9240 }
9241#line 9237 "parse.c"
9242 break;
9243
9244 case 271: /* lex_ctxt: "escaped space" */
9245#line 2673 "parse.y"
9246 {
9247 (yyval.ctxt) = p->ctxt;
9248 }
9249#line 9245 "parse.c"
9250 break;
9251
9252 case 272: /* lex_ctxt: none */
9253#line 2677 "parse.y"
9254 {
9255 (yyval.ctxt) = p->ctxt;
9256 }
9257#line 9253 "parse.c"
9258 break;
9259
9260 case 273: /* arg_value: arg */
9261#line 2683 "parse.y"
9262 {
9263 value_expr((yyvsp[0].node));
9264 (yyval.node) = (yyvsp[0].node);
9265 }
9266#line 9262 "parse.c"
9267 break;
9268
9269 case 275: /* aref_args: args trailer */
9270#line 2691 "parse.y"
9271 {
9272 (yyval.node) = (yyvsp[-1].node);
9273 }
9274#line 9270 "parse.c"
9275 break;
9276
9277 case 276: /* aref_args: args ',' assocs trailer */
9278#line 2695 "parse.y"
9279 {
9280 /*%%%*/
9281 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
9282 /*% %*/
9283 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
9284 }
9285#line 9281 "parse.c"
9286 break;
9287
9288 case 277: /* aref_args: assocs trailer */
9289#line 2702 "parse.y"
9290 {
9291 /*%%%*/
9292 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
9293 /*% %*/
9294 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
9295 }
9296#line 9292 "parse.c"
9297 break;
9298
9299 case 278: /* arg_rhs: arg */
9300#line 2711 "parse.y"
9301 {
9302 value_expr((yyvsp[0].node));
9303 (yyval.node) = (yyvsp[0].node);
9304 }
9305#line 9301 "parse.c"
9306 break;
9307
9308 case 279: /* arg_rhs: arg "`rescue' modifier" arg */
9309#line 2716 "parse.y"
9310 {
9311 /*%%%*/
9312 value_expr((yyvsp[-2].node));
9313 (yyval.node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9314 /*% %*/
9315 /*% ripper: rescue_mod!($1, $3) %*/
9316 }
9317#line 9313 "parse.c"
9318 break;
9319
9320 case 280: /* paren_args: '(' opt_call_args rparen */
9321#line 2726 "parse.y"
9322 {
9323 /*%%%*/
9324 (yyval.node) = (yyvsp[-1].node);
9325 /*% %*/
9326 /*% ripper: arg_paren!(escape_Qundef($2)) %*/
9327 }
9328#line 9324 "parse.c"
9329 break;
9330
9331 case 281: /* paren_args: '(' args ',' args_forward rparen */
9332#line 2733 "parse.y"
9333 {
9334 if (!check_forwarding_args(p)) {
9335 (yyval.node) = Qnone;
9336 }
9337 else {
9338 /*%%%*/
9339 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
9340 /*% %*/
9341 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
9342 }
9343 }
9344#line 9340 "parse.c"
9345 break;
9346
9347 case 282: /* paren_args: '(' args_forward rparen */
9348#line 2745 "parse.y"
9349 {
9350 if (!check_forwarding_args(p)) {
9351 (yyval.node) = Qnone;
9352 }
9353 else {
9354 /*%%%*/
9355 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
9356 /*% %*/
9357 /*% ripper: arg_paren!($2) %*/
9358 }
9359 }
9360#line 9356 "parse.c"
9361 break;
9362
9363 case 287: /* opt_call_args: args ',' */
9364#line 2765 "parse.y"
9365 {
9366 (yyval.node) = (yyvsp[-1].node);
9367 }
9368#line 9364 "parse.c"
9369 break;
9370
9371 case 288: /* opt_call_args: args ',' assocs ',' */
9372#line 2769 "parse.y"
9373 {
9374 /*%%%*/
9375 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
9376 /*% %*/
9377 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
9378 }
9379#line 9375 "parse.c"
9380 break;
9381
9382 case 289: /* opt_call_args: assocs ',' */
9383#line 2776 "parse.y"
9384 {
9385 /*%%%*/
9386 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
9387 /*% %*/
9388 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
9389 }
9390#line 9386 "parse.c"
9391 break;
9392
9393 case 290: /* call_args: command */
9394#line 2785 "parse.y"
9395 {
9396 /*%%%*/
9397 value_expr((yyvsp[0].node));
9398 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
9399 /*% %*/
9400 /*% ripper: args_add!(args_new!, $1) %*/
9401 }
9402#line 9398 "parse.c"
9403 break;
9404
9405 case 291: /* call_args: args opt_block_arg */
9406#line 2793 "parse.y"
9407 {
9408 /*%%%*/
9409 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node));
9410 /*% %*/
9411 /*% ripper: args_add_block!($1, $2) %*/
9412 }
9413#line 9409 "parse.c"
9414 break;
9415
9416 case 292: /* call_args: assocs opt_block_arg */
9417#line 2800 "parse.y"
9418 {
9419 /*%%%*/
9420 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
9421 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
9422 /*% %*/
9423 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
9424 }
9425#line 9421 "parse.c"
9426 break;
9427
9428 case 293: /* call_args: args ',' assocs opt_block_arg */
9429#line 2808 "parse.y"
9430 {
9431 /*%%%*/
9432 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
9433 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
9434 /*% %*/
9435 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
9436 }
9437#line 9433 "parse.c"
9438 break;
9439
9440 case 295: /* $@14: %empty */
9441#line 2819 "parse.y"
9442 {
9443 /* If call_args starts with a open paren '(' or '[',
9444 * look-ahead reading of the letters calls CMDARG_PUSH(0),
9445 * but the push must be done after CMDARG_PUSH(1).
9446 * So this code makes them consistent by first cancelling
9447 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
9448 * and finally redoing CMDARG_PUSH(0).
9449 */
9450 int lookahead = 0;
9451 switch (yychar) {
9452 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
9453 lookahead = 1;
9454 }
9455 if (lookahead) CMDARG_POP();
9456 CMDARG_PUSH(1);
9457 if (lookahead) CMDARG_PUSH(0);
9458 }
9459#line 9455 "parse.c"
9460 break;
9461
9462 case 296: /* command_args: $@14 call_args */
9463#line 2837 "parse.y"
9464 {
9465 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
9466 * but the push must be done after CMDARG_POP() in the parser.
9467 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
9468 * CMDARG_POP() to pop 1 pushed by command_args,
9469 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
9470 */
9471 int lookahead = 0;
9472 switch (yychar) {
9473 case tLBRACE_ARG:
9474 lookahead = 1;
9475 }
9476 if (lookahead) CMDARG_POP();
9477 CMDARG_POP();
9478 if (lookahead) CMDARG_PUSH(0);
9479 (yyval.node) = (yyvsp[0].node);
9480 }
9481#line 9477 "parse.c"
9482 break;
9483
9484 case 297: /* block_arg: "&" arg_value */
9485#line 2857 "parse.y"
9486 {
9487 /*%%%*/
9488 (yyval.node) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
9489 /*% %*/
9490 /*% ripper: $2 %*/
9491 }
9492#line 9488 "parse.c"
9493 break;
9494
9495 case 298: /* block_arg: "&" */
9496#line 2864 "parse.y"
9497 {
9498 /*%%%*/
9499 if (!local_id(p, ANON_BLOCK_ID)) {
9500 compile_error(p, "no anonymous block parameter");
9501 }
9502 (yyval.node) = NEW_BLOCK_PASS(NEW_LVAR(ANON_BLOCK_ID, &(yylsp[0])), &(yyloc));
9503 /*%
9504 $$ = Qnil;
9505 %*/
9506 }
9507#line 9503 "parse.c"
9508 break;
9509
9510 case 299: /* opt_block_arg: ',' block_arg */
9511#line 2877 "parse.y"
9512 {
9513 (yyval.node) = (yyvsp[0].node);
9514 }
9515#line 9511 "parse.c"
9516 break;
9517
9518 case 300: /* opt_block_arg: none */
9519#line 2881 "parse.y"
9520 {
9521 (yyval.node) = 0;
9522 }
9523#line 9519 "parse.c"
9524 break;
9525
9526 case 301: /* args: arg_value */
9527#line 2888 "parse.y"
9528 {
9529 /*%%%*/
9530 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
9531 /*% %*/
9532 /*% ripper: args_add!(args_new!, $1) %*/
9533 }
9534#line 9530 "parse.c"
9535 break;
9536
9537 case 302: /* args: "*" arg_value */
9538#line 2895 "parse.y"
9539 {
9540 /*%%%*/
9541 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
9542 /*% %*/
9543 /*% ripper: args_add_star!(args_new!, $2) %*/
9544 }
9545#line 9541 "parse.c"
9546 break;
9547
9548 case 303: /* args: args ',' arg_value */
9549#line 2902 "parse.y"
9550 {
9551 /*%%%*/
9552 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9553 /*% %*/
9554 /*% ripper: args_add!($1, $3) %*/
9555 }
9556#line 9552 "parse.c"
9557 break;
9558
9559 case 304: /* args: args ',' "*" arg_value */
9560#line 2909 "parse.y"
9561 {
9562 /*%%%*/
9563 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
9564 /*% %*/
9565 /*% ripper: args_add_star!($1, $4) %*/
9566 }
9567#line 9563 "parse.c"
9568 break;
9569
9570 case 307: /* mrhs: args ',' arg_value */
9571#line 2924 "parse.y"
9572 {
9573 /*%%%*/
9574 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9575 /*% %*/
9576 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
9577 }
9578#line 9574 "parse.c"
9579 break;
9580
9581 case 308: /* mrhs: args ',' "*" arg_value */
9582#line 2931 "parse.y"
9583 {
9584 /*%%%*/
9585 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
9586 /*% %*/
9587 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
9588 }
9589#line 9585 "parse.c"
9590 break;
9591
9592 case 309: /* mrhs: "*" arg_value */
9593#line 2938 "parse.y"
9594 {
9595 /*%%%*/
9596 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
9597 /*% %*/
9598 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
9599 }
9600#line 9596 "parse.c"
9601 break;
9602
9603 case 320: /* primary: "method" */
9604#line 2957 "parse.y"
9605 {
9606 /*%%%*/
9607 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
9608 /*% %*/
9609 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
9610 }
9611#line 9607 "parse.c"
9612 break;
9613
9614 case 321: /* $@15: %empty */
9615#line 2964 "parse.y"
9616 {
9617 CMDARG_PUSH(0);
9618 }
9619#line 9615 "parse.c"
9620 break;
9621
9622 case 322: /* primary: k_begin $@15 bodystmt k_end */
9623#line 2969 "parse.y"
9624 {
9625 CMDARG_POP();
9626 /*%%%*/
9627 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9628 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
9629 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9630 /*% %*/
9631 /*% ripper: begin!($3) %*/
9632 }
9633#line 9629 "parse.c"
9634 break;
9635
9636 case 323: /* $@16: %empty */
9637#line 2978 "parse.y"
9638 {SET_LEX_STATE(EXPR_ENDARG);}
9639#line 9635 "parse.c"
9640 break;
9641
9642 case 324: /* primary: "( arg" $@16 rparen */
9643#line 2979 "parse.y"
9644 {
9645 /*%%%*/
9646 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9647 /*% %*/
9648 /*% ripper: paren!(0) %*/
9649 }
9650#line 9646 "parse.c"
9651 break;
9652
9653 case 325: /* $@17: %empty */
9654#line 2985 "parse.y"
9655 {SET_LEX_STATE(EXPR_ENDARG);}
9656#line 9652 "parse.c"
9657 break;
9658
9659 case 326: /* primary: "( arg" stmt $@17 rparen */
9660#line 2986 "parse.y"
9661 {
9662 /*%%%*/
9663 if (nd_type_p((yyvsp[-2].node), NODE_SELF)) (yyvsp[-2].node)->nd_state = 0;
9664 (yyval.node) = (yyvsp[-2].node);
9665 /*% %*/
9666 /*% ripper: paren!($2) %*/
9667 }
9668#line 9664 "parse.c"
9669 break;
9670
9671 case 327: /* primary: "(" compstmt ')' */
9672#line 2994 "parse.y"
9673 {
9674 /*%%%*/
9675 if (nd_type_p((yyvsp[-1].node), NODE_SELF)) (yyvsp[-1].node)->nd_state = 0;
9676 (yyval.node) = (yyvsp[-1].node);
9677 /*% %*/
9678 /*% ripper: paren!($2) %*/
9679 }
9680#line 9676 "parse.c"
9681 break;
9682
9683 case 328: /* primary: primary_value "::" "constant" */
9684#line 3002 "parse.y"
9685 {
9686 /*%%%*/
9687 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
9688 /*% %*/
9689 /*% ripper: const_path_ref!($1, $3) %*/
9690 }
9691#line 9687 "parse.c"
9692 break;
9693
9694 case 329: /* primary: ":: at EXPR_BEG" "constant" */
9695#line 3009 "parse.y"
9696 {
9697 /*%%%*/
9698 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
9699 /*% %*/
9700 /*% ripper: top_const_ref!($2) %*/
9701 }
9702#line 9698 "parse.c"
9703 break;
9704
9705 case 330: /* primary: "[" aref_args ']' */
9706#line 3016 "parse.y"
9707 {
9708 /*%%%*/
9709 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
9710 /*% %*/
9711 /*% ripper: array!(escape_Qundef($2)) %*/
9712 }
9713#line 9709 "parse.c"
9714 break;
9715
9716 case 331: /* primary: "{" assoc_list '}' */
9717#line 3023 "parse.y"
9718 {
9719 /*%%%*/
9720 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
9721 (yyval.node)->nd_brace = TRUE;
9722 /*% %*/
9723 /*% ripper: hash!(escape_Qundef($2)) %*/
9724 }
9725#line 9721 "parse.c"
9726 break;
9727
9728 case 332: /* primary: k_return */
9729#line 3031 "parse.y"
9730 {
9731 /*%%%*/
9732 (yyval.node) = NEW_RETURN(0, &(yyloc));
9733 /*% %*/
9734 /*% ripper: return0! %*/
9735 }
9736#line 9732 "parse.c"
9737 break;
9738
9739 case 333: /* primary: "`yield'" '(' call_args rparen */
9740#line 3038 "parse.y"
9741 {
9742 /*%%%*/
9743 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
9744 /*% %*/
9745 /*% ripper: yield!(paren!($3)) %*/
9746 }
9747#line 9743 "parse.c"
9748 break;
9749
9750 case 334: /* primary: "`yield'" '(' rparen */
9751#line 3045 "parse.y"
9752 {
9753 /*%%%*/
9754 (yyval.node) = NEW_YIELD(0, &(yyloc));
9755 /*% %*/
9756 /*% ripper: yield!(paren!(args_new!)) %*/
9757 }
9758#line 9754 "parse.c"
9759 break;
9760
9761 case 335: /* primary: "`yield'" */
9762#line 3052 "parse.y"
9763 {
9764 /*%%%*/
9765 (yyval.node) = NEW_YIELD(0, &(yyloc));
9766 /*% %*/
9767 /*% ripper: yield0! %*/
9768 }
9769#line 9765 "parse.c"
9770 break;
9771
9772 case 336: /* $@18: %empty */
9773#line 3058 "parse.y"
9774 {p->ctxt.in_defined = 1;}
9775#line 9771 "parse.c"
9776 break;
9777
9778 case 337: /* primary: "`defined?'" opt_nl '(' $@18 expr rparen */
9779#line 3059 "parse.y"
9780 {
9781 p->ctxt.in_defined = 0;
9782 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
9783 }
9784#line 9780 "parse.c"
9785 break;
9786
9787 case 338: /* primary: "`not'" '(' expr rparen */
9788#line 3064 "parse.y"
9789 {
9790 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
9791 }
9792#line 9788 "parse.c"
9793 break;
9794
9795 case 339: /* primary: "`not'" '(' rparen */
9796#line 3068 "parse.y"
9797 {
9798 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
9799 }
9800#line 9796 "parse.c"
9801 break;
9802
9803 case 340: /* primary: fcall brace_block */
9804#line 3072 "parse.y"
9805 {
9806 /*%%%*/
9807 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9808 /*% %*/
9809 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
9810 }
9811#line 9807 "parse.c"
9812 break;
9813
9814 case 342: /* primary: method_call brace_block */
9815#line 3080 "parse.y"
9816 {
9817 /*%%%*/
9818 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
9819 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9820 /*% %*/
9821 /*% ripper: method_add_block!($1, $2) %*/
9822 }
9823#line 9819 "parse.c"
9824 break;
9825
9826 case 344: /* primary: k_if expr_value then compstmt if_tail k_end */
9827#line 3092 "parse.y"
9828 {
9829 /*%%%*/
9830 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9831 fixpos((yyval.node), (yyvsp[-4].node));
9832 /*% %*/
9833 /*% ripper: if!($2, $4, escape_Qundef($5)) %*/
9834 }
9835#line 9831 "parse.c"
9836 break;
9837
9838 case 345: /* primary: k_unless expr_value then compstmt opt_else k_end */
9839#line 3103 "parse.y"
9840 {
9841 /*%%%*/
9842 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9843 fixpos((yyval.node), (yyvsp[-4].node));
9844 /*% %*/
9845 /*% ripper: unless!($2, $4, escape_Qundef($5)) %*/
9846 }
9847#line 9843 "parse.c"
9848 break;
9849
9850 case 346: /* primary: k_while expr_value_do compstmt k_end */
9851#line 3113 "parse.y"
9852 {
9853 /*%%%*/
9854 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
9855 fixpos((yyval.node), (yyvsp[-2].node));
9856 /*% %*/
9857 /*% ripper: while!($2, $3) %*/
9858 }
9859#line 9855 "parse.c"
9860 break;
9861
9862 case 347: /* primary: k_until expr_value_do compstmt k_end */
9863#line 3123 "parse.y"
9864 {
9865 /*%%%*/
9866 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
9867 fixpos((yyval.node), (yyvsp[-2].node));
9868 /*% %*/
9869 /*% ripper: until!($2, $3) %*/
9870 }
9871#line 9867 "parse.c"
9872 break;
9873
9874 case 348: /* @19: %empty */
9875#line 3131 "parse.y"
9876 {
9877 (yyval.val) = p->case_labels;
9878 p->case_labels = Qnil;
9879 }
9880#line 9876 "parse.c"
9881 break;
9882
9883 case 349: /* primary: k_case expr_value opt_terms @19 case_body k_end */
9884#line 3137 "parse.y"
9885 {
9886 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
9887 p->case_labels = (yyvsp[-2].val);
9888 /*%%%*/
9889 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
9890 fixpos((yyval.node), (yyvsp[-4].node));
9891 /*% %*/
9892 /*% ripper: case!($2, $5) %*/
9893 }
9894#line 9890 "parse.c"
9895 break;
9896
9897 case 350: /* @20: %empty */
9898#line 3147 "parse.y"
9899 {
9900 (yyval.val) = p->case_labels;
9901 p->case_labels = 0;
9902 }
9903#line 9899 "parse.c"
9904 break;
9905
9906 case 351: /* primary: k_case opt_terms @20 case_body k_end */
9907#line 3153 "parse.y"
9908 {
9909 if (RTEST(p->case_labels)) rb_hash_clear(p->case_labels);
9910 p->case_labels = (yyvsp[-2].val);
9911 /*%%%*/
9912 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
9913 /*% %*/
9914 /*% ripper: case!(Qnil, $4) %*/
9915 }
9916#line 9912 "parse.c"
9917 break;
9918
9919 case 352: /* primary: k_case expr_value opt_terms p_case_body k_end */
9920#line 3164 "parse.y"
9921 {
9922 /*%%%*/
9923 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
9924 /*% %*/
9925 /*% ripper: case!($2, $4) %*/
9926 }
9927#line 9923 "parse.c"
9928 break;
9929
9930 case 353: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
9931#line 3173 "parse.y"
9932 {
9933 /*%%%*/
9934 /*
9935 * for a, b, c in e
9936 * #=>
9937 * e.each{|*x| a, b, c = x}
9938 *
9939 * for a in e
9940 * #=>
9941 * e.each{|x| a, = x}
9942 */
9943 ID id = internal_id(p);
9944 NODE *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
9945 NODE *args, *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
9946 rb_ast_id_table_t *tbl = rb_ast_new_local_table(p->ast, 1);
9947 tbl->ids[0] = id; /* internal id */
9948
9949 switch (nd_type((yyvsp[-4].node))) {
9950 case NODE_LASGN:
9951 case NODE_DASGN: /* e.each {|internal_var| a = internal_var; ... } */
9952 (yyvsp[-4].node)->nd_value = internal_var;
9953 id = 0;
9954 m->nd_plen = 1;
9955 m->nd_next = (yyvsp[-4].node);
9956 break;
9957 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
9958 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
9959 break;
9960 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
9961 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]));
9962 }
9963 /* {|*internal_id| <m> = internal_id; ... } */
9964 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
9965 scope = NEW_NODE(NODE_SCOPE, tbl, (yyvsp[-1].node), args, &(yyloc));
9966 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
9967 fixpos((yyval.node), (yyvsp[-4].node));
9968 /*% %*/
9969 /*% ripper: for!($2, $4, $5) %*/
9970 }
9971#line 9967 "parse.c"
9972 break;
9973
9974 case 354: /* $@21: %empty */
9975#line 3213 "parse.y"
9976 {
9977 if (p->ctxt.in_def) {
9978 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[-1]));
9979 yyerror1(&loc, "class definition in method body");
9980 }
9981 p->ctxt.in_class = 1;
9982 local_push(p, 0);
9983 }
9984#line 9980 "parse.c"
9985 break;
9986
9987 case 355: /* primary: k_class cpath superclass $@21 bodystmt k_end */
9988#line 3223 "parse.y"
9989 {
9990 /*%%%*/
9991 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
9992 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9993 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9994 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9995 /*% %*/
9996 /*% ripper: class!($2, $3, $5) %*/
9997 local_pop(p);
9998 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
9999 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
10000 }
10001#line 9997 "parse.c"
10002 break;
10003
10004 case 356: /* $@22: %empty */
10005#line 3236 "parse.y"
10006 {
10007 p->ctxt.in_def = 0;
10008 p->ctxt.in_class = 0;
10009 local_push(p, 0);
10010 }
10011#line 10007 "parse.c"
10012 break;
10013
10014 case 357: /* primary: k_class "<<" expr $@22 term bodystmt k_end */
10015#line 3244 "parse.y"
10016 {
10017 /*%%%*/
10018 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
10019 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
10020 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
10021 fixpos((yyval.node), (yyvsp[-4].node));
10022 /*% %*/
10023 /*% ripper: sclass!($3, $6) %*/
10024 local_pop(p);
10025 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
10026 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
10027 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
10028 }
10029#line 10025 "parse.c"
10030 break;
10031
10032 case 358: /* $@23: %empty */
10033#line 3258 "parse.y"
10034 {
10035 if (p->ctxt.in_def) {
10036 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
10037 yyerror1(&loc, "module definition in method body");
10038 }
10039 p->ctxt.in_class = 1;
10040 local_push(p, 0);
10041 }
10042#line 10038 "parse.c"
10043 break;
10044
10045 case 359: /* primary: k_module cpath $@23 bodystmt k_end */
10046#line 3268 "parse.y"
10047 {
10048 /*%%%*/
10049 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10050 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
10051 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
10052 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
10053 /*% %*/
10054 /*% ripper: module!($2, $4) %*/
10055 local_pop(p);
10056 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
10057 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
10058 }
10059#line 10055 "parse.c"
10060 break;
10061
10062 case 360: /* primary: defn_head f_arglist bodystmt k_end */
10063#line 3284 "parse.y"
10064 {
10065 restore_defun(p, (yyvsp[-3].node)->nd_defn);
10066 /*%%%*/
10067 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
10068 /*% %*/
10069 /*% ripper: def!(get_value($1), $2, $3) %*/
10070 local_pop(p);
10071 }
10072#line 10068 "parse.c"
10073 break;
10074
10075 case 361: /* primary: defs_head f_arglist bodystmt k_end */
10076#line 3296 "parse.y"
10077 {
10078 restore_defun(p, (yyvsp[-3].node)->nd_defn);
10079 /*%%%*/
10080 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
10081 /*%
10082 $1 = get_value($1);
10083 %*/
10084 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $3) %*/
10085 local_pop(p);
10086 }
10087#line 10083 "parse.c"
10088 break;
10089
10090 case 362: /* primary: "`break'" */
10091#line 3307 "parse.y"
10092 {
10093 /*%%%*/
10094 (yyval.node) = NEW_BREAK(0, &(yyloc));
10095 /*% %*/
10096 /*% ripper: break!(args_new!) %*/
10097 }
10098#line 10094 "parse.c"
10099 break;
10100
10101 case 363: /* primary: "`next'" */
10102#line 3314 "parse.y"
10103 {
10104 /*%%%*/
10105 (yyval.node) = NEW_NEXT(0, &(yyloc));
10106 /*% %*/
10107 /*% ripper: next!(args_new!) %*/
10108 }
10109#line 10105 "parse.c"
10110 break;
10111
10112 case 364: /* primary: "`redo'" */
10113#line 3321 "parse.y"
10114 {
10115 /*%%%*/
10116 (yyval.node) = NEW_REDO(&(yyloc));
10117 /*% %*/
10118 /*% ripper: redo! %*/
10119 }
10120#line 10116 "parse.c"
10121 break;
10122
10123 case 365: /* primary: "`retry'" */
10124#line 3328 "parse.y"
10125 {
10126 /*%%%*/
10127 (yyval.node) = NEW_RETRY(&(yyloc));
10128 /*% %*/
10129 /*% ripper: retry! %*/
10130 }
10131#line 10127 "parse.c"
10132 break;
10133
10134 case 366: /* primary_value: primary */
10135#line 3337 "parse.y"
10136 {
10137 value_expr((yyvsp[0].node));
10138 (yyval.node) = (yyvsp[0].node);
10139 }
10140#line 10136 "parse.c"
10141 break;
10142
10143 case 367: /* k_begin: "`begin'" */
10144#line 3344 "parse.y"
10145 {
10146 token_info_push(p, "begin", &(yyloc));
10147 }
10148#line 10144 "parse.c"
10149 break;
10150
10151 case 368: /* k_if: "`if'" */
10152#line 3350 "parse.y"
10153 {
10154 WARN_EOL("if");
10155 token_info_push(p, "if", &(yyloc));
10156 if (p->token_info && p->token_info->nonspc &&
10157 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
10158 const char *tok = p->lex.ptok;
10159 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
10160 beg += rb_strlen_lit("else");
10161 while (beg < tok && ISSPACE(*beg)) beg++;
10162 if (beg == tok) {
10163 p->token_info->nonspc = 0;
10164 }
10165 }
10166 }
10167#line 10163 "parse.c"
10168 break;
10169
10170 case 369: /* k_unless: "`unless'" */
10171#line 3367 "parse.y"
10172 {
10173 token_info_push(p, "unless", &(yyloc));
10174 }
10175#line 10171 "parse.c"
10176 break;
10177
10178 case 370: /* k_while: "`while'" */
10179#line 3373 "parse.y"
10180 {
10181 token_info_push(p, "while", &(yyloc));
10182 }
10183#line 10179 "parse.c"
10184 break;
10185
10186 case 371: /* k_until: "`until'" */
10187#line 3379 "parse.y"
10188 {
10189 token_info_push(p, "until", &(yyloc));
10190 }
10191#line 10187 "parse.c"
10192 break;
10193
10194 case 372: /* k_case: "`case'" */
10195#line 3385 "parse.y"
10196 {
10197 token_info_push(p, "case", &(yyloc));
10198 }
10199#line 10195 "parse.c"
10200 break;
10201
10202 case 373: /* k_for: "`for'" */
10203#line 3391 "parse.y"
10204 {
10205 token_info_push(p, "for", &(yyloc));
10206 }
10207#line 10203 "parse.c"
10208 break;
10209
10210 case 374: /* k_class: "`class'" */
10211#line 3397 "parse.y"
10212 {
10213 token_info_push(p, "class", &(yyloc));
10214 (yyval.ctxt) = p->ctxt;
10215 }
10216#line 10212 "parse.c"
10217 break;
10218
10219 case 375: /* k_module: "`module'" */
10220#line 3404 "parse.y"
10221 {
10222 token_info_push(p, "module", &(yyloc));
10223 (yyval.ctxt) = p->ctxt;
10224 }
10225#line 10221 "parse.c"
10226 break;
10227
10228 case 376: /* k_def: "`def'" */
10229#line 3411 "parse.y"
10230 {
10231 token_info_push(p, "def", &(yyloc));
10232 p->ctxt.in_argdef = 1;
10233 }
10234#line 10230 "parse.c"
10235 break;
10236
10237 case 377: /* k_do: "`do'" */
10238#line 3418 "parse.y"
10239 {
10240 token_info_push(p, "do", &(yyloc));
10241 }
10242#line 10238 "parse.c"
10243 break;
10244
10245 case 378: /* k_do_block: "`do' for block" */
10246#line 3424 "parse.y"
10247 {
10248 token_info_push(p, "do", &(yyloc));
10249 }
10250#line 10246 "parse.c"
10251 break;
10252
10253 case 379: /* k_rescue: "`rescue'" */
10254#line 3430 "parse.y"
10255 {
10256 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
10257 }
10258#line 10254 "parse.c"
10259 break;
10260
10261 case 380: /* k_ensure: "`ensure'" */
10262#line 3436 "parse.y"
10263 {
10264 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
10265 }
10266#line 10262 "parse.c"
10267 break;
10268
10269 case 381: /* k_when: "`when'" */
10270#line 3442 "parse.y"
10271 {
10272 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
10273 }
10274#line 10270 "parse.c"
10275 break;
10276
10277 case 382: /* k_else: "`else'" */
10278#line 3448 "parse.y"
10279 {
10280 token_info *ptinfo_beg = p->token_info;
10281 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
10282 token_info_warn(p, "else", p->token_info, same, &(yyloc));
10283 if (same) {
10284 token_info e;
10285 e.next = ptinfo_beg->next;
10286 e.token = "else";
10287 token_info_setup(&e, p->lex.pbeg, &(yyloc));
10288 if (!e.nonspc) *ptinfo_beg = e;
10289 }
10290 }
10291#line 10287 "parse.c"
10292 break;
10293
10294 case 383: /* k_elsif: "`elsif'" */
10295#line 3463 "parse.y"
10296 {
10297 WARN_EOL("elsif");
10298 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
10299 }
10300#line 10296 "parse.c"
10301 break;
10302
10303 case 384: /* k_end: "`end'" */
10304#line 3470 "parse.y"
10305 {
10306 token_info_pop(p, "end", &(yyloc));
10307 }
10308#line 10304 "parse.c"
10309 break;
10310
10311 case 385: /* k_return: "`return'" */
10312#line 3476 "parse.y"
10313 {
10314 if (p->ctxt.in_class && !p->ctxt.in_def && !dyna_in_block(p))
10315 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
10316 }
10317#line 10313 "parse.c"
10318 break;
10319
10320 case 392: /* if_tail: k_elsif expr_value then compstmt if_tail */
10321#line 3495 "parse.y"
10322 {
10323 /*%%%*/
10324 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10325 fixpos((yyval.node), (yyvsp[-3].node));
10326 /*% %*/
10327 /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/
10328 }
10329#line 10325 "parse.c"
10330 break;
10331
10332 case 394: /* opt_else: k_else compstmt */
10333#line 3506 "parse.y"
10334 {
10335 /*%%%*/
10336 (yyval.node) = (yyvsp[0].node);
10337 /*% %*/
10338 /*% ripper: else!($2) %*/
10339 }
10340#line 10336 "parse.c"
10341 break;
10342
10343 case 397: /* f_marg: f_norm_arg */
10344#line 3519 "parse.y"
10345 {
10346 /*%%%*/
10347 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10348 mark_lvar_used(p, (yyval.node));
10349 /*% %*/
10350 /*% ripper: assignable(p, $1) %*/
10351 }
10352#line 10348 "parse.c"
10353 break;
10354
10355 case 398: /* f_marg: "(" f_margs rparen */
10356#line 3527 "parse.y"
10357 {
10358 /*%%%*/
10359 (yyval.node) = (yyvsp[-1].node);
10360 /*% %*/
10361 /*% ripper: mlhs_paren!($2) %*/
10362 }
10363#line 10359 "parse.c"
10364 break;
10365
10366 case 399: /* f_marg_list: f_marg */
10367#line 3536 "parse.y"
10368 {
10369 /*%%%*/
10370 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
10371 /*% %*/
10372 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
10373 }
10374#line 10370 "parse.c"
10375 break;
10376
10377 case 400: /* f_marg_list: f_marg_list ',' f_marg */
10378#line 3543 "parse.y"
10379 {
10380 /*%%%*/
10381 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
10382 /*% %*/
10383 /*% ripper: mlhs_add!($1, $3) %*/
10384 }
10385#line 10381 "parse.c"
10386 break;
10387
10388 case 401: /* f_margs: f_marg_list */
10389#line 3552 "parse.y"
10390 {
10391 /*%%%*/
10392 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
10393 /*% %*/
10394 /*% ripper: $1 %*/
10395 }
10396#line 10392 "parse.c"
10397 break;
10398
10399 case 402: /* f_margs: f_marg_list ',' f_rest_marg */
10400#line 3559 "parse.y"
10401 {
10402 /*%%%*/
10403 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10404 /*% %*/
10405 /*% ripper: mlhs_add_star!($1, $3) %*/
10406 }
10407#line 10403 "parse.c"
10408 break;
10409
10410 case 403: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
10411#line 3566 "parse.y"
10412 {
10413 /*%%%*/
10414 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
10415 /*% %*/
10416 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
10417 }
10418#line 10414 "parse.c"
10419 break;
10420
10421 case 404: /* f_margs: f_rest_marg */
10422#line 3573 "parse.y"
10423 {
10424 /*%%%*/
10425 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
10426 /*% %*/
10427 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
10428 }
10429#line 10425 "parse.c"
10430 break;
10431
10432 case 405: /* f_margs: f_rest_marg ',' f_marg_list */
10433#line 3580 "parse.y"
10434 {
10435 /*%%%*/
10436 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
10437 /*% %*/
10438 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
10439 }
10440#line 10436 "parse.c"
10441 break;
10442
10443 case 406: /* f_rest_marg: "*" f_norm_arg */
10444#line 3589 "parse.y"
10445 {
10446 /*%%%*/
10447 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10448 mark_lvar_used(p, (yyval.node));
10449 /*% %*/
10450 /*% ripper: assignable(p, $2) %*/
10451 }
10452#line 10448 "parse.c"
10453 break;
10454
10455 case 407: /* f_rest_marg: "*" */
10456#line 3597 "parse.y"
10457 {
10458 /*%%%*/
10459 (yyval.node) = NODE_SPECIAL_NO_NAME_REST;
10460 /*% %*/
10461 /*% ripper: Qnil %*/
10462 }
10463#line 10459 "parse.c"
10464 break;
10465
10466 case 409: /* f_any_kwrest: f_no_kwarg */
10467#line 3606 "parse.y"
10468 {(yyval.id) = ID2VAL(idNil);}
10469#line 10465 "parse.c"
10470 break;
10471
10472 case 410: /* $@24: %empty */
10473#line 3609 "parse.y"
10474 {p->ctxt.in_argdef = 0;}
10475#line 10471 "parse.c"
10476 break;
10477
10478 case 412: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
10479#line 3612 "parse.y"
10480 {
10481 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
10482 }
10483#line 10479 "parse.c"
10484 break;
10485
10486 case 413: /* block_args_tail: f_block_kwarg opt_f_block_arg */
10487#line 3616 "parse.y"
10488 {
10489 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
10490 }
10491#line 10487 "parse.c"
10492 break;
10493
10494 case 414: /* block_args_tail: f_any_kwrest opt_f_block_arg */
10495#line 3620 "parse.y"
10496 {
10497 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
10498 }
10499#line 10495 "parse.c"
10500 break;
10501
10502 case 415: /* block_args_tail: f_block_arg */
10503#line 3624 "parse.y"
10504 {
10505 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
10506 }
10507#line 10503 "parse.c"
10508 break;
10509
10510 case 416: /* opt_block_args_tail: ',' block_args_tail */
10511#line 3630 "parse.y"
10512 {
10513 (yyval.node) = (yyvsp[0].node);
10514 }
10515#line 10511 "parse.c"
10516 break;
10517
10518 case 417: /* opt_block_args_tail: %empty */
10519#line 3634 "parse.y"
10520 {
10521 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
10522 }
10523#line 10519 "parse.c"
10524 break;
10525
10526 case 418: /* excessed_comma: ',' */
10527#line 3640 "parse.y"
10528 {
10529 /* magic number for rest_id in iseq_set_arguments() */
10530 /*%%%*/
10531 (yyval.id) = NODE_SPECIAL_EXCESSIVE_COMMA;
10532 /*% %*/
10533 /*% ripper: excessed_comma! %*/
10534 }
10535#line 10531 "parse.c"
10536 break;
10537
10538 case 419: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
10539#line 3650 "parse.y"
10540 {
10541 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10542 }
10543#line 10539 "parse.c"
10544 break;
10545
10546 case 420: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10547#line 3654 "parse.y"
10548 {
10549 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10550 }
10551#line 10547 "parse.c"
10552 break;
10553
10554 case 421: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
10555#line 3658 "parse.y"
10556 {
10557 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10558 }
10559#line 10555 "parse.c"
10560 break;
10561
10562 case 422: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
10563#line 3662 "parse.y"
10564 {
10565 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10566 }
10567#line 10563 "parse.c"
10568 break;
10569
10570 case 423: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
10571#line 3666 "parse.y"
10572 {
10573 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10574 }
10575#line 10571 "parse.c"
10576 break;
10577
10578 case 424: /* block_param: f_arg excessed_comma */
10579#line 3670 "parse.y"
10580 {
10581 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
10582 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), Qnone, (yyval.node), &(yyloc));
10583 }
10584#line 10580 "parse.c"
10585 break;
10586
10587 case 425: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10588#line 3675 "parse.y"
10589 {
10590 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10591 }
10592#line 10588 "parse.c"
10593 break;
10594
10595 case 426: /* block_param: f_arg opt_block_args_tail */
10596#line 3679 "parse.y"
10597 {
10598 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10599 }
10600#line 10596 "parse.c"
10601 break;
10602
10603 case 427: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
10604#line 3683 "parse.y"
10605 {
10606 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10607 }
10608#line 10604 "parse.c"
10609 break;
10610
10611 case 428: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10612#line 3687 "parse.y"
10613 {
10614 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10615 }
10616#line 10612 "parse.c"
10617 break;
10618
10619 case 429: /* block_param: f_block_optarg opt_block_args_tail */
10620#line 3691 "parse.y"
10621 {
10622 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10623 }
10624#line 10620 "parse.c"
10625 break;
10626
10627 case 430: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
10628#line 3695 "parse.y"
10629 {
10630 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10631 }
10632#line 10628 "parse.c"
10633 break;
10634
10635 case 431: /* block_param: f_rest_arg opt_block_args_tail */
10636#line 3699 "parse.y"
10637 {
10638 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10639 }
10640#line 10636 "parse.c"
10641 break;
10642
10643 case 432: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
10644#line 3703 "parse.y"
10645 {
10646 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10647 }
10648#line 10644 "parse.c"
10649 break;
10650
10651 case 433: /* block_param: block_args_tail */
10652#line 3707 "parse.y"
10653 {
10654 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10655 }
10656#line 10652 "parse.c"
10657 break;
10658
10659 case 435: /* opt_block_param: block_param_def */
10660#line 3714 "parse.y"
10661 {
10662 p->command_start = TRUE;
10663 }
10664#line 10660 "parse.c"
10665 break;
10666
10667 case 436: /* block_param_def: '|' opt_bv_decl '|' */
10668#line 3720 "parse.y"
10669 {
10670 p->cur_arg = 0;
10671 p->max_numparam = ORDINAL_PARAM;
10672 p->ctxt.in_argdef = 0;
10673 /*%%%*/
10674 (yyval.node) = 0;
10675 /*% %*/
10676 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/
10677 }
10678#line 10674 "parse.c"
10679 break;
10680
10681 case 437: /* block_param_def: '|' block_param opt_bv_decl '|' */
10682#line 3730 "parse.y"
10683 {
10684 p->cur_arg = 0;
10685 p->max_numparam = ORDINAL_PARAM;
10686 p->ctxt.in_argdef = 0;
10687 /*%%%*/
10688 (yyval.node) = (yyvsp[-2].node);
10689 /*% %*/
10690 /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/
10691 }
10692#line 10688 "parse.c"
10693 break;
10694
10695 case 438: /* opt_bv_decl: opt_nl */
10696#line 3743 "parse.y"
10697 {
10698 (yyval.node) = 0;
10699 }
10700#line 10696 "parse.c"
10701 break;
10702
10703 case 439: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
10704#line 3747 "parse.y"
10705 {
10706 /*%%%*/
10707 (yyval.node) = 0;
10708 /*% %*/
10709 /*% ripper: $3 %*/
10710 }
10711#line 10707 "parse.c"
10712 break;
10713
10714 case 442: /* bvar: "local variable or method" */
10715#line 3762 "parse.y"
10716 {
10717 new_bv(p, get_id((yyvsp[0].id)));
10718 /*% ripper: get_value($1) %*/
10719 }
10720#line 10716 "parse.c"
10721 break;
10722
10723 case 443: /* bvar: f_bad_arg */
10724#line 3767 "parse.y"
10725 {
10726 (yyval.node) = 0;
10727 }
10728#line 10724 "parse.c"
10729 break;
10730
10731 case 444: /* @25: %empty */
10732#line 3773 "parse.y"
10733 {
10734 token_info_push(p, "->", &(yylsp[0]));
10735 (yyvsp[0].vars) = dyna_push(p);
10736 (yyval.num) = p->lex.lpar_beg;
10737 p->lex.lpar_beg = p->lex.paren_nest;
10738 }
10739#line 10735 "parse.c"
10740 break;
10741
10742 case 445: /* @26: %empty */
10743#line 3779 "parse.y"
10744 {
10745 (yyval.num) = p->max_numparam;
10746 p->max_numparam = 0;
10747 }
10748#line 10744 "parse.c"
10749 break;
10750
10751 case 446: /* @27: %empty */
10752#line 3783 "parse.y"
10753 {
10754 (yyval.node) = numparam_push(p);
10755 }
10756#line 10752 "parse.c"
10757 break;
10758
10759 case 447: /* $@28: %empty */
10760#line 3787 "parse.y"
10761 {
10762 CMDARG_PUSH(0);
10763 }
10764#line 10760 "parse.c"
10765 break;
10766
10767 case 448: /* lambda: "->" @25 @26 @27 f_larglist $@28 lambda_body */
10768#line 3791 "parse.y"
10769 {
10770 int max_numparam = p->max_numparam;
10771 p->lex.lpar_beg = (yyvsp[-5].num);
10772 p->max_numparam = (yyvsp[-4].num);
10773 CMDARG_POP();
10774 (yyvsp[-2].node) = args_with_numbered(p, (yyvsp[-2].node), max_numparam);
10775 /*%%%*/
10776 {
10777 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10778 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node), (yyvsp[0].node), &loc);
10779 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
10780 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10781 nd_set_first_loc((yyval.node), (yylsp[-6]).beg_pos);
10782 }
10783 /*% %*/
10784 /*% ripper: lambda!($5, $7) %*/
10785 numparam_pop(p, (yyvsp[-3].node));
10786 dyna_pop(p, (yyvsp[-6].vars));
10787 }
10788#line 10784 "parse.c"
10789 break;
10790
10791 case 449: /* f_larglist: '(' f_args opt_bv_decl ')' */
10792#line 3813 "parse.y"
10793 {
10794 p->ctxt.in_argdef = 0;
10795 /*%%%*/
10796 (yyval.node) = (yyvsp[-2].node);
10797 p->max_numparam = ORDINAL_PARAM;
10798 /*% %*/
10799 /*% ripper: paren!($2) %*/
10800 }
10801#line 10797 "parse.c"
10802 break;
10803
10804 case 450: /* f_larglist: f_args */
10805#line 3822 "parse.y"
10806 {
10807 p->ctxt.in_argdef = 0;
10808 /*%%%*/
10809 if (!args_info_empty_p((yyvsp[0].node)->nd_ainfo))
10810 p->max_numparam = ORDINAL_PARAM;
10811 /*% %*/
10812 (yyval.node) = (yyvsp[0].node);
10813 }
10814#line 10810 "parse.c"
10815 break;
10816
10817 case 451: /* lambda_body: tLAMBEG compstmt '}' */
10818#line 3833 "parse.y"
10819 {
10820 token_info_pop(p, "}", &(yylsp[0]));
10821 (yyval.node) = (yyvsp[-1].node);
10822 }
10823#line 10819 "parse.c"
10824 break;
10825
10826 case 452: /* lambda_body: "`do' for lambda" bodystmt k_end */
10827#line 3838 "parse.y"
10828 {
10829 (yyval.node) = (yyvsp[-1].node);
10830 }
10831#line 10827 "parse.c"
10832 break;
10833
10834 case 453: /* do_block: k_do_block do_body k_end */
10835#line 3844 "parse.y"
10836 {
10837 (yyval.node) = (yyvsp[-1].node);
10838 /*%%%*/
10839 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10840 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10841 /*% %*/
10842 }
10843#line 10839 "parse.c"
10844 break;
10845
10846 case 454: /* block_call: command do_block */
10847#line 3854 "parse.y"
10848 {
10849 /*%%%*/
10850 if (nd_type_p((yyvsp[-1].node), NODE_YIELD)) {
10851 compile_error(p, "block given to yield");
10852 }
10853 else {
10854 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
10855 }
10856 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10857 fixpos((yyval.node), (yyvsp[-1].node));
10858 /*% %*/
10859 /*% ripper: method_add_block!($1, $2) %*/
10860 }
10861#line 10857 "parse.c"
10862 break;
10863
10864 case 455: /* block_call: block_call call_op2 operation2 opt_paren_args */
10865#line 3868 "parse.y"
10866 {
10867 /*%%%*/
10868 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10869 /*% %*/
10870 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
10871 }
10872#line 10868 "parse.c"
10873 break;
10874
10875 case 456: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
10876#line 3875 "parse.y"
10877 {
10878 /*%%%*/
10879 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10880 /*% %*/
10881 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
10882 }
10883#line 10879 "parse.c"
10884 break;
10885
10886 case 457: /* block_call: block_call call_op2 operation2 command_args do_block */
10887#line 3882 "parse.y"
10888 {
10889 /*%%%*/
10890 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10891 /*% %*/
10892 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
10893 }
10894#line 10890 "parse.c"
10895 break;
10896
10897 case 458: /* method_call: fcall paren_args */
10898#line 3891 "parse.y"
10899 {
10900 /*%%%*/
10901 (yyval.node) = (yyvsp[-1].node);
10902 (yyval.node)->nd_args = (yyvsp[0].node);
10903 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
10904 /*% %*/
10905 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
10906 }
10907#line 10903 "parse.c"
10908 break;
10909
10910 case 459: /* method_call: primary_value call_op operation2 opt_paren_args */
10911#line 3900 "parse.y"
10912 {
10913 /*%%%*/
10914 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10915 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10916 /*% %*/
10917 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
10918 }
10919#line 10915 "parse.c"
10920 break;
10921
10922 case 460: /* method_call: primary_value "::" operation2 paren_args */
10923#line 3908 "parse.y"
10924 {
10925 /*%%%*/
10926 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10927 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10928 /*% %*/
10929 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), $3), $4) %*/
10930 }
10931#line 10927 "parse.c"
10932 break;
10933
10934 case 461: /* method_call: primary_value "::" operation3 */
10935#line 3916 "parse.y"
10936 {
10937 /*%%%*/
10938 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
10939 /*% %*/
10940 /*% ripper: call!($1, ID2VAL(idCOLON2), $3) %*/
10941 }
10942#line 10938 "parse.c"
10943 break;
10944
10945 case 462: /* method_call: primary_value call_op paren_args */
10946#line 3923 "parse.y"
10947 {
10948 /*%%%*/
10949 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10950 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10951 /*% %*/
10952 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
10953 }
10954#line 10950 "parse.c"
10955 break;
10956
10957 case 463: /* method_call: primary_value "::" paren_args */
10958#line 3931 "parse.y"
10959 {
10960 /*%%%*/
10961 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10962 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10963 /*% %*/
10964 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), ID2VAL(idCall)), $3) %*/
10965 }
10966#line 10962 "parse.c"
10967 break;
10968
10969 case 464: /* method_call: "`super'" paren_args */
10970#line 3939 "parse.y"
10971 {
10972 /*%%%*/
10973 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
10974 /*% %*/
10975 /*% ripper: super!($2) %*/
10976 }
10977#line 10973 "parse.c"
10978 break;
10979
10980 case 465: /* method_call: "`super'" */
10981#line 3946 "parse.y"
10982 {
10983 /*%%%*/
10984 (yyval.node) = NEW_ZSUPER(&(yyloc));
10985 /*% %*/
10986 /*% ripper: zsuper! %*/
10987 }
10988#line 10984 "parse.c"
10989 break;
10990
10991 case 466: /* method_call: primary_value '[' opt_call_args rbracket */
10992#line 3953 "parse.y"
10993 {
10994 /*%%%*/
10995 if ((yyvsp[-3].node) && nd_type_p((yyvsp[-3].node), NODE_SELF))
10996 (yyval.node) = NEW_FCALL(tAREF, (yyvsp[-1].node), &(yyloc));
10997 else
10998 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
10999 fixpos((yyval.node), (yyvsp[-3].node));
11000 /*% %*/
11001 /*% ripper: aref!($1, escape_Qundef($3)) %*/
11002 }
11003#line 10999 "parse.c"
11004 break;
11005
11006 case 467: /* brace_block: '{' brace_body '}' */
11007#line 3966 "parse.y"
11008 {
11009 (yyval.node) = (yyvsp[-1].node);
11010 /*%%%*/
11011 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11012 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
11013 /*% %*/
11014 }
11015#line 11011 "parse.c"
11016 break;
11017
11018 case 468: /* brace_block: k_do do_body k_end */
11019#line 3974 "parse.y"
11020 {
11021 (yyval.node) = (yyvsp[-1].node);
11022 /*%%%*/
11023 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11024 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
11025 /*% %*/
11026 }
11027#line 11023 "parse.c"
11028 break;
11029
11030 case 469: /* @29: %empty */
11031#line 3983 "parse.y"
11032 {(yyval.vars) = dyna_push(p);}
11033#line 11029 "parse.c"
11034 break;
11035
11036 case 470: /* @30: %empty */
11037#line 3984 "parse.y"
11038 {
11039 (yyval.num) = p->max_numparam;
11040 p->max_numparam = 0;
11041 }
11042#line 11038 "parse.c"
11043 break;
11044
11045 case 471: /* @31: %empty */
11046#line 3988 "parse.y"
11047 {
11048 (yyval.node) = numparam_push(p);
11049 }
11050#line 11046 "parse.c"
11051 break;
11052
11053 case 472: /* brace_body: @29 @30 @31 opt_block_param compstmt */
11054#line 3992 "parse.y"
11055 {
11056 int max_numparam = p->max_numparam;
11057 p->max_numparam = (yyvsp[-3].num);
11058 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
11059 /*%%%*/
11060 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11061 /*% %*/
11062 /*% ripper: brace_block!(escape_Qundef($4), $5) %*/
11063 numparam_pop(p, (yyvsp[-2].node));
11064 dyna_pop(p, (yyvsp[-4].vars));
11065 }
11066#line 11062 "parse.c"
11067 break;
11068
11069 case 473: /* @32: %empty */
11070#line 4005 "parse.y"
11071 {(yyval.vars) = dyna_push(p);}
11072#line 11068 "parse.c"
11073 break;
11074
11075 case 474: /* @33: %empty */
11076#line 4006 "parse.y"
11077 {
11078 (yyval.num) = p->max_numparam;
11079 p->max_numparam = 0;
11080 }
11081#line 11077 "parse.c"
11082 break;
11083
11084 case 475: /* @34: %empty */
11085#line 4010 "parse.y"
11086 {
11087 (yyval.node) = numparam_push(p);
11088 CMDARG_PUSH(0);
11089 }
11090#line 11086 "parse.c"
11091 break;
11092
11093 case 476: /* do_body: @32 @33 @34 opt_block_param bodystmt */
11094#line 4015 "parse.y"
11095 {
11096 int max_numparam = p->max_numparam;
11097 p->max_numparam = (yyvsp[-3].num);
11098 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
11099 /*%%%*/
11100 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11101 /*% %*/
11102 /*% ripper: do_block!(escape_Qundef($4), $5) %*/
11103 CMDARG_POP();
11104 numparam_pop(p, (yyvsp[-2].node));
11105 dyna_pop(p, (yyvsp[-4].vars));
11106 }
11107#line 11103 "parse.c"
11108 break;
11109
11110 case 477: /* case_args: arg_value */
11111#line 4030 "parse.y"
11112 {
11113 /*%%%*/
11114 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
11115 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11116 /*% %*/
11117 /*% ripper: args_add!(args_new!, $1) %*/
11118 }
11119#line 11115 "parse.c"
11120 break;
11121
11122 case 478: /* case_args: "*" arg_value */
11123#line 4038 "parse.y"
11124 {
11125 /*%%%*/
11126 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
11127 /*% %*/
11128 /*% ripper: args_add_star!(args_new!, $2) %*/
11129 }
11130#line 11126 "parse.c"
11131 break;
11132
11133 case 479: /* case_args: case_args ',' arg_value */
11134#line 4045 "parse.y"
11135 {
11136 /*%%%*/
11137 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
11138 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11139 /*% %*/
11140 /*% ripper: args_add!($1, $3) %*/
11141 }
11142#line 11138 "parse.c"
11143 break;
11144
11145 case 480: /* case_args: case_args ',' "*" arg_value */
11146#line 4053 "parse.y"
11147 {
11148 /*%%%*/
11149 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
11150 /*% %*/
11151 /*% ripper: args_add_star!($1, $4) %*/
11152 }
11153#line 11149 "parse.c"
11154 break;
11155
11156 case 481: /* case_body: k_when case_args then compstmt cases */
11157#line 4064 "parse.y"
11158 {
11159 /*%%%*/
11160 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11161 fixpos((yyval.node), (yyvsp[-3].node));
11162 /*% %*/
11163 /*% ripper: when!($2, $4, escape_Qundef($5)) %*/
11164 }
11165#line 11161 "parse.c"
11166 break;
11167
11168 case 484: /* @35: %empty */
11169#line 4078 "parse.y"
11170 {
11171 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
11172 p->command_start = FALSE;
11173 (yyvsp[0].ctxt) = p->ctxt;
11174 p->ctxt.in_kwarg = 1;
11175 (yyval.tbl) = push_pvtbl(p);
11176 }
11177#line 11173 "parse.c"
11178 break;
11179
11180 case 485: /* @36: %empty */
11181#line 4085 "parse.y"
11182 {
11183 (yyval.tbl) = push_pktbl(p);
11184 }
11185#line 11181 "parse.c"
11186 break;
11187
11188 case 486: /* $@37: %empty */
11189#line 4089 "parse.y"
11190 {
11191 pop_pktbl(p, (yyvsp[-2].tbl));
11192 pop_pvtbl(p, (yyvsp[-3].tbl));
11193 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
11194 }
11195#line 11191 "parse.c"
11196 break;
11197
11198 case 487: /* p_case_body: "`in'" @35 @36 p_top_expr then $@37 compstmt p_cases */
11199#line 4096 "parse.y"
11200 {
11201 /*%%%*/
11202 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11203 /*% %*/
11204 /*% ripper: in!($4, $7, escape_Qundef($8)) %*/
11205 }
11206#line 11202 "parse.c"
11207 break;
11208
11209 case 491: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
11210#line 4110 "parse.y"
11211 {
11212 /*%%%*/
11213 (yyval.node) = new_if(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
11214 fixpos((yyval.node), (yyvsp[0].node));
11215 /*% %*/
11216 /*% ripper: if_mod!($3, $1) %*/
11217 }
11218#line 11214 "parse.c"
11219 break;
11220
11221 case 492: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
11222#line 4118 "parse.y"
11223 {
11224 /*%%%*/
11225 (yyval.node) = new_unless(p, (yyvsp[0].node), (yyvsp[-2].node), 0, &(yyloc));
11226 fixpos((yyval.node), (yyvsp[0].node));
11227 /*% %*/
11228 /*% ripper: unless_mod!($3, $1) %*/
11229 }
11230#line 11226 "parse.c"
11231 break;
11232
11233 case 494: /* p_top_expr_body: p_expr ',' */
11234#line 4129 "parse.y"
11235 {
11236 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, Qnone, &(yyloc));
11237 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
11238 }
11239#line 11235 "parse.c"
11240 break;
11241
11242 case 495: /* p_top_expr_body: p_expr ',' p_args */
11243#line 4134 "parse.y"
11244 {
11245 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
11246 /*%%%*/
11247 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
11248 /*%
11249 %*/
11250 }
11251#line 11247 "parse.c"
11252 break;
11253
11254 case 496: /* p_top_expr_body: p_find */
11255#line 4142 "parse.y"
11256 {
11257 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
11258 }
11259#line 11255 "parse.c"
11260 break;
11261
11262 case 497: /* p_top_expr_body: p_args_tail */
11263#line 4146 "parse.y"
11264 {
11265 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
11266 }
11267#line 11263 "parse.c"
11268 break;
11269
11270 case 498: /* p_top_expr_body: p_kwargs */
11271#line 4150 "parse.y"
11272 {
11273 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
11274 }
11275#line 11271 "parse.c"
11276 break;
11277
11278 case 500: /* p_as: p_expr "=>" p_variable */
11279#line 4159 "parse.y"
11280 {
11281 /*%%%*/
11282 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
11283 n = list_append(p, n, (yyvsp[0].node));
11284 (yyval.node) = new_hash(p, n, &(yyloc));
11285 /*% %*/
11286 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
11287 }
11288#line 11284 "parse.c"
11289 break;
11290
11291 case 502: /* p_alt: p_alt '|' p_expr_basic */
11292#line 4171 "parse.y"
11293 {
11294 /*%%%*/
11295 (yyval.node) = NEW_NODE(NODE_OR, (yyvsp[-2].node), (yyvsp[0].node), 0, &(yyloc));
11296 /*% %*/
11297 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
11298 }
11299#line 11295 "parse.c"
11300 break;
11301
11302 case 504: /* p_lparen: '(' */
11303#line 4180 "parse.y"
11304 {(yyval.tbl) = push_pktbl(p);}
11305#line 11301 "parse.c"
11306 break;
11307
11308 case 505: /* p_lbracket: '[' */
11309#line 4181 "parse.y"
11310 {(yyval.tbl) = push_pktbl(p);}
11311#line 11307 "parse.c"
11312 break;
11313
11314 case 508: /* p_expr_basic: p_const p_lparen p_args rparen */
11315#line 4186 "parse.y"
11316 {
11317 pop_pktbl(p, (yyvsp[-2].tbl));
11318 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
11319 /*%%%*/
11320 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11321 /*%
11322 %*/
11323 }
11324#line 11320 "parse.c"
11325 break;
11326
11327 case 509: /* p_expr_basic: p_const p_lparen p_find rparen */
11328#line 4195 "parse.y"
11329 {
11330 pop_pktbl(p, (yyvsp[-2].tbl));
11331 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11332 /*%%%*/
11333 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11334 /*%
11335 %*/
11336 }
11337#line 11333 "parse.c"
11338 break;
11339
11340 case 510: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
11341#line 4204 "parse.y"
11342 {
11343 pop_pktbl(p, (yyvsp[-2].tbl));
11344 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11345 /*%%%*/
11346 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11347 /*%
11348 %*/
11349 }
11350#line 11346 "parse.c"
11351 break;
11352
11353 case 511: /* p_expr_basic: p_const '(' rparen */
11354#line 4213 "parse.y"
11355 {
11356 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
11357 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
11358 }
11359#line 11355 "parse.c"
11360 break;
11361
11362 case 512: /* p_expr_basic: p_const p_lbracket p_args rbracket */
11363#line 4218 "parse.y"
11364 {
11365 pop_pktbl(p, (yyvsp[-2].tbl));
11366 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
11367 /*%%%*/
11368 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11369 /*%
11370 %*/
11371 }
11372#line 11368 "parse.c"
11373 break;
11374
11375 case 513: /* p_expr_basic: p_const p_lbracket p_find rbracket */
11376#line 4227 "parse.y"
11377 {
11378 pop_pktbl(p, (yyvsp[-2].tbl));
11379 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11380 /*%%%*/
11381 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11382 /*%
11383 %*/
11384 }
11385#line 11381 "parse.c"
11386 break;
11387
11388 case 514: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
11389#line 4236 "parse.y"
11390 {
11391 pop_pktbl(p, (yyvsp[-2].tbl));
11392 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11393 /*%%%*/
11394 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11395 /*%
11396 %*/
11397 }
11398#line 11394 "parse.c"
11399 break;
11400
11401 case 515: /* p_expr_basic: p_const '[' rbracket */
11402#line 4245 "parse.y"
11403 {
11404 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
11405 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
11406 }
11407#line 11403 "parse.c"
11408 break;
11409
11410 case 516: /* p_expr_basic: "[" p_args rbracket */
11411#line 4250 "parse.y"
11412 {
11413 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
11414 }
11415#line 11411 "parse.c"
11416 break;
11417
11418 case 517: /* p_expr_basic: "[" p_find rbracket */
11419#line 4254 "parse.y"
11420 {
11421 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
11422 }
11423#line 11419 "parse.c"
11424 break;
11425
11426 case 518: /* p_expr_basic: "[" rbracket */
11427#line 4258 "parse.y"
11428 {
11429 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
11430 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
11431 }
11432#line 11428 "parse.c"
11433 break;
11434
11435 case 519: /* @38: %empty */
11436#line 4263 "parse.y"
11437 {
11438 (yyval.tbl) = push_pktbl(p);
11439 (yyvsp[0].ctxt) = p->ctxt;
11440 p->ctxt.in_kwarg = 0;
11441 }
11442#line 11438 "parse.c"
11443 break;
11444
11445 case 520: /* p_expr_basic: "{" @38 p_kwargs rbrace */
11446#line 4269 "parse.y"
11447 {
11448 pop_pktbl(p, (yyvsp[-2].tbl));
11449 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
11450 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
11451 }
11452#line 11448 "parse.c"
11453 break;
11454
11455 case 521: /* p_expr_basic: "{" rbrace */
11456#line 4275 "parse.y"
11457 {
11458 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
11459 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
11460 }
11461#line 11457 "parse.c"
11462 break;
11463
11464 case 522: /* @39: %empty */
11465#line 4279 "parse.y"
11466 {(yyval.tbl) = push_pktbl(p);}
11467#line 11463 "parse.c"
11468 break;
11469
11470 case 523: /* p_expr_basic: "(" @39 p_expr rparen */
11471#line 4280 "parse.y"
11472 {
11473 pop_pktbl(p, (yyvsp[-2].tbl));
11474 (yyval.node) = (yyvsp[-1].node);
11475 }
11476#line 11472 "parse.c"
11477 break;
11478
11479 case 524: /* p_args: p_expr */
11480#line 4287 "parse.y"
11481 {
11482 /*%%%*/
11483 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
11484 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &(yyloc));
11485 /*%
11486 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, 0, Qnone, &@$);
11487 %*/
11488 }
11489#line 11485 "parse.c"
11490 break;
11491
11492 case 525: /* p_args: p_args_head */
11493#line 4296 "parse.y"
11494 {
11495 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, Qnone, &(yyloc));
11496 }
11497#line 11493 "parse.c"
11498 break;
11499
11500 case 526: /* p_args: p_args_head p_arg */
11501#line 4300 "parse.y"
11502 {
11503 /*%%%*/
11504 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, Qnone, &(yyloc));
11505 /*%
11506 VALUE pre_args = rb_ary_concat($1, get_value($2));
11507 $$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$);
11508 %*/
11509 }
11510#line 11506 "parse.c"
11511 break;
11512
11513 case 527: /* p_args: p_args_head "*" "local variable or method" */
11514#line 4309 "parse.y"
11515 {
11516 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-2].node), 1, (yyvsp[0].id), Qnone, &(yyloc));
11517 }
11518#line 11514 "parse.c"
11519 break;
11520
11521 case 528: /* p_args: p_args_head "*" "local variable or method" ',' p_args_post */
11522#line 4313 "parse.y"
11523 {
11524 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-4].node), 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11525 }
11526#line 11522 "parse.c"
11527 break;
11528
11529 case 529: /* p_args: p_args_head "*" */
11530#line 4317 "parse.y"
11531 {
11532 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, 0, Qnone, &(yyloc));
11533 }
11534#line 11530 "parse.c"
11535 break;
11536
11537 case 530: /* p_args: p_args_head "*" ',' p_args_post */
11538#line 4321 "parse.y"
11539 {
11540 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, 0, (yyvsp[0].node), &(yyloc));
11541 }
11542#line 11538 "parse.c"
11543 break;
11544
11545 case 532: /* p_args_head: p_arg ',' */
11546#line 4328 "parse.y"
11547 {
11548 (yyval.node) = (yyvsp[-1].node);
11549 }
11550#line 11546 "parse.c"
11551 break;
11552
11553 case 533: /* p_args_head: p_args_head p_arg ',' */
11554#line 4332 "parse.y"
11555 {
11556 /*%%%*/
11557 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
11558 /*% %*/
11559 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
11560 }
11561#line 11557 "parse.c"
11562 break;
11563
11564 case 534: /* p_args_tail: p_rest */
11565#line 4341 "parse.y"
11566 {
11567 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].id), Qnone, &(yyloc));
11568 }
11569#line 11565 "parse.c"
11570 break;
11571
11572 case 535: /* p_args_tail: p_rest ',' p_args_post */
11573#line 4345 "parse.y"
11574 {
11575 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11576 }
11577#line 11573 "parse.c"
11578 break;
11579
11580 case 536: /* p_find: p_rest ',' p_args_post ',' p_rest */
11581#line 4351 "parse.y"
11582 {
11583 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].id), (yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11584
11585 if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL))
11586 rb_warn0L_experimental(nd_line((yyval.node)), "Find pattern is experimental, and the behavior may change in future versions of Ruby!");
11587 }
11588#line 11584 "parse.c"
11589 break;
11590
11591 case 537: /* p_rest: "*" "local variable or method" */
11592#line 4361 "parse.y"
11593 {
11594 (yyval.id) = (yyvsp[0].id);
11595 }
11596#line 11592 "parse.c"
11597 break;
11598
11599 case 538: /* p_rest: "*" */
11600#line 4365 "parse.y"
11601 {
11602 (yyval.id) = 0;
11603 }
11604#line 11600 "parse.c"
11605 break;
11606
11607 case 540: /* p_args_post: p_args_post ',' p_arg */
11608#line 4372 "parse.y"
11609 {
11610 /*%%%*/
11611 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
11612 /*% %*/
11613 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
11614 }
11615#line 11611 "parse.c"
11616 break;
11617
11618 case 541: /* p_arg: p_expr */
11619#line 4381 "parse.y"
11620 {
11621 /*%%%*/
11622 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11623 /*% %*/
11624 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
11625 }
11626#line 11622 "parse.c"
11627 break;
11628
11629 case 542: /* p_kwargs: p_kwarg ',' p_any_kwrest */
11630#line 4390 "parse.y"
11631 {
11632 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
11633 }
11634#line 11630 "parse.c"
11635 break;
11636
11637 case 543: /* p_kwargs: p_kwarg */
11638#line 4394 "parse.y"
11639 {
11640 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
11641 }
11642#line 11638 "parse.c"
11643 break;
11644
11645 case 544: /* p_kwargs: p_kwarg ',' */
11646#line 4398 "parse.y"
11647 {
11648 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
11649 }
11650#line 11646 "parse.c"
11651 break;
11652
11653 case 545: /* p_kwargs: p_any_kwrest */
11654#line 4402 "parse.y"
11655 {
11656 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
11657 }
11658#line 11654 "parse.c"
11659 break;
11660
11661 case 547: /* p_kwarg: p_kwarg ',' p_kw */
11662#line 4410 "parse.y"
11663 {
11664 /*%%%*/
11665 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
11666 /*% %*/
11667 /*% ripper: rb_ary_push($1, $3) %*/
11668 }
11669#line 11665 "parse.c"
11670 break;
11671
11672 case 548: /* p_kw: p_kw_label p_expr */
11673#line 4419 "parse.y"
11674 {
11675 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
11676 /*%%%*/
11677 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yyloc)), &(yyloc)), (yyvsp[0].node));
11678 /*% %*/
11679 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
11680 }
11681#line 11677 "parse.c"
11682 break;
11683
11684 case 549: /* p_kw: p_kw_label */
11685#line 4427 "parse.y"
11686 {
11687 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
11688 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
11689 yyerror1(&(yylsp[0]), "key must be valid as local variables");
11690 }
11691 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
11692 /*%%%*/
11693 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
11694 /*% %*/
11695 /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/
11696 }
11697#line 11693 "parse.c"
11698 break;
11699
11700 case 551: /* p_kw_label: "string literal" string_contents tLABEL_END */
11701#line 4442 "parse.y"
11702 {
11703 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11704 /*%%%*/
11705 if (!(yyvsp[-1].node) || nd_type_p((yyvsp[-1].node), NODE_STR)) {
11706 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
11707 (yyval.id) = SYM2ID(node->nd_lit);
11708 }
11709 /*%
11710 if (ripper_is_node_yylval($2) && RNODE($2)->nd_cval) {
11711 VALUE label = RNODE($2)->nd_cval;
11712 VALUE rval = RNODE($2)->nd_rval;
11713 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
11714 RNODE($$)->nd_loc = loc;
11715 }
11716 %*/
11717 else {
11718 yyerror1(&loc, "symbol literal with interpolation is not allowed");
11719 (yyval.id) = 0;
11720 }
11721 }
11722#line 11718 "parse.c"
11723 break;
11724
11725 case 552: /* p_kwrest: kwrest_mark "local variable or method" */
11726#line 4465 "parse.y"
11727 {
11728 (yyval.id) = (yyvsp[0].id);
11729 }
11730#line 11726 "parse.c"
11731 break;
11732
11733 case 553: /* p_kwrest: kwrest_mark */
11734#line 4469 "parse.y"
11735 {
11736 (yyval.id) = 0;
11737 }
11738#line 11734 "parse.c"
11739 break;
11740
11741 case 554: /* p_kwnorest: kwrest_mark "`nil'" */
11742#line 4475 "parse.y"
11743 {
11744 (yyval.id) = 0;
11745 }
11746#line 11742 "parse.c"
11747 break;
11748
11749 case 556: /* p_any_kwrest: p_kwnorest */
11750#line 4481 "parse.y"
11751 {(yyval.id) = ID2VAL(idNil);}
11752#line 11748 "parse.c"
11753 break;
11754
11755 case 558: /* p_value: p_primitive ".." p_primitive */
11756#line 4486 "parse.y"
11757 {
11758 /*%%%*/
11759 value_expr((yyvsp[-2].node));
11760 value_expr((yyvsp[0].node));
11761 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11762 /*% %*/
11763 /*% ripper: dot2!($1, $3) %*/
11764 }
11765#line 11761 "parse.c"
11766 break;
11767
11768 case 559: /* p_value: p_primitive "..." p_primitive */
11769#line 4495 "parse.y"
11770 {
11771 /*%%%*/
11772 value_expr((yyvsp[-2].node));
11773 value_expr((yyvsp[0].node));
11774 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11775 /*% %*/
11776 /*% ripper: dot3!($1, $3) %*/
11777 }
11778#line 11774 "parse.c"
11779 break;
11780
11781 case 560: /* p_value: p_primitive ".." */
11782#line 4504 "parse.y"
11783 {
11784 /*%%%*/
11785 value_expr((yyvsp[-1].node));
11786 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11787 /*% %*/
11788 /*% ripper: dot2!($1, Qnil) %*/
11789 }
11790#line 11786 "parse.c"
11791 break;
11792
11793 case 561: /* p_value: p_primitive "..." */
11794#line 4512 "parse.y"
11795 {
11796 /*%%%*/
11797 value_expr((yyvsp[-1].node));
11798 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11799 /*% %*/
11800 /*% ripper: dot3!($1, Qnil) %*/
11801 }
11802#line 11798 "parse.c"
11803 break;
11804
11805 case 565: /* p_value: "(.." p_primitive */
11806#line 4523 "parse.y"
11807 {
11808 /*%%%*/
11809 value_expr((yyvsp[0].node));
11810 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11811 /*% %*/
11812 /*% ripper: dot2!(Qnil, $2) %*/
11813 }
11814#line 11810 "parse.c"
11815 break;
11816
11817 case 566: /* p_value: "(..." p_primitive */
11818#line 4531 "parse.y"
11819 {
11820 /*%%%*/
11821 value_expr((yyvsp[0].node));
11822 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11823 /*% %*/
11824 /*% ripper: dot3!(Qnil, $2) %*/
11825 }
11826#line 11822 "parse.c"
11827 break;
11828
11829 case 575: /* p_primitive: keyword_variable */
11830#line 4549 "parse.y"
11831 {
11832 /*%%%*/
11833 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
11834 /*% %*/
11835 /*% ripper: var_ref!($1) %*/
11836 }
11837#line 11833 "parse.c"
11838 break;
11839
11840 case 577: /* p_variable: "local variable or method" */
11841#line 4559 "parse.y"
11842 {
11843 /*%%%*/
11844 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
11845 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11846 /*% %*/
11847 /*% ripper: assignable(p, var_field(p, $1)) %*/
11848 }
11849#line 11845 "parse.c"
11850 break;
11851
11852 case 578: /* p_var_ref: '^' "local variable or method" */
11853#line 4569 "parse.y"
11854 {
11855 /*%%%*/
11856 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
11857 if (!(nd_type_p(n, NODE_LVAR) || nd_type_p(n, NODE_DVAR))) {
11858 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
11859 }
11860 (yyval.node) = n;
11861 /*% %*/
11862 /*% ripper: var_ref!($2) %*/
11863 }
11864#line 11860 "parse.c"
11865 break;
11866
11867 case 579: /* p_var_ref: '^' nonlocal_var */
11868#line 4580 "parse.y"
11869 {
11870 /*%%%*/
11871 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
11872 /*% %*/
11873 /*% ripper: var_ref!($2) %*/
11874 }
11875#line 11871 "parse.c"
11876 break;
11877
11878 case 580: /* p_expr_ref: '^' "(" expr_value ')' */
11879#line 4589 "parse.y"
11880 {
11881 /*%%%*/
11882 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
11883 /*% %*/
11884 /*% ripper: begin!($3) %*/
11885 }
11886#line 11882 "parse.c"
11887 break;
11888
11889 case 581: /* p_const: ":: at EXPR_BEG" cname */
11890#line 4598 "parse.y"
11891 {
11892 /*%%%*/
11893 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
11894 /*% %*/
11895 /*% ripper: top_const_ref!($2) %*/
11896 }
11897#line 11893 "parse.c"
11898 break;
11899
11900 case 582: /* p_const: p_const "::" cname */
11901#line 4605 "parse.y"
11902 {
11903 /*%%%*/
11904 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11905 /*% %*/
11906 /*% ripper: const_path_ref!($1, $3) %*/
11907 }
11908#line 11904 "parse.c"
11909 break;
11910
11911 case 583: /* p_const: "constant" */
11912#line 4612 "parse.y"
11913 {
11914 /*%%%*/
11915 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
11916 /*% %*/
11917 /*% ripper: var_ref!($1) %*/
11918 }
11919#line 11915 "parse.c"
11920 break;
11921
11922 case 584: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
11923#line 4623 "parse.y"
11924 {
11925 /*%%%*/
11926 (yyval.node) = NEW_RESBODY((yyvsp[-4].node),
11927 (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),
11928 (yyvsp[0].node), &(yyloc));
11929 fixpos((yyval.node), (yyvsp[-4].node)?(yyvsp[-4].node):(yyvsp[-1].node));
11930 /*% %*/
11931 /*% ripper: rescue!(escape_Qundef($2), escape_Qundef($3), escape_Qundef($5), escape_Qundef($6)) %*/
11932 }
11933#line 11929 "parse.c"
11934 break;
11935
11936 case 586: /* exc_list: arg_value */
11937#line 4636 "parse.y"
11938 {
11939 /*%%%*/
11940 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11941 /*% %*/
11942 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
11943 }
11944#line 11940 "parse.c"
11945 break;
11946
11947 case 587: /* exc_list: mrhs */
11948#line 4643 "parse.y"
11949 {
11950 /*%%%*/
11951 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
11952 /*% %*/
11953 /*% ripper: $1 %*/
11954 }
11955#line 11951 "parse.c"
11956 break;
11957
11958 case 589: /* exc_var: "=>" lhs */
11959#line 4653 "parse.y"
11960 {
11961 (yyval.node) = (yyvsp[0].node);
11962 }
11963#line 11959 "parse.c"
11964 break;
11965
11966 case 591: /* opt_ensure: k_ensure compstmt */
11967#line 4660 "parse.y"
11968 {
11969 /*%%%*/
11970 (yyval.node) = (yyvsp[0].node);
11971 /*% %*/
11972 /*% ripper: ensure!($2) %*/
11973 }
11974#line 11970 "parse.c"
11975 break;
11976
11977 case 595: /* strings: string */
11978#line 4674 "parse.y"
11979 {
11980 /*%%%*/
11981 NODE *node = (yyvsp[0].node);
11982 if (!node) {
11983 node = NEW_STR(STR_NEW0(), &(yyloc));
11984 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
11985 }
11986 else {
11987 node = evstr2dstr(p, node);
11988 }
11989 (yyval.node) = node;
11990 /*% %*/
11991 /*% ripper: $1 %*/
11992 }
11993#line 11989 "parse.c"
11994 break;
11995
11996 case 598: /* string: string string1 */
11997#line 4693 "parse.y"
11998 {
11999 /*%%%*/
12000 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12001 /*% %*/
12002 /*% ripper: string_concat!($1, $2) %*/
12003 }
12004#line 12000 "parse.c"
12005 break;
12006
12007 case 599: /* string1: "string literal" string_contents "terminator" */
12008#line 4702 "parse.y"
12009 {
12010 /*%%%*/
12011 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
12012 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
12013 /*% %*/
12014 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
12015 }
12016#line 12012 "parse.c"
12017 break;
12018
12019 case 600: /* xstring: "backtick literal" xstring_contents "terminator" */
12020#line 4712 "parse.y"
12021 {
12022 /*%%%*/
12023 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
12024 /*% %*/
12025 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
12026 }
12027#line 12023 "parse.c"
12028 break;
12029
12030 case 601: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
12031#line 4721 "parse.y"
12032 {
12033 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
12034 }
12035#line 12031 "parse.c"
12036 break;
12037
12038 case 602: /* words: "word list" ' ' word_list "terminator" */
12039#line 4727 "parse.y"
12040 {
12041 /*%%%*/
12042 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12043 /*% %*/
12044 /*% ripper: array!($3) %*/
12045 }
12046#line 12042 "parse.c"
12047 break;
12048
12049 case 603: /* word_list: %empty */
12050#line 4736 "parse.y"
12051 {
12052 /*%%%*/
12053 (yyval.node) = 0;
12054 /*% %*/
12055 /*% ripper: words_new! %*/
12056 }
12057#line 12053 "parse.c"
12058 break;
12059
12060 case 604: /* word_list: word_list word ' ' */
12061#line 4743 "parse.y"
12062 {
12063 /*%%%*/
12064 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
12065 /*% %*/
12066 /*% ripper: words_add!($1, $2) %*/
12067 }
12068#line 12064 "parse.c"
12069 break;
12070
12071 case 606: /* word: word string_content */
12072#line 4754 "parse.y"
12073 {
12074 /*%%%*/
12075 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12076 /*% %*/
12077 /*% ripper: word_add!($1, $2) %*/
12078 }
12079#line 12075 "parse.c"
12080 break;
12081
12082 case 607: /* symbols: "symbol list" ' ' symbol_list "terminator" */
12083#line 4763 "parse.y"
12084 {
12085 /*%%%*/
12086 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12087 /*% %*/
12088 /*% ripper: array!($3) %*/
12089 }
12090#line 12086 "parse.c"
12091 break;
12092
12093 case 608: /* symbol_list: %empty */
12094#line 4772 "parse.y"
12095 {
12096 /*%%%*/
12097 (yyval.node) = 0;
12098 /*% %*/
12099 /*% ripper: symbols_new! %*/
12100 }
12101#line 12097 "parse.c"
12102 break;
12103
12104 case 609: /* symbol_list: symbol_list word ' ' */
12105#line 4779 "parse.y"
12106 {
12107 /*%%%*/
12108 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
12109 /*% %*/
12110 /*% ripper: symbols_add!($1, $2) %*/
12111 }
12112#line 12108 "parse.c"
12113 break;
12114
12115 case 610: /* qwords: "verbatim word list" ' ' qword_list "terminator" */
12116#line 4788 "parse.y"
12117 {
12118 /*%%%*/
12119 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12120 /*% %*/
12121 /*% ripper: array!($3) %*/
12122 }
12123#line 12119 "parse.c"
12124 break;
12125
12126 case 611: /* qsymbols: "verbatim symbol list" ' ' qsym_list "terminator" */
12127#line 4797 "parse.y"
12128 {
12129 /*%%%*/
12130 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
12131 /*% %*/
12132 /*% ripper: array!($3) %*/
12133 }
12134#line 12130 "parse.c"
12135 break;
12136
12137 case 612: /* qword_list: %empty */
12138#line 4806 "parse.y"
12139 {
12140 /*%%%*/
12141 (yyval.node) = 0;
12142 /*% %*/
12143 /*% ripper: qwords_new! %*/
12144 }
12145#line 12141 "parse.c"
12146 break;
12147
12148 case 613: /* qword_list: qword_list "literal content" ' ' */
12149#line 4813 "parse.y"
12150 {
12151 /*%%%*/
12152 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
12153 /*% %*/
12154 /*% ripper: qwords_add!($1, $2) %*/
12155 }
12156#line 12152 "parse.c"
12157 break;
12158
12159 case 614: /* qsym_list: %empty */
12160#line 4822 "parse.y"
12161 {
12162 /*%%%*/
12163 (yyval.node) = 0;
12164 /*% %*/
12165 /*% ripper: qsymbols_new! %*/
12166 }
12167#line 12163 "parse.c"
12168 break;
12169
12170 case 615: /* qsym_list: qsym_list "literal content" ' ' */
12171#line 4829 "parse.y"
12172 {
12173 /*%%%*/
12174 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
12175 /*% %*/
12176 /*% ripper: qsymbols_add!($1, $2) %*/
12177 }
12178#line 12174 "parse.c"
12179 break;
12180
12181 case 616: /* string_contents: %empty */
12182#line 4838 "parse.y"
12183 {
12184 /*%%%*/
12185 (yyval.node) = 0;
12186 /*% %*/
12187 /*% ripper: string_content! %*/
12188 /*%%%*/
12189 /*%
12190 $$ = ripper_new_yylval(p, 0, $$, 0);
12191 %*/
12192 }
12193#line 12189 "parse.c"
12194 break;
12195
12196 case 617: /* string_contents: string_contents string_content */
12197#line 4849 "parse.y"
12198 {
12199 /*%%%*/
12200 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12201 /*% %*/
12202 /*% ripper: string_add!($1, $2) %*/
12203 /*%%%*/
12204 /*%
12205 if (ripper_is_node_yylval($1) && ripper_is_node_yylval($2) &&
12206 !RNODE($1)->nd_cval) {
12207 RNODE($1)->nd_cval = RNODE($2)->nd_cval;
12208 RNODE($1)->nd_rval = add_mark_object(p, $$);
12209 $$ = $1;
12210 }
12211 %*/
12212 }
12213#line 12209 "parse.c"
12214 break;
12215
12216 case 618: /* xstring_contents: %empty */
12217#line 4867 "parse.y"
12218 {
12219 /*%%%*/
12220 (yyval.node) = 0;
12221 /*% %*/
12222 /*% ripper: xstring_new! %*/
12223 }
12224#line 12220 "parse.c"
12225 break;
12226
12227 case 619: /* xstring_contents: xstring_contents string_content */
12228#line 4874 "parse.y"
12229 {
12230 /*%%%*/
12231 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12232 /*% %*/
12233 /*% ripper: xstring_add!($1, $2) %*/
12234 }
12235#line 12231 "parse.c"
12236 break;
12237
12238 case 620: /* regexp_contents: %empty */
12239#line 4883 "parse.y"
12240 {
12241 /*%%%*/
12242 (yyval.node) = 0;
12243 /*% %*/
12244 /*% ripper: regexp_new! %*/
12245 /*%%%*/
12246 /*%
12247 $$ = ripper_new_yylval(p, 0, $$, 0);
12248 %*/
12249 }
12250#line 12246 "parse.c"
12251 break;
12252
12253 case 621: /* regexp_contents: regexp_contents string_content */
12254#line 4894 "parse.y"
12255 {
12256 /*%%%*/
12257 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
12258 if (!head) {
12259 (yyval.node) = tail;
12260 }
12261 else if (!tail) {
12262 (yyval.node) = head;
12263 }
12264 else {
12265 switch (nd_type(head)) {
12266 case NODE_STR:
12267 nd_set_type(head, NODE_DSTR);
12268 break;
12269 case NODE_DSTR:
12270 break;
12271 default:
12272 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
12273 break;
12274 }
12275 (yyval.node) = list_append(p, head, tail);
12276 }
12277 /*%
12278 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
12279 if (ripper_is_node_yylval(n1)) {
12280 s1 = RNODE(n1)->nd_cval;
12281 n1 = RNODE(n1)->nd_rval;
12282 }
12283 if (ripper_is_node_yylval(n2)) {
12284 s2 = RNODE(n2)->nd_cval;
12285 n2 = RNODE(n2)->nd_rval;
12286 }
12287 $$ = dispatch2(regexp_add, n1, n2);
12288 if (!s1 && s2) {
12289 $$ = ripper_new_yylval(p, 0, $$, s2);
12290 }
12291 %*/
12292 }
12293#line 12289 "parse.c"
12294 break;
12295
12296 case 623: /* @40: %empty */
12297#line 4937 "parse.y"
12298 {
12299 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
12300 (yyval.strterm) = p->lex.strterm;
12301 p->lex.strterm = 0;
12302 SET_LEX_STATE(EXPR_BEG);
12303 }
12304#line 12300 "parse.c"
12305 break;
12306
12307 case 624: /* string_content: tSTRING_DVAR @40 string_dvar */
12308#line 4944 "parse.y"
12309 {
12310 p->lex.strterm = (yyvsp[-1].strterm);
12311 /*%%%*/
12312 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
12313 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
12314 /*% %*/
12315 /*% ripper: string_dvar!($3) %*/
12316 }
12317#line 12313 "parse.c"
12318 break;
12319
12320 case 625: /* $@41: %empty */
12321#line 4953 "parse.y"
12322 {
12323 CMDARG_PUSH(0);
12324 COND_PUSH(0);
12325 }
12326#line 12322 "parse.c"
12327 break;
12328
12329 case 626: /* @42: %empty */
12330#line 4957 "parse.y"
12331 {
12332 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
12333 (yyval.strterm) = p->lex.strterm;
12334 p->lex.strterm = 0;
12335 }
12336#line 12332 "parse.c"
12337 break;
12338
12339 case 627: /* @43: %empty */
12340#line 4962 "parse.y"
12341 {
12342 (yyval.num) = p->lex.state;
12343 SET_LEX_STATE(EXPR_BEG);
12344 }
12345#line 12341 "parse.c"
12346 break;
12347
12348 case 628: /* @44: %empty */
12349#line 4966 "parse.y"
12350 {
12351 (yyval.num) = p->lex.brace_nest;
12352 p->lex.brace_nest = 0;
12353 }
12354#line 12350 "parse.c"
12355 break;
12356
12357 case 629: /* @45: %empty */
12358#line 4970 "parse.y"
12359 {
12360 (yyval.num) = p->heredoc_indent;
12361 p->heredoc_indent = 0;
12362 }
12363#line 12359 "parse.c"
12364 break;
12365
12366 case 630: /* string_content: tSTRING_DBEG $@41 @42 @43 @44 @45 compstmt "'}'" */
12367#line 4975 "parse.y"
12368 {
12369 COND_POP();
12370 CMDARG_POP();
12371 p->lex.strterm = (yyvsp[-5].strterm);
12372 SET_LEX_STATE((yyvsp[-4].num));
12373 p->lex.brace_nest = (yyvsp[-3].num);
12374 p->heredoc_indent = (yyvsp[-2].num);
12375 p->heredoc_line_indent = -1;
12376 /*%%%*/
12377 if ((yyvsp[-1].node)) (yyvsp[-1].node)->flags &= ~NODE_FL_NEWLINE;
12378 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
12379 /*% %*/
12380 /*% ripper: string_embexpr!($7) %*/
12381 }
12382#line 12378 "parse.c"
12383 break;
12384
12385 case 631: /* string_dvar: "global variable" */
12386#line 4992 "parse.y"
12387 {
12388 /*%%%*/
12389 (yyval.node) = NEW_GVAR((yyvsp[0].id), &(yyloc));
12390 /*% %*/
12391 /*% ripper: var_ref!($1) %*/
12392 }
12393#line 12389 "parse.c"
12394 break;
12395
12396 case 632: /* string_dvar: "instance variable" */
12397#line 4999 "parse.y"
12398 {
12399 /*%%%*/
12400 (yyval.node) = NEW_IVAR((yyvsp[0].id), &(yyloc));
12401 /*% %*/
12402 /*% ripper: var_ref!($1) %*/
12403 }
12404#line 12400 "parse.c"
12405 break;
12406
12407 case 633: /* string_dvar: "class variable" */
12408#line 5006 "parse.y"
12409 {
12410 /*%%%*/
12411 (yyval.node) = NEW_CVAR((yyvsp[0].id), &(yyloc));
12412 /*% %*/
12413 /*% ripper: var_ref!($1) %*/
12414 }
12415#line 12411 "parse.c"
12416 break;
12417
12418 case 637: /* ssym: "symbol literal" sym */
12419#line 5020 "parse.y"
12420 {
12421 SET_LEX_STATE(EXPR_END);
12422 /*%%%*/
12423 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
12424 /*% %*/
12425 /*% ripper: symbol_literal!(symbol!($2)) %*/
12426 }
12427#line 12423 "parse.c"
12428 break;
12429
12430 case 642: /* dsym: "symbol literal" string_contents "terminator" */
12431#line 5036 "parse.y"
12432 {
12433 SET_LEX_STATE(EXPR_END);
12434 /*%%%*/
12435 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
12436 /*% %*/
12437 /*% ripper: dyna_symbol!($2) %*/
12438 }
12439#line 12435 "parse.c"
12440 break;
12441
12442 case 644: /* numeric: tUMINUS_NUM simple_numeric */
12443#line 5047 "parse.y"
12444 {
12445 /*%%%*/
12446 (yyval.node) = (yyvsp[0].node);
12447 RB_OBJ_WRITE(p->ast, &(yyval.node)->nd_lit, negate_lit(p, (yyval.node)->nd_lit));
12448 /*% %*/
12449 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
12450 }
12451#line 12447 "parse.c"
12452 break;
12453
12454 case 657: /* keyword_variable: "`nil'" */
12455#line 5074 "parse.y"
12456 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
12457#line 12453 "parse.c"
12458 break;
12459
12460 case 658: /* keyword_variable: "`self'" */
12461#line 5075 "parse.y"
12462 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
12463#line 12459 "parse.c"
12464 break;
12465
12466 case 659: /* keyword_variable: "`true'" */
12467#line 5076 "parse.y"
12468 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
12469#line 12465 "parse.c"
12470 break;
12471
12472 case 660: /* keyword_variable: "`false'" */
12473#line 5077 "parse.y"
12474 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
12475#line 12471 "parse.c"
12476 break;
12477
12478 case 661: /* keyword_variable: "`__FILE__'" */
12479#line 5078 "parse.y"
12480 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
12481#line 12477 "parse.c"
12482 break;
12483
12484 case 662: /* keyword_variable: "`__LINE__'" */
12485#line 5079 "parse.y"
12486 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
12487#line 12483 "parse.c"
12488 break;
12489
12490 case 663: /* keyword_variable: "`__ENCODING__'" */
12491#line 5080 "parse.y"
12492 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
12493#line 12489 "parse.c"
12494 break;
12495
12496 case 664: /* var_ref: user_variable */
12497#line 5084 "parse.y"
12498 {
12499 /*%%%*/
12500 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
12501 /*%
12502 if (id_is_var(p, get_id($1))) {
12503 $$ = dispatch1(var_ref, $1);
12504 }
12505 else {
12506 $$ = dispatch1(vcall, $1);
12507 }
12508 %*/
12509 }
12510#line 12506 "parse.c"
12511 break;
12512
12513 case 665: /* var_ref: keyword_variable */
12514#line 5097 "parse.y"
12515 {
12516 /*%%%*/
12517 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
12518 /*% %*/
12519 /*% ripper: var_ref!($1) %*/
12520 }
12521#line 12517 "parse.c"
12522 break;
12523
12524 case 666: /* var_lhs: user_variable */
12525#line 5106 "parse.y"
12526 {
12527 /*%%%*/
12528 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12529 /*% %*/
12530 /*% ripper: assignable(p, var_field(p, $1)) %*/
12531 }
12532#line 12528 "parse.c"
12533 break;
12534
12535 case 667: /* var_lhs: keyword_variable */
12536#line 5113 "parse.y"
12537 {
12538 /*%%%*/
12539 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12540 /*% %*/
12541 /*% ripper: assignable(p, var_field(p, $1)) %*/
12542 }
12543#line 12539 "parse.c"
12544 break;
12545
12546 case 670: /* $@46: %empty */
12547#line 5126 "parse.y"
12548 {
12549 SET_LEX_STATE(EXPR_BEG);
12550 p->command_start = TRUE;
12551 }
12552#line 12548 "parse.c"
12553 break;
12554
12555 case 671: /* superclass: '<' $@46 expr_value term */
12556#line 5131 "parse.y"
12557 {
12558 (yyval.node) = (yyvsp[-1].node);
12559 }
12560#line 12556 "parse.c"
12561 break;
12562
12563 case 672: /* superclass: %empty */
12564#line 5135 "parse.y"
12565 {
12566 /*%%%*/
12567 (yyval.node) = 0;
12568 /*% %*/
12569 /*% ripper: Qnil %*/
12570 }
12571#line 12567 "parse.c"
12572 break;
12573
12574 case 674: /* f_opt_paren_args: none */
12575#line 5145 "parse.y"
12576 {
12577 p->ctxt.in_argdef = 0;
12578 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[-1]));
12579 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[-1]));
12580 }
12581#line 12577 "parse.c"
12582 break;
12583
12584 case 675: /* f_paren_args: '(' f_args rparen */
12585#line 5153 "parse.y"
12586 {
12587 /*%%%*/
12588 (yyval.node) = (yyvsp[-1].node);
12589 /*% %*/
12590 /*% ripper: paren!($2) %*/
12591 SET_LEX_STATE(EXPR_BEG);
12592 p->command_start = TRUE;
12593 p->ctxt.in_argdef = 0;
12594 }
12595#line 12591 "parse.c"
12596 break;
12597
12598 case 677: /* @47: %empty */
12599#line 5165 "parse.y"
12600 {
12601 (yyval.ctxt) = p->ctxt;
12602 p->ctxt.in_kwarg = 1;
12603 p->ctxt.in_argdef = 1;
12604 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
12605 }
12606#line 12602 "parse.c"
12607 break;
12608
12609 case 678: /* f_arglist: @47 f_args term */
12610#line 5172 "parse.y"
12611 {
12612 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
12613 p->ctxt.in_argdef = 0;
12614 (yyval.node) = (yyvsp[-1].node);
12615 SET_LEX_STATE(EXPR_BEG);
12616 p->command_start = TRUE;
12617 }
12618#line 12614 "parse.c"
12619 break;
12620
12621 case 679: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
12622#line 5182 "parse.y"
12623 {
12624 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12625 }
12626#line 12622 "parse.c"
12627 break;
12628
12629 case 680: /* args_tail: f_kwarg opt_f_block_arg */
12630#line 5186 "parse.y"
12631 {
12632 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
12633 }
12634#line 12630 "parse.c"
12635 break;
12636
12637 case 681: /* args_tail: f_any_kwrest opt_f_block_arg */
12638#line 5190 "parse.y"
12639 {
12640 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12641 }
12642#line 12638 "parse.c"
12643 break;
12644
12645 case 682: /* args_tail: f_block_arg */
12646#line 5194 "parse.y"
12647 {
12648 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
12649 }
12650#line 12646 "parse.c"
12651 break;
12652
12653 case 683: /* args_tail: args_forward */
12654#line 5198 "parse.y"
12655 {
12656 add_forwarding_args(p);
12657 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[0].id), ID2VAL(idFWD_BLOCK), &(yylsp[0]));
12658 }
12659#line 12655 "parse.c"
12660 break;
12661
12662 case 684: /* opt_args_tail: ',' args_tail */
12663#line 5205 "parse.y"
12664 {
12665 (yyval.node) = (yyvsp[0].node);
12666 }
12667#line 12663 "parse.c"
12668 break;
12669
12670 case 685: /* opt_args_tail: %empty */
12671#line 5209 "parse.y"
12672 {
12673 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12674 }
12675#line 12671 "parse.c"
12676 break;
12677
12678 case 686: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
12679#line 5215 "parse.y"
12680 {
12681 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12682 }
12683#line 12679 "parse.c"
12684 break;
12685
12686 case 687: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
12687#line 5219 "parse.y"
12688 {
12689 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12690 }
12691#line 12687 "parse.c"
12692 break;
12693
12694 case 688: /* f_args: f_arg ',' f_optarg opt_args_tail */
12695#line 5223 "parse.y"
12696 {
12697 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12698 }
12699#line 12695 "parse.c"
12700 break;
12701
12702 case 689: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
12703#line 5227 "parse.y"
12704 {
12705 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12706 }
12707#line 12703 "parse.c"
12708 break;
12709
12710 case 690: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
12711#line 5231 "parse.y"
12712 {
12713 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12714 }
12715#line 12711 "parse.c"
12716 break;
12717
12718 case 691: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
12719#line 5235 "parse.y"
12720 {
12721 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12722 }
12723#line 12719 "parse.c"
12724 break;
12725
12726 case 692: /* f_args: f_arg opt_args_tail */
12727#line 5239 "parse.y"
12728 {
12729 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12730 }
12731#line 12727 "parse.c"
12732 break;
12733
12734 case 693: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
12735#line 5243 "parse.y"
12736 {
12737 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12738 }
12739#line 12735 "parse.c"
12740 break;
12741
12742 case 694: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
12743#line 5247 "parse.y"
12744 {
12745 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12746 }
12747#line 12743 "parse.c"
12748 break;
12749
12750 case 695: /* f_args: f_optarg opt_args_tail */
12751#line 5251 "parse.y"
12752 {
12753 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12754 }
12755#line 12751 "parse.c"
12756 break;
12757
12758 case 696: /* f_args: f_optarg ',' f_arg opt_args_tail */
12759#line 5255 "parse.y"
12760 {
12761 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12762 }
12763#line 12759 "parse.c"
12764 break;
12765
12766 case 697: /* f_args: f_rest_arg opt_args_tail */
12767#line 5259 "parse.y"
12768 {
12769 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12770 }
12771#line 12767 "parse.c"
12772 break;
12773
12774 case 698: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
12775#line 5263 "parse.y"
12776 {
12777 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12778 }
12779#line 12775 "parse.c"
12780 break;
12781
12782 case 699: /* f_args: args_tail */
12783#line 5267 "parse.y"
12784 {
12785 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12786 }
12787#line 12783 "parse.c"
12788 break;
12789
12790 case 700: /* f_args: %empty */
12791#line 5271 "parse.y"
12792 {
12793 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12794 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[0]));
12795 }
12796#line 12792 "parse.c"
12797 break;
12798
12799 case 701: /* args_forward: "(..." */
12800#line 5278 "parse.y"
12801 {
12802 /*%%%*/
12803 (yyval.id) = idFWD_KWREST;
12804 /*% %*/
12805 /*% ripper: args_forward! %*/
12806 }
12807#line 12803 "parse.c"
12808 break;
12809
12810 case 702: /* f_bad_arg: "constant" */
12811#line 5287 "parse.y"
12812 {
12813 static const char mesg[] = "formal argument cannot be a constant";
12814 /*%%%*/
12815 yyerror1(&(yylsp[0]), mesg);
12816 (yyval.id) = 0;
12817 /*% %*/
12818 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12819 }
12820#line 12816 "parse.c"
12821 break;
12822
12823 case 703: /* f_bad_arg: "instance variable" */
12824#line 5296 "parse.y"
12825 {
12826 static const char mesg[] = "formal argument cannot be an instance variable";
12827 /*%%%*/
12828 yyerror1(&(yylsp[0]), mesg);
12829 (yyval.id) = 0;
12830 /*% %*/
12831 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12832 }
12833#line 12829 "parse.c"
12834 break;
12835
12836 case 704: /* f_bad_arg: "global variable" */
12837#line 5305 "parse.y"
12838 {
12839 static const char mesg[] = "formal argument cannot be a global variable";
12840 /*%%%*/
12841 yyerror1(&(yylsp[0]), mesg);
12842 (yyval.id) = 0;
12843 /*% %*/
12844 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12845 }
12846#line 12842 "parse.c"
12847 break;
12848
12849 case 705: /* f_bad_arg: "class variable" */
12850#line 5314 "parse.y"
12851 {
12852 static const char mesg[] = "formal argument cannot be a class variable";
12853 /*%%%*/
12854 yyerror1(&(yylsp[0]), mesg);
12855 (yyval.id) = 0;
12856 /*% %*/
12857 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12858 }
12859#line 12855 "parse.c"
12860 break;
12861
12862 case 707: /* f_norm_arg: "local variable or method" */
12863#line 5326 "parse.y"
12864 {
12865 formal_argument(p, (yyvsp[0].id));
12866 p->max_numparam = ORDINAL_PARAM;
12867 (yyval.id) = (yyvsp[0].id);
12868 }
12869#line 12865 "parse.c"
12870 break;
12871
12872 case 708: /* f_arg_asgn: f_norm_arg */
12873#line 5334 "parse.y"
12874 {
12875 ID id = get_id((yyvsp[0].id));
12876 arg_var(p, id);
12877 p->cur_arg = id;
12878 (yyval.id) = (yyvsp[0].id);
12879 }
12880#line 12876 "parse.c"
12881 break;
12882
12883 case 709: /* f_arg_item: f_arg_asgn */
12884#line 5343 "parse.y"
12885 {
12886 p->cur_arg = 0;
12887 /*%%%*/
12888 (yyval.node) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
12889 /*% %*/
12890 /*% ripper: get_value($1) %*/
12891 }
12892#line 12888 "parse.c"
12893 break;
12894
12895 case 710: /* f_arg_item: "(" f_margs rparen */
12896#line 5351 "parse.y"
12897 {
12898 /*%%%*/
12899 ID tid = internal_id(p);
12900 YYLTYPE loc;
12901 loc.beg_pos = (yylsp[-1]).beg_pos;
12902 loc.end_pos = (yylsp[-1]).beg_pos;
12903 arg_var(p, tid);
12904 if (dyna_in_block(p)) {
12905 (yyvsp[-1].node)->nd_value = NEW_DVAR(tid, &loc);
12906 }
12907 else {
12908 (yyvsp[-1].node)->nd_value = NEW_LVAR(tid, &loc);
12909 }
12910 (yyval.node) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
12911 (yyval.node)->nd_next = (yyvsp[-1].node);
12912 /*% %*/
12913 /*% ripper: mlhs_paren!($2) %*/
12914 }
12915#line 12911 "parse.c"
12916 break;
12917
12918 case 712: /* f_arg: f_arg ',' f_arg_item */
12919#line 5374 "parse.y"
12920 {
12921 /*%%%*/
12922 (yyval.node) = (yyvsp[-2].node);
12923 (yyval.node)->nd_plen++;
12924 (yyval.node)->nd_next = block_append(p, (yyval.node)->nd_next, (yyvsp[0].node)->nd_next);
12925 rb_discard_node(p, (yyvsp[0].node));
12926 /*% %*/
12927 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12928 }
12929#line 12925 "parse.c"
12930 break;
12931
12932 case 713: /* f_label: "label" */
12933#line 5387 "parse.y"
12934 {
12935 arg_var(p, formal_argument(p, (yyvsp[0].id)));
12936 p->cur_arg = get_id((yyvsp[0].id));
12937 p->max_numparam = ORDINAL_PARAM;
12938 p->ctxt.in_argdef = 0;
12939 (yyval.id) = (yyvsp[0].id);
12940 }
12941#line 12937 "parse.c"
12942 break;
12943
12944 case 714: /* f_kw: f_label arg_value */
12945#line 5397 "parse.y"
12946 {
12947 p->cur_arg = 0;
12948 p->ctxt.in_argdef = 1;
12949 /*%%%*/
12950 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12951 /*% %*/
12952 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
12953 }
12954#line 12950 "parse.c"
12955 break;
12956
12957 case 715: /* f_kw: f_label */
12958#line 5406 "parse.y"
12959 {
12960 p->cur_arg = 0;
12961 p->ctxt.in_argdef = 1;
12962 /*%%%*/
12963 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
12964 /*% %*/
12965 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
12966 }
12967#line 12963 "parse.c"
12968 break;
12969
12970 case 716: /* f_block_kw: f_label primary_value */
12971#line 5417 "parse.y"
12972 {
12973 p->ctxt.in_argdef = 1;
12974 /*%%%*/
12975 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12976 /*% %*/
12977 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
12978 }
12979#line 12975 "parse.c"
12980 break;
12981
12982 case 717: /* f_block_kw: f_label */
12983#line 5425 "parse.y"
12984 {
12985 p->ctxt.in_argdef = 1;
12986 /*%%%*/
12987 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
12988 /*% %*/
12989 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
12990 }
12991#line 12987 "parse.c"
12992 break;
12993
12994 case 718: /* f_block_kwarg: f_block_kw */
12995#line 5435 "parse.y"
12996 {
12997 /*%%%*/
12998 (yyval.node) = (yyvsp[0].node);
12999 /*% %*/
13000 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
13001 }
13002#line 12998 "parse.c"
13003 break;
13004
13005 case 719: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
13006#line 5442 "parse.y"
13007 {
13008 /*%%%*/
13009 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
13010 /*% %*/
13011 /*% ripper: rb_ary_push($1, get_value($3)) %*/
13012 }
13013#line 13009 "parse.c"
13014 break;
13015
13016 case 720: /* f_kwarg: f_kw */
13017#line 5452 "parse.y"
13018 {
13019 /*%%%*/
13020 (yyval.node) = (yyvsp[0].node);
13021 /*% %*/
13022 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
13023 }
13024#line 13020 "parse.c"
13025 break;
13026
13027 case 721: /* f_kwarg: f_kwarg ',' f_kw */
13028#line 5459 "parse.y"
13029 {
13030 /*%%%*/
13031 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
13032 /*% %*/
13033 /*% ripper: rb_ary_push($1, get_value($3)) %*/
13034 }
13035#line 13031 "parse.c"
13036 break;
13037
13038 case 724: /* f_no_kwarg: kwrest_mark "`nil'" */
13039#line 5472 "parse.y"
13040 {
13041 /*%%%*/
13042 /*% %*/
13043 /*% ripper: nokw_param!(Qnil) %*/
13044 }
13045#line 13041 "parse.c"
13046 break;
13047
13048 case 725: /* f_kwrest: kwrest_mark "local variable or method" */
13049#line 5480 "parse.y"
13050 {
13051 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
13052 /*%%%*/
13053 (yyval.id) = (yyvsp[0].id);
13054 /*% %*/
13055 /*% ripper: kwrest_param!($2) %*/
13056 }
13057#line 13053 "parse.c"
13058 break;
13059
13060 case 726: /* f_kwrest: kwrest_mark */
13061#line 5488 "parse.y"
13062 {
13063 /*%%%*/
13064 (yyval.id) = internal_id(p);
13065 arg_var(p, (yyval.id));
13066 /*% %*/
13067 /*% ripper: kwrest_param!(Qnil) %*/
13068 }
13069#line 13065 "parse.c"
13070 break;
13071
13072 case 727: /* f_opt: f_arg_asgn f_eq arg_value */
13073#line 5498 "parse.y"
13074 {
13075 p->cur_arg = 0;
13076 p->ctxt.in_argdef = 1;
13077 /*%%%*/
13078 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
13079 /*% %*/
13080 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
13081 }
13082#line 13078 "parse.c"
13083 break;
13084
13085 case 728: /* f_block_opt: f_arg_asgn f_eq primary_value */
13086#line 5509 "parse.y"
13087 {
13088 p->cur_arg = 0;
13089 p->ctxt.in_argdef = 1;
13090 /*%%%*/
13091 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
13092 /*% %*/
13093 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
13094 }
13095#line 13091 "parse.c"
13096 break;
13097
13098 case 729: /* f_block_optarg: f_block_opt */
13099#line 5520 "parse.y"
13100 {
13101 /*%%%*/
13102 (yyval.node) = (yyvsp[0].node);
13103 /*% %*/
13104 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
13105 }
13106#line 13102 "parse.c"
13107 break;
13108
13109 case 730: /* f_block_optarg: f_block_optarg ',' f_block_opt */
13110#line 5527 "parse.y"
13111 {
13112 /*%%%*/
13113 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
13114 /*% %*/
13115 /*% ripper: rb_ary_push($1, get_value($3)) %*/
13116 }
13117#line 13113 "parse.c"
13118 break;
13119
13120 case 731: /* f_optarg: f_opt */
13121#line 5536 "parse.y"
13122 {
13123 /*%%%*/
13124 (yyval.node) = (yyvsp[0].node);
13125 /*% %*/
13126 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
13127 }
13128#line 13124 "parse.c"
13129 break;
13130
13131 case 732: /* f_optarg: f_optarg ',' f_opt */
13132#line 5543 "parse.y"
13133 {
13134 /*%%%*/
13135 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
13136 /*% %*/
13137 /*% ripper: rb_ary_push($1, get_value($3)) %*/
13138 }
13139#line 13135 "parse.c"
13140 break;
13141
13142 case 735: /* f_rest_arg: restarg_mark "local variable or method" */
13143#line 5556 "parse.y"
13144 {
13145 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
13146 /*%%%*/
13147 (yyval.id) = (yyvsp[0].id);
13148 /*% %*/
13149 /*% ripper: rest_param!($2) %*/
13150 }
13151#line 13147 "parse.c"
13152 break;
13153
13154 case 736: /* f_rest_arg: restarg_mark */
13155#line 5564 "parse.y"
13156 {
13157 /*%%%*/
13158 (yyval.id) = internal_id(p);
13159 arg_var(p, (yyval.id));
13160 /*% %*/
13161 /*% ripper: rest_param!(Qnil) %*/
13162 }
13163#line 13159 "parse.c"
13164 break;
13165
13166 case 739: /* f_block_arg: blkarg_mark "local variable or method" */
13167#line 5578 "parse.y"
13168 {
13169 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
13170 /*%%%*/
13171 (yyval.id) = (yyvsp[0].id);
13172 /*% %*/
13173 /*% ripper: blockarg!($2) %*/
13174 }
13175#line 13171 "parse.c"
13176 break;
13177
13178 case 740: /* f_block_arg: blkarg_mark */
13179#line 5586 "parse.y"
13180 {
13181 /*%%%*/
13182 arg_var(p, shadowing_lvar(p, get_id(ANON_BLOCK_ID)));
13183 /*%
13184 $$ = dispatch1(blockarg, Qnil);
13185 %*/
13186 }
13187#line 13183 "parse.c"
13188 break;
13189
13190 case 741: /* opt_f_block_arg: ',' f_block_arg */
13191#line 5596 "parse.y"
13192 {
13193 (yyval.id) = (yyvsp[0].id);
13194 }
13195#line 13191 "parse.c"
13196 break;
13197
13198 case 742: /* opt_f_block_arg: none */
13199#line 5600 "parse.y"
13200 {
13201 (yyval.id) = Qnull;
13202 }
13203#line 13199 "parse.c"
13204 break;
13205
13206 case 743: /* singleton: var_ref */
13207#line 5606 "parse.y"
13208 {
13209 value_expr((yyvsp[0].node));
13210 (yyval.node) = (yyvsp[0].node);
13211 }
13212#line 13208 "parse.c"
13213 break;
13214
13215 case 744: /* $@48: %empty */
13216#line 5610 "parse.y"
13217 {SET_LEX_STATE(EXPR_BEG);}
13218#line 13214 "parse.c"
13219 break;
13220
13221 case 745: /* singleton: '(' $@48 expr rparen */
13222#line 5611 "parse.y"
13223 {
13224 /*%%%*/
13225 switch (nd_type((yyvsp[-1].node))) {
13226 case NODE_STR:
13227 case NODE_DSTR:
13228 case NODE_XSTR:
13229 case NODE_DXSTR:
13230 case NODE_DREGX:
13231 case NODE_LIT:
13232 case NODE_LIST:
13233 case NODE_ZLIST:
13234 yyerror1(&(yylsp[-1]), "can't define singleton method for literals");
13235 break;
13236 default:
13237 value_expr((yyvsp[-1].node));
13238 break;
13239 }
13240 (yyval.node) = (yyvsp[-1].node);
13241 /*% %*/
13242 /*% ripper: paren!($3) %*/
13243 }
13244#line 13240 "parse.c"
13245 break;
13246
13247 case 747: /* assoc_list: assocs trailer */
13248#line 5636 "parse.y"
13249 {
13250 /*%%%*/
13251 (yyval.node) = (yyvsp[-1].node);
13252 /*% %*/
13253 /*% ripper: assoclist_from_args!($1) %*/
13254 }
13255#line 13251 "parse.c"
13256 break;
13257
13258 case 749: /* assocs: assocs ',' assoc */
13259#line 5647 "parse.y"
13260 {
13261 /*%%%*/
13262 NODE *assocs = (yyvsp[-2].node);
13263 NODE *tail = (yyvsp[0].node);
13264 if (!assocs) {
13265 assocs = tail;
13266 }
13267 else if (tail) {
13268 if (assocs->nd_head &&
13269 !tail->nd_head && nd_type_p(tail->nd_next, NODE_LIST) &&
13270 nd_type_p(tail->nd_next->nd_head, NODE_HASH)) {
13271 /* DSTAR */
13272 tail = tail->nd_next->nd_head->nd_head;
13273 }
13274 assocs = list_concat(assocs, tail);
13275 }
13276 (yyval.node) = assocs;
13277 /*% %*/
13278 /*% ripper: rb_ary_push($1, get_value($3)) %*/
13279 }
13280#line 13276 "parse.c"
13281 break;
13282
13283 case 750: /* assoc: arg_value "=>" arg_value */
13284#line 5670 "parse.y"
13285 {
13286 /*%%%*/
13287 if (nd_type_p((yyvsp[-2].node), NODE_STR)) {
13288 nd_set_type((yyvsp[-2].node), NODE_LIT);
13289 RB_OBJ_WRITE(p->ast, &(yyvsp[-2].node)->nd_lit, rb_fstring((yyvsp[-2].node)->nd_lit));
13290 }
13291 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
13292 /*% %*/
13293 /*% ripper: assoc_new!($1, $3) %*/
13294 }
13295#line 13291 "parse.c"
13296 break;
13297
13298 case 751: /* assoc: "label" arg_value */
13299#line 5681 "parse.y"
13300 {
13301 /*%%%*/
13302 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
13303 /*% %*/
13304 /*% ripper: assoc_new!($1, $2) %*/
13305 }
13306#line 13302 "parse.c"
13307 break;
13308
13309 case 752: /* assoc: "label" */
13310#line 5688 "parse.y"
13311 {
13312 /*%%%*/
13313 NODE *val = gettable(p, (yyvsp[0].id), &(yyloc));
13314 if (!val) val = NEW_BEGIN(0, &(yyloc));
13315 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yylsp[0])), &(yyloc)), val);
13316 /*% %*/
13317 /*% ripper: assoc_new!($1, Qnil) %*/
13318 }
13319#line 13315 "parse.c"
13320 break;
13321
13322 case 753: /* assoc: "string literal" string_contents tLABEL_END arg_value */
13323#line 5697 "parse.y"
13324 {
13325 /*%%%*/
13326 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
13327 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
13328 /*% %*/
13329 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
13330 }
13331#line 13327 "parse.c"
13332 break;
13333
13334 case 754: /* assoc: "**arg" arg_value */
13335#line 5705 "parse.y"
13336 {
13337 /*%%%*/
13338 if (nd_type_p((yyvsp[0].node), NODE_HASH) &&
13339 !((yyvsp[0].node)->nd_head && (yyvsp[0].node)->nd_head->nd_alen)) {
13340 static VALUE empty_hash;
13341 if (!empty_hash) {
13342 empty_hash = rb_obj_freeze(rb_hash_new());
13343 rb_gc_register_mark_object(empty_hash);
13344 }
13345 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
13346 }
13347 else
13348 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
13349 /*% %*/
13350 /*% ripper: assoc_splat!($2) %*/
13351 }
13352#line 13348 "parse.c"
13353 break;
13354
13355 case 781: /* term: ';' */
13356#line 5773 "parse.y"
13357 {yyerrok;token_flush(p);}
13358#line 13354 "parse.c"
13359 break;
13360
13361 case 782: /* term: '\n' */
13362#line 5774 "parse.y"
13363 {token_flush(p);}
13364#line 13360 "parse.c"
13365 break;
13366
13367 case 784: /* terms: terms ';' */
13368#line 5778 "parse.y"
13369 {yyerrok;}
13370#line 13366 "parse.c"
13371 break;
13372
13373 case 785: /* none: %empty */
13374#line 5782 "parse.y"
13375 {
13376 (yyval.node) = Qnull;
13377 }
13378#line 13374 "parse.c"
13379 break;
13380
13381
13382#line 13378 "parse.c"
13383
13384 default: break;
13385 }
13386 /* User semantic actions sometimes alter yychar, and that requires
13387 that yytoken be updated with the new translation. We take the
13388 approach of translating immediately before every use of yytoken.
13389 One alternative is translating here after every semantic action,
13390 but that translation would be missed if the semantic action invokes
13391 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
13392 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
13393 incorrect destructor might then be invoked immediately. In the
13394 case of YYERROR or YYBACKUP, subsequent parser actions might lead
13395 to an incorrect destructor call or verbose syntax error message
13396 before the lookahead is translated. */
13397 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
13398
13399 YYPOPSTACK (yylen);
13400 yylen = 0;
13401
13402 *++yyvsp = yyval;
13403 *++yylsp = yyloc;
13404
13405 /* Now 'shift' the result of the reduction. Determine what state
13406 that goes to, based on the state we popped back to and the rule
13407 number reduced by. */
13408 {
13409 const int yylhs = yyr1[yyn] - YYNTOKENS;
13410 const int yyi = yypgoto[yylhs] + *yyssp;
13411 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
13412 ? yytable[yyi]
13413 : yydefgoto[yylhs]);
13414 }
13415
13416 goto yynewstate;
13417
13418
13419/*--------------------------------------.
13420| yyerrlab -- here on detecting error. |
13421`--------------------------------------*/
13422yyerrlab:
13423 /* Make sure we have latest lookahead translation. See comments at
13424 user semantic actions for why this is necessary. */
13425 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
13426 /* If not already recovering from an error, report this error. */
13427 if (!yyerrstatus)
13428 {
13429 ++yynerrs;
13430 {
13431 yypcontext_t yyctx
13432 = {yyssp, yytoken, &yylloc};
13433 char const *yymsgp = YY_("syntax error");
13434 int yysyntax_error_status;
13435 yysyntax_error_status = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
13436 if (yysyntax_error_status == 0)
13437 yymsgp = yymsg;
13438 else if (yysyntax_error_status == -1)
13439 {
13440 if (yymsg != yymsgbuf)
13441 YYSTACK_FREE (yymsg);
13442 yymsg = YY_CAST (char *,
13443 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
13444 if (yymsg)
13445 {
13446 yysyntax_error_status
13447 = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
13448 yymsgp = yymsg;
13449 }
13450 else
13451 {
13452 yymsg = yymsgbuf;
13453 yymsg_alloc = sizeof yymsgbuf;
13454 yysyntax_error_status = YYENOMEM;
13455 }
13456 }
13457 yyerror (&yylloc, p, yymsgp);
13458 if (yysyntax_error_status == YYENOMEM)
13459 YYNOMEM;
13460 }
13461 }
13462
13463 yyerror_range[1] = yylloc;
13464 if (yyerrstatus == 3)
13465 {
13466 /* If just tried and failed to reuse lookahead token after an
13467 error, discard it. */
13468
13469 if (yychar <= END_OF_INPUT)
13470 {
13471 /* Return failure if at end of input. */
13472 if (yychar == END_OF_INPUT)
13473 YYABORT;
13474 }
13475 else
13476 {
13477 yydestruct ("Error: discarding",
13478 yytoken, &yylval, &yylloc, p);
13479 yychar = YYEMPTY;
13480 }
13481 }
13482
13483 /* Else will try to reuse lookahead token after shifting the error
13484 token. */
13485 goto yyerrlab1;
13486
13487
13488/*---------------------------------------------------.
13489| yyerrorlab -- error raised explicitly by YYERROR. |
13490`---------------------------------------------------*/
13491yyerrorlab:
13492 /* Pacify compilers when the user code never invokes YYERROR and the
13493 label yyerrorlab therefore never appears in user code. */
13494 if (0)
13495 YYERROR;
13496 ++yynerrs;
13497
13498 /* Do not reclaim the symbols of the rule whose action triggered
13499 this YYERROR. */
13500 YYPOPSTACK (yylen);
13501 yylen = 0;
13502 YY_STACK_PRINT (yyss, yyssp);
13503 yystate = *yyssp;
13504 goto yyerrlab1;
13505
13506
13507/*-------------------------------------------------------------.
13508| yyerrlab1 -- common code for both syntax error and YYERROR. |
13509`-------------------------------------------------------------*/
13510yyerrlab1:
13511 yyerrstatus = 3; /* Each real token shifted decrements this. */
13512
13513 /* Pop stack until we find a state that shifts the error token. */
13514 for (;;)
13515 {
13516 yyn = yypact[yystate];
13517 if (!yypact_value_is_default (yyn))
13518 {
13519 yyn += YYSYMBOL_YYerror;
13520 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
13521 {
13522 yyn = yytable[yyn];
13523 if (0 < yyn)
13524 break;
13525 }
13526 }
13527
13528 /* Pop the current state because it cannot handle the error token. */
13529 if (yyssp == yyss)
13530 YYABORT;
13531
13532 yyerror_range[1] = *yylsp;
13533 yydestruct ("Error: popping",
13534 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
13535 YYPOPSTACK (1);
13536 yystate = *yyssp;
13537 YY_STACK_PRINT (yyss, yyssp);
13538 }
13539
13540 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
13541 *++yyvsp = yylval;
13542 YY_IGNORE_MAYBE_UNINITIALIZED_END
13543
13544 yyerror_range[2] = yylloc;
13545 ++yylsp;
13546 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
13547
13548 /* Shift the error token. */
13549 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
13550
13551 yystate = yyn;
13552 goto yynewstate;
13553
13554
13555/*-------------------------------------.
13556| yyacceptlab -- YYACCEPT comes here. |
13557`-------------------------------------*/
13558yyacceptlab:
13559 yyresult = 0;
13560 goto yyreturnlab;
13561
13562
13563/*-----------------------------------.
13564| yyabortlab -- YYABORT comes here. |
13565`-----------------------------------*/
13566yyabortlab:
13567 yyresult = 1;
13568 goto yyreturnlab;
13569
13570
13571/*-----------------------------------------------------------.
13572| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
13573`-----------------------------------------------------------*/
13574yyexhaustedlab:
13575 yyerror (&yylloc, p, YY_("memory exhausted"));
13576 yyresult = 2;
13577 goto yyreturnlab;
13578
13579
13580/*----------------------------------------------------------.
13581| yyreturnlab -- parsing is finished, clean up and return. |
13582`----------------------------------------------------------*/
13583yyreturnlab:
13584 if (yychar != YYEMPTY)
13585 {
13586 /* Make sure we have latest lookahead translation. See comments at
13587 user semantic actions for why this is necessary. */
13588 yytoken = YYTRANSLATE (yychar);
13589 yydestruct ("Cleanup: discarding lookahead",
13590 yytoken, &yylval, &yylloc, p);
13591 }
13592 /* Do not reclaim the symbols of the rule whose action triggered
13593 this YYABORT or YYACCEPT. */
13594 YYPOPSTACK (yylen);
13595 YY_STACK_PRINT (yyss, yyssp);
13596 while (yyssp != yyss)
13597 {
13598 yydestruct ("Cleanup: popping",
13599 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
13600 YYPOPSTACK (1);
13601 }
13602#ifndef yyoverflow
13603 if (yyss != yyssa)
13604 YYSTACK_FREE (yyss);
13605#endif
13606 if (yymsg != yymsgbuf)
13607 YYSTACK_FREE (yymsg);
13608 return yyresult;
13609}
13610
13611#line 5786 "parse.y"
13612
13613# undef p
13614# undef yylex
13615# undef yylval
13616# define yylval (*p->lval)
13617
13618static int regx_options(struct parser_params*);
13619static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
13620static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
13621static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
13622static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
13623
13624#ifndef RIPPER
13625# define set_yylval_node(x) { \
13626 YYLTYPE _cur_loc; \
13627 rb_parser_set_location(p, &_cur_loc); \
13628 yylval.node = (x); \
13629}
13630# define set_yylval_str(x) \
13631do { \
13632 set_yylval_node(NEW_STR(x, &_cur_loc)); \
13633 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
13634} while(0)
13635# define set_yylval_literal(x) \
13636do { \
13637 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
13638 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
13639} while(0)
13640# define set_yylval_num(x) (yylval.num = (x))
13641# define set_yylval_id(x) (yylval.id = (x))
13642# define set_yylval_name(x) (yylval.id = (x))
13643# define yylval_id() (yylval.id)
13644#else
13645static inline VALUE
13646ripper_yylval_id(struct parser_params *p, ID x)
13647{
13648 return ripper_new_yylval(p, x, ID2SYM(x), 0);
13649}
13650# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
13651# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
13652# define set_yylval_id(x) (void)(x)
13653# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
13654# define set_yylval_literal(x) add_mark_object(p, (x))
13655# define set_yylval_node(x) (yylval.val = ripper_new_yylval(p, 0, 0, STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)))
13656# define yylval_id() yylval.id
13657# define _cur_loc NULL_LOC /* dummy */
13658#endif
13659
13660#define set_yylval_noname() set_yylval_id(keyword_nil)
13661
13662#ifndef RIPPER
13663#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
13664#define dispatch_scan_event(p, t) ((void)0)
13665#define dispatch_delayed_token(p, t) ((void)0)
13666#define has_delayed_token(p) (0)
13667#else
13668#define literal_flush(p, ptr) ((void)(ptr))
13669
13670#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val))
13671
13672static inline VALUE
13673intern_sym(const char *name)
13674{
13675 ID id = rb_intern_const(name);
13676 return ID2SYM(id);
13677}
13678
13679static int
13680ripper_has_scan_event(struct parser_params *p)
13681{
13682 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
13683 return p->lex.pcur > p->lex.ptok;
13684}
13685
13686static VALUE
13687ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
13688{
13689 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
13690 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
13691 token_flush(p);
13692 return rval;
13693}
13694
13695static void
13696ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
13697{
13698 if (!ripper_has_scan_event(p)) return;
13699 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
13700}
13701#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
13702
13703static void
13704ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
13705{
13706 int saved_line = p->ruby_sourceline;
13707 const char *saved_tokp = p->lex.ptok;
13708
13709 if (NIL_P(p->delayed.token)) return;
13710 p->ruby_sourceline = p->delayed.line;
13711 p->lex.ptok = p->lex.pbeg + p->delayed.col;
13712 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
13713 p->delayed.token = Qnil;
13714 p->ruby_sourceline = saved_line;
13715 p->lex.ptok = saved_tokp;
13716}
13717#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
13718#define has_delayed_token(p) (!NIL_P(p->delayed.token))
13719#endif /* RIPPER */
13720
13721static inline int
13722is_identchar(const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
13723{
13724 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
13725}
13726
13727static inline int
13728parser_is_identchar(struct parser_params *p)
13729{
13730 return !(p)->eofp && is_identchar(p->lex.pcur-1, p->lex.pend, p->enc);
13731}
13732
13733static inline int
13734parser_isascii(struct parser_params *p)
13735{
13736 return ISASCII(*(p->lex.pcur-1));
13737}
13738
13739static void
13740token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
13741{
13742 int column = 1, nonspc = 0, i;
13743 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
13744 if (*ptr == '\t') {
13745 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
13746 }
13747 column++;
13748 if (*ptr != ' ' && *ptr != '\t') {
13749 nonspc = 1;
13750 }
13751 }
13752
13753 ptinfo->beg = loc->beg_pos;
13754 ptinfo->indent = column;
13755 ptinfo->nonspc = nonspc;
13756}
13757
13758static void
13759token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
13760{
13761 token_info *ptinfo;
13762
13763 if (!p->token_info_enabled) return;
13764 ptinfo = ALLOC(token_info);
13765 ptinfo->token = token;
13766 ptinfo->next = p->token_info;
13767 token_info_setup(ptinfo, p->lex.pbeg, loc);
13768
13769 p->token_info = ptinfo;
13770}
13771
13772static void
13773token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
13774{
13775 token_info *ptinfo_beg = p->token_info;
13776
13777 if (!ptinfo_beg) return;
13778 p->token_info = ptinfo_beg->next;
13779
13780 /* indentation check of matched keywords (begin..end, if..end, etc.) */
13781 token_info_warn(p, token, ptinfo_beg, 1, loc);
13782 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
13783}
13784
13785static void
13786token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
13787{
13788 token_info *ptinfo_beg = p->token_info;
13789
13790 if (!ptinfo_beg) return;
13791 p->token_info = ptinfo_beg->next;
13792
13793 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
13794 ptinfo_beg->beg.column != beg_pos.column ||
13795 strcmp(ptinfo_beg->token, token)) {
13796 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
13797 beg_pos.lineno, beg_pos.column, token,
13798 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
13799 ptinfo_beg->token);
13800 }
13801
13802 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
13803}
13804
13805static void
13806token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
13807{
13808 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
13809 if (!p->token_info_enabled) return;
13810 if (!ptinfo_beg) return;
13811 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
13812 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
13813 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
13814 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
13815 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
13816 rb_warn3L(ptinfo_end->beg.lineno,
13817 "mismatched indentations at '%s' with '%s' at %d",
13818 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
13819}
13820
13821static int
13822parser_precise_mbclen(struct parser_params *p, const char *ptr)
13823{
13824 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
13825 if (!MBCLEN_CHARFOUND_P(len)) {
13826 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
13827 return -1;
13828 }
13829 return len;
13830}
13831
13832#ifndef RIPPER
13833static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
13834
13835static inline void
13836parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
13837{
13838 VALUE str;
13839 int lineno = p->ruby_sourceline;
13840 if (!yylloc) {
13841 return;
13842 }
13843 else if (yylloc->beg_pos.lineno == lineno) {
13844 str = p->lex.lastline;
13845 }
13846 else {
13847 return;
13848 }
13849 ruby_show_error_line(p->error_buffer, yylloc, lineno, str);
13850}
13851
13852static int
13853parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
13854{
13855#if 0
13856 YYLTYPE current;
13857
13858 if (!yylloc) {
13859 yylloc = RUBY_SET_YYLLOC(current);
13860 }
13861 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
13862 p->ruby_sourceline != yylloc->end_pos.lineno)) {
13863 yylloc = 0;
13864 }
13865#endif
13866 compile_error(p, "%s", msg);
13867 parser_show_error_line(p, yylloc);
13868 return 0;
13869}
13870
13871static int
13872parser_yyerror0(struct parser_params *p, const char *msg)
13873{
13874 YYLTYPE current;
13875 return parser_yyerror(p, RUBY_SET_YYLLOC(current), msg);
13876}
13877
13878static void
13879ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
13880{
13881 VALUE mesg;
13882 const int max_line_margin = 30;
13883 const char *ptr, *ptr_end, *pt, *pb;
13884 const char *pre = "", *post = "", *pend;
13885 const char *code = "", *caret = "";
13886 const char *lim;
13887 const char *const pbeg = RSTRING_PTR(str);
13888 char *buf;
13889 long len;
13890 int i;
13891
13892 if (!yylloc) return;
13893 pend = RSTRING_END(str);
13894 if (pend > pbeg && pend[-1] == '\n') {
13895 if (--pend > pbeg && pend[-1] == '\r') --pend;
13896 }
13897
13898 pt = pend;
13899 if (lineno == yylloc->end_pos.lineno &&
13900 (pend - pbeg) > yylloc->end_pos.column) {
13901 pt = pbeg + yylloc->end_pos.column;
13902 }
13903
13904 ptr = ptr_end = pt;
13905 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
13906 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
13907
13908 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
13909 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
13910
13911 len = ptr_end - ptr;
13912 if (len > 4) {
13913 if (ptr > pbeg) {
13914 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
13915 if (ptr > pbeg) pre = "...";
13916 }
13917 if (ptr_end < pend) {
13918 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
13919 if (ptr_end < pend) post = "...";
13920 }
13921 }
13922 pb = pbeg;
13923 if (lineno == yylloc->beg_pos.lineno) {
13924 pb += yylloc->beg_pos.column;
13925 if (pb > pt) pb = pt;
13926 }
13927 if (pb < ptr) pb = ptr;
13928 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
13929 return;
13930 }
13931 if (RTEST(errbuf)) {
13932 mesg = rb_attr_get(errbuf, idMesg);
13933 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
13934 rb_str_cat_cstr(mesg, "\n");
13935 }
13936 else {
13937 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
13938 }
13939 if (!errbuf && rb_stderr_tty_p()) {
13940#define CSI_BEGIN "\033["
13941#define CSI_SGR "m"
13942 rb_str_catf(mesg,
13943 CSI_BEGIN""CSI_SGR"%s" /* pre */
13944 CSI_BEGIN"1"CSI_SGR"%.*s"
13945 CSI_BEGIN"1;4"CSI_SGR"%.*s"
13946 CSI_BEGIN";1"CSI_SGR"%.*s"
13947 CSI_BEGIN""CSI_SGR"%s" /* post */
13948 "\n",
13949 pre,
13950 (int)(pb - ptr), ptr,
13951 (int)(pt - pb), pb,
13952 (int)(ptr_end - pt), pt,
13953 post);
13954 }
13955 else {
13956 char *p2;
13957
13958 len = ptr_end - ptr;
13959 lim = pt < pend ? pt : pend;
13960 i = (int)(lim - ptr);
13961 buf = ALLOCA_N(char, i+2);
13962 code = ptr;
13963 caret = p2 = buf;
13964 if (ptr <= pb) {
13965 while (ptr < pb) {
13966 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
13967 }
13968 *p2++ = '^';
13969 ptr++;
13970 }
13971 if (lim > ptr) {
13972 memset(p2, '~', (lim - ptr));
13973 p2 += (lim - ptr);
13974 }
13975 *p2 = '\0';
13976 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
13977 pre, (int)len, code, post,
13978 pre, caret);
13979 }
13980 if (!errbuf) rb_write_error_str(mesg);
13981}
13982#else
13983static int
13984parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
13985{
13986 const char *pcur = 0, *ptok = 0;
13987 if (p->ruby_sourceline == yylloc->beg_pos.lineno &&
13988 p->ruby_sourceline == yylloc->end_pos.lineno) {
13989 pcur = p->lex.pcur;
13990 ptok = p->lex.ptok;
13991 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
13992 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
13993 }
13994 parser_yyerror0(p, msg);
13995 if (pcur) {
13996 p->lex.ptok = ptok;
13997 p->lex.pcur = pcur;
13998 }
13999 return 0;
14000}
14001
14002static int
14003parser_yyerror0(struct parser_params *p, const char *msg)
14004{
14005 dispatch1(parse_error, STR_NEW2(msg));
14006 ripper_error(p);
14007 return 0;
14008}
14009
14010static inline void
14011parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
14012{
14013}
14014#endif /* !RIPPER */
14015
14016#ifndef RIPPER
14017static int
14018vtable_size(const struct vtable *tbl)
14019{
14020 if (!DVARS_TERMINAL_P(tbl)) {
14021 return tbl->pos;
14022 }
14023 else {
14024 return 0;
14025 }
14026}
14027#endif
14028
14029static struct vtable *
14030vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
14031{
14032 struct vtable *tbl = ALLOC(struct vtable);
14033 tbl->pos = 0;
14034 tbl->capa = 8;
14035 tbl->tbl = ALLOC_N(ID, tbl->capa);
14036 tbl->prev = prev;
14037#ifndef RIPPER
14038 if (p->debug) {
14039 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
14040 }
14041#endif
14042 return tbl;
14043}
14044#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
14045
14046static void
14047vtable_free_gen(struct parser_params *p, int line, const char *name,
14048 struct vtable *tbl)
14049{
14050#ifndef RIPPER
14051 if (p->debug) {
14052 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
14053 }
14054#endif
14055 if (!DVARS_TERMINAL_P(tbl)) {
14056 if (tbl->tbl) {
14057 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
14058 }
14059 ruby_sized_xfree(tbl, sizeof(*tbl));
14060 }
14061}
14062#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
14063
14064static void
14065vtable_add_gen(struct parser_params *p, int line, const char *name,
14066 struct vtable *tbl, ID id)
14067{
14068#ifndef RIPPER
14069 if (p->debug) {
14070 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
14071 line, name, (void *)tbl, rb_id2name(id));
14072 }
14073#endif
14074 if (DVARS_TERMINAL_P(tbl)) {
14075 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
14076 return;
14077 }
14078 if (tbl->pos == tbl->capa) {
14079 tbl->capa = tbl->capa * 2;
14080 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
14081 }
14082 tbl->tbl[tbl->pos++] = id;
14083}
14084#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
14085
14086#ifndef RIPPER
14087static void
14088vtable_pop_gen(struct parser_params *p, int line, const char *name,
14089 struct vtable *tbl, int n)
14090{
14091 if (p->debug) {
14092 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
14093 line, name, (void *)tbl, n);
14094 }
14095 if (tbl->pos < n) {
14096 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
14097 return;
14098 }
14099 tbl->pos -= n;
14100}
14101#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
14102#endif
14103
14104static int
14105vtable_included(const struct vtable * tbl, ID id)
14106{
14107 int i;
14108
14109 if (!DVARS_TERMINAL_P(tbl)) {
14110 for (i = 0; i < tbl->pos; i++) {
14111 if (tbl->tbl[i] == id) {
14112 return i+1;
14113 }
14114 }
14115 }
14116 return 0;
14117}
14118
14119static void parser_prepare(struct parser_params *p);
14120
14121#ifndef RIPPER
14122static NODE *parser_append_options(struct parser_params *p, NODE *node);
14123
14124static VALUE
14125debug_lines(VALUE fname)
14126{
14127 ID script_lines;
14128 CONST_ID(script_lines, "SCRIPT_LINES__");
14129 if (rb_const_defined_at(rb_cObject, script_lines)) {
14130 VALUE hash = rb_const_get_at(rb_cObject, script_lines);
14131 if (RB_TYPE_P(hash, T_HASH)) {
14132 VALUE lines = rb_ary_new();
14133 rb_hash_aset(hash, fname, lines);
14134 return lines;
14135 }
14136 }
14137 return 0;
14138}
14139
14140static int
14141e_option_supplied(struct parser_params *p)
14142{
14143 return strcmp(p->ruby_sourcefile, "-e") == 0;
14144}
14145
14146static VALUE
14147yycompile0(VALUE arg)
14148{
14149 int n;
14150 NODE *tree;
14151 struct parser_params *p = (struct parser_params *)arg;
14152 VALUE cov = Qfalse;
14153
14154 if (!compile_for_eval && !NIL_P(p->ruby_sourcefile_string)) {
14155 p->debug_lines = debug_lines(p->ruby_sourcefile_string);
14156 if (p->debug_lines && p->ruby_sourceline > 0) {
14157 VALUE str = rb_default_rs;
14158 n = p->ruby_sourceline;
14159 do {
14160 rb_ary_push(p->debug_lines, str);
14161 } while (--n);
14162 }
14163
14164 if (!e_option_supplied(p)) {
14165 cov = Qtrue;
14166 }
14167 }
14168
14169 if (p->keep_script_lines || ruby_vm_keep_script_lines) {
14170 if (!p->debug_lines) {
14171 p->debug_lines = rb_ary_new();
14172 }
14173
14174 RB_OBJ_WRITE(p->ast, &p->ast->body.script_lines, p->debug_lines);
14175 }
14176
14177 parser_prepare(p);
14178#define RUBY_DTRACE_PARSE_HOOK(name) \
14179 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
14180 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
14181 }
14182 RUBY_DTRACE_PARSE_HOOK(BEGIN);
14183 n = yyparse(p);
14184 RUBY_DTRACE_PARSE_HOOK(END);
14185 p->debug_lines = 0;
14186
14187 p->lex.strterm = 0;
14188 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
14189 p->lex.prevline = p->lex.lastline = p->lex.nextline = 0;
14190 if (n || p->error_p) {
14191 VALUE mesg = p->error_buffer;
14192 if (!mesg) {
14194 }
14195 rb_set_errinfo(mesg);
14196 return FALSE;
14197 }
14198 tree = p->eval_tree;
14199 if (!tree) {
14200 tree = NEW_NIL(&NULL_LOC);
14201 }
14202 else {
14203 VALUE opt = p->compile_option;
14204 NODE *prelude;
14205 NODE *body = parser_append_options(p, tree->nd_body);
14206 if (!opt) opt = rb_obj_hide(rb_ident_hash_new());
14207 rb_hash_aset(opt, rb_sym_intern_ascii_cstr("coverage_enabled"), cov);
14208 prelude = block_append(p, p->eval_tree_begin, body);
14209 tree->nd_body = prelude;
14210 RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt);
14211 }
14212 p->ast->body.root = tree;
14213 if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count);
14214 return TRUE;
14215}
14216
14217static rb_ast_t *
14218yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line)
14219{
14220 rb_ast_t *ast;
14221 if (NIL_P(fname)) {
14222 p->ruby_sourcefile_string = Qnil;
14223 p->ruby_sourcefile = "(none)";
14224 }
14225 else {
14226 p->ruby_sourcefile_string = rb_fstring(fname);
14227 p->ruby_sourcefile = StringValueCStr(fname);
14228 }
14229 p->ruby_sourceline = line - 1;
14230
14231 p->lvtbl = NULL;
14232
14233 p->ast = ast = rb_ast_new();
14234 rb_suppress_tracing(yycompile0, (VALUE)p);
14235 p->ast = 0;
14236 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
14237
14238 while (p->lvtbl) {
14239 local_pop(p);
14240 }
14241
14242 return ast;
14243}
14244#endif /* !RIPPER */
14245
14246static rb_encoding *
14247must_be_ascii_compatible(VALUE s)
14248{
14249 rb_encoding *enc = rb_enc_get(s);
14250 if (!rb_enc_asciicompat(enc)) {
14251 rb_raise(rb_eArgError, "invalid source encoding");
14252 }
14253 return enc;
14254}
14255
14256static VALUE
14257lex_get_str(struct parser_params *p, VALUE s)
14258{
14259 char *beg, *end, *start;
14260 long len;
14261
14262 beg = RSTRING_PTR(s);
14263 len = RSTRING_LEN(s);
14264 start = beg;
14265 if (p->lex.gets_.ptr) {
14266 if (len == p->lex.gets_.ptr) return Qnil;
14267 beg += p->lex.gets_.ptr;
14268 len -= p->lex.gets_.ptr;
14269 }
14270 end = memchr(beg, '\n', len);
14271 if (end) len = ++end - beg;
14272 p->lex.gets_.ptr += len;
14273 return rb_str_subseq(s, beg - start, len);
14274}
14275
14276static VALUE
14277lex_getline(struct parser_params *p)
14278{
14279 VALUE line = (*p->lex.gets)(p, p->lex.input);
14280 if (NIL_P(line)) return line;
14281 must_be_ascii_compatible(line);
14282 if (RB_OBJ_FROZEN(line)) line = rb_str_dup(line); // needed for RubyVM::AST.of because script_lines in iseq is deep-frozen
14283 p->line_count++;
14284 return line;
14285}
14286
14287static const rb_data_type_t parser_data_type;
14288
14289#ifndef RIPPER
14290static rb_ast_t*
14291parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
14292{
14293 struct parser_params *p;
14294
14295 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14296
14297 p->lex.gets = lex_get_str;
14298 p->lex.gets_.ptr = 0;
14299 p->lex.input = rb_str_new_frozen(s);
14300 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14301
14302 return yycompile(vparser, p, fname, line);
14303}
14304
14305rb_ast_t*
14306rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
14307{
14308 return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);
14309}
14310
14311rb_ast_t*
14312rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
14313{
14314 must_be_ascii_compatible(s);
14315 return parser_compile_string(vparser, f, s, line);
14316}
14317
14318VALUE rb_io_gets_internal(VALUE io);
14319
14320static VALUE
14321lex_io_gets(struct parser_params *p, VALUE io)
14322{
14323 return rb_io_gets_internal(io);
14324}
14325
14326rb_ast_t*
14327rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
14328{
14329 struct parser_params *p;
14330
14331 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14332
14333 p->lex.gets = lex_io_gets;
14334 p->lex.input = file;
14335 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14336
14337 return yycompile(vparser, p, fname, start);
14338}
14339
14340static VALUE
14341lex_generic_gets(struct parser_params *p, VALUE input)
14342{
14343 return (*p->lex.gets_.call)(input, p->line_count);
14344}
14345
14346rb_ast_t*
14347rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
14348{
14349 struct parser_params *p;
14350
14351 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14352
14353 p->lex.gets = lex_generic_gets;
14354 p->lex.gets_.call = lex_gets;
14355 p->lex.input = input;
14356 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14357
14358 return yycompile(vparser, p, fname, start);
14359}
14360#endif /* !RIPPER */
14361
14362#define STR_FUNC_ESCAPE 0x01
14363#define STR_FUNC_EXPAND 0x02
14364#define STR_FUNC_REGEXP 0x04
14365#define STR_FUNC_QWORDS 0x08
14366#define STR_FUNC_SYMBOL 0x10
14367#define STR_FUNC_INDENT 0x20
14368#define STR_FUNC_LABEL 0x40
14369#define STR_FUNC_LIST 0x4000
14370#define STR_FUNC_TERM 0x8000
14371
14372enum string_type {
14373 str_label = STR_FUNC_LABEL,
14374 str_squote = (0),
14375 str_dquote = (STR_FUNC_EXPAND),
14376 str_xquote = (STR_FUNC_EXPAND),
14377 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
14378 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
14379 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
14380 str_ssym = (STR_FUNC_SYMBOL),
14381 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
14382};
14383
14384static VALUE
14385parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
14386{
14387 VALUE str;
14388
14389 str = rb_enc_str_new(ptr, len, enc);
14390 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
14392 }
14393 else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) {
14394 rb_enc_associate(str, rb_ascii8bit_encoding());
14395 }
14396 }
14397
14398 return str;
14399}
14400
14401#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
14402#define lex_eol_p(p) ((p)->lex.pcur >= (p)->lex.pend)
14403#define lex_eol_n_p(p,n) ((p)->lex.pcur+(n) >= (p)->lex.pend)
14404#define peek(p,c) peek_n(p, (c), 0)
14405#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
14406#define peekc(p) peekc_n(p, 0)
14407#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
14408
14409#ifdef RIPPER
14410static void
14411add_delayed_token(struct parser_params *p, const char *tok, const char *end)
14412{
14413 if (tok < end) {
14414 if (!has_delayed_token(p)) {
14415 p->delayed.token = rb_str_buf_new(end - tok);
14416 rb_enc_associate(p->delayed.token, p->enc);
14417 p->delayed.line = p->ruby_sourceline;
14418 p->delayed.col = rb_long2int(tok - p->lex.pbeg);
14419 }
14420 rb_str_buf_cat(p->delayed.token, tok, end - tok);
14421 p->lex.ptok = end;
14422 }
14423}
14424#else
14425#define add_delayed_token(p, tok, end) ((void)(tok), (void)(end))
14426#endif
14427
14428static int
14429nextline(struct parser_params *p, int set_encoding)
14430{
14431 VALUE v = p->lex.nextline;
14432 p->lex.nextline = 0;
14433 if (!v) {
14434 if (p->eofp)
14435 return -1;
14436
14437 if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
14438 goto end_of_input;
14439 }
14440
14441 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
14442 end_of_input:
14443 p->eofp = 1;
14444 lex_goto_eol(p);
14445 return -1;
14446 }
14447#ifndef RIPPER
14448 if (p->debug_lines) {
14449 if (set_encoding) rb_enc_associate(v, p->enc);
14450 rb_ary_push(p->debug_lines, v);
14451 }
14452#endif
14453 p->cr_seen = FALSE;
14454 }
14455 else if (NIL_P(v)) {
14456 /* after here-document without terminator */
14457 goto end_of_input;
14458 }
14459 add_delayed_token(p, p->lex.ptok, p->lex.pend);
14460 if (p->heredoc_end > 0) {
14461 p->ruby_sourceline = p->heredoc_end;
14462 p->heredoc_end = 0;
14463 }
14464 p->ruby_sourceline++;
14465 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
14466 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
14467 token_flush(p);
14468 p->lex.prevline = p->lex.lastline;
14469 p->lex.lastline = v;
14470 return 0;
14471}
14472
14473static int
14474parser_cr(struct parser_params *p, int c)
14475{
14476 if (peek(p, '\n')) {
14477 p->lex.pcur++;
14478 c = '\n';
14479 }
14480 return c;
14481}
14482
14483static inline int
14484nextc0(struct parser_params *p, int set_encoding)
14485{
14486 int c;
14487
14488 if (UNLIKELY((p->lex.pcur == p->lex.pend) || p->eofp || RTEST(p->lex.nextline))) {
14489 if (nextline(p, set_encoding)) return -1;
14490 }
14491 c = (unsigned char)*p->lex.pcur++;
14492 if (UNLIKELY(c == '\r')) {
14493 c = parser_cr(p, c);
14494 }
14495
14496 return c;
14497}
14498#define nextc(p) nextc0(p, TRUE)
14499
14500static void
14501pushback(struct parser_params *p, int c)
14502{
14503 if (c == -1) return;
14504 p->lex.pcur--;
14505 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
14506 p->lex.pcur--;
14507 }
14508}
14509
14510#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
14511
14512#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
14513#define tok(p) (p)->tokenbuf
14514#define toklen(p) (p)->tokidx
14515
14516static int
14517looking_at_eol_p(struct parser_params *p)
14518{
14519 const char *ptr = p->lex.pcur;
14520 while (ptr < p->lex.pend) {
14521 int c = (unsigned char)*ptr++;
14522 int eol = (c == '\n' || c == '#');
14523 if (eol || !ISSPACE(c)) {
14524 return eol;
14525 }
14526 }
14527 return TRUE;
14528}
14529
14530static char*
14531newtok(struct parser_params *p)
14532{
14533 p->tokidx = 0;
14534 p->tokline = p->ruby_sourceline;
14535 if (!p->tokenbuf) {
14536 p->toksiz = 60;
14537 p->tokenbuf = ALLOC_N(char, 60);
14538 }
14539 if (p->toksiz > 4096) {
14540 p->toksiz = 60;
14541 REALLOC_N(p->tokenbuf, char, 60);
14542 }
14543 return p->tokenbuf;
14544}
14545
14546static char *
14547tokspace(struct parser_params *p, int n)
14548{
14549 p->tokidx += n;
14550
14551 if (p->tokidx >= p->toksiz) {
14552 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
14553 REALLOC_N(p->tokenbuf, char, p->toksiz);
14554 }
14555 return &p->tokenbuf[p->tokidx-n];
14556}
14557
14558static void
14559tokadd(struct parser_params *p, int c)
14560{
14561 p->tokenbuf[p->tokidx++] = (char)c;
14562 if (p->tokidx >= p->toksiz) {
14563 p->toksiz *= 2;
14564 REALLOC_N(p->tokenbuf, char, p->toksiz);
14565 }
14566}
14567
14568static int
14569tok_hex(struct parser_params *p, size_t *numlen)
14570{
14571 int c;
14572
14573 c = scan_hex(p->lex.pcur, 2, numlen);
14574 if (!*numlen) {
14575 yyerror0("invalid hex escape");
14576 token_flush(p);
14577 return 0;
14578 }
14579 p->lex.pcur += *numlen;
14580 return c;
14581}
14582
14583#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
14584
14585static int
14586escaped_control_code(int c)
14587{
14588 int c2 = 0;
14589 switch (c) {
14590 case ' ':
14591 c2 = 's';
14592 break;
14593 case '\n':
14594 c2 = 'n';
14595 break;
14596 case '\t':
14597 c2 = 't';
14598 break;
14599 case '\v':
14600 c2 = 'v';
14601 break;
14602 case '\r':
14603 c2 = 'r';
14604 break;
14605 case '\f':
14606 c2 = 'f';
14607 break;
14608 }
14609 return c2;
14610}
14611
14612#define WARN_SPACE_CHAR(c, prefix) \
14613 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
14614
14615static int
14616tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
14617 int regexp_literal, int wide)
14618{
14619 size_t numlen;
14620 int codepoint = scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
14621 literal_flush(p, p->lex.pcur);
14622 p->lex.pcur += numlen;
14623 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
14624 yyerror0("invalid Unicode escape");
14625 return wide && numlen > 0;
14626 }
14627 if (codepoint > 0x10ffff) {
14628 yyerror0("invalid Unicode codepoint (too large)");
14629 return wide;
14630 }
14631 if ((codepoint & 0xfffff800) == 0xd800) {
14632 yyerror0("invalid Unicode codepoint");
14633 return wide;
14634 }
14635 if (regexp_literal) {
14636 tokcopy(p, (int)numlen);
14637 }
14638 else if (codepoint >= 0x80) {
14639 rb_encoding *utf8 = rb_utf8_encoding();
14640 if (*encp && utf8 != *encp) {
14641 YYLTYPE loc = RUBY_INIT_YYLLOC();
14642 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
14643 parser_show_error_line(p, &loc);
14644 return wide;
14645 }
14646 *encp = utf8;
14647 tokaddmbc(p, codepoint, *encp);
14648 }
14649 else {
14650 tokadd(p, codepoint);
14651 }
14652 return TRUE;
14653}
14654
14655/* return value is for ?\u3042 */
14656static void
14657tokadd_utf8(struct parser_params *p, rb_encoding **encp,
14658 int term, int symbol_literal, int regexp_literal)
14659{
14660 /*
14661 * If `term` is not -1, then we allow multiple codepoints in \u{}
14662 * upto `term` byte, otherwise we're parsing a character literal.
14663 * And then add the codepoints to the current token.
14664 */
14665 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
14666
14667 const int open_brace = '{', close_brace = '}';
14668
14669 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
14670
14671 if (peek(p, open_brace)) { /* handle \u{...} form */
14672 const char *second = NULL;
14673 int c, last = nextc(p);
14674 if (p->lex.pcur >= p->lex.pend) goto unterminated;
14675 while (ISSPACE(c = *p->lex.pcur) && ++p->lex.pcur < p->lex.pend);
14676 while (c != close_brace) {
14677 if (c == term) goto unterminated;
14678 if (second == multiple_codepoints)
14679 second = p->lex.pcur;
14680 if (regexp_literal) tokadd(p, last);
14681 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
14682 break;
14683 }
14684 while (ISSPACE(c = *p->lex.pcur)) {
14685 if (++p->lex.pcur >= p->lex.pend) goto unterminated;
14686 last = c;
14687 }
14688 if (term == -1 && !second)
14689 second = multiple_codepoints;
14690 }
14691
14692 if (c != close_brace) {
14693 unterminated:
14694 token_flush(p);
14695 yyerror0("unterminated Unicode escape");
14696 return;
14697 }
14698 if (second && second != multiple_codepoints) {
14699 const char *pcur = p->lex.pcur;
14700 p->lex.pcur = second;
14701 dispatch_scan_event(p, tSTRING_CONTENT);
14702 token_flush(p);
14703 p->lex.pcur = pcur;
14704 yyerror0(multiple_codepoints);
14705 token_flush(p);
14706 }
14707
14708 if (regexp_literal) tokadd(p, close_brace);
14709 nextc(p);
14710 }
14711 else { /* handle \uxxxx form */
14712 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
14713 token_flush(p);
14714 return;
14715 }
14716 }
14717}
14718
14719#define ESCAPE_CONTROL 1
14720#define ESCAPE_META 2
14721
14722static int
14723read_escape(struct parser_params *p, int flags, rb_encoding **encp)
14724{
14725 int c;
14726 size_t numlen;
14727
14728 switch (c = nextc(p)) {
14729 case '\\': /* Backslash */
14730 return c;
14731
14732 case 'n': /* newline */
14733 return '\n';
14734
14735 case 't': /* horizontal tab */
14736 return '\t';
14737
14738 case 'r': /* carriage-return */
14739 return '\r';
14740
14741 case 'f': /* form-feed */
14742 return '\f';
14743
14744 case 'v': /* vertical tab */
14745 return '\13';
14746
14747 case 'a': /* alarm(bell) */
14748 return '\007';
14749
14750 case 'e': /* escape */
14751 return 033;
14752
14753 case '0': case '1': case '2': case '3': /* octal constant */
14754 case '4': case '5': case '6': case '7':
14755 pushback(p, c);
14756 c = scan_oct(p->lex.pcur, 3, &numlen);
14757 p->lex.pcur += numlen;
14758 return c;
14759
14760 case 'x': /* hex constant */
14761 c = tok_hex(p, &numlen);
14762 if (numlen == 0) return 0;
14763 return c;
14764
14765 case 'b': /* backspace */
14766 return '\010';
14767
14768 case 's': /* space */
14769 return ' ';
14770
14771 case 'M':
14772 if (flags & ESCAPE_META) goto eof;
14773 if ((c = nextc(p)) != '-') {
14774 goto eof;
14775 }
14776 if ((c = nextc(p)) == '\\') {
14777 switch (peekc(p)) {
14778 case 'u': case 'U':
14779 nextc(p);
14780 goto eof;
14781 }
14782 return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
14783 }
14784 else if (c == -1 || !ISASCII(c)) goto eof;
14785 else {
14786 int c2 = escaped_control_code(c);
14787 if (c2) {
14788 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
14789 WARN_SPACE_CHAR(c2, "\\M-");
14790 }
14791 else {
14792 WARN_SPACE_CHAR(c2, "\\C-\\M-");
14793 }
14794 }
14795 else if (ISCNTRL(c)) goto eof;
14796 return ((c & 0xff) | 0x80);
14797 }
14798
14799 case 'C':
14800 if ((c = nextc(p)) != '-') {
14801 goto eof;
14802 }
14803 case 'c':
14804 if (flags & ESCAPE_CONTROL) goto eof;
14805 if ((c = nextc(p))== '\\') {
14806 switch (peekc(p)) {
14807 case 'u': case 'U':
14808 nextc(p);
14809 goto eof;
14810 }
14811 c = read_escape(p, flags|ESCAPE_CONTROL, encp);
14812 }
14813 else if (c == '?')
14814 return 0177;
14815 else if (c == -1 || !ISASCII(c)) goto eof;
14816 else {
14817 int c2 = escaped_control_code(c);
14818 if (c2) {
14819 if (ISCNTRL(c)) {
14820 if (flags & ESCAPE_META) {
14821 WARN_SPACE_CHAR(c2, "\\M-");
14822 }
14823 else {
14824 WARN_SPACE_CHAR(c2, "");
14825 }
14826 }
14827 else {
14828 if (flags & ESCAPE_META) {
14829 WARN_SPACE_CHAR(c2, "\\M-\\C-");
14830 }
14831 else {
14832 WARN_SPACE_CHAR(c2, "\\C-");
14833 }
14834 }
14835 }
14836 else if (ISCNTRL(c)) goto eof;
14837 }
14838 return c & 0x9f;
14839
14840 eof:
14841 case -1:
14842 yyerror0("Invalid escape character syntax");
14843 token_flush(p);
14844 return '\0';
14845
14846 default:
14847 return c;
14848 }
14849}
14850
14851static void
14852tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
14853{
14854 int len = rb_enc_codelen(c, enc);
14855 rb_enc_mbcput(c, tokspace(p, len), enc);
14856}
14857
14858static int
14859tokadd_escape(struct parser_params *p, rb_encoding **encp)
14860{
14861 int c;
14862 size_t numlen;
14863
14864 switch (c = nextc(p)) {
14865 case '\n':
14866 return 0; /* just ignore */
14867
14868 case '0': case '1': case '2': case '3': /* octal constant */
14869 case '4': case '5': case '6': case '7':
14870 {
14871 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
14872 if (numlen == 0) goto eof;
14873 p->lex.pcur += numlen;
14874 tokcopy(p, (int)numlen + 1);
14875 }
14876 return 0;
14877
14878 case 'x': /* hex constant */
14879 {
14880 tok_hex(p, &numlen);
14881 if (numlen == 0) return -1;
14882 tokcopy(p, (int)numlen + 2);
14883 }
14884 return 0;
14885
14886 eof:
14887 case -1:
14888 yyerror0("Invalid escape character syntax");
14889 token_flush(p);
14890 return -1;
14891
14892 default:
14893 tokadd(p, '\\');
14894 tokadd(p, c);
14895 }
14896 return 0;
14897}
14898
14899static int
14900regx_options(struct parser_params *p)
14901{
14902 int kcode = 0;
14903 int kopt = 0;
14904 int options = 0;
14905 int c, opt, kc;
14906
14907 newtok(p);
14908 while (c = nextc(p), ISALPHA(c)) {
14909 if (c == 'o') {
14910 options |= RE_OPTION_ONCE;
14911 }
14912 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
14913 if (kc >= 0) {
14914 if (kc != rb_ascii8bit_encindex()) kcode = c;
14915 kopt = opt;
14916 }
14917 else {
14918 options |= opt;
14919 }
14920 }
14921 else {
14922 tokadd(p, c);
14923 }
14924 }
14925 options |= kopt;
14926 pushback(p, c);
14927 if (toklen(p)) {
14928 YYLTYPE loc = RUBY_INIT_YYLLOC();
14929 tokfix(p);
14930 compile_error(p, "unknown regexp option%s - %*s",
14931 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
14932 parser_show_error_line(p, &loc);
14933 }
14934 return options | RE_OPTION_ENCODING(kcode);
14935}
14936
14937static int
14938tokadd_mbchar(struct parser_params *p, int c)
14939{
14940 int len = parser_precise_mbclen(p, p->lex.pcur-1);
14941 if (len < 0) return -1;
14942 tokadd(p, c);
14943 p->lex.pcur += --len;
14944 if (len > 0) tokcopy(p, len);
14945 return c;
14946}
14947
14948static inline int
14949simple_re_meta(int c)
14950{
14951 switch (c) {
14952 case '$': case '*': case '+': case '.':
14953 case '?': case '^': case '|':
14954 case ')': case ']': case '}': case '>':
14955 return TRUE;
14956 default:
14957 return FALSE;
14958 }
14959}
14960
14961static int
14962parser_update_heredoc_indent(struct parser_params *p, int c)
14963{
14964 if (p->heredoc_line_indent == -1) {
14965 if (c == '\n') p->heredoc_line_indent = 0;
14966 }
14967 else {
14968 if (c == ' ') {
14969 p->heredoc_line_indent++;
14970 return TRUE;
14971 }
14972 else if (c == '\t') {
14973 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
14974 p->heredoc_line_indent = w * TAB_WIDTH;
14975 return TRUE;
14976 }
14977 else if (c != '\n') {
14978 if (p->heredoc_indent > p->heredoc_line_indent) {
14979 p->heredoc_indent = p->heredoc_line_indent;
14980 }
14981 p->heredoc_line_indent = -1;
14982 }
14983 }
14984 return FALSE;
14985}
14986
14987static void
14988parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
14989{
14990 YYLTYPE loc = RUBY_INIT_YYLLOC();
14991 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
14992 compile_error(p, "%s mixed within %s source", n1, n2);
14993 parser_show_error_line(p, &loc);
14994}
14995
14996static void
14997parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
14998{
14999 const char *pos = p->lex.pcur;
15000 p->lex.pcur = beg;
15001 parser_mixed_error(p, enc1, enc2);
15002 p->lex.pcur = pos;
15003}
15004
15005static int
15006tokadd_string(struct parser_params *p,
15007 int func, int term, int paren, long *nest,
15008 rb_encoding **encp, rb_encoding **enc)
15009{
15010 int c;
15011 bool erred = false;
15012
15013#define mixed_error(enc1, enc2) \
15014 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
15015#define mixed_escape(beg, enc1, enc2) \
15016 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
15017
15018 while ((c = nextc(p)) != -1) {
15019 if (p->heredoc_indent > 0) {
15020 parser_update_heredoc_indent(p, c);
15021 }
15022
15023 if (paren && c == paren) {
15024 ++*nest;
15025 }
15026 else if (c == term) {
15027 if (!nest || !*nest) {
15028 pushback(p, c);
15029 break;
15030 }
15031 --*nest;
15032 }
15033 else if ((func & STR_FUNC_EXPAND) && c == '#' && p->lex.pcur < p->lex.pend) {
15034 int c2 = *p->lex.pcur;
15035 if (c2 == '$' || c2 == '@' || c2 == '{') {
15036 pushback(p, c);
15037 break;
15038 }
15039 }
15040 else if (c == '\\') {
15041 literal_flush(p, p->lex.pcur - 1);
15042 c = nextc(p);
15043 switch (c) {
15044 case '\n':
15045 if (func & STR_FUNC_QWORDS) break;
15046 if (func & STR_FUNC_EXPAND) {
15047 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
15048 continue;
15049 if (c == term) {
15050 c = '\\';
15051 goto terminate;
15052 }
15053 }
15054 tokadd(p, '\\');
15055 break;
15056
15057 case '\\':
15058 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
15059 break;
15060
15061 case 'u':
15062 if ((func & STR_FUNC_EXPAND) == 0) {
15063 tokadd(p, '\\');
15064 break;
15065 }
15066 tokadd_utf8(p, enc, term,
15067 func & STR_FUNC_SYMBOL,
15068 func & STR_FUNC_REGEXP);
15069 continue;
15070
15071 default:
15072 if (c == -1) return -1;
15073 if (!ISASCII(c)) {
15074 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
15075 goto non_ascii;
15076 }
15077 if (func & STR_FUNC_REGEXP) {
15078 switch (c) {
15079 case 'c':
15080 case 'C':
15081 case 'M': {
15082 pushback(p, c);
15083 c = read_escape(p, 0, enc);
15084
15085 int i;
15086 char escbuf[5];
15087 snprintf(escbuf, sizeof(escbuf), "\\x%02X", c);
15088 for (i = 0; i < 4; i++) {
15089 tokadd(p, escbuf[i]);
15090 }
15091 continue;
15092 }
15093 }
15094
15095 if (c == term && !simple_re_meta(c)) {
15096 tokadd(p, c);
15097 continue;
15098 }
15099 pushback(p, c);
15100 if ((c = tokadd_escape(p, enc)) < 0)
15101 return -1;
15102 if (*enc && *enc != *encp) {
15103 mixed_escape(p->lex.ptok+2, *enc, *encp);
15104 }
15105 continue;
15106 }
15107 else if (func & STR_FUNC_EXPAND) {
15108 pushback(p, c);
15109 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
15110 c = read_escape(p, 0, enc);
15111 }
15112 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
15113 /* ignore backslashed spaces in %w */
15114 }
15115 else if (c != term && !(paren && c == paren)) {
15116 tokadd(p, '\\');
15117 pushback(p, c);
15118 continue;
15119 }
15120 }
15121 }
15122 else if (!parser_isascii(p)) {
15123 non_ascii:
15124 if (!*enc) {
15125 *enc = *encp;
15126 }
15127 else if (*enc != *encp) {
15128 mixed_error(*enc, *encp);
15129 continue;
15130 }
15131 if (tokadd_mbchar(p, c) == -1) return -1;
15132 continue;
15133 }
15134 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
15135 pushback(p, c);
15136 break;
15137 }
15138 if (c & 0x80) {
15139 if (!*enc) {
15140 *enc = *encp;
15141 }
15142 else if (*enc != *encp) {
15143 mixed_error(*enc, *encp);
15144 continue;
15145 }
15146 }
15147 tokadd(p, c);
15148 }
15149 terminate:
15150 if (*enc) *encp = *enc;
15151 return c;
15152}
15153
15154static inline rb_strterm_t *
15155new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
15156{
15157 return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
15158}
15159
15160/* imemo_parser_strterm for literal */
15161#define NEW_STRTERM(func, term, paren) \
15162 new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
15163
15164#ifdef RIPPER
15165static void
15166flush_string_content(struct parser_params *p, rb_encoding *enc)
15167{
15168 VALUE content = yylval.val;
15169 if (!ripper_is_node_yylval(content))
15170 content = ripper_new_yylval(p, 0, 0, content);
15171 if (has_delayed_token(p)) {
15172 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
15173 if (len > 0) {
15174 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
15175 }
15176 dispatch_delayed_token(p, tSTRING_CONTENT);
15177 p->lex.ptok = p->lex.pcur;
15178 RNODE(content)->nd_rval = yylval.val;
15179 }
15180 dispatch_scan_event(p, tSTRING_CONTENT);
15181 if (yylval.val != content)
15182 RNODE(content)->nd_rval = yylval.val;
15183 yylval.val = content;
15184}
15185#else
15186#define flush_string_content(p, enc) ((void)(enc))
15187#endif
15188
15189RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
15190/* this can be shared with ripper, since it's independent from struct
15191 * parser_params. */
15192#ifndef RIPPER
15193#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
15194#define SPECIAL_PUNCT(idx) ( \
15195 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
15196 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
15197 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
15198 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
15199 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
15200 BIT('0', idx))
15201const unsigned int ruby_global_name_punct_bits[] = {
15202 SPECIAL_PUNCT(0),
15203 SPECIAL_PUNCT(1),
15204 SPECIAL_PUNCT(2),
15205};
15206#undef BIT
15207#undef SPECIAL_PUNCT
15208#endif
15209
15210static enum yytokentype
15211parser_peek_variable_name(struct parser_params *p)
15212{
15213 int c;
15214 const char *ptr = p->lex.pcur;
15215
15216 if (ptr + 1 >= p->lex.pend) return 0;
15217 c = *ptr++;
15218 switch (c) {
15219 case '$':
15220 if ((c = *ptr) == '-') {
15221 if (++ptr >= p->lex.pend) return 0;
15222 c = *ptr;
15223 }
15224 else if (is_global_name_punct(c) || ISDIGIT(c)) {
15225 return tSTRING_DVAR;
15226 }
15227 break;
15228 case '@':
15229 if ((c = *ptr) == '@') {
15230 if (++ptr >= p->lex.pend) return 0;
15231 c = *ptr;
15232 }
15233 break;
15234 case '{':
15235 p->lex.pcur = ptr;
15236 p->command_start = TRUE;
15237 return tSTRING_DBEG;
15238 default:
15239 return 0;
15240 }
15241 if (!ISASCII(c) || c == '_' || ISALPHA(c))
15242 return tSTRING_DVAR;
15243 return 0;
15244}
15245
15246#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
15247#define IS_END() IS_lex_state(EXPR_END_ANY)
15248#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
15249#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
15250#define IS_LABEL_POSSIBLE() (\
15251 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
15252 IS_ARG())
15253#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
15254#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
15255
15256static inline enum yytokentype
15257parser_string_term(struct parser_params *p, int func)
15258{
15259 p->lex.strterm = 0;
15260 if (func & STR_FUNC_REGEXP) {
15261 set_yylval_num(regx_options(p));
15262 dispatch_scan_event(p, tREGEXP_END);
15263 SET_LEX_STATE(EXPR_END);
15264 return tREGEXP_END;
15265 }
15266 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
15267 nextc(p);
15268 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
15269 return tLABEL_END;
15270 }
15271 SET_LEX_STATE(EXPR_END);
15272 return tSTRING_END;
15273}
15274
15275static enum yytokentype
15276parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
15277{
15278 int func = (int)quote->u1.func;
15279 int term = (int)quote->u3.term;
15280 int paren = (int)quote->u2.paren;
15281 int c, space = 0;
15282 rb_encoding *enc = p->enc;
15283 rb_encoding *base_enc = 0;
15284 VALUE lit;
15285
15286 if (func & STR_FUNC_TERM) {
15287 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
15288 SET_LEX_STATE(EXPR_END);
15289 p->lex.strterm = 0;
15290 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
15291 }
15292 c = nextc(p);
15293 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
15294 do {c = nextc(p);} while (ISSPACE(c));
15295 space = 1;
15296 }
15297 if (func & STR_FUNC_LIST) {
15298 quote->u1.func &= ~STR_FUNC_LIST;
15299 space = 1;
15300 }
15301 if (c == term && !quote->u0.nest) {
15302 if (func & STR_FUNC_QWORDS) {
15303 quote->u1.func |= STR_FUNC_TERM;
15304 pushback(p, c); /* dispatch the term at tSTRING_END */
15305 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
15306 return ' ';
15307 }
15308 return parser_string_term(p, func);
15309 }
15310 if (space) {
15311 pushback(p, c);
15312 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
15313 return ' ';
15314 }
15315 newtok(p);
15316 if ((func & STR_FUNC_EXPAND) && c == '#') {
15317 int t = parser_peek_variable_name(p);
15318 if (t) return t;
15319 tokadd(p, '#');
15320 c = nextc(p);
15321 }
15322 pushback(p, c);
15323 if (tokadd_string(p, func, term, paren, &quote->u0.nest,
15324 &enc, &base_enc) == -1) {
15325 if (p->eofp) {
15326#ifndef RIPPER
15327# define unterminated_literal(mesg) yyerror0(mesg)
15328#else
15329# define unterminated_literal(mesg) compile_error(p, mesg)
15330#endif
15331 literal_flush(p, p->lex.pcur);
15332 if (func & STR_FUNC_QWORDS) {
15333 /* no content to add, bailing out here */
15334 unterminated_literal("unterminated list meets end of file");
15335 p->lex.strterm = 0;
15336 return tSTRING_END;
15337 }
15338 if (func & STR_FUNC_REGEXP) {
15339 unterminated_literal("unterminated regexp meets end of file");
15340 }
15341 else {
15342 unterminated_literal("unterminated string meets end of file");
15343 }
15344 quote->u1.func |= STR_FUNC_TERM;
15345 }
15346 }
15347
15348 tokfix(p);
15349 lit = STR_NEW3(tok(p), toklen(p), enc, func);
15350 set_yylval_str(lit);
15351 flush_string_content(p, enc);
15352
15353 return tSTRING_CONTENT;
15354}
15355
15356static enum yytokentype
15357heredoc_identifier(struct parser_params *p)
15358{
15359 /*
15360 * term_len is length of `<<"END"` except `END`,
15361 * in this case term_len is 4 (<, <, " and ").
15362 */
15363 long len, offset = p->lex.pcur - p->lex.pbeg;
15364 int c = nextc(p), term, func = 0, quote = 0;
15365 enum yytokentype token = tSTRING_BEG;
15366 int indent = 0;
15367
15368 if (c == '-') {
15369 c = nextc(p);
15370 func = STR_FUNC_INDENT;
15371 offset++;
15372 }
15373 else if (c == '~') {
15374 c = nextc(p);
15375 func = STR_FUNC_INDENT;
15376 offset++;
15377 indent = INT_MAX;
15378 }
15379 switch (c) {
15380 case '\'':
15381 func |= str_squote; goto quoted;
15382 case '"':
15383 func |= str_dquote; goto quoted;
15384 case '`':
15385 token = tXSTRING_BEG;
15386 func |= str_xquote; goto quoted;
15387
15388 quoted:
15389 quote++;
15390 offset++;
15391 term = c;
15392 len = 0;
15393 while ((c = nextc(p)) != term) {
15394 if (c == -1 || c == '\r' || c == '\n') {
15395 yyerror0("unterminated here document identifier");
15396 return -1;
15397 }
15398 }
15399 break;
15400
15401 default:
15402 if (!parser_is_identchar(p)) {
15403 pushback(p, c);
15404 if (func & STR_FUNC_INDENT) {
15405 pushback(p, indent > 0 ? '~' : '-');
15406 }
15407 return 0;
15408 }
15409 func |= str_dquote;
15410 do {
15411 int n = parser_precise_mbclen(p, p->lex.pcur-1);
15412 if (n < 0) return 0;
15413 p->lex.pcur += --n;
15414 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
15415 pushback(p, c);
15416 break;
15417 }
15418
15419 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
15420 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
15421 yyerror0("too long here document identifier");
15422 dispatch_scan_event(p, tHEREDOC_BEG);
15423 lex_goto_eol(p);
15424
15425 p->lex.strterm = new_strterm(0, 0, 0, p->lex.lastline);
15426 p->lex.strterm->flags |= STRTERM_HEREDOC;
15427 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
15428 here->offset = offset;
15429 here->sourceline = p->ruby_sourceline;
15430 here->length = (int)len;
15431 here->quote = quote;
15432 here->func = func;
15433
15434 token_flush(p);
15435 p->heredoc_indent = indent;
15436 p->heredoc_line_indent = 0;
15437 return token;
15438}
15439
15440static void
15441heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
15442{
15443 VALUE line;
15444
15445 p->lex.strterm = 0;
15446 line = here->lastline;
15447 p->lex.lastline = line;
15448 p->lex.pbeg = RSTRING_PTR(line);
15449 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
15450 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
15451 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
15452 p->heredoc_end = p->ruby_sourceline;
15453 p->ruby_sourceline = (int)here->sourceline;
15454 if (p->eofp) p->lex.nextline = Qnil;
15455 p->eofp = 0;
15456}
15457
15458static int
15459dedent_string(VALUE string, int width)
15460{
15461 char *str;
15462 long len;
15463 int i, col = 0;
15464
15465 RSTRING_GETMEM(string, str, len);
15466 for (i = 0; i < len && col < width; i++) {
15467 if (str[i] == ' ') {
15468 col++;
15469 }
15470 else if (str[i] == '\t') {
15471 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
15472 if (n > width) break;
15473 col = n;
15474 }
15475 else {
15476 break;
15477 }
15478 }
15479 if (!i) return 0;
15480 rb_str_modify(string);
15481 str = RSTRING_PTR(string);
15482 if (RSTRING_LEN(string) != len)
15483 rb_fatal("literal string changed: %+"PRIsVALUE, string);
15484 MEMMOVE(str, str + i, char, len - i);
15485 rb_str_set_len(string, len - i);
15486 return i;
15487}
15488
15489#ifndef RIPPER
15490static NODE *
15491heredoc_dedent(struct parser_params *p, NODE *root)
15492{
15493 NODE *node, *str_node, *prev_node;
15494 int indent = p->heredoc_indent;
15495 VALUE prev_lit = 0;
15496
15497 if (indent <= 0) return root;
15498 p->heredoc_indent = 0;
15499 if (!root) return root;
15500
15501 prev_node = node = str_node = root;
15502 if (nd_type_p(root, NODE_LIST)) str_node = root->nd_head;
15503
15504 while (str_node) {
15505 VALUE lit = str_node->nd_lit;
15506 if (str_node->flags & NODE_FL_NEWLINE) {
15507 dedent_string(lit, indent);
15508 }
15509 if (!prev_lit) {
15510 prev_lit = lit;
15511 }
15512 else if (!literal_concat0(p, prev_lit, lit)) {
15513 return 0;
15514 }
15515 else {
15516 NODE *end = node->nd_end;
15517 node = prev_node->nd_next = node->nd_next;
15518 if (!node) {
15519 if (nd_type_p(prev_node, NODE_DSTR))
15520 nd_set_type(prev_node, NODE_STR);
15521 break;
15522 }
15523 node->nd_end = end;
15524 goto next_str;
15525 }
15526
15527 str_node = 0;
15528 while ((node = (prev_node = node)->nd_next) != 0) {
15529 next_str:
15530 if (!nd_type_p(node, NODE_LIST)) break;
15531 if ((str_node = node->nd_head) != 0) {
15532 enum node_type type = nd_type(str_node);
15533 if (type == NODE_STR || type == NODE_DSTR) break;
15534 prev_lit = 0;
15535 str_node = 0;
15536 }
15537 }
15538 }
15539 return root;
15540}
15541#else /* RIPPER */
15542static VALUE
15543heredoc_dedent(struct parser_params *p, VALUE array)
15544{
15545 int indent = p->heredoc_indent;
15546
15547 if (indent <= 0) return array;
15548 p->heredoc_indent = 0;
15549 dispatch2(heredoc_dedent, array, INT2NUM(indent));
15550 return array;
15551}
15552
15553/*
15554 * call-seq:
15555 * Ripper.dedent_string(input, width) -> Integer
15556 *
15557 * USE OF RIPPER LIBRARY ONLY.
15558 *
15559 * Strips up to +width+ leading whitespaces from +input+,
15560 * and returns the stripped column width.
15561 */
15562static VALUE
15563parser_dedent_string(VALUE self, VALUE input, VALUE width)
15564{
15565 int wid, col;
15566
15567 StringValue(input);
15568 wid = NUM2UINT(width);
15569 col = dedent_string(input, wid);
15570 return INT2NUM(col);
15571}
15572#endif
15573
15574static int
15575whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
15576{
15577 const char *ptr = p->lex.pbeg;
15578 long n;
15579
15580 if (indent) {
15581 while (*ptr && ISSPACE(*ptr)) ptr++;
15582 }
15583 n = p->lex.pend - (ptr + len);
15584 if (n < 0) return FALSE;
15585 if (n > 0 && ptr[len] != '\n') {
15586 if (ptr[len] != '\r') return FALSE;
15587 if (n <= 1 || ptr[len+1] != '\n') return FALSE;
15588 }
15589 return strncmp(eos, ptr, len) == 0;
15590}
15591
15592static int
15593word_match_p(struct parser_params *p, const char *word, long len)
15594{
15595 if (strncmp(p->lex.pcur, word, len)) return 0;
15596 if (p->lex.pcur + len == p->lex.pend) return 1;
15597 int c = (unsigned char)p->lex.pcur[len];
15598 if (ISSPACE(c)) return 1;
15599 switch (c) {
15600 case '\0': case '\004': case '\032': return 1;
15601 }
15602 return 0;
15603}
15604
15605#define NUM_SUFFIX_R (1<<0)
15606#define NUM_SUFFIX_I (1<<1)
15607#define NUM_SUFFIX_ALL 3
15608
15609static int
15610number_literal_suffix(struct parser_params *p, int mask)
15611{
15612 int c, result = 0;
15613 const char *lastp = p->lex.pcur;
15614
15615 while ((c = nextc(p)) != -1) {
15616 if ((mask & NUM_SUFFIX_I) && c == 'i') {
15617 result |= (mask & NUM_SUFFIX_I);
15618 mask &= ~NUM_SUFFIX_I;
15619 /* r after i, rational of complex is disallowed */
15620 mask &= ~NUM_SUFFIX_R;
15621 continue;
15622 }
15623 if ((mask & NUM_SUFFIX_R) && c == 'r') {
15624 result |= (mask & NUM_SUFFIX_R);
15625 mask &= ~NUM_SUFFIX_R;
15626 continue;
15627 }
15628 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
15629 p->lex.pcur = lastp;
15630 literal_flush(p, p->lex.pcur);
15631 return 0;
15632 }
15633 pushback(p, c);
15634 break;
15635 }
15636 return result;
15637}
15638
15639static enum yytokentype
15640set_number_literal(struct parser_params *p, VALUE v,
15641 enum yytokentype type, int suffix)
15642{
15643 if (suffix & NUM_SUFFIX_I) {
15644 v = rb_complex_raw(INT2FIX(0), v);
15645 type = tIMAGINARY;
15646 }
15647 set_yylval_literal(v);
15648 SET_LEX_STATE(EXPR_END);
15649 return type;
15650}
15651
15652static enum yytokentype
15653set_integer_literal(struct parser_params *p, VALUE v, int suffix)
15654{
15655 enum yytokentype type = tINTEGER;
15656 if (suffix & NUM_SUFFIX_R) {
15657 v = rb_rational_raw1(v);
15658 type = tRATIONAL;
15659 }
15660 return set_number_literal(p, v, type, suffix);
15661}
15662
15663#ifdef RIPPER
15664static void
15665dispatch_heredoc_end(struct parser_params *p)
15666{
15667 VALUE str;
15668 if (has_delayed_token(p))
15669 dispatch_delayed_token(p, tSTRING_CONTENT);
15670 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
15671 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
15672 lex_goto_eol(p);
15673 token_flush(p);
15674}
15675
15676#else
15677#define dispatch_heredoc_end(p) ((void)0)
15678#endif
15679
15680static enum yytokentype
15681here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
15682{
15683 int c, func, indent = 0;
15684 const char *eos, *ptr, *ptr_end;
15685 long len;
15686 VALUE str = 0;
15687 rb_encoding *enc = p->enc;
15688 rb_encoding *base_enc = 0;
15689 int bol;
15690
15691 eos = RSTRING_PTR(here->lastline) + here->offset;
15692 len = here->length;
15693 indent = (func = here->func) & STR_FUNC_INDENT;
15694
15695 if ((c = nextc(p)) == -1) {
15696 error:
15697#ifdef RIPPER
15698 if (!has_delayed_token(p)) {
15699 dispatch_scan_event(p, tSTRING_CONTENT);
15700 }
15701 else {
15702 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
15703 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
15704 int cr = ENC_CODERANGE_UNKNOWN;
15705 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
15706 if (cr != ENC_CODERANGE_7BIT &&
15707 p->enc == rb_usascii_encoding() &&
15708 enc != rb_utf8_encoding()) {
15709 enc = rb_ascii8bit_encoding();
15710 }
15711 }
15712 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
15713 }
15714 dispatch_delayed_token(p, tSTRING_CONTENT);
15715 }
15716 lex_goto_eol(p);
15717#endif
15718 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15719 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
15720 (int)len, eos);
15721 token_flush(p);
15722 p->lex.strterm = 0;
15723 SET_LEX_STATE(EXPR_END);
15724 return tSTRING_END;
15725 }
15726 bol = was_bol(p);
15727 if (!bol) {
15728 /* not beginning of line, cannot be the terminator */
15729 }
15730 else if (p->heredoc_line_indent == -1) {
15731 /* `heredoc_line_indent == -1` means
15732 * - "after an interpolation in the same line", or
15733 * - "in a continuing line"
15734 */
15735 p->heredoc_line_indent = 0;
15736 }
15737 else if (whole_match_p(p, eos, len, indent)) {
15738 dispatch_heredoc_end(p);
15739 restore:
15740 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15741 token_flush(p);
15742 p->lex.strterm = 0;
15743 SET_LEX_STATE(EXPR_END);
15744 return tSTRING_END;
15745 }
15746
15747 if (!(func & STR_FUNC_EXPAND)) {
15748 do {
15749 ptr = RSTRING_PTR(p->lex.lastline);
15750 ptr_end = p->lex.pend;
15751 if (ptr_end > ptr) {
15752 switch (ptr_end[-1]) {
15753 case '\n':
15754 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
15755 ptr_end++;
15756 break;
15757 }
15758 case '\r':
15759 --ptr_end;
15760 }
15761 }
15762
15763 if (p->heredoc_indent > 0) {
15764 long i = 0;
15765 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
15766 i++;
15767 p->heredoc_line_indent = 0;
15768 }
15769
15770 if (str)
15771 rb_str_cat(str, ptr, ptr_end - ptr);
15772 else
15773 str = STR_NEW(ptr, ptr_end - ptr);
15774 if (ptr_end < p->lex.pend) rb_str_cat(str, "\n", 1);
15775 lex_goto_eol(p);
15776 if (p->heredoc_indent > 0) {
15777 goto flush_str;
15778 }
15779 if (nextc(p) == -1) {
15780 if (str) {
15781 str = 0;
15782 }
15783 goto error;
15784 }
15785 } while (!whole_match_p(p, eos, len, indent));
15786 }
15787 else {
15788 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
15789 newtok(p);
15790 if (c == '#') {
15791 int t = parser_peek_variable_name(p);
15792 if (p->heredoc_line_indent != -1) {
15793 if (p->heredoc_indent > p->heredoc_line_indent) {
15794 p->heredoc_indent = p->heredoc_line_indent;
15795 }
15796 p->heredoc_line_indent = -1;
15797 }
15798 if (t) return t;
15799 tokadd(p, '#');
15800 c = nextc(p);
15801 }
15802 do {
15803 pushback(p, c);
15804 enc = p->enc;
15805 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
15806 if (p->eofp) goto error;
15807 goto restore;
15808 }
15809 if (c != '\n') {
15810 if (c == '\\') p->heredoc_line_indent = -1;
15811 flush:
15812 str = STR_NEW3(tok(p), toklen(p), enc, func);
15813 flush_str:
15814 set_yylval_str(str);
15815#ifndef RIPPER
15816 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15817#endif
15818 flush_string_content(p, enc);
15819 return tSTRING_CONTENT;
15820 }
15821 tokadd(p, nextc(p));
15822 if (p->heredoc_indent > 0) {
15823 lex_goto_eol(p);
15824 goto flush;
15825 }
15826 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
15827 if ((c = nextc(p)) == -1) goto error;
15828 } while (!whole_match_p(p, eos, len, indent));
15829 str = STR_NEW3(tok(p), toklen(p), enc, func);
15830 }
15831 dispatch_heredoc_end(p);
15832#ifdef RIPPER
15833 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
15834 yylval.val, str);
15835#endif
15836 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15837 token_flush(p);
15838 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
15839 set_yylval_str(str);
15840#ifndef RIPPER
15841 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15842#endif
15843 return tSTRING_CONTENT;
15844}
15845
15846#include "lex.c"
15847
15848static int
15849arg_ambiguous(struct parser_params *p, char c)
15850{
15851#ifndef RIPPER
15852 if (c == '/') {
15853 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
15854 }
15855 else {
15856 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
15857 }
15858#else
15859 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
15860#endif
15861 return TRUE;
15862}
15863
15864static ID
15865#ifndef RIPPER
15866formal_argument(struct parser_params *p, ID lhs)
15867#else
15868formal_argument(struct parser_params *p, VALUE lhs)
15869#endif
15870{
15871 ID id = get_id(lhs);
15872
15873 switch (id_type(id)) {
15874 case ID_LOCAL:
15875 break;
15876#ifndef RIPPER
15877# define ERR(mesg) yyerror0(mesg)
15878#else
15879# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
15880#endif
15881 case ID_CONST:
15882 ERR("formal argument cannot be a constant");
15883 return 0;
15884 case ID_INSTANCE:
15885 ERR("formal argument cannot be an instance variable");
15886 return 0;
15887 case ID_GLOBAL:
15888 ERR("formal argument cannot be a global variable");
15889 return 0;
15890 case ID_CLASS:
15891 ERR("formal argument cannot be a class variable");
15892 return 0;
15893 default:
15894 ERR("formal argument must be local variable");
15895 return 0;
15896#undef ERR
15897 }
15898 shadowing_lvar(p, id);
15899 return lhs;
15900}
15901
15902static int
15903lvar_defined(struct parser_params *p, ID id)
15904{
15905 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
15906}
15907
15908/* emacsen -*- hack */
15909static long
15910parser_encode_length(struct parser_params *p, const char *name, long len)
15911{
15912 long nlen;
15913
15914 if (len > 5 && name[nlen = len - 5] == '-') {
15915 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
15916 return nlen;
15917 }
15918 if (len > 4 && name[nlen = len - 4] == '-') {
15919 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
15920 return nlen;
15921 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
15922 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
15923 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
15924 return nlen;
15925 }
15926 return len;
15927}
15928
15929static void
15930parser_set_encode(struct parser_params *p, const char *name)
15931{
15932 int idx = rb_enc_find_index(name);
15933 rb_encoding *enc;
15934 VALUE excargs[3];
15935
15936 if (idx < 0) {
15937 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
15938 error:
15939 excargs[0] = rb_eArgError;
15940 excargs[2] = rb_make_backtrace();
15941 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
15942 rb_exc_raise(rb_make_exception(3, excargs));
15943 }
15944 enc = rb_enc_from_index(idx);
15945 if (!rb_enc_asciicompat(enc)) {
15946 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
15947 goto error;
15948 }
15949 p->enc = enc;
15950#ifndef RIPPER
15951 if (p->debug_lines) {
15952 VALUE lines = p->debug_lines;
15953 long i, n = RARRAY_LEN(lines);
15954 for (i = 0; i < n; ++i) {
15955 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
15956 }
15957 }
15958#endif
15959}
15960
15961static int
15962comment_at_top(struct parser_params *p)
15963{
15964 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
15965 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
15966 while (ptr < ptr_end) {
15967 if (!ISSPACE(*ptr)) return 0;
15968 ptr++;
15969 }
15970 return 1;
15971}
15972
15973typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
15974typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
15975
15976static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
15977
15978static void
15979magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
15980{
15981 if (!comment_at_top(p)) {
15982 return;
15983 }
15984 parser_set_encode(p, val);
15985}
15986
15987static int
15988parser_get_bool(struct parser_params *p, const char *name, const char *val)
15989{
15990 switch (*val) {
15991 case 't': case 'T':
15992 if (STRCASECMP(val, "true") == 0) {
15993 return TRUE;
15994 }
15995 break;
15996 case 'f': case 'F':
15997 if (STRCASECMP(val, "false") == 0) {
15998 return FALSE;
15999 }
16000 break;
16001 }
16002 return parser_invalid_pragma_value(p, name, val);
16003}
16004
16005static int
16006parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
16007{
16008 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
16009 return -1;
16010}
16011
16012static void
16013parser_set_token_info(struct parser_params *p, const char *name, const char *val)
16014{
16015 int b = parser_get_bool(p, name, val);
16016 if (b >= 0) p->token_info_enabled = b;
16017}
16018
16019static void
16020parser_set_compile_option_flag(struct parser_params *p, const char *name, const char *val)
16021{
16022 int b;
16023
16024 if (p->token_seen) {
16025 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
16026 return;
16027 }
16028
16029 b = parser_get_bool(p, name, val);
16030 if (b < 0) return;
16031
16032 if (!p->compile_option)
16033 p->compile_option = rb_obj_hide(rb_ident_hash_new());
16034 rb_hash_aset(p->compile_option, ID2SYM(rb_intern(name)),
16035 RBOOL(b));
16036}
16037
16038static void
16039parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
16040{
16041 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
16042 if (*s == ' ' || *s == '\t') continue;
16043 if (*s == '#') break;
16044 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
16045 return;
16046 }
16047
16048 switch (*val) {
16049 case 'n': case 'N':
16050 if (STRCASECMP(val, "none") == 0) {
16051 p->ctxt.shareable_constant_value = shareable_none;
16052 return;
16053 }
16054 break;
16055 case 'l': case 'L':
16056 if (STRCASECMP(val, "literal") == 0) {
16057 p->ctxt.shareable_constant_value = shareable_literal;
16058 return;
16059 }
16060 break;
16061 case 'e': case 'E':
16062 if (STRCASECMP(val, "experimental_copy") == 0) {
16063 p->ctxt.shareable_constant_value = shareable_copy;
16064 return;
16065 }
16066 if (STRCASECMP(val, "experimental_everything") == 0) {
16067 p->ctxt.shareable_constant_value = shareable_everything;
16068 return;
16069 }
16070 break;
16071 }
16072 parser_invalid_pragma_value(p, name, val);
16073}
16074
16075# if WARN_PAST_SCOPE
16076static void
16077parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
16078{
16079 int b = parser_get_bool(p, name, val);
16080 if (b >= 0) p->past_scope_enabled = b;
16081}
16082# endif
16083
16084struct magic_comment {
16085 const char *name;
16086 rb_magic_comment_setter_t func;
16087 rb_magic_comment_length_t length;
16088};
16089
16090static const struct magic_comment magic_comments[] = {
16091 {"coding", magic_comment_encoding, parser_encode_length},
16092 {"encoding", magic_comment_encoding, parser_encode_length},
16093 {"frozen_string_literal", parser_set_compile_option_flag},
16094 {"shareable_constant_value", parser_set_shareable_constant_value},
16095 {"warn_indent", parser_set_token_info},
16096# if WARN_PAST_SCOPE
16097 {"warn_past_scope", parser_set_past_scope},
16098# endif
16099};
16100
16101static const char *
16102magic_comment_marker(const char *str, long len)
16103{
16104 long i = 2;
16105
16106 while (i < len) {
16107 switch (str[i]) {
16108 case '-':
16109 if (str[i-1] == '*' && str[i-2] == '-') {
16110 return str + i + 1;
16111 }
16112 i += 2;
16113 break;
16114 case '*':
16115 if (i + 1 >= len) return 0;
16116 if (str[i+1] != '-') {
16117 i += 4;
16118 }
16119 else if (str[i-1] != '-') {
16120 i += 2;
16121 }
16122 else {
16123 return str + i + 2;
16124 }
16125 break;
16126 default:
16127 i += 3;
16128 break;
16129 }
16130 }
16131 return 0;
16132}
16133
16134static int
16135parser_magic_comment(struct parser_params *p, const char *str, long len)
16136{
16137 int indicator = 0;
16138 VALUE name = 0, val = 0;
16139 const char *beg, *end, *vbeg, *vend;
16140#define str_copy(_s, _p, _n) ((_s) \
16141 ? (void)(rb_str_resize((_s), (_n)), \
16142 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
16143 : (void)((_s) = STR_NEW((_p), (_n))))
16144
16145 if (len <= 7) return FALSE;
16146 if (!!(beg = magic_comment_marker(str, len))) {
16147 if (!(end = magic_comment_marker(beg, str + len - beg)))
16148 return FALSE;
16149 indicator = TRUE;
16150 str = beg;
16151 len = end - beg - 3;
16152 }
16153
16154 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
16155 while (len > 0) {
16156 const struct magic_comment *mc = magic_comments;
16157 char *s;
16158 int i;
16159 long n = 0;
16160
16161 for (; len > 0 && *str; str++, --len) {
16162 switch (*str) {
16163 case '\'': case '"': case ':': case ';':
16164 continue;
16165 }
16166 if (!ISSPACE(*str)) break;
16167 }
16168 for (beg = str; len > 0; str++, --len) {
16169 switch (*str) {
16170 case '\'': case '"': case ':': case ';':
16171 break;
16172 default:
16173 if (ISSPACE(*str)) break;
16174 continue;
16175 }
16176 break;
16177 }
16178 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
16179 if (!len) break;
16180 if (*str != ':') {
16181 if (!indicator) return FALSE;
16182 continue;
16183 }
16184
16185 do str++; while (--len > 0 && ISSPACE(*str));
16186 if (!len) break;
16187 if (*str == '"') {
16188 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
16189 if (*str == '\\') {
16190 --len;
16191 ++str;
16192 }
16193 }
16194 vend = str;
16195 if (len) {
16196 --len;
16197 ++str;
16198 }
16199 }
16200 else {
16201 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
16202 vend = str;
16203 }
16204 if (indicator) {
16205 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
16206 }
16207 else {
16208 while (len > 0 && (ISSPACE(*str))) --len, str++;
16209 if (len) return FALSE;
16210 }
16211
16212 n = end - beg;
16213 str_copy(name, beg, n);
16214 s = RSTRING_PTR(name);
16215 for (i = 0; i < n; ++i) {
16216 if (s[i] == '-') s[i] = '_';
16217 }
16218 do {
16219 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
16220 n = vend - vbeg;
16221 if (mc->length) {
16222 n = (*mc->length)(p, vbeg, n);
16223 }
16224 str_copy(val, vbeg, n);
16225 (*mc->func)(p, mc->name, RSTRING_PTR(val));
16226 break;
16227 }
16228 } while (++mc < magic_comments + numberof(magic_comments));
16229#ifdef RIPPER
16230 str_copy(val, vbeg, vend - vbeg);
16231 dispatch2(magic_comment, name, val);
16232#endif
16233 }
16234
16235 return TRUE;
16236}
16237
16238static void
16239set_file_encoding(struct parser_params *p, const char *str, const char *send)
16240{
16241 int sep = 0;
16242 const char *beg = str;
16243 VALUE s;
16244
16245 for (;;) {
16246 if (send - str <= 6) return;
16247 switch (str[6]) {
16248 case 'C': case 'c': str += 6; continue;
16249 case 'O': case 'o': str += 5; continue;
16250 case 'D': case 'd': str += 4; continue;
16251 case 'I': case 'i': str += 3; continue;
16252 case 'N': case 'n': str += 2; continue;
16253 case 'G': case 'g': str += 1; continue;
16254 case '=': case ':':
16255 sep = 1;
16256 str += 6;
16257 break;
16258 default:
16259 str += 6;
16260 if (ISSPACE(*str)) break;
16261 continue;
16262 }
16263 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
16264 sep = 0;
16265 }
16266 for (;;) {
16267 do {
16268 if (++str >= send) return;
16269 } while (ISSPACE(*str));
16270 if (sep) break;
16271 if (*str != '=' && *str != ':') return;
16272 sep = 1;
16273 str++;
16274 }
16275 beg = str;
16276 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
16277 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
16278 parser_set_encode(p, RSTRING_PTR(s));
16279 rb_str_resize(s, 0);
16280}
16281
16282static void
16283parser_prepare(struct parser_params *p)
16284{
16285 int c = nextc0(p, FALSE);
16286 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
16287 switch (c) {
16288 case '#':
16289 if (peek(p, '!')) p->has_shebang = 1;
16290 break;
16291 case 0xef: /* UTF-8 BOM marker */
16292 if (p->lex.pend - p->lex.pcur >= 2 &&
16293 (unsigned char)p->lex.pcur[0] == 0xbb &&
16294 (unsigned char)p->lex.pcur[1] == 0xbf) {
16295 p->enc = rb_utf8_encoding();
16296 p->lex.pcur += 2;
16297#ifndef RIPPER
16298 if (p->debug_lines) {
16299 rb_enc_associate(p->lex.lastline, p->enc);
16300 }
16301#endif
16302 p->lex.pbeg = p->lex.pcur;
16303 return;
16304 }
16305 break;
16306 case EOF:
16307 return;
16308 }
16309 pushback(p, c);
16310 p->enc = rb_enc_get(p->lex.lastline);
16311}
16312
16313#ifndef RIPPER
16314#define ambiguous_operator(tok, op, syn) ( \
16315 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
16316 rb_warning0("even though it seems like "syn""))
16317#else
16318#define ambiguous_operator(tok, op, syn) \
16319 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
16320#endif
16321#define warn_balanced(tok, op, syn) ((void) \
16322 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
16323 space_seen && !ISSPACE(c) && \
16324 (ambiguous_operator(tok, op, syn), 0)), \
16325 (enum yytokentype)(tok))
16326
16327static VALUE
16328parse_rational(struct parser_params *p, char *str, int len, int seen_point)
16329{
16330 VALUE v;
16331 char *point = &str[seen_point];
16332 size_t fraclen = len-seen_point-1;
16333 memmove(point, point+1, fraclen+1);
16334 v = rb_cstr_to_inum(str, 10, FALSE);
16335 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
16336}
16337
16338static enum yytokentype
16339no_digits(struct parser_params *p)
16340{
16341 yyerror0("numeric literal without digits");
16342 if (peek(p, '_')) nextc(p);
16343 /* dummy 0, for tUMINUS_NUM at numeric */
16344 return set_integer_literal(p, INT2FIX(0), 0);
16345}
16346
16347static enum yytokentype
16348parse_numeric(struct parser_params *p, int c)
16349{
16350 int is_float, seen_point, seen_e, nondigit;
16351 int suffix;
16352
16353 is_float = seen_point = seen_e = nondigit = 0;
16354 SET_LEX_STATE(EXPR_END);
16355 newtok(p);
16356 if (c == '-' || c == '+') {
16357 tokadd(p, c);
16358 c = nextc(p);
16359 }
16360 if (c == '0') {
16361 int start = toklen(p);
16362 c = nextc(p);
16363 if (c == 'x' || c == 'X') {
16364 /* hexadecimal */
16365 c = nextc(p);
16366 if (c != -1 && ISXDIGIT(c)) {
16367 do {
16368 if (c == '_') {
16369 if (nondigit) break;
16370 nondigit = c;
16371 continue;
16372 }
16373 if (!ISXDIGIT(c)) break;
16374 nondigit = 0;
16375 tokadd(p, c);
16376 } while ((c = nextc(p)) != -1);
16377 }
16378 pushback(p, c);
16379 tokfix(p);
16380 if (toklen(p) == start) {
16381 return no_digits(p);
16382 }
16383 else if (nondigit) goto trailing_uc;
16384 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16385 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
16386 }
16387 if (c == 'b' || c == 'B') {
16388 /* binary */
16389 c = nextc(p);
16390 if (c == '0' || c == '1') {
16391 do {
16392 if (c == '_') {
16393 if (nondigit) break;
16394 nondigit = c;
16395 continue;
16396 }
16397 if (c != '0' && c != '1') break;
16398 nondigit = 0;
16399 tokadd(p, c);
16400 } while ((c = nextc(p)) != -1);
16401 }
16402 pushback(p, c);
16403 tokfix(p);
16404 if (toklen(p) == start) {
16405 return no_digits(p);
16406 }
16407 else if (nondigit) goto trailing_uc;
16408 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16409 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
16410 }
16411 if (c == 'd' || c == 'D') {
16412 /* decimal */
16413 c = nextc(p);
16414 if (c != -1 && ISDIGIT(c)) {
16415 do {
16416 if (c == '_') {
16417 if (nondigit) break;
16418 nondigit = c;
16419 continue;
16420 }
16421 if (!ISDIGIT(c)) break;
16422 nondigit = 0;
16423 tokadd(p, c);
16424 } while ((c = nextc(p)) != -1);
16425 }
16426 pushback(p, c);
16427 tokfix(p);
16428 if (toklen(p) == start) {
16429 return no_digits(p);
16430 }
16431 else if (nondigit) goto trailing_uc;
16432 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16433 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
16434 }
16435 if (c == '_') {
16436 /* 0_0 */
16437 goto octal_number;
16438 }
16439 if (c == 'o' || c == 'O') {
16440 /* prefixed octal */
16441 c = nextc(p);
16442 if (c == -1 || c == '_' || !ISDIGIT(c)) {
16443 return no_digits(p);
16444 }
16445 }
16446 if (c >= '0' && c <= '7') {
16447 /* octal */
16448 octal_number:
16449 do {
16450 if (c == '_') {
16451 if (nondigit) break;
16452 nondigit = c;
16453 continue;
16454 }
16455 if (c < '0' || c > '9') break;
16456 if (c > '7') goto invalid_octal;
16457 nondigit = 0;
16458 tokadd(p, c);
16459 } while ((c = nextc(p)) != -1);
16460 if (toklen(p) > start) {
16461 pushback(p, c);
16462 tokfix(p);
16463 if (nondigit) goto trailing_uc;
16464 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16465 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
16466 }
16467 if (nondigit) {
16468 pushback(p, c);
16469 goto trailing_uc;
16470 }
16471 }
16472 if (c > '7' && c <= '9') {
16473 invalid_octal:
16474 yyerror0("Invalid octal digit");
16475 }
16476 else if (c == '.' || c == 'e' || c == 'E') {
16477 tokadd(p, '0');
16478 }
16479 else {
16480 pushback(p, c);
16481 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16482 return set_integer_literal(p, INT2FIX(0), suffix);
16483 }
16484 }
16485
16486 for (;;) {
16487 switch (c) {
16488 case '0': case '1': case '2': case '3': case '4':
16489 case '5': case '6': case '7': case '8': case '9':
16490 nondigit = 0;
16491 tokadd(p, c);
16492 break;
16493
16494 case '.':
16495 if (nondigit) goto trailing_uc;
16496 if (seen_point || seen_e) {
16497 goto decode_num;
16498 }
16499 else {
16500 int c0 = nextc(p);
16501 if (c0 == -1 || !ISDIGIT(c0)) {
16502 pushback(p, c0);
16503 goto decode_num;
16504 }
16505 c = c0;
16506 }
16507 seen_point = toklen(p);
16508 tokadd(p, '.');
16509 tokadd(p, c);
16510 is_float++;
16511 nondigit = 0;
16512 break;
16513
16514 case 'e':
16515 case 'E':
16516 if (nondigit) {
16517 pushback(p, c);
16518 c = nondigit;
16519 goto decode_num;
16520 }
16521 if (seen_e) {
16522 goto decode_num;
16523 }
16524 nondigit = c;
16525 c = nextc(p);
16526 if (c != '-' && c != '+' && !ISDIGIT(c)) {
16527 pushback(p, c);
16528 nondigit = 0;
16529 goto decode_num;
16530 }
16531 tokadd(p, nondigit);
16532 seen_e++;
16533 is_float++;
16534 tokadd(p, c);
16535 nondigit = (c == '-' || c == '+') ? c : 0;
16536 break;
16537
16538 case '_': /* `_' in number just ignored */
16539 if (nondigit) goto decode_num;
16540 nondigit = c;
16541 break;
16542
16543 default:
16544 goto decode_num;
16545 }
16546 c = nextc(p);
16547 }
16548
16549 decode_num:
16550 pushback(p, c);
16551 if (nondigit) {
16552 trailing_uc:
16553 literal_flush(p, p->lex.pcur - 1);
16554 YYLTYPE loc = RUBY_INIT_YYLLOC();
16555 compile_error(p, "trailing `%c' in number", nondigit);
16556 parser_show_error_line(p, &loc);
16557 }
16558 tokfix(p);
16559 if (is_float) {
16560 enum yytokentype type = tFLOAT;
16561 VALUE v;
16562
16563 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
16564 if (suffix & NUM_SUFFIX_R) {
16565 type = tRATIONAL;
16566 v = parse_rational(p, tok(p), toklen(p), seen_point);
16567 }
16568 else {
16569 double d = strtod(tok(p), 0);
16570 if (errno == ERANGE) {
16571 rb_warning1("Float %s out of range", WARN_S(tok(p)));
16572 errno = 0;
16573 }
16574 v = DBL2NUM(d);
16575 }
16576 return set_number_literal(p, v, type, suffix);
16577 }
16578 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16579 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
16580}
16581
16582static enum yytokentype
16583parse_qmark(struct parser_params *p, int space_seen)
16584{
16585 rb_encoding *enc;
16586 register int c;
16587 VALUE lit;
16588
16589 if (IS_END()) {
16590 SET_LEX_STATE(EXPR_VALUE);
16591 return '?';
16592 }
16593 c = nextc(p);
16594 if (c == -1) {
16595 compile_error(p, "incomplete character syntax");
16596 return 0;
16597 }
16598 if (rb_enc_isspace(c, p->enc)) {
16599 if (!IS_ARG()) {
16600 int c2 = escaped_control_code(c);
16601 if (c2) {
16602 WARN_SPACE_CHAR(c2, "?");
16603 }
16604 }
16605 ternary:
16606 pushback(p, c);
16607 SET_LEX_STATE(EXPR_VALUE);
16608 return '?';
16609 }
16610 newtok(p);
16611 enc = p->enc;
16612 if (!parser_isascii(p)) {
16613 if (tokadd_mbchar(p, c) == -1) return 0;
16614 }
16615 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
16616 p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
16617 if (space_seen) {
16618 const char *start = p->lex.pcur - 1, *ptr = start;
16619 do {
16620 int n = parser_precise_mbclen(p, ptr);
16621 if (n < 0) return -1;
16622 ptr += n;
16623 } while (ptr < p->lex.pend && is_identchar(ptr, p->lex.pend, p->enc));
16624 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
16625 " a conditional operator, put a space after `?'",
16626 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
16627 }
16628 goto ternary;
16629 }
16630 else if (c == '\\') {
16631 if (peek(p, 'u')) {
16632 nextc(p);
16633 enc = rb_utf8_encoding();
16634 tokadd_utf8(p, &enc, -1, 0, 0);
16635 }
16636 else if (!lex_eol_p(p) && !(c = *p->lex.pcur, ISASCII(c))) {
16637 nextc(p);
16638 if (tokadd_mbchar(p, c) == -1) return 0;
16639 }
16640 else {
16641 c = read_escape(p, 0, &enc);
16642 tokadd(p, c);
16643 }
16644 }
16645 else {
16646 tokadd(p, c);
16647 }
16648 tokfix(p);
16649 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
16650 set_yylval_str(lit);
16651 SET_LEX_STATE(EXPR_END);
16652 return tCHAR;
16653}
16654
16655static enum yytokentype
16656parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
16657{
16658 register int c;
16659 const char *ptok = p->lex.pcur;
16660
16661 if (IS_BEG()) {
16662 int term;
16663 int paren;
16664
16665 c = nextc(p);
16666 quotation:
16667 if (c == -1) goto unterminated;
16668 if (!ISALNUM(c)) {
16669 term = c;
16670 if (!ISASCII(c)) goto unknown;
16671 c = 'Q';
16672 }
16673 else {
16674 term = nextc(p);
16675 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
16676 unknown:
16677 pushback(p, term);
16678 c = parser_precise_mbclen(p, p->lex.pcur);
16679 if (c < 0) return 0;
16680 p->lex.pcur += c;
16681 yyerror0("unknown type of %string");
16682 return 0;
16683 }
16684 }
16685 if (term == -1) {
16686 unterminated:
16687 compile_error(p, "unterminated quoted string meets end of file");
16688 return 0;
16689 }
16690 paren = term;
16691 if (term == '(') term = ')';
16692 else if (term == '[') term = ']';
16693 else if (term == '{') term = '}';
16694 else if (term == '<') term = '>';
16695 else paren = 0;
16696
16697 p->lex.ptok = ptok-1;
16698 switch (c) {
16699 case 'Q':
16700 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
16701 return tSTRING_BEG;
16702
16703 case 'q':
16704 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
16705 return tSTRING_BEG;
16706
16707 case 'W':
16708 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16709 return tWORDS_BEG;
16710
16711 case 'w':
16712 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16713 return tQWORDS_BEG;
16714
16715 case 'I':
16716 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16717 return tSYMBOLS_BEG;
16718
16719 case 'i':
16720 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16721 return tQSYMBOLS_BEG;
16722
16723 case 'x':
16724 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
16725 return tXSTRING_BEG;
16726
16727 case 'r':
16728 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
16729 return tREGEXP_BEG;
16730
16731 case 's':
16732 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
16733 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
16734 return tSYMBEG;
16735
16736 default:
16737 yyerror0("unknown type of %string");
16738 return 0;
16739 }
16740 }
16741 if ((c = nextc(p)) == '=') {
16742 set_yylval_id('%');
16743 SET_LEX_STATE(EXPR_BEG);
16744 return tOP_ASGN;
16745 }
16746 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
16747 goto quotation;
16748 }
16749 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16750 pushback(p, c);
16751 return warn_balanced('%', "%%", "string literal");
16752}
16753
16754static int
16755tokadd_ident(struct parser_params *p, int c)
16756{
16757 do {
16758 if (tokadd_mbchar(p, c) == -1) return -1;
16759 c = nextc(p);
16760 } while (parser_is_identchar(p));
16761 pushback(p, c);
16762 return 0;
16763}
16764
16765static ID
16766tokenize_ident(struct parser_params *p, const enum lex_state_e last_state)
16767{
16768 ID ident = TOK_INTERN();
16769
16770 set_yylval_name(ident);
16771
16772 return ident;
16773}
16774
16775static int
16776parse_numvar(struct parser_params *p)
16777{
16778 size_t len;
16779 int overflow;
16780 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
16781 const unsigned long nth_ref_max =
16782 ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
16783 /* NTH_REF is left-shifted to be ORed with back-ref flag and
16784 * turned into a Fixnum, in compile.c */
16785
16786 if (overflow || n > nth_ref_max) {
16787 /* compile_error()? */
16788 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
16789 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
16790 }
16791 else {
16792 return (int)n;
16793 }
16794}
16795
16796static enum yytokentype
16797parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
16798{
16799 const char *ptr = p->lex.pcur;
16800 register int c;
16801
16802 SET_LEX_STATE(EXPR_END);
16803 p->lex.ptok = ptr - 1; /* from '$' */
16804 newtok(p);
16805 c = nextc(p);
16806 switch (c) {
16807 case '_': /* $_: last read line string */
16808 c = nextc(p);
16809 if (parser_is_identchar(p)) {
16810 tokadd(p, '$');
16811 tokadd(p, '_');
16812 break;
16813 }
16814 pushback(p, c);
16815 c = '_';
16816 /* fall through */
16817 case '~': /* $~: match-data */
16818 case '*': /* $*: argv */
16819 case '$': /* $$: pid */
16820 case '?': /* $?: last status */
16821 case '!': /* $!: error string */
16822 case '@': /* $@: error position */
16823 case '/': /* $/: input record separator */
16824 case '\\': /* $\: output record separator */
16825 case ';': /* $;: field separator */
16826 case ',': /* $,: output field separator */
16827 case '.': /* $.: last read line number */
16828 case '=': /* $=: ignorecase */
16829 case ':': /* $:: load path */
16830 case '<': /* $<: reading filename */
16831 case '>': /* $>: default output handle */
16832 case '\"': /* $": already loaded files */
16833 tokadd(p, '$');
16834 tokadd(p, c);
16835 goto gvar;
16836
16837 case '-':
16838 tokadd(p, '$');
16839 tokadd(p, c);
16840 c = nextc(p);
16841 if (parser_is_identchar(p)) {
16842 if (tokadd_mbchar(p, c) == -1) return 0;
16843 }
16844 else {
16845 pushback(p, c);
16846 pushback(p, '-');
16847 return '$';
16848 }
16849 gvar:
16850 set_yylval_name(TOK_INTERN());
16851 return tGVAR;
16852
16853 case '&': /* $&: last match */
16854 case '`': /* $`: string before last match */
16855 case '\'': /* $': string after last match */
16856 case '+': /* $+: string matches last paren. */
16857 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
16858 tokadd(p, '$');
16859 tokadd(p, c);
16860 goto gvar;
16861 }
16862 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
16863 return tBACK_REF;
16864
16865 case '1': case '2': case '3':
16866 case '4': case '5': case '6':
16867 case '7': case '8': case '9':
16868 tokadd(p, '$');
16869 do {
16870 tokadd(p, c);
16871 c = nextc(p);
16872 } while (c != -1 && ISDIGIT(c));
16873 pushback(p, c);
16874 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
16875 tokfix(p);
16876 c = parse_numvar(p);
16877 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
16878 return tNTH_REF;
16879
16880 default:
16881 if (!parser_is_identchar(p)) {
16882 YYLTYPE loc = RUBY_INIT_YYLLOC();
16883 if (c == -1 || ISSPACE(c)) {
16884 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
16885 }
16886 else {
16887 pushback(p, c);
16888 compile_error(p, "`$%c' is not allowed as a global variable name", c);
16889 }
16890 parser_show_error_line(p, &loc);
16891 set_yylval_noname();
16892 return tGVAR;
16893 }
16894 /* fall through */
16895 case '0':
16896 tokadd(p, '$');
16897 }
16898
16899 if (tokadd_ident(p, c)) return 0;
16900 SET_LEX_STATE(EXPR_END);
16901 tokenize_ident(p, last_state);
16902 return tGVAR;
16903}
16904
16905#ifndef RIPPER
16906static bool
16907parser_numbered_param(struct parser_params *p, int n)
16908{
16909 if (n < 0) return false;
16910
16911 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
16912 return false;
16913 }
16914 if (p->max_numparam == ORDINAL_PARAM) {
16915 compile_error(p, "ordinary parameter is defined");
16916 return false;
16917 }
16918 struct vtable *args = p->lvtbl->args;
16919 if (p->max_numparam < n) {
16920 p->max_numparam = n;
16921 }
16922 while (n > args->pos) {
16923 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
16924 }
16925 return true;
16926}
16927#endif
16928
16929static enum yytokentype
16930parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
16931{
16932 const char *ptr = p->lex.pcur;
16933 enum yytokentype result = tIVAR;
16934 register int c = nextc(p);
16935 YYLTYPE loc;
16936
16937 p->lex.ptok = ptr - 1; /* from '@' */
16938 newtok(p);
16939 tokadd(p, '@');
16940 if (c == '@') {
16941 result = tCVAR;
16942 tokadd(p, '@');
16943 c = nextc(p);
16944 }
16945 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
16946 if (c == -1 || !parser_is_identchar(p)) {
16947 pushback(p, c);
16948 RUBY_SET_YYLLOC(loc);
16949 if (result == tIVAR) {
16950 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
16951 }
16952 else {
16953 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
16954 }
16955 parser_show_error_line(p, &loc);
16956 set_yylval_noname();
16957 SET_LEX_STATE(EXPR_END);
16958 return result;
16959 }
16960 else if (ISDIGIT(c)) {
16961 pushback(p, c);
16962 RUBY_SET_YYLLOC(loc);
16963 if (result == tIVAR) {
16964 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
16965 }
16966 else {
16967 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
16968 }
16969 parser_show_error_line(p, &loc);
16970 set_yylval_noname();
16971 SET_LEX_STATE(EXPR_END);
16972 return result;
16973 }
16974
16975 if (tokadd_ident(p, c)) return 0;
16976 tokenize_ident(p, last_state);
16977 return result;
16978}
16979
16980static enum yytokentype
16981parse_ident(struct parser_params *p, int c, int cmd_state)
16982{
16983 enum yytokentype result;
16984 int mb = ENC_CODERANGE_7BIT;
16985 const enum lex_state_e last_state = p->lex.state;
16986 ID ident;
16987
16988 do {
16989 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
16990 if (tokadd_mbchar(p, c) == -1) return 0;
16991 c = nextc(p);
16992 } while (parser_is_identchar(p));
16993 if ((c == '!' || c == '?') && !peek(p, '=')) {
16994 result = tFID;
16995 tokadd(p, c);
16996 }
16997 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
16998 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
16999 result = tIDENTIFIER;
17000 tokadd(p, c);
17001 }
17002 else {
17003 result = tCONSTANT; /* assume provisionally */
17004 pushback(p, c);
17005 }
17006 tokfix(p);
17007
17008 if (IS_LABEL_POSSIBLE()) {
17009 if (IS_LABEL_SUFFIX(0)) {
17010 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
17011 nextc(p);
17012 set_yylval_name(TOK_INTERN());
17013 return tLABEL;
17014 }
17015 }
17016 if (mb == ENC_CODERANGE_7BIT && !IS_lex_state(EXPR_DOT)) {
17017 const struct kwtable *kw;
17018
17019 /* See if it is a reserved word. */
17020 kw = rb_reserved_word(tok(p), toklen(p));
17021 if (kw) {
17022 enum lex_state_e state = p->lex.state;
17023 if (IS_lex_state_for(state, EXPR_FNAME)) {
17024 SET_LEX_STATE(EXPR_ENDFN);
17025 set_yylval_name(rb_intern2(tok(p), toklen(p)));
17026 return kw->id[0];
17027 }
17028 SET_LEX_STATE(kw->state);
17029 if (IS_lex_state(EXPR_BEG)) {
17030 p->command_start = TRUE;
17031 }
17032 if (kw->id[0] == keyword_do) {
17033 if (lambda_beginning_p()) {
17034 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
17035 return keyword_do_LAMBDA;
17036 }
17037 if (COND_P()) return keyword_do_cond;
17038 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
17039 return keyword_do_block;
17040 return keyword_do;
17041 }
17042 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED)))
17043 return kw->id[0];
17044 else {
17045 if (kw->id[0] != kw->id[1])
17046 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
17047 return kw->id[1];
17048 }
17049 }
17050 }
17051
17052 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
17053 if (cmd_state) {
17054 SET_LEX_STATE(EXPR_CMDARG);
17055 }
17056 else {
17057 SET_LEX_STATE(EXPR_ARG);
17058 }
17059 }
17060 else if (p->lex.state == EXPR_FNAME) {
17061 SET_LEX_STATE(EXPR_ENDFN);
17062 }
17063 else {
17064 SET_LEX_STATE(EXPR_END);
17065 }
17066
17067 ident = tokenize_ident(p, last_state);
17068 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
17069 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
17070 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
17071 lvar_defined(p, ident)) {
17072 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
17073 }
17074 return result;
17075}
17076
17077static enum yytokentype
17078parser_yylex(struct parser_params *p)
17079{
17080 register int c;
17081 int space_seen = 0;
17082 int cmd_state;
17083 int label;
17084 enum lex_state_e last_state;
17085 int fallthru = FALSE;
17086 int token_seen = p->token_seen;
17087
17088 if (p->lex.strterm) {
17089 if (p->lex.strterm->flags & STRTERM_HEREDOC) {
17090 return here_document(p, &p->lex.strterm->u.heredoc);
17091 }
17092 else {
17093 token_flush(p);
17094 return parse_string(p, &p->lex.strterm->u.literal);
17095 }
17096 }
17097 cmd_state = p->command_start;
17098 p->command_start = FALSE;
17099 p->token_seen = TRUE;
17100 retry:
17101 last_state = p->lex.state;
17102#ifndef RIPPER
17103 token_flush(p);
17104#endif
17105 switch (c = nextc(p)) {
17106 case '\0': /* NUL */
17107 case '\004': /* ^D */
17108 case '\032': /* ^Z */
17109 case -1: /* end of script. */
17110 return 0;
17111
17112 /* white spaces */
17113 case '\r':
17114 if (!p->cr_seen) {
17115 p->cr_seen = TRUE;
17116 /* carried over with p->lex.nextline for nextc() */
17117 rb_warn0("encountered \\r in middle of line, treated as a mere space");
17118 }
17119 /* fall through */
17120 case ' ': case '\t': case '\f':
17121 case '\13': /* '\v' */
17122 space_seen = 1;
17123#ifdef RIPPER
17124 while ((c = nextc(p))) {
17125 switch (c) {
17126 case ' ': case '\t': case '\f': case '\r':
17127 case '\13': /* '\v' */
17128 break;
17129 default:
17130 goto outofloop;
17131 }
17132 }
17133 outofloop:
17134 pushback(p, c);
17135 dispatch_scan_event(p, tSP);
17136#endif
17137 goto retry;
17138
17139 case '#': /* it's a comment */
17140 p->token_seen = token_seen;
17141 /* no magic_comment in shebang line */
17142 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
17143 if (comment_at_top(p)) {
17144 set_file_encoding(p, p->lex.pcur, p->lex.pend);
17145 }
17146 }
17147 lex_goto_eol(p);
17148 dispatch_scan_event(p, tCOMMENT);
17149 fallthru = TRUE;
17150 /* fall through */
17151 case '\n':
17152 p->token_seen = token_seen;
17153 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
17154 !IS_lex_state(EXPR_LABELED));
17155 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
17156 if (!fallthru) {
17157 dispatch_scan_event(p, tIGNORED_NL);
17158 }
17159 fallthru = FALSE;
17160 if (!c && p->ctxt.in_kwarg) {
17161 goto normal_newline;
17162 }
17163 goto retry;
17164 }
17165 while (1) {
17166 switch (c = nextc(p)) {
17167 case ' ': case '\t': case '\f': case '\r':
17168 case '\13': /* '\v' */
17169 space_seen = 1;
17170 break;
17171 case '#':
17172 pushback(p, c);
17173 if (space_seen) dispatch_scan_event(p, tSP);
17174 goto retry;
17175 case '&':
17176 case '.': {
17177 dispatch_delayed_token(p, tIGNORED_NL);
17178 if (peek(p, '.') == (c == '&')) {
17179 pushback(p, c);
17180 dispatch_scan_event(p, tSP);
17181 goto retry;
17182 }
17183 }
17184 default:
17185 p->ruby_sourceline--;
17186 p->lex.nextline = p->lex.lastline;
17187 case -1: /* EOF no decrement*/
17188#ifndef RIPPER
17189 if (p->lex.prevline && !p->eofp) p->lex.lastline = p->lex.prevline;
17190 p->lex.pbeg = RSTRING_PTR(p->lex.lastline);
17191 p->lex.pend = p->lex.pcur = p->lex.pbeg + RSTRING_LEN(p->lex.lastline);
17192 pushback(p, 1); /* always pushback */
17193 p->lex.ptok = p->lex.pcur;
17194#else
17195 lex_goto_eol(p);
17196 if (c != -1) {
17197 p->lex.ptok = p->lex.pcur;
17198 }
17199#endif
17200 goto normal_newline;
17201 }
17202 }
17203 normal_newline:
17204 p->command_start = TRUE;
17205 SET_LEX_STATE(EXPR_BEG);
17206 return '\n';
17207
17208 case '*':
17209 if ((c = nextc(p)) == '*') {
17210 if ((c = nextc(p)) == '=') {
17211 set_yylval_id(idPow);
17212 SET_LEX_STATE(EXPR_BEG);
17213 return tOP_ASGN;
17214 }
17215 pushback(p, c);
17216 if (IS_SPCARG(c)) {
17217 rb_warning0("`**' interpreted as argument prefix");
17218 c = tDSTAR;
17219 }
17220 else if (IS_BEG()) {
17221 c = tDSTAR;
17222 }
17223 else {
17224 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
17225 }
17226 }
17227 else {
17228 if (c == '=') {
17229 set_yylval_id('*');
17230 SET_LEX_STATE(EXPR_BEG);
17231 return tOP_ASGN;
17232 }
17233 pushback(p, c);
17234 if (IS_SPCARG(c)) {
17235 rb_warning0("`*' interpreted as argument prefix");
17236 c = tSTAR;
17237 }
17238 else if (IS_BEG()) {
17239 c = tSTAR;
17240 }
17241 else {
17242 c = warn_balanced('*', "*", "argument prefix");
17243 }
17244 }
17245 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17246 return c;
17247
17248 case '!':
17249 c = nextc(p);
17250 if (IS_AFTER_OPERATOR()) {
17251 SET_LEX_STATE(EXPR_ARG);
17252 if (c == '@') {
17253 return '!';
17254 }
17255 }
17256 else {
17257 SET_LEX_STATE(EXPR_BEG);
17258 }
17259 if (c == '=') {
17260 return tNEQ;
17261 }
17262 if (c == '~') {
17263 return tNMATCH;
17264 }
17265 pushback(p, c);
17266 return '!';
17267
17268 case '=':
17269 if (was_bol(p)) {
17270 /* skip embedded rd document */
17271 if (word_match_p(p, "begin", 5)) {
17272 int first_p = TRUE;
17273
17274 lex_goto_eol(p);
17275 dispatch_scan_event(p, tEMBDOC_BEG);
17276 for (;;) {
17277 lex_goto_eol(p);
17278 if (!first_p) {
17279 dispatch_scan_event(p, tEMBDOC);
17280 }
17281 first_p = FALSE;
17282 c = nextc(p);
17283 if (c == -1) {
17284 compile_error(p, "embedded document meets end of file");
17285 return 0;
17286 }
17287 if (c == '=' && word_match_p(p, "end", 3)) {
17288 break;
17289 }
17290 pushback(p, c);
17291 }
17292 lex_goto_eol(p);
17293 dispatch_scan_event(p, tEMBDOC_END);
17294 goto retry;
17295 }
17296 }
17297
17298 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17299 if ((c = nextc(p)) == '=') {
17300 if ((c = nextc(p)) == '=') {
17301 return tEQQ;
17302 }
17303 pushback(p, c);
17304 return tEQ;
17305 }
17306 if (c == '~') {
17307 return tMATCH;
17308 }
17309 else if (c == '>') {
17310 return tASSOC;
17311 }
17312 pushback(p, c);
17313 return '=';
17314
17315 case '<':
17316 c = nextc(p);
17317 if (c == '<' &&
17318 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
17319 !IS_END() &&
17320 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
17321 int token = heredoc_identifier(p);
17322 if (token) return token < 0 ? 0 : token;
17323 }
17324 if (IS_AFTER_OPERATOR()) {
17325 SET_LEX_STATE(EXPR_ARG);
17326 }
17327 else {
17328 if (IS_lex_state(EXPR_CLASS))
17329 p->command_start = TRUE;
17330 SET_LEX_STATE(EXPR_BEG);
17331 }
17332 if (c == '=') {
17333 if ((c = nextc(p)) == '>') {
17334 return tCMP;
17335 }
17336 pushback(p, c);
17337 return tLEQ;
17338 }
17339 if (c == '<') {
17340 if ((c = nextc(p)) == '=') {
17341 set_yylval_id(idLTLT);
17342 SET_LEX_STATE(EXPR_BEG);
17343 return tOP_ASGN;
17344 }
17345 pushback(p, c);
17346 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
17347 }
17348 pushback(p, c);
17349 return '<';
17350
17351 case '>':
17352 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17353 if ((c = nextc(p)) == '=') {
17354 return tGEQ;
17355 }
17356 if (c == '>') {
17357 if ((c = nextc(p)) == '=') {
17358 set_yylval_id(idGTGT);
17359 SET_LEX_STATE(EXPR_BEG);
17360 return tOP_ASGN;
17361 }
17362 pushback(p, c);
17363 return tRSHFT;
17364 }
17365 pushback(p, c);
17366 return '>';
17367
17368 case '"':
17369 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
17370 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
17371 p->lex.ptok = p->lex.pcur-1;
17372 return tSTRING_BEG;
17373
17374 case '`':
17375 if (IS_lex_state(EXPR_FNAME)) {
17376 SET_LEX_STATE(EXPR_ENDFN);
17377 return c;
17378 }
17379 if (IS_lex_state(EXPR_DOT)) {
17380 if (cmd_state)
17381 SET_LEX_STATE(EXPR_CMDARG);
17382 else
17383 SET_LEX_STATE(EXPR_ARG);
17384 return c;
17385 }
17386 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
17387 return tXSTRING_BEG;
17388
17389 case '\'':
17390 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
17391 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
17392 p->lex.ptok = p->lex.pcur-1;
17393 return tSTRING_BEG;
17394
17395 case '?':
17396 return parse_qmark(p, space_seen);
17397
17398 case '&':
17399 if ((c = nextc(p)) == '&') {
17400 SET_LEX_STATE(EXPR_BEG);
17401 if ((c = nextc(p)) == '=') {
17402 set_yylval_id(idANDOP);
17403 SET_LEX_STATE(EXPR_BEG);
17404 return tOP_ASGN;
17405 }
17406 pushback(p, c);
17407 return tANDOP;
17408 }
17409 else if (c == '=') {
17410 set_yylval_id('&');
17411 SET_LEX_STATE(EXPR_BEG);
17412 return tOP_ASGN;
17413 }
17414 else if (c == '.') {
17415 set_yylval_id(idANDDOT);
17416 SET_LEX_STATE(EXPR_DOT);
17417 return tANDDOT;
17418 }
17419 pushback(p, c);
17420 if (IS_SPCARG(c)) {
17421 if ((c != ':') ||
17422 (c = peekc_n(p, 1)) == -1 ||
17423 !(c == '\'' || c == '"' ||
17424 is_identchar((p->lex.pcur+1), p->lex.pend, p->enc))) {
17425 rb_warning0("`&' interpreted as argument prefix");
17426 }
17427 c = tAMPER;
17428 }
17429 else if (IS_BEG()) {
17430 c = tAMPER;
17431 }
17432 else {
17433 c = warn_balanced('&', "&", "argument prefix");
17434 }
17435 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17436 return c;
17437
17438 case '|':
17439 if ((c = nextc(p)) == '|') {
17440 SET_LEX_STATE(EXPR_BEG);
17441 if ((c = nextc(p)) == '=') {
17442 set_yylval_id(idOROP);
17443 SET_LEX_STATE(EXPR_BEG);
17444 return tOP_ASGN;
17445 }
17446 pushback(p, c);
17447 if (IS_lex_state_for(last_state, EXPR_BEG)) {
17448 c = '|';
17449 pushback(p, '|');
17450 return c;
17451 }
17452 return tOROP;
17453 }
17454 if (c == '=') {
17455 set_yylval_id('|');
17456 SET_LEX_STATE(EXPR_BEG);
17457 return tOP_ASGN;
17458 }
17459 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
17460 pushback(p, c);
17461 return '|';
17462
17463 case '+':
17464 c = nextc(p);
17465 if (IS_AFTER_OPERATOR()) {
17466 SET_LEX_STATE(EXPR_ARG);
17467 if (c == '@') {
17468 return tUPLUS;
17469 }
17470 pushback(p, c);
17471 return '+';
17472 }
17473 if (c == '=') {
17474 set_yylval_id('+');
17475 SET_LEX_STATE(EXPR_BEG);
17476 return tOP_ASGN;
17477 }
17478 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
17479 SET_LEX_STATE(EXPR_BEG);
17480 pushback(p, c);
17481 if (c != -1 && ISDIGIT(c)) {
17482 return parse_numeric(p, '+');
17483 }
17484 return tUPLUS;
17485 }
17486 SET_LEX_STATE(EXPR_BEG);
17487 pushback(p, c);
17488 return warn_balanced('+', "+", "unary operator");
17489
17490 case '-':
17491 c = nextc(p);
17492 if (IS_AFTER_OPERATOR()) {
17493 SET_LEX_STATE(EXPR_ARG);
17494 if (c == '@') {
17495 return tUMINUS;
17496 }
17497 pushback(p, c);
17498 return '-';
17499 }
17500 if (c == '=') {
17501 set_yylval_id('-');
17502 SET_LEX_STATE(EXPR_BEG);
17503 return tOP_ASGN;
17504 }
17505 if (c == '>') {
17506 SET_LEX_STATE(EXPR_ENDFN);
17507 return tLAMBDA;
17508 }
17509 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
17510 SET_LEX_STATE(EXPR_BEG);
17511 pushback(p, c);
17512 if (c != -1 && ISDIGIT(c)) {
17513 return tUMINUS_NUM;
17514 }
17515 return tUMINUS;
17516 }
17517 SET_LEX_STATE(EXPR_BEG);
17518 pushback(p, c);
17519 return warn_balanced('-', "-", "unary operator");
17520
17521 case '.': {
17522 int is_beg = IS_BEG();
17523 SET_LEX_STATE(EXPR_BEG);
17524 if ((c = nextc(p)) == '.') {
17525 if ((c = nextc(p)) == '.') {
17526 if (p->ctxt.in_argdef) {
17527 SET_LEX_STATE(EXPR_ENDARG);
17528 return tBDOT3;
17529 }
17530 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
17531 rb_warn0("... at EOL, should be parenthesized?");
17532 }
17533 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
17534 if (IS_lex_state_for(last_state, EXPR_LABEL))
17535 return tDOT3;
17536 }
17537 return is_beg ? tBDOT3 : tDOT3;
17538 }
17539 pushback(p, c);
17540 return is_beg ? tBDOT2 : tDOT2;
17541 }
17542 pushback(p, c);
17543 if (c != -1 && ISDIGIT(c)) {
17544 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
17545 parse_numeric(p, '.');
17546 if (ISDIGIT(prev)) {
17547 yyerror0("unexpected fraction part after numeric literal");
17548 }
17549 else {
17550 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
17551 }
17552 SET_LEX_STATE(EXPR_END);
17553 p->lex.ptok = p->lex.pcur;
17554 goto retry;
17555 }
17556 set_yylval_id('.');
17557 SET_LEX_STATE(EXPR_DOT);
17558 return '.';
17559 }
17560
17561 case '0': case '1': case '2': case '3': case '4':
17562 case '5': case '6': case '7': case '8': case '9':
17563 return parse_numeric(p, c);
17564
17565 case ')':
17566 COND_POP();
17567 CMDARG_POP();
17568 SET_LEX_STATE(EXPR_ENDFN);
17569 p->lex.paren_nest--;
17570 return c;
17571
17572 case ']':
17573 COND_POP();
17574 CMDARG_POP();
17575 SET_LEX_STATE(EXPR_END);
17576 p->lex.paren_nest--;
17577 return c;
17578
17579 case '}':
17580 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
17581 if (!p->lex.brace_nest--) return tSTRING_DEND;
17582 COND_POP();
17583 CMDARG_POP();
17584 SET_LEX_STATE(EXPR_END);
17585 p->lex.paren_nest--;
17586 return c;
17587
17588 case ':':
17589 c = nextc(p);
17590 if (c == ':') {
17591 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
17592 SET_LEX_STATE(EXPR_BEG);
17593 return tCOLON3;
17594 }
17595 set_yylval_id(idCOLON2);
17596 SET_LEX_STATE(EXPR_DOT);
17597 return tCOLON2;
17598 }
17599 if (IS_END() || ISSPACE(c) || c == '#') {
17600 pushback(p, c);
17601 c = warn_balanced(':', ":", "symbol literal");
17602 SET_LEX_STATE(EXPR_BEG);
17603 return c;
17604 }
17605 switch (c) {
17606 case '\'':
17607 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
17608 break;
17609 case '"':
17610 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
17611 break;
17612 default:
17613 pushback(p, c);
17614 break;
17615 }
17616 SET_LEX_STATE(EXPR_FNAME);
17617 return tSYMBEG;
17618
17619 case '/':
17620 if (IS_BEG()) {
17621 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
17622 return tREGEXP_BEG;
17623 }
17624 if ((c = nextc(p)) == '=') {
17625 set_yylval_id('/');
17626 SET_LEX_STATE(EXPR_BEG);
17627 return tOP_ASGN;
17628 }
17629 pushback(p, c);
17630 if (IS_SPCARG(c)) {
17631 arg_ambiguous(p, '/');
17632 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
17633 return tREGEXP_BEG;
17634 }
17635 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17636 return warn_balanced('/', "/", "regexp literal");
17637
17638 case '^':
17639 if ((c = nextc(p)) == '=') {
17640 set_yylval_id('^');
17641 SET_LEX_STATE(EXPR_BEG);
17642 return tOP_ASGN;
17643 }
17644 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17645 pushback(p, c);
17646 return '^';
17647
17648 case ';':
17649 SET_LEX_STATE(EXPR_BEG);
17650 p->command_start = TRUE;
17651 return ';';
17652
17653 case ',':
17654 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17655 return ',';
17656
17657 case '~':
17658 if (IS_AFTER_OPERATOR()) {
17659 if ((c = nextc(p)) != '@') {
17660 pushback(p, c);
17661 }
17662 SET_LEX_STATE(EXPR_ARG);
17663 }
17664 else {
17665 SET_LEX_STATE(EXPR_BEG);
17666 }
17667 return '~';
17668
17669 case '(':
17670 if (IS_BEG()) {
17671 c = tLPAREN;
17672 }
17673 else if (!space_seen) {
17674 /* foo( ... ) => method call, no ambiguity */
17675 }
17676 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
17677 c = tLPAREN_ARG;
17678 }
17679 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
17680 rb_warning0("parentheses after method name is interpreted as "
17681 "an argument list, not a decomposed argument");
17682 }
17683 p->lex.paren_nest++;
17684 COND_PUSH(0);
17685 CMDARG_PUSH(0);
17686 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17687 return c;
17688
17689 case '[':
17690 p->lex.paren_nest++;
17691 if (IS_AFTER_OPERATOR()) {
17692 if ((c = nextc(p)) == ']') {
17693 p->lex.paren_nest--;
17694 SET_LEX_STATE(EXPR_ARG);
17695 if ((c = nextc(p)) == '=') {
17696 return tASET;
17697 }
17698 pushback(p, c);
17699 return tAREF;
17700 }
17701 pushback(p, c);
17702 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
17703 return '[';
17704 }
17705 else if (IS_BEG()) {
17706 c = tLBRACK;
17707 }
17708 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
17709 c = tLBRACK;
17710 }
17711 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17712 COND_PUSH(0);
17713 CMDARG_PUSH(0);
17714 return c;
17715
17716 case '{':
17717 ++p->lex.brace_nest;
17718 if (lambda_beginning_p())
17719 c = tLAMBEG;
17720 else if (IS_lex_state(EXPR_LABELED))
17721 c = tLBRACE; /* hash */
17722 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
17723 c = '{'; /* block (primary) */
17724 else if (IS_lex_state(EXPR_ENDARG))
17725 c = tLBRACE_ARG; /* block (expr) */
17726 else
17727 c = tLBRACE; /* hash */
17728 if (c != tLBRACE) {
17729 p->command_start = TRUE;
17730 SET_LEX_STATE(EXPR_BEG);
17731 }
17732 else {
17733 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17734 }
17735 ++p->lex.paren_nest; /* after lambda_beginning_p() */
17736 COND_PUSH(0);
17737 CMDARG_PUSH(0);
17738 return c;
17739
17740 case '\\':
17741 c = nextc(p);
17742 if (c == '\n') {
17743 space_seen = 1;
17744 dispatch_scan_event(p, tSP);
17745 goto retry; /* skip \\n */
17746 }
17747 if (c == ' ') return tSP;
17748 if (ISSPACE(c)) return c;
17749 pushback(p, c);
17750 return '\\';
17751
17752 case '%':
17753 return parse_percent(p, space_seen, last_state);
17754
17755 case '$':
17756 return parse_gvar(p, last_state);
17757
17758 case '@':
17759 return parse_atmark(p, last_state);
17760
17761 case '_':
17762 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
17763 p->ruby__end__seen = 1;
17764 p->eofp = 1;
17765#ifndef RIPPER
17766 return -1;
17767#else
17768 lex_goto_eol(p);
17769 dispatch_scan_event(p, k__END__);
17770 return 0;
17771#endif
17772 }
17773 newtok(p);
17774 break;
17775
17776 default:
17777 if (!parser_is_identchar(p)) {
17778 compile_error(p, "Invalid char `\\x%02X' in expression", c);
17779 token_flush(p);
17780 goto retry;
17781 }
17782
17783 newtok(p);
17784 break;
17785 }
17786
17787 return parse_ident(p, c, cmd_state);
17788}
17789
17790static enum yytokentype
17791yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
17792{
17793 enum yytokentype t;
17794
17795 p->lval = lval;
17796 lval->val = Qundef;
17797 t = parser_yylex(p);
17798
17799 if (p->lex.strterm && (p->lex.strterm->flags & STRTERM_HEREDOC))
17800 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*yylloc);
17801 else
17802 RUBY_SET_YYLLOC(*yylloc);
17803
17804 if (has_delayed_token(p))
17805 dispatch_delayed_token(p, t);
17806 else if (t != 0)
17807 dispatch_scan_event(p, t);
17808
17809 return t;
17810}
17811
17812#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
17813
17814static NODE*
17815node_newnode(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2, const rb_code_location_t *loc)
17816{
17817 NODE *n = rb_ast_newnode(p->ast, type);
17818
17819 rb_node_init(n, type, a0, a1, a2);
17820
17821 nd_set_loc(n, loc);
17822 nd_set_node_id(n, parser_get_node_id(p));
17823 return n;
17824}
17825
17826static NODE *
17827nd_set_loc(NODE *nd, const YYLTYPE *loc)
17828{
17829 nd->nd_loc = *loc;
17830 nd_set_line(nd, loc->beg_pos.lineno);
17831 return nd;
17832}
17833
17834#ifndef RIPPER
17835static enum node_type
17836nodetype(NODE *node) /* for debug */
17837{
17838 return (enum node_type)nd_type(node);
17839}
17840
17841static int
17842nodeline(NODE *node)
17843{
17844 return nd_line(node);
17845}
17846
17847static NODE*
17848newline_node(NODE *node)
17849{
17850 if (node) {
17851 node = remove_begin(node);
17852 node->flags |= NODE_FL_NEWLINE;
17853 }
17854 return node;
17855}
17856
17857static void
17858fixpos(NODE *node, NODE *orig)
17859{
17860 if (!node) return;
17861 if (!orig) return;
17862 nd_set_line(node, nd_line(orig));
17863}
17864
17865static void
17866parser_warning(struct parser_params *p, NODE *node, const char *mesg)
17867{
17868 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17869}
17870
17871static void
17872parser_warn(struct parser_params *p, NODE *node, const char *mesg)
17873{
17874 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17875}
17876
17877static NODE*
17878block_append(struct parser_params *p, NODE *head, NODE *tail)
17879{
17880 NODE *end, *h = head, *nd;
17881
17882 if (tail == 0) return head;
17883
17884 if (h == 0) return tail;
17885 switch (nd_type(h)) {
17886 case NODE_LIT:
17887 case NODE_STR:
17888 case NODE_SELF:
17889 case NODE_TRUE:
17890 case NODE_FALSE:
17891 case NODE_NIL:
17892 parser_warning(p, h, "unused literal ignored");
17893 return tail;
17894 default:
17895 h = end = NEW_BLOCK(head, &head->nd_loc);
17896 end->nd_end = end;
17897 head = end;
17898 break;
17899 case NODE_BLOCK:
17900 end = h->nd_end;
17901 break;
17902 }
17903
17904 nd = end->nd_head;
17905 switch (nd_type(nd)) {
17906 case NODE_RETURN:
17907 case NODE_BREAK:
17908 case NODE_NEXT:
17909 case NODE_REDO:
17910 case NODE_RETRY:
17911 if (RTEST(ruby_verbose)) {
17912 parser_warning(p, tail, "statement not reached");
17913 }
17914 break;
17915
17916 default:
17917 break;
17918 }
17919
17920 if (!nd_type_p(tail, NODE_BLOCK)) {
17921 tail = NEW_BLOCK(tail, &tail->nd_loc);
17922 tail->nd_end = tail;
17923 }
17924 end->nd_next = tail;
17925 h->nd_end = tail->nd_end;
17926 nd_set_last_loc(head, nd_last_loc(tail));
17927 return head;
17928}
17929
17930/* append item to the list */
17931static NODE*
17932list_append(struct parser_params *p, NODE *list, NODE *item)
17933{
17934 NODE *last;
17935
17936 if (list == 0) return NEW_LIST(item, &item->nd_loc);
17937 if (list->nd_next) {
17938 last = list->nd_next->nd_end;
17939 }
17940 else {
17941 last = list;
17942 }
17943
17944 list->nd_alen += 1;
17945 last->nd_next = NEW_LIST(item, &item->nd_loc);
17946 list->nd_next->nd_end = last->nd_next;
17947
17948 nd_set_last_loc(list, nd_last_loc(item));
17949
17950 return list;
17951}
17952
17953/* concat two lists */
17954static NODE*
17955list_concat(NODE *head, NODE *tail)
17956{
17957 NODE *last;
17958
17959 if (head->nd_next) {
17960 last = head->nd_next->nd_end;
17961 }
17962 else {
17963 last = head;
17964 }
17965
17966 head->nd_alen += tail->nd_alen;
17967 last->nd_next = tail;
17968 if (tail->nd_next) {
17969 head->nd_next->nd_end = tail->nd_next->nd_end;
17970 }
17971 else {
17972 head->nd_next->nd_end = tail;
17973 }
17974
17975 nd_set_last_loc(head, nd_last_loc(tail));
17976
17977 return head;
17978}
17979
17980static int
17981literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
17982{
17983 if (NIL_P(tail)) return 1;
17984 if (!rb_enc_compatible(head, tail)) {
17985 compile_error(p, "string literal encodings differ (%s / %s)",
17986 rb_enc_name(rb_enc_get(head)),
17987 rb_enc_name(rb_enc_get(tail)));
17988 rb_str_resize(head, 0);
17989 rb_str_resize(tail, 0);
17990 return 0;
17991 }
17992 rb_str_buf_append(head, tail);
17993 return 1;
17994}
17995
17996static VALUE
17997string_literal_head(enum node_type htype, NODE *head)
17998{
17999 if (htype != NODE_DSTR) return Qfalse;
18000 if (head->nd_next) {
18001 head = head->nd_next->nd_end->nd_head;
18002 if (!head || !nd_type_p(head, NODE_STR)) return Qfalse;
18003 }
18004 const VALUE lit = head->nd_lit;
18005 ASSUME(lit != Qfalse);
18006 return lit;
18007}
18008
18009/* concat two string literals */
18010static NODE *
18011literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
18012{
18013 enum node_type htype;
18014 VALUE lit;
18015
18016 if (!head) return tail;
18017 if (!tail) return head;
18018
18019 htype = nd_type(head);
18020 if (htype == NODE_EVSTR) {
18021 head = new_dstr(p, head, loc);
18022 htype = NODE_DSTR;
18023 }
18024 if (p->heredoc_indent > 0) {
18025 switch (htype) {
18026 case NODE_STR:
18027 nd_set_type(head, NODE_DSTR);
18028 case NODE_DSTR:
18029 return list_append(p, head, tail);
18030 default:
18031 break;
18032 }
18033 }
18034 switch (nd_type(tail)) {
18035 case NODE_STR:
18036 if ((lit = string_literal_head(htype, head)) != Qfalse) {
18037 htype = NODE_STR;
18038 }
18039 else {
18040 lit = head->nd_lit;
18041 }
18042 if (htype == NODE_STR) {
18043 if (!literal_concat0(p, lit, tail->nd_lit)) {
18044 error:
18045 rb_discard_node(p, head);
18046 rb_discard_node(p, tail);
18047 return 0;
18048 }
18049 rb_discard_node(p, tail);
18050 }
18051 else {
18052 list_append(p, head, tail);
18053 }
18054 break;
18055
18056 case NODE_DSTR:
18057 if (htype == NODE_STR) {
18058 if (!literal_concat0(p, head->nd_lit, tail->nd_lit))
18059 goto error;
18060 tail->nd_lit = head->nd_lit;
18061 rb_discard_node(p, head);
18062 head = tail;
18063 }
18064 else if (NIL_P(tail->nd_lit)) {
18065 append:
18066 head->nd_alen += tail->nd_alen - 1;
18067 if (!head->nd_next) {
18068 head->nd_next = tail->nd_next;
18069 }
18070 else if (tail->nd_next) {
18071 head->nd_next->nd_end->nd_next = tail->nd_next;
18072 head->nd_next->nd_end = tail->nd_next->nd_end;
18073 }
18074 rb_discard_node(p, tail);
18075 }
18076 else if ((lit = string_literal_head(htype, head)) != Qfalse) {
18077 if (!literal_concat0(p, lit, tail->nd_lit))
18078 goto error;
18079 tail->nd_lit = Qnil;
18080 goto append;
18081 }
18082 else {
18083 list_concat(head, NEW_NODE(NODE_LIST, NEW_STR(tail->nd_lit, loc), tail->nd_alen, tail->nd_next, loc));
18084 }
18085 break;
18086
18087 case NODE_EVSTR:
18088 if (htype == NODE_STR) {
18089 nd_set_type(head, NODE_DSTR);
18090 head->nd_alen = 1;
18091 }
18092 list_append(p, head, tail);
18093 break;
18094 }
18095 return head;
18096}
18097
18098static NODE *
18099evstr2dstr(struct parser_params *p, NODE *node)
18100{
18101 if (nd_type_p(node, NODE_EVSTR)) {
18102 node = new_dstr(p, node, &node->nd_loc);
18103 }
18104 return node;
18105}
18106
18107static NODE *
18108new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18109{
18110 NODE *head = node;
18111
18112 if (node) {
18113 switch (nd_type(node)) {
18114 case NODE_STR:
18115 nd_set_type(node, NODE_DSTR);
18116 return node;
18117 case NODE_DSTR:
18118 break;
18119 case NODE_EVSTR:
18120 return node;
18121 }
18122 }
18123 return NEW_EVSTR(head, loc);
18124}
18125
18126static NODE *
18127new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18128{
18129 VALUE lit = STR_NEW0();
18130 NODE *dstr = NEW_DSTR(lit, loc);
18131 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18132 return list_append(p, dstr, node);
18133}
18134
18135static NODE *
18136call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
18137 const YYLTYPE *op_loc, const YYLTYPE *loc)
18138{
18139 NODE *expr;
18140 value_expr(recv);
18141 value_expr(arg1);
18142 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
18143 nd_set_line(expr, op_loc->beg_pos.lineno);
18144 return expr;
18145}
18146
18147static NODE *
18148call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
18149{
18150 NODE *opcall;
18151 value_expr(recv);
18152 opcall = NEW_OPCALL(recv, id, 0, loc);
18153 nd_set_line(opcall, op_loc->beg_pos.lineno);
18154 return opcall;
18155}
18156
18157static NODE *
18158new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
18159{
18160 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
18161 nd_set_line(qcall, op_loc->beg_pos.lineno);
18162 return qcall;
18163}
18164
18165static NODE*
18166new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
18167{
18168 NODE *ret;
18169 if (block) block_dup_check(p, args, block);
18170 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
18171 if (block) ret = method_add_block(p, ret, block, loc);
18172 fixpos(ret, recv);
18173 return ret;
18174}
18175
18176#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? (node)->nd_body : node)
18177static NODE*
18178match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
18179{
18180 NODE *n;
18181 int line = op_loc->beg_pos.lineno;
18182
18183 value_expr(node1);
18184 value_expr(node2);
18185 if (node1 && (n = nd_once_body(node1)) != 0) {
18186 switch (nd_type(n)) {
18187 case NODE_DREGX:
18188 {
18189 NODE *match = NEW_MATCH2(node1, node2, loc);
18190 nd_set_line(match, line);
18191 return match;
18192 }
18193
18194 case NODE_LIT:
18195 if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
18196 const VALUE lit = n->nd_lit;
18197 NODE *match = NEW_MATCH2(node1, node2, loc);
18198 match->nd_args = reg_named_capture_assign(p, lit, loc);
18199 nd_set_line(match, line);
18200 return match;
18201 }
18202 }
18203 }
18204
18205 if (node2 && (n = nd_once_body(node2)) != 0) {
18206 NODE *match3;
18207
18208 switch (nd_type(n)) {
18209 case NODE_LIT:
18210 if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
18211 /* fallthru */
18212 case NODE_DREGX:
18213 match3 = NEW_MATCH3(node2, node1, loc);
18214 return match3;
18215 }
18216 }
18217
18218 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
18219 nd_set_line(n, line);
18220 return n;
18221}
18222
18223# if WARN_PAST_SCOPE
18224static int
18225past_dvar_p(struct parser_params *p, ID id)
18226{
18227 struct vtable *past = p->lvtbl->past;
18228 while (past) {
18229 if (vtable_included(past, id)) return 1;
18230 past = past->prev;
18231 }
18232 return 0;
18233}
18234# endif
18235
18236static int
18237numparam_nested_p(struct parser_params *p)
18238{
18239 struct local_vars *local = p->lvtbl;
18240 NODE *outer = local->numparam.outer;
18241 NODE *inner = local->numparam.inner;
18242 if (outer || inner) {
18243 NODE *used = outer ? outer : inner;
18244 compile_error(p, "numbered parameter is already used in\n"
18245 "%s:%d: %s block here",
18246 p->ruby_sourcefile, nd_line(used),
18247 outer ? "outer" : "inner");
18248 parser_show_error_line(p, &used->nd_loc);
18249 return 1;
18250 }
18251 return 0;
18252}
18253
18254static NODE*
18255gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
18256{
18257 ID *vidp = NULL;
18258 NODE *node;
18259 switch (id) {
18260 case keyword_self:
18261 return NEW_SELF(loc);
18262 case keyword_nil:
18263 return NEW_NIL(loc);
18264 case keyword_true:
18265 return NEW_TRUE(loc);
18266 case keyword_false:
18267 return NEW_FALSE(loc);
18268 case keyword__FILE__:
18269 {
18270 VALUE file = p->ruby_sourcefile_string;
18271 if (NIL_P(file))
18272 file = rb_str_new(0, 0);
18273 else
18274 file = rb_str_dup(file);
18275 node = NEW_STR(file, loc);
18276 RB_OBJ_WRITTEN(p->ast, Qnil, file);
18277 }
18278 return node;
18279 case keyword__LINE__:
18280 return NEW_LIT(INT2FIX(p->tokline), loc);
18281 case keyword__ENCODING__:
18282 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
18283 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
18284 return node;
18285
18286 }
18287 switch (id_type(id)) {
18288 case ID_LOCAL:
18289 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
18290 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
18291 if (id == p->cur_arg) {
18292 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
18293 return 0;
18294 }
18295 if (vidp) *vidp |= LVAR_USED;
18296 node = NEW_DVAR(id, loc);
18297 return node;
18298 }
18299 if (local_id_ref(p, id, &vidp)) {
18300 if (id == p->cur_arg) {
18301 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
18302 return 0;
18303 }
18304 if (vidp) *vidp |= LVAR_USED;
18305 node = NEW_LVAR(id, loc);
18306 return node;
18307 }
18308 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
18309 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
18310 if (numparam_nested_p(p)) return 0;
18311 node = NEW_DVAR(id, loc);
18312 struct local_vars *local = p->lvtbl;
18313 if (!local->numparam.current) local->numparam.current = node;
18314 return node;
18315 }
18316# if WARN_PAST_SCOPE
18317 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
18318 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
18319 }
18320# endif
18321 /* method call without arguments */
18322 return NEW_VCALL(id, loc);
18323 case ID_GLOBAL:
18324 return NEW_GVAR(id, loc);
18325 case ID_INSTANCE:
18326 return NEW_IVAR(id, loc);
18327 case ID_CONST:
18328 return NEW_CONST(id, loc);
18329 case ID_CLASS:
18330 return NEW_CVAR(id, loc);
18331 }
18332 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
18333 return 0;
18334}
18335
18336static NODE *
18337opt_arg_append(NODE *opt_list, NODE *opt)
18338{
18339 NODE *opts = opt_list;
18340 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
18341
18342 while (opts->nd_next) {
18343 opts = opts->nd_next;
18344 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
18345 }
18346 opts->nd_next = opt;
18347
18348 return opt_list;
18349}
18350
18351static NODE *
18352kwd_append(NODE *kwlist, NODE *kw)
18353{
18354 if (kwlist) {
18355 NODE *kws = kwlist;
18356 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
18357 while (kws->nd_next) {
18358 kws = kws->nd_next;
18359 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
18360 }
18361 kws->nd_next = kw;
18362 }
18363 return kwlist;
18364}
18365
18366static NODE *
18367new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
18368{
18369 return NEW_DEFINED(remove_begin_all(expr), loc);
18370}
18371
18372static NODE*
18373symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
18374{
18375 enum node_type type = nd_type(symbol);
18376 switch (type) {
18377 case NODE_DSTR:
18378 nd_set_type(symbol, NODE_DSYM);
18379 break;
18380 case NODE_STR:
18381 nd_set_type(symbol, NODE_LIT);
18382 RB_OBJ_WRITTEN(p->ast, Qnil, symbol->nd_lit = rb_str_intern(symbol->nd_lit));
18383 break;
18384 default:
18385 compile_error(p, "unexpected node as symbol: %s", ruby_node_name(type));
18386 }
18387 return list_append(p, symbols, symbol);
18388}
18389
18390static NODE *
18391new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
18392{
18393 NODE *list, *prev;
18394 VALUE lit;
18395
18396 if (!node) {
18397 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
18398 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
18399 return node;
18400 }
18401 switch (nd_type(node)) {
18402 case NODE_STR:
18403 {
18404 VALUE src = node->nd_lit;
18405 nd_set_type(node, NODE_LIT);
18406 nd_set_loc(node, loc);
18407 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
18408 }
18409 break;
18410 default:
18411 lit = STR_NEW0();
18412 node = NEW_NODE(NODE_DSTR, lit, 1, NEW_LIST(node, loc), loc);
18413 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18414 /* fall through */
18415 case NODE_DSTR:
18416 nd_set_type(node, NODE_DREGX);
18417 nd_set_loc(node, loc);
18418 node->nd_cflag = options & RE_OPTION_MASK;
18419 if (!NIL_P(node->nd_lit)) reg_fragment_check(p, node->nd_lit, options);
18420 for (list = (prev = node)->nd_next; list; list = list->nd_next) {
18421 NODE *frag = list->nd_head;
18422 enum node_type type = nd_type(frag);
18423 if (type == NODE_STR || (type == NODE_DSTR && !frag->nd_next)) {
18424 VALUE tail = frag->nd_lit;
18425 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(prev->nd_lit)) {
18426 VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
18427 if (!literal_concat0(p, lit, tail)) {
18428 return NEW_NIL(loc); /* dummy node on error */
18429 }
18430 rb_str_resize(tail, 0);
18431 prev->nd_next = list->nd_next;
18432 rb_discard_node(p, list->nd_head);
18433 rb_discard_node(p, list);
18434 list = prev;
18435 }
18436 else {
18437 prev = list;
18438 }
18439 }
18440 else {
18441 prev = 0;
18442 }
18443 }
18444 if (!node->nd_next) {
18445 VALUE src = node->nd_lit;
18446 nd_set_type(node, NODE_LIT);
18447 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
18448 }
18449 if (options & RE_OPTION_ONCE) {
18450 node = NEW_NODE(NODE_ONCE, 0, node, 0, loc);
18451 }
18452 break;
18453 }
18454 return node;
18455}
18456
18457static NODE *
18458new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
18459{
18460 if (!k) return 0;
18461 return NEW_KW_ARG(0, (k), loc);
18462}
18463
18464static NODE *
18465new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18466{
18467 if (!node) {
18468 VALUE lit = STR_NEW0();
18469 NODE *xstr = NEW_XSTR(lit, loc);
18470 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18471 return xstr;
18472 }
18473 switch (nd_type(node)) {
18474 case NODE_STR:
18475 nd_set_type(node, NODE_XSTR);
18476 nd_set_loc(node, loc);
18477 break;
18478 case NODE_DSTR:
18479 nd_set_type(node, NODE_DXSTR);
18480 nd_set_loc(node, loc);
18481 break;
18482 default:
18483 node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node, loc), loc);
18484 break;
18485 }
18486 return node;
18487}
18488
18489static void
18490check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
18491{
18492 VALUE lit;
18493
18494 if (!arg || !p->case_labels) return;
18495
18496 lit = rb_node_case_when_optimizable_literal(arg);
18497 if (lit == Qundef) return;
18498 if (nd_type_p(arg, NODE_STR)) {
18499 RB_OBJ_WRITTEN(p->ast, Qnil, arg->nd_lit = lit);
18500 }
18501
18502 if (NIL_P(p->case_labels)) {
18503 p->case_labels = rb_obj_hide(rb_hash_new());
18504 }
18505 else {
18506 VALUE line = rb_hash_lookup(p->case_labels, lit);
18507 if (!NIL_P(line)) {
18508 rb_warning1("duplicated `when' clause with line %d is ignored",
18509 WARN_IVAL(line));
18510 return;
18511 }
18512 }
18513 rb_hash_aset(p->case_labels, lit, INT2NUM(p->ruby_sourceline));
18514}
18515
18516#else /* !RIPPER */
18517static int
18518id_is_var(struct parser_params *p, ID id)
18519{
18520 if (is_notop_id(id)) {
18521 switch (id & ID_SCOPE_MASK) {
18522 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
18523 return 1;
18524 case ID_LOCAL:
18525 if (dyna_in_block(p)) {
18526 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
18527 }
18528 if (local_id(p, id)) return 1;
18529 /* method call without arguments */
18530 return 0;
18531 }
18532 }
18533 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
18534 return 0;
18535}
18536
18537static VALUE
18538new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
18539{
18540 VALUE src = 0, err;
18541 int options = 0;
18542 if (ripper_is_node_yylval(re)) {
18543 src = RNODE(re)->nd_cval;
18544 re = RNODE(re)->nd_rval;
18545 }
18546 if (ripper_is_node_yylval(opt)) {
18547 options = (int)RNODE(opt)->nd_tag;
18548 opt = RNODE(opt)->nd_rval;
18549 }
18550 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
18551 compile_error(p, "%"PRIsVALUE, err);
18552 }
18553 return dispatch2(regexp_literal, re, opt);
18554}
18555#endif /* !RIPPER */
18556
18557static inline enum lex_state_e
18558parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
18559{
18560 if (p->debug) {
18561 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
18562 }
18563 return p->lex.state = ls;
18564}
18565
18566#ifndef RIPPER
18567static const char rb_parser_lex_state_names[][8] = {
18568 "BEG", "END", "ENDARG", "ENDFN", "ARG",
18569 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
18570 "LABEL", "LABELED","FITEM",
18571};
18572
18573static VALUE
18574append_lex_state_name(enum lex_state_e state, VALUE buf)
18575{
18576 int i, sep = 0;
18577 unsigned int mask = 1;
18578 static const char none[] = "NONE";
18579
18580 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
18581 if ((unsigned)state & mask) {
18582 if (sep) {
18583 rb_str_cat(buf, "|", 1);
18584 }
18585 sep = 1;
18586 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
18587 }
18588 }
18589 if (!sep) {
18590 rb_str_cat(buf, none, sizeof(none)-1);
18591 }
18592 return buf;
18593}
18594
18595static void
18596flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
18597{
18598 VALUE mesg = p->debug_buffer;
18599
18600 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
18601 p->debug_buffer = Qnil;
18602 rb_io_puts(1, &mesg, out);
18603 }
18604 if (!NIL_P(str) && RSTRING_LEN(str)) {
18605 rb_io_write(p->debug_output, str);
18606 }
18607}
18608
18609enum lex_state_e
18610rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
18611 enum lex_state_e to, int line)
18612{
18613 VALUE mesg;
18614 mesg = rb_str_new_cstr("lex_state: ");
18615 append_lex_state_name(from, mesg);
18616 rb_str_cat_cstr(mesg, " -> ");
18617 append_lex_state_name(to, mesg);
18618 rb_str_catf(mesg, " at line %d\n", line);
18619 flush_debug_buffer(p, p->debug_output, mesg);
18620 return to;
18621}
18622
18623VALUE
18624rb_parser_lex_state_name(enum lex_state_e state)
18625{
18626 return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
18627}
18628
18629static void
18630append_bitstack_value(stack_type stack, VALUE mesg)
18631{
18632 if (stack == 0) {
18633 rb_str_cat_cstr(mesg, "0");
18634 }
18635 else {
18636 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
18637 for (; mask && !(stack & mask); mask >>= 1) continue;
18638 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
18639 }
18640}
18641
18642void
18643rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
18644 const char *name, int line)
18645{
18646 VALUE mesg = rb_sprintf("%s: ", name);
18647 append_bitstack_value(stack, mesg);
18648 rb_str_catf(mesg, " at line %d\n", line);
18649 flush_debug_buffer(p, p->debug_output, mesg);
18650}
18651
18652void
18653rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
18654{
18655 va_list ap;
18656 VALUE mesg = rb_str_new_cstr("internal parser error: ");
18657
18658 va_start(ap, fmt);
18659 rb_str_vcatf(mesg, fmt, ap);
18660 va_end(ap);
18661 yyerror0(RSTRING_PTR(mesg));
18662 RB_GC_GUARD(mesg);
18663
18664 mesg = rb_str_new(0, 0);
18665 append_lex_state_name(p->lex.state, mesg);
18666 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
18667 rb_str_resize(mesg, 0);
18668 append_bitstack_value(p->cond_stack, mesg);
18669 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
18670 rb_str_resize(mesg, 0);
18671 append_bitstack_value(p->cmdarg_stack, mesg);
18672 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
18673 if (p->debug_output == rb_ractor_stdout())
18674 p->debug_output = rb_ractor_stderr();
18675 p->debug = TRUE;
18676}
18677
18678static YYLTYPE *
18679rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
18680{
18681 yylloc->beg_pos.lineno = sourceline;
18682 yylloc->beg_pos.column = beg_pos;
18683 yylloc->end_pos.lineno = sourceline;
18684 yylloc->end_pos.column = end_pos;
18685 return yylloc;
18686}
18687
18688YYLTYPE *
18689rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
18690{
18691 int sourceline = here->sourceline;
18692 int beg_pos = (int)here->offset - here->quote
18693 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
18694 int end_pos = (int)here->offset + here->length + here->quote;
18695
18696 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
18697}
18698
18699YYLTYPE *
18700rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
18701{
18702 int sourceline = p->ruby_sourceline;
18703 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
18704 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
18705 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
18706}
18707
18708YYLTYPE *
18709rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
18710{
18711 int sourceline = p->ruby_sourceline;
18712 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
18713 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
18714 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
18715}
18716#endif /* !RIPPER */
18717
18718static int
18719assignable0(struct parser_params *p, ID id, const char **err)
18720{
18721 if (!id) return -1;
18722 switch (id) {
18723 case keyword_self:
18724 *err = "Can't change the value of self";
18725 return -1;
18726 case keyword_nil:
18727 *err = "Can't assign to nil";
18728 return -1;
18729 case keyword_true:
18730 *err = "Can't assign to true";
18731 return -1;
18732 case keyword_false:
18733 *err = "Can't assign to false";
18734 return -1;
18735 case keyword__FILE__:
18736 *err = "Can't assign to __FILE__";
18737 return -1;
18738 case keyword__LINE__:
18739 *err = "Can't assign to __LINE__";
18740 return -1;
18741 case keyword__ENCODING__:
18742 *err = "Can't assign to __ENCODING__";
18743 return -1;
18744 }
18745 switch (id_type(id)) {
18746 case ID_LOCAL:
18747 if (dyna_in_block(p)) {
18748 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
18749 compile_error(p, "Can't assign to numbered parameter _%d",
18750 NUMPARAM_ID_TO_IDX(id));
18751 return -1;
18752 }
18753 if (dvar_curr(p, id)) return NODE_DASGN;
18754 if (dvar_defined(p, id)) return NODE_DASGN;
18755 if (local_id(p, id)) return NODE_LASGN;
18756 dyna_var(p, id);
18757 return NODE_DASGN;
18758 }
18759 else {
18760 if (!local_id(p, id)) local_var(p, id);
18761 return NODE_LASGN;
18762 }
18763 break;
18764 case ID_GLOBAL: return NODE_GASGN;
18765 case ID_INSTANCE: return NODE_IASGN;
18766 case ID_CONST:
18767 if (!p->ctxt.in_def) return NODE_CDECL;
18768 *err = "dynamic constant assignment";
18769 return -1;
18770 case ID_CLASS: return NODE_CVASGN;
18771 default:
18772 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
18773 }
18774 return -1;
18775}
18776
18777#ifndef RIPPER
18778static NODE*
18779assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
18780{
18781 const char *err = 0;
18782 int node_type = assignable0(p, id, &err);
18783 switch (node_type) {
18784 case NODE_DASGN: return NEW_DASGN(id, val, loc);
18785 case NODE_LASGN: return NEW_LASGN(id, val, loc);
18786 case NODE_GASGN: return NEW_GASGN(id, val, loc);
18787 case NODE_IASGN: return NEW_IASGN(id, val, loc);
18788 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
18789 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
18790 }
18791 if (err) yyerror1(loc, err);
18792 return NEW_BEGIN(0, loc);
18793}
18794#else
18795static VALUE
18796assignable(struct parser_params *p, VALUE lhs)
18797{
18798 const char *err = 0;
18799 assignable0(p, get_id(lhs), &err);
18800 if (err) lhs = assign_error(p, err, lhs);
18801 return lhs;
18802}
18803#endif
18804
18805static int
18806is_private_local_id(ID name)
18807{
18808 VALUE s;
18809 if (name == idUScore) return 1;
18810 if (!is_local_id(name)) return 0;
18811 s = rb_id2str(name);
18812 if (!s) return 0;
18813 return RSTRING_PTR(s)[0] == '_';
18814}
18815
18816static int
18817shadowing_lvar_0(struct parser_params *p, ID name)
18818{
18819 if (dyna_in_block(p)) {
18820 if (dvar_curr(p, name)) {
18821 if (is_private_local_id(name)) return 1;
18822 yyerror0("duplicated argument name");
18823 }
18824 else if (dvar_defined(p, name) || local_id(p, name)) {
18825 vtable_add(p->lvtbl->vars, name);
18826 if (p->lvtbl->used) {
18827 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
18828 }
18829 return 0;
18830 }
18831 }
18832 else {
18833 if (local_id(p, name)) {
18834 if (is_private_local_id(name)) return 1;
18835 yyerror0("duplicated argument name");
18836 }
18837 }
18838 return 1;
18839}
18840
18841static ID
18842shadowing_lvar(struct parser_params *p, ID name)
18843{
18844 shadowing_lvar_0(p, name);
18845 return name;
18846}
18847
18848static void
18849new_bv(struct parser_params *p, ID name)
18850{
18851 if (!name) return;
18852 if (!is_local_id(name)) {
18853 compile_error(p, "invalid local variable - %"PRIsVALUE,
18854 rb_id2str(name));
18855 return;
18856 }
18857 if (!shadowing_lvar_0(p, name)) return;
18858 dyna_var(p, name);
18859}
18860
18861#ifndef RIPPER
18862static NODE *
18863aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
18864{
18865 return NEW_ATTRASGN(recv, tASET, idx, loc);
18866}
18867
18868static void
18869block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
18870{
18871 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
18872 compile_error(p, "both block arg and actual block given");
18873 }
18874}
18875
18876static NODE *
18877attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
18878{
18879 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
18880 return NEW_ATTRASGN(recv, id, 0, loc);
18881}
18882
18883static void
18884rb_backref_error(struct parser_params *p, NODE *node)
18885{
18886 switch (nd_type(node)) {
18887 case NODE_NTH_REF:
18888 compile_error(p, "Can't set variable $%ld", node->nd_nth);
18889 break;
18890 case NODE_BACK_REF:
18891 compile_error(p, "Can't set variable $%c", (int)node->nd_nth);
18892 break;
18893 }
18894}
18895#else
18896static VALUE
18897backref_error(struct parser_params *p, NODE *ref, VALUE expr)
18898{
18899 VALUE mesg = rb_str_new_cstr("Can't set variable ");
18900 rb_str_append(mesg, ref->nd_cval);
18901 return dispatch2(assign_error, mesg, expr);
18902}
18903#endif
18904
18905#ifndef RIPPER
18906static NODE *
18907arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18908{
18909 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
18910 switch (nd_type(node1)) {
18911 case NODE_LIST:
18912 return list_append(p, node1, node2);
18913 case NODE_BLOCK_PASS:
18914 node1->nd_head = arg_append(p, node1->nd_head, node2, loc);
18915 node1->nd_loc.end_pos = node1->nd_head->nd_loc.end_pos;
18916 return node1;
18917 case NODE_ARGSPUSH:
18918 node1->nd_body = list_append(p, NEW_LIST(node1->nd_body, &node1->nd_body->nd_loc), node2);
18919 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18920 nd_set_type(node1, NODE_ARGSCAT);
18921 return node1;
18922 case NODE_ARGSCAT:
18923 if (!nd_type_p(node1->nd_body, NODE_LIST)) break;
18924 node1->nd_body = list_append(p, node1->nd_body, node2);
18925 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18926 return node1;
18927 }
18928 return NEW_ARGSPUSH(node1, node2, loc);
18929}
18930
18931static NODE *
18932arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18933{
18934 if (!node2) return node1;
18935 switch (nd_type(node1)) {
18936 case NODE_BLOCK_PASS:
18937 if (node1->nd_head)
18938 node1->nd_head = arg_concat(p, node1->nd_head, node2, loc);
18939 else
18940 node1->nd_head = NEW_LIST(node2, loc);
18941 return node1;
18942 case NODE_ARGSPUSH:
18943 if (!nd_type_p(node2, NODE_LIST)) break;
18944 node1->nd_body = list_concat(NEW_LIST(node1->nd_body, loc), node2);
18945 nd_set_type(node1, NODE_ARGSCAT);
18946 return node1;
18947 case NODE_ARGSCAT:
18948 if (!nd_type_p(node2, NODE_LIST) ||
18949 !nd_type_p(node1->nd_body, NODE_LIST)) break;
18950 node1->nd_body = list_concat(node1->nd_body, node2);
18951 return node1;
18952 }
18953 return NEW_ARGSCAT(node1, node2, loc);
18954}
18955
18956static NODE *
18957last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
18958{
18959 NODE *n1;
18960 if ((n1 = splat_array(args)) != 0) {
18961 return list_append(p, n1, last_arg);
18962 }
18963 return arg_append(p, args, last_arg, loc);
18964}
18965
18966static NODE *
18967rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
18968{
18969 NODE *n1;
18970 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
18971 return list_concat(n1, rest_arg);
18972 }
18973 return arg_concat(p, args, rest_arg, loc);
18974}
18975
18976static NODE *
18977splat_array(NODE* node)
18978{
18979 if (nd_type_p(node, NODE_SPLAT)) node = node->nd_head;
18980 if (nd_type_p(node, NODE_LIST)) return node;
18981 return 0;
18982}
18983
18984static void
18985mark_lvar_used(struct parser_params *p, NODE *rhs)
18986{
18987 ID *vidp = NULL;
18988 if (!rhs) return;
18989 switch (nd_type(rhs)) {
18990 case NODE_LASGN:
18991 if (local_id_ref(p, rhs->nd_vid, &vidp)) {
18992 if (vidp) *vidp |= LVAR_USED;
18993 }
18994 break;
18995 case NODE_DASGN:
18996 if (dvar_defined_ref(p, rhs->nd_vid, &vidp)) {
18997 if (vidp) *vidp |= LVAR_USED;
18998 }
18999 break;
19000#if 0
19001 case NODE_MASGN:
19002 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
19003 mark_lvar_used(p, rhs->nd_head);
19004 }
19005 break;
19006#endif
19007 }
19008}
19009
19010static NODE *
19011const_decl_path(struct parser_params *p, NODE **dest)
19012{
19013 NODE *n = *dest;
19014 if (!nd_type_p(n, NODE_CALL)) {
19015 const YYLTYPE *loc = &n->nd_loc;
19016 VALUE path;
19017 if (n->nd_vid) {
19018 path = rb_id2str(n->nd_vid);
19019 }
19020 else {
19021 n = n->nd_else;
19022 path = rb_ary_new();
19023 for (; n && nd_type_p(n, NODE_COLON2); n = n->nd_head) {
19024 rb_ary_push(path, rb_id2str(n->nd_mid));
19025 }
19026 if (n && nd_type_p(n, NODE_CONST)) {
19027 // Const::Name
19028 rb_ary_push(path, rb_id2str(n->nd_vid));
19029 }
19030 else if (n && nd_type_p(n, NODE_COLON3)) {
19031 // ::Const::Name
19032 rb_ary_push(path, rb_str_new(0, 0));
19033 }
19034 else {
19035 // expression::Name
19036 rb_ary_push(path, rb_str_new_cstr("..."));
19037 }
19038 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
19039 path = rb_fstring(path);
19040 }
19041 *dest = n = NEW_LIT(path, loc);
19042 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
19043 }
19044 return n;
19045}
19046
19047extern VALUE rb_mRubyVMFrozenCore;
19048
19049static NODE *
19050make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
19051{
19052 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
19053
19054 if (copy) {
19055 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
19056 NEW_LIST(value, loc), loc);
19057 }
19058 else {
19059 return NEW_CALL(fcore, rb_intern("make_shareable"),
19060 NEW_LIST(value, loc), loc);
19061 }
19062}
19063
19064static NODE *
19065ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
19066{
19067 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
19068 NODE *args = NEW_LIST(value, loc);
19069 args = list_append(p, args, const_decl_path(p, dest));
19070 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
19071}
19072
19073static int is_static_content(NODE *node);
19074
19075static VALUE
19076shareable_literal_value(NODE *node)
19077{
19078 if (!node) return Qnil;
19079 enum node_type type = nd_type(node);
19080 switch (type) {
19081 case NODE_TRUE:
19082 return Qtrue;
19083 case NODE_FALSE:
19084 return Qfalse;
19085 case NODE_NIL:
19086 return Qnil;
19087 case NODE_LIT:
19088 return node->nd_lit;
19089 default:
19090 return Qundef;
19091 }
19092}
19093
19094#ifndef SHAREABLE_BARE_EXPRESSION
19095#define SHAREABLE_BARE_EXPRESSION 1
19096#endif
19097
19098static NODE *
19099shareable_literal_constant(struct parser_params *p, enum shareability shareable,
19100 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
19101{
19102# define shareable_literal_constant_next(n) \
19103 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
19104 VALUE lit = Qnil;
19105
19106 if (!value) return 0;
19107 enum node_type type = nd_type(value);
19108 switch (type) {
19109 case NODE_TRUE:
19110 case NODE_FALSE:
19111 case NODE_NIL:
19112 case NODE_LIT:
19113 return value;
19114
19115 case NODE_DSTR:
19116 if (shareable == shareable_literal) {
19117 value = NEW_CALL(value, idUMinus, 0, loc);
19118 }
19119 return value;
19120
19121 case NODE_STR:
19122 lit = rb_fstring(value->nd_lit);
19123 nd_set_type(value, NODE_LIT);
19124 RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
19125 return value;
19126
19127 case NODE_ZLIST:
19128 lit = rb_ary_new();
19129 OBJ_FREEZE_RAW(lit);
19130 NODE *n = NEW_LIT(lit, loc);
19131 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
19132 return n;
19133
19134 case NODE_LIST:
19135 lit = rb_ary_new();
19136 for (NODE *n = value; n; n = n->nd_next) {
19137 NODE *elt = n->nd_head;
19138 if (elt) {
19139 elt = shareable_literal_constant_next(elt);
19140 if (elt) {
19141 n->nd_head = elt;
19142 }
19143 else if (RTEST(lit)) {
19144 rb_ary_clear(lit);
19145 lit = Qfalse;
19146 }
19147 }
19148 if (RTEST(lit)) {
19149 VALUE e = shareable_literal_value(elt);
19150 if (e != Qundef) {
19151 rb_ary_push(lit, e);
19152 }
19153 else {
19154 rb_ary_clear(lit);
19155 lit = Qnil; /* make shareable at runtime */
19156 }
19157 }
19158 }
19159 break;
19160
19161 case NODE_HASH:
19162 if (!value->nd_brace) return 0;
19163 lit = rb_hash_new();
19164 for (NODE *n = value->nd_head; n; n = n->nd_next->nd_next) {
19165 NODE *key = n->nd_head;
19166 NODE *val = n->nd_next->nd_head;
19167 if (key) {
19168 key = shareable_literal_constant_next(key);
19169 if (key) {
19170 n->nd_head = key;
19171 }
19172 else if (RTEST(lit)) {
19173 rb_hash_clear(lit);
19174 lit = Qfalse;
19175 }
19176 }
19177 if (val) {
19178 val = shareable_literal_constant_next(val);
19179 if (val) {
19180 n->nd_next->nd_head = val;
19181 }
19182 else if (RTEST(lit)) {
19183 rb_hash_clear(lit);
19184 lit = Qfalse;
19185 }
19186 }
19187 if (RTEST(lit)) {
19188 VALUE k = shareable_literal_value(key);
19189 VALUE v = shareable_literal_value(val);
19190 if (k != Qundef && v != Qundef) {
19191 rb_hash_aset(lit, k, v);
19192 }
19193 else {
19194 rb_hash_clear(lit);
19195 lit = Qnil; /* make shareable at runtime */
19196 }
19197 }
19198 }
19199 break;
19200
19201 default:
19202 if (shareable == shareable_literal &&
19203 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
19204 return ensure_shareable_node(p, dest, value, loc);
19205 }
19206 return 0;
19207 }
19208
19209 /* Array or Hash */
19210 if (!lit) return 0;
19211 if (NIL_P(lit)) {
19212 // if shareable_literal, all elements should have been ensured
19213 // as shareable
19214 value = make_shareable_node(p, value, false, loc);
19215 }
19216 else {
19217 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
19218 RB_OBJ_WRITTEN(p->ast, Qnil, value->nd_lit);
19219 }
19220
19221 return value;
19222# undef shareable_literal_constant_next
19223}
19224
19225static NODE *
19226shareable_constant_value(struct parser_params *p, enum shareability shareable,
19227 NODE *lhs, NODE *value, const YYLTYPE *loc)
19228{
19229 if (!value) return 0;
19230 switch (shareable) {
19231 case shareable_none:
19232 return value;
19233
19234 case shareable_literal:
19235 {
19236 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
19237 if (lit) return lit;
19238 return value;
19239 }
19240 break;
19241
19242 case shareable_copy:
19243 case shareable_everything:
19244 {
19245 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
19246 if (lit) return lit;
19247 return make_shareable_node(p, value, shareable == shareable_copy, loc);
19248 }
19249 break;
19250
19251 default:
19253 }
19254}
19255
19256static NODE *
19257node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
19258{
19259 if (!lhs) return 0;
19260
19261 switch (nd_type(lhs)) {
19262 case NODE_CDECL:
19263 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
19264 /* fallthru */
19265
19266 case NODE_GASGN:
19267 case NODE_IASGN:
19268 case NODE_LASGN:
19269 case NODE_DASGN:
19270 case NODE_MASGN:
19271 case NODE_CVASGN:
19272 lhs->nd_value = rhs;
19273 nd_set_loc(lhs, loc);
19274 break;
19275
19276 case NODE_ATTRASGN:
19277 lhs->nd_args = arg_append(p, lhs->nd_args, rhs, loc);
19278 nd_set_loc(lhs, loc);
19279 break;
19280
19281 default:
19282 /* should not happen */
19283 break;
19284 }
19285
19286 return lhs;
19287}
19288
19289static NODE *
19290value_expr_check(struct parser_params *p, NODE *node)
19291{
19292 NODE *void_node = 0, *vn;
19293
19294 if (!node) {
19295 rb_warning0("empty expression");
19296 }
19297 while (node) {
19298 switch (nd_type(node)) {
19299 case NODE_RETURN:
19300 case NODE_BREAK:
19301 case NODE_NEXT:
19302 case NODE_REDO:
19303 case NODE_RETRY:
19304 return void_node ? void_node : node;
19305
19306 case NODE_CASE3:
19307 if (!node->nd_body || !nd_type_p(node->nd_body, NODE_IN)) {
19308 compile_error(p, "unexpected node");
19309 return NULL;
19310 }
19311 if (node->nd_body->nd_body) {
19312 return NULL;
19313 }
19314 /* single line pattern matching */
19315 return void_node ? void_node : node;
19316
19317 case NODE_BLOCK:
19318 while (node->nd_next) {
19319 node = node->nd_next;
19320 }
19321 node = node->nd_head;
19322 break;
19323
19324 case NODE_BEGIN:
19325 node = node->nd_body;
19326 break;
19327
19328 case NODE_IF:
19329 case NODE_UNLESS:
19330 if (!node->nd_body) {
19331 return NULL;
19332 }
19333 else if (!node->nd_else) {
19334 return NULL;
19335 }
19336 vn = value_expr_check(p, node->nd_body);
19337 if (!vn) return NULL;
19338 if (!void_node) void_node = vn;
19339 node = node->nd_else;
19340 break;
19341
19342 case NODE_AND:
19343 case NODE_OR:
19344 node = node->nd_1st;
19345 break;
19346
19347 case NODE_LASGN:
19348 case NODE_DASGN:
19349 case NODE_MASGN:
19350 mark_lvar_used(p, node);
19351 return NULL;
19352
19353 default:
19354 return NULL;
19355 }
19356 }
19357
19358 return NULL;
19359}
19360
19361static int
19362value_expr_gen(struct parser_params *p, NODE *node)
19363{
19364 NODE *void_node = value_expr_check(p, node);
19365 if (void_node) {
19366 yyerror1(&void_node->nd_loc, "void value expression");
19367 /* or "control never reach"? */
19368 return FALSE;
19369 }
19370 return TRUE;
19371}
19372static void
19373void_expr(struct parser_params *p, NODE *node)
19374{
19375 const char *useless = 0;
19376
19377 if (!RTEST(ruby_verbose)) return;
19378
19379 if (!node || !(node = nd_once_body(node))) return;
19380 switch (nd_type(node)) {
19381 case NODE_OPCALL:
19382 switch (node->nd_mid) {
19383 case '+':
19384 case '-':
19385 case '*':
19386 case '/':
19387 case '%':
19388 case tPOW:
19389 case tUPLUS:
19390 case tUMINUS:
19391 case '|':
19392 case '^':
19393 case '&':
19394 case tCMP:
19395 case '>':
19396 case tGEQ:
19397 case '<':
19398 case tLEQ:
19399 case tEQ:
19400 case tNEQ:
19401 useless = rb_id2name(node->nd_mid);
19402 break;
19403 }
19404 break;
19405
19406 case NODE_LVAR:
19407 case NODE_DVAR:
19408 case NODE_GVAR:
19409 case NODE_IVAR:
19410 case NODE_CVAR:
19411 case NODE_NTH_REF:
19412 case NODE_BACK_REF:
19413 useless = "a variable";
19414 break;
19415 case NODE_CONST:
19416 useless = "a constant";
19417 break;
19418 case NODE_LIT:
19419 case NODE_STR:
19420 case NODE_DSTR:
19421 case NODE_DREGX:
19422 useless = "a literal";
19423 break;
19424 case NODE_COLON2:
19425 case NODE_COLON3:
19426 useless = "::";
19427 break;
19428 case NODE_DOT2:
19429 useless = "..";
19430 break;
19431 case NODE_DOT3:
19432 useless = "...";
19433 break;
19434 case NODE_SELF:
19435 useless = "self";
19436 break;
19437 case NODE_NIL:
19438 useless = "nil";
19439 break;
19440 case NODE_TRUE:
19441 useless = "true";
19442 break;
19443 case NODE_FALSE:
19444 useless = "false";
19445 break;
19446 case NODE_DEFINED:
19447 useless = "defined?";
19448 break;
19449 }
19450
19451 if (useless) {
19452 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
19453 }
19454}
19455
19456static NODE *
19457void_stmts(struct parser_params *p, NODE *node)
19458{
19459 NODE *const n = node;
19460 if (!RTEST(ruby_verbose)) return n;
19461 if (!node) return n;
19462 if (!nd_type_p(node, NODE_BLOCK)) return n;
19463
19464 while (node->nd_next) {
19465 void_expr(p, node->nd_head);
19466 node = node->nd_next;
19467 }
19468 return n;
19469}
19470
19471static NODE *
19472remove_begin(NODE *node)
19473{
19474 NODE **n = &node, *n1 = node;
19475 while (n1 && nd_type_p(n1, NODE_BEGIN) && n1->nd_body) {
19476 *n = n1 = n1->nd_body;
19477 }
19478 return node;
19479}
19480
19481static NODE *
19482remove_begin_all(NODE *node)
19483{
19484 NODE **n = &node, *n1 = node;
19485 while (n1 && nd_type_p(n1, NODE_BEGIN)) {
19486 *n = n1 = n1->nd_body;
19487 }
19488 return node;
19489}
19490
19491static void
19492reduce_nodes(struct parser_params *p, NODE **body)
19493{
19494 NODE *node = *body;
19495
19496 if (!node) {
19497 *body = NEW_NIL(&NULL_LOC);
19498 return;
19499 }
19500#define subnodes(n1, n2) \
19501 ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
19502 (!node->n2) ? (body = &node->n1, 1) : \
19503 (reduce_nodes(p, &node->n1), body = &node->n2, 1))
19504
19505 while (node) {
19506 int newline = (int)(node->flags & NODE_FL_NEWLINE);
19507 switch (nd_type(node)) {
19508 end:
19509 case NODE_NIL:
19510 *body = 0;
19511 return;
19512 case NODE_RETURN:
19513 *body = node = node->nd_stts;
19514 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19515 continue;
19516 case NODE_BEGIN:
19517 *body = node = node->nd_body;
19518 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19519 continue;
19520 case NODE_BLOCK:
19521 body = &node->nd_end->nd_head;
19522 break;
19523 case NODE_IF:
19524 case NODE_UNLESS:
19525 if (subnodes(nd_body, nd_else)) break;
19526 return;
19527 case NODE_CASE:
19528 body = &node->nd_body;
19529 break;
19530 case NODE_WHEN:
19531 if (!subnodes(nd_body, nd_next)) goto end;
19532 break;
19533 case NODE_ENSURE:
19534 if (!subnodes(nd_head, nd_resq)) goto end;
19535 break;
19536 case NODE_RESCUE:
19537 if (node->nd_else) {
19538 body = &node->nd_resq;
19539 break;
19540 }
19541 if (!subnodes(nd_head, nd_resq)) goto end;
19542 break;
19543 default:
19544 return;
19545 }
19546 node = *body;
19547 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19548 }
19549
19550#undef subnodes
19551}
19552
19553static int
19554is_static_content(NODE *node)
19555{
19556 if (!node) return 1;
19557 switch (nd_type(node)) {
19558 case NODE_HASH:
19559 if (!(node = node->nd_head)) break;
19560 case NODE_LIST:
19561 do {
19562 if (!is_static_content(node->nd_head)) return 0;
19563 } while ((node = node->nd_next) != 0);
19564 case NODE_LIT:
19565 case NODE_STR:
19566 case NODE_NIL:
19567 case NODE_TRUE:
19568 case NODE_FALSE:
19569 case NODE_ZLIST:
19570 break;
19571 default:
19572 return 0;
19573 }
19574 return 1;
19575}
19576
19577static int
19578assign_in_cond(struct parser_params *p, NODE *node)
19579{
19580 switch (nd_type(node)) {
19581 case NODE_MASGN:
19582 case NODE_LASGN:
19583 case NODE_DASGN:
19584 case NODE_GASGN:
19585 case NODE_IASGN:
19586 break;
19587
19588 default:
19589 return 0;
19590 }
19591
19592 if (!node->nd_value) return 1;
19593 if (is_static_content(node->nd_value)) {
19594 /* reports always */
19595 parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
19596 }
19597 return 1;
19598}
19599
19600enum cond_type {
19601 COND_IN_OP,
19602 COND_IN_COND,
19603 COND_IN_FF
19604};
19605
19606#define SWITCH_BY_COND_TYPE(t, w, arg) \
19607 switch (t) { \
19608 case COND_IN_OP: break; \
19609 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
19610 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
19611 }
19612
19613static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
19614
19615static NODE*
19616range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19617{
19618 enum node_type type;
19619
19620 if (node == 0) return 0;
19621
19622 type = nd_type(node);
19623 value_expr(node);
19624 if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
19625 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
19626 ID lineno = rb_intern("$.");
19627 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
19628 }
19629 return cond0(p, node, COND_IN_FF, loc);
19630}
19631
19632static NODE*
19633cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc)
19634{
19635 if (node == 0) return 0;
19636 if (!(node = nd_once_body(node))) return 0;
19637 assign_in_cond(p, node);
19638
19639 switch (nd_type(node)) {
19640 case NODE_DSTR:
19641 case NODE_EVSTR:
19642 case NODE_STR:
19643 SWITCH_BY_COND_TYPE(type, warn, "string ")
19644 break;
19645
19646 case NODE_DREGX:
19647 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
19648
19649 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
19650
19651 case NODE_AND:
19652 case NODE_OR:
19653 node->nd_1st = cond0(p, node->nd_1st, COND_IN_COND, loc);
19654 node->nd_2nd = cond0(p, node->nd_2nd, COND_IN_COND, loc);
19655 break;
19656
19657 case NODE_DOT2:
19658 case NODE_DOT3:
19659 node->nd_beg = range_op(p, node->nd_beg, loc);
19660 node->nd_end = range_op(p, node->nd_end, loc);
19661 if (nd_type_p(node, NODE_DOT2)) nd_set_type(node,NODE_FLIP2);
19662 else if (nd_type_p(node, NODE_DOT3)) nd_set_type(node, NODE_FLIP3);
19663 break;
19664
19665 case NODE_DSYM:
19666 warn_symbol:
19667 SWITCH_BY_COND_TYPE(type, warning, "symbol ")
19668 break;
19669
19670 case NODE_LIT:
19671 if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
19672 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
19673 nd_set_type(node, NODE_MATCH);
19674 }
19675 else if (node->nd_lit == Qtrue ||
19676 node->nd_lit == Qfalse) {
19677 /* booleans are OK, e.g., while true */
19678 }
19679 else if (SYMBOL_P(node->nd_lit)) {
19680 goto warn_symbol;
19681 }
19682 else {
19683 SWITCH_BY_COND_TYPE(type, warning, "")
19684 }
19685 default:
19686 break;
19687 }
19688 return node;
19689}
19690
19691static NODE*
19692cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19693{
19694 if (node == 0) return 0;
19695 return cond0(p, node, COND_IN_COND, loc);
19696}
19697
19698static NODE*
19699method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19700{
19701 if (node == 0) return 0;
19702 return cond0(p, node, COND_IN_OP, loc);
19703}
19704
19705static NODE*
19706new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
19707{
19708 YYLTYPE loc = {*pos, *pos};
19709 return NEW_NIL(&loc);
19710}
19711
19712static NODE*
19713new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
19714{
19715 if (!cc) return right;
19716 cc = cond0(p, cc, COND_IN_COND, loc);
19717 return newline_node(NEW_IF(cc, left, right, loc));
19718}
19719
19720static NODE*
19721new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
19722{
19723 if (!cc) return right;
19724 cc = cond0(p, cc, COND_IN_COND, loc);
19725 return newline_node(NEW_UNLESS(cc, left, right, loc));
19726}
19727
19728static NODE*
19729logop(struct parser_params *p, ID id, NODE *left, NODE *right,
19730 const YYLTYPE *op_loc, const YYLTYPE *loc)
19731{
19732 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
19733 NODE *op;
19734 value_expr(left);
19735 if (left && nd_type_p(left, type)) {
19736 NODE *node = left, *second;
19737 while ((second = node->nd_2nd) != 0 && nd_type_p(second, type)) {
19738 node = second;
19739 }
19740 node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
19741 nd_set_line(node->nd_2nd, op_loc->beg_pos.lineno);
19742 left->nd_loc.end_pos = loc->end_pos;
19743 return left;
19744 }
19745 op = NEW_NODE(type, left, right, 0, loc);
19746 nd_set_line(op, op_loc->beg_pos.lineno);
19747 return op;
19748}
19749
19750static void
19751no_blockarg(struct parser_params *p, NODE *node)
19752{
19753 if (node && nd_type_p(node, NODE_BLOCK_PASS)) {
19754 compile_error(p, "block argument should not be given");
19755 }
19756}
19757
19758static NODE *
19759ret_args(struct parser_params *p, NODE *node)
19760{
19761 if (node) {
19762 no_blockarg(p, node);
19763 if (nd_type_p(node, NODE_LIST)) {
19764 if (node->nd_next == 0) {
19765 node = node->nd_head;
19766 }
19767 else {
19768 nd_set_type(node, NODE_VALUES);
19769 }
19770 }
19771 }
19772 return node;
19773}
19774
19775static NODE *
19776new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19777{
19778 if (node) no_blockarg(p, node);
19779
19780 return NEW_YIELD(node, loc);
19781}
19782
19783static VALUE
19784negate_lit(struct parser_params *p, VALUE lit)
19785{
19786 if (FIXNUM_P(lit)) {
19787 return LONG2FIX(-FIX2LONG(lit));
19788 }
19789 if (SPECIAL_CONST_P(lit)) {
19790#if USE_FLONUM
19791 if (FLONUM_P(lit)) {
19792 return DBL2NUM(-RFLOAT_VALUE(lit));
19793 }
19794#endif
19795 goto unknown;
19796 }
19797 switch (BUILTIN_TYPE(lit)) {
19798 case T_BIGNUM:
19799 BIGNUM_NEGATE(lit);
19800 lit = rb_big_norm(lit);
19801 break;
19802 case T_RATIONAL:
19803 RATIONAL_SET_NUM(lit, negate_lit(p, RRATIONAL(lit)->num));
19804 break;
19805 case T_COMPLEX:
19806 RCOMPLEX_SET_REAL(lit, negate_lit(p, RCOMPLEX(lit)->real));
19807 RCOMPLEX_SET_IMAG(lit, negate_lit(p, RCOMPLEX(lit)->imag));
19808 break;
19809 case T_FLOAT:
19810 lit = DBL2NUM(-RFLOAT_VALUE(lit));
19811 break;
19812 unknown:
19813 default:
19814 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
19815 rb_builtin_class_name(lit));
19816 break;
19817 }
19818 return lit;
19819}
19820
19821static NODE *
19822arg_blk_pass(NODE *node1, NODE *node2)
19823{
19824 if (node2) {
19825 if (!node1) return node2;
19826 node2->nd_head = node1;
19827 nd_set_first_lineno(node2, nd_first_lineno(node1));
19828 nd_set_first_column(node2, nd_first_column(node1));
19829 return node2;
19830 }
19831 return node1;
19832}
19833
19834static bool
19835args_info_empty_p(struct rb_args_info *args)
19836{
19837 if (args->pre_args_num) return false;
19838 if (args->post_args_num) return false;
19839 if (args->rest_arg) return false;
19840 if (args->opt_args) return false;
19841 if (args->block_arg) return false;
19842 if (args->kw_args) return false;
19843 if (args->kw_rest_arg) return false;
19844 return true;
19845}
19846
19847static NODE*
19848new_args(struct parser_params *p, NODE *pre_args, NODE *opt_args, ID rest_arg, NODE *post_args, NODE *tail, const YYLTYPE *loc)
19849{
19850 int saved_line = p->ruby_sourceline;
19851 struct rb_args_info *args = tail->nd_ainfo;
19852
19853 if (args->block_arg == idFWD_BLOCK) {
19854 if (rest_arg) {
19855 yyerror1(&tail->nd_loc, "... after rest argument");
19856 return tail;
19857 }
19858 rest_arg = idFWD_REST;
19859 }
19860
19861 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
19862 args->pre_init = pre_args ? pre_args->nd_next : 0;
19863
19864 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
19865 args->post_init = post_args ? post_args->nd_next : 0;
19866 args->first_post_arg = post_args ? post_args->nd_pid : 0;
19867
19868 args->rest_arg = rest_arg;
19869
19870 args->opt_args = opt_args;
19871
19872 args->ruby2_keywords = rest_arg == idFWD_REST;
19873
19874 p->ruby_sourceline = saved_line;
19875 nd_set_loc(tail, loc);
19876
19877 return tail;
19878}
19879
19880static NODE*
19881new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
19882{
19883 int saved_line = p->ruby_sourceline;
19884 NODE *node;
19885 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19886 struct rb_args_info *args = ZALLOC(struct rb_args_info);
19887 rb_imemo_tmpbuf_set_ptr(tmpbuf, args);
19888 args->imemo = tmpbuf;
19889 node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
19890 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19891 if (p->error_p) return node;
19892
19893 args->block_arg = block;
19894 args->kw_args = kw_args;
19895
19896 if (kw_args) {
19897 /*
19898 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
19899 * variable order: k1, kr1, k2, &b, internal_id, krest
19900 * #=> <reorder>
19901 * variable order: kr1, k1, k2, internal_id, krest, &b
19902 */
19903 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
19904 struct vtable *vtargs = p->lvtbl->args;
19905 NODE *kwn = kw_args;
19906
19907 if (block) block = vtargs->tbl[vtargs->pos-1];
19908 vtable_pop(vtargs, !!block + !!kw_rest_arg);
19909 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
19910 while (kwn) {
19911 if (!NODE_REQUIRED_KEYWORD_P(kwn->nd_body))
19912 --kw_vars;
19913 --required_kw_vars;
19914 kwn = kwn->nd_next;
19915 }
19916
19917 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
19918 ID vid = kwn->nd_body->nd_vid;
19919 if (NODE_REQUIRED_KEYWORD_P(kwn->nd_body)) {
19920 *required_kw_vars++ = vid;
19921 }
19922 else {
19923 *kw_vars++ = vid;
19924 }
19925 }
19926
19927 arg_var(p, kw_bits);
19928 if (kw_rest_arg) arg_var(p, kw_rest_arg);
19929 if (block) arg_var(p, block);
19930
19931 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
19932 args->kw_rest_arg->nd_cflag = kw_bits;
19933 }
19934 else if (kw_rest_arg == idNil) {
19935 args->no_kwarg = 1;
19936 }
19937 else if (kw_rest_arg) {
19938 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
19939 }
19940
19941 p->ruby_sourceline = saved_line;
19942 return node;
19943}
19944
19945static NODE *
19946args_with_numbered(struct parser_params *p, NODE *args, int max_numparam)
19947{
19948 if (max_numparam > NO_PARAM) {
19949 if (!args) {
19950 YYLTYPE loc = RUBY_INIT_YYLLOC();
19951 args = new_args_tail(p, 0, 0, 0, 0);
19952 nd_set_loc(args, &loc);
19953 }
19954 args->nd_ainfo->pre_args_num = max_numparam;
19955 }
19956 return args;
19957}
19958
19959static NODE*
19960new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
19961{
19962 struct rb_ary_pattern_info *apinfo = aryptn->nd_apinfo;
19963
19964 aryptn->nd_pconst = constant;
19965
19966 if (pre_arg) {
19967 NODE *pre_args = NEW_LIST(pre_arg, loc);
19968 if (apinfo->pre_args) {
19969 apinfo->pre_args = list_concat(pre_args, apinfo->pre_args);
19970 }
19971 else {
19972 apinfo->pre_args = pre_args;
19973 }
19974 }
19975 return aryptn;
19976}
19977
19978static NODE*
19979new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc)
19980{
19981 int saved_line = p->ruby_sourceline;
19982 NODE *node;
19983 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19984 struct rb_ary_pattern_info *apinfo = ZALLOC(struct rb_ary_pattern_info);
19985 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
19986 node = NEW_NODE(NODE_ARYPTN, 0, tmpbuf, apinfo, loc);
19987 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19988
19989 apinfo->pre_args = pre_args;
19990
19991 if (has_rest) {
19992 if (rest_arg) {
19993 apinfo->rest_arg = assignable(p, rest_arg, 0, loc);
19994 }
19995 else {
19996 apinfo->rest_arg = NODE_SPECIAL_NO_NAME_REST;
19997 }
19998 }
19999 else {
20000 apinfo->rest_arg = NULL;
20001 }
20002
20003 apinfo->post_args = post_args;
20004
20005 p->ruby_sourceline = saved_line;
20006 return node;
20007}
20008
20009static NODE*
20010new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
20011{
20012 fndptn->nd_pconst = constant;
20013
20014 return fndptn;
20015}
20016
20017static NODE*
20018new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc)
20019{
20020 int saved_line = p->ruby_sourceline;
20021 NODE *node;
20022 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
20023 struct rb_fnd_pattern_info *fpinfo = ZALLOC(struct rb_fnd_pattern_info);
20024 rb_imemo_tmpbuf_set_ptr(tmpbuf, fpinfo);
20025 node = NEW_NODE(NODE_FNDPTN, 0, tmpbuf, fpinfo, loc);
20026 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
20027
20028 fpinfo->pre_rest_arg = pre_rest_arg ? assignable(p, pre_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
20029 fpinfo->args = args;
20030 fpinfo->post_rest_arg = post_rest_arg ? assignable(p, post_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
20031
20032 p->ruby_sourceline = saved_line;
20033 return node;
20034}
20035
20036static NODE*
20037new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
20038{
20039 hshptn->nd_pconst = constant;
20040 return hshptn;
20041}
20042
20043static NODE*
20044new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
20045{
20046 int saved_line = p->ruby_sourceline;
20047 NODE *node, *kw_rest_arg_node;
20048
20049 if (kw_rest_arg == idNil) {
20050 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
20051 }
20052 else if (kw_rest_arg) {
20053 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
20054 }
20055 else {
20056 kw_rest_arg_node = NULL;
20057 }
20058
20059 node = NEW_NODE(NODE_HSHPTN, 0, kw_args, kw_rest_arg_node, loc);
20060
20061 p->ruby_sourceline = saved_line;
20062 return node;
20063}
20064
20065static NODE*
20066dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
20067{
20068 VALUE lit;
20069
20070 if (!node) {
20071 return NEW_LIT(ID2SYM(idNULL), loc);
20072 }
20073
20074 switch (nd_type(node)) {
20075 case NODE_DSTR:
20076 nd_set_type(node, NODE_DSYM);
20077 nd_set_loc(node, loc);
20078 break;
20079 case NODE_STR:
20080 lit = node->nd_lit;
20081 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = ID2SYM(rb_intern_str(lit)));
20082 nd_set_type(node, NODE_LIT);
20083 nd_set_loc(node, loc);
20084 break;
20085 default:
20086 node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node, loc), loc);
20087 break;
20088 }
20089 return node;
20090}
20091
20092static int
20093append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
20094{
20095 NODE *node = (NODE *)v;
20096 NODE **result = (NODE **)h;
20097 node->nd_alen = 2;
20098 node->nd_next->nd_end = node->nd_next;
20099 node->nd_next->nd_next = 0;
20100 if (*result)
20101 list_concat(*result, node);
20102 else
20103 *result = node;
20104 return ST_CONTINUE;
20105}
20106
20107static bool
20108hash_literal_key_p(VALUE k)
20109{
20110 switch (OBJ_BUILTIN_TYPE(k)) {
20111 case T_NODE:
20112 return false;
20113 default:
20114 return true;
20115 }
20116}
20117
20118static int
20119literal_cmp(VALUE val, VALUE lit)
20120{
20121 if (val == lit) return 0;
20122 if (!hash_literal_key_p(val) || !hash_literal_key_p(lit)) return -1;
20123 return rb_iseq_cdhash_cmp(val, lit);
20124}
20125
20126static st_index_t
20127literal_hash(VALUE a)
20128{
20129 if (!hash_literal_key_p(a)) return (st_index_t)a;
20130 return rb_iseq_cdhash_hash(a);
20131}
20132
20133static const struct st_hash_type literal_type = {
20134 literal_cmp,
20135 literal_hash,
20136};
20137
20138static NODE *
20139remove_duplicate_keys(struct parser_params *p, NODE *hash)
20140{
20141 st_table *literal_keys = st_init_table_with_size(&literal_type, hash->nd_alen / 2);
20142 NODE *result = 0;
20143 NODE *last_expr = 0;
20144 rb_code_location_t loc = hash->nd_loc;
20145 while (hash && hash->nd_head && hash->nd_next) {
20146 NODE *head = hash->nd_head;
20147 NODE *value = hash->nd_next;
20148 NODE *next = value->nd_next;
20149 st_data_t key = (st_data_t)head;
20150 st_data_t data;
20151 value->nd_next = 0;
20152 if (nd_type_p(head, NODE_LIT) &&
20153 st_delete(literal_keys, (key = (st_data_t)head->nd_lit, &key), &data)) {
20154 NODE *dup_value = ((NODE *)data)->nd_next;
20155 rb_compile_warn(p->ruby_sourcefile, nd_line((NODE *)data),
20156 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
20157 head->nd_lit, nd_line(head));
20158 if (dup_value == last_expr) {
20159 value->nd_head = block_append(p, dup_value->nd_head, value->nd_head);
20160 }
20161 else {
20162 last_expr->nd_head = block_append(p, dup_value->nd_head, last_expr->nd_head);
20163 }
20164 }
20165 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
20166 last_expr = nd_type_p(head, NODE_LIT) ? value : head;
20167 hash = next;
20168 }
20169 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
20170 st_free_table(literal_keys);
20171 if (hash) {
20172 if (!result) result = hash;
20173 else list_concat(result, hash);
20174 }
20175 result->nd_loc = loc;
20176 return result;
20177}
20178
20179static NODE *
20180new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
20181{
20182 if (hash) hash = remove_duplicate_keys(p, hash);
20183 return NEW_HASH(hash, loc);
20184}
20185#endif
20186
20187static void
20188error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
20189{
20190 if (is_private_local_id(id)) {
20191 return;
20192 }
20193 if (st_is_member(p->pvtbl, id)) {
20194 yyerror1(loc, "duplicated variable name");
20195 }
20196 else {
20197 st_insert(p->pvtbl, (st_data_t)id, 0);
20198 }
20199}
20200
20201static void
20202error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
20203{
20204 if (!p->pktbl) {
20205 p->pktbl = st_init_numtable();
20206 }
20207 else if (st_is_member(p->pktbl, key)) {
20208 yyerror1(loc, "duplicated key name");
20209 return;
20210 }
20211 st_insert(p->pktbl, (st_data_t)key, 0);
20212}
20213
20214#ifndef RIPPER
20215static NODE *
20216new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
20217{
20218 return NEW_HASH(hash, loc);
20219}
20220#endif /* !RIPPER */
20221
20222#ifndef RIPPER
20223static NODE *
20224new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
20225{
20226 NODE *asgn;
20227
20228 if (lhs) {
20229 ID vid = lhs->nd_vid;
20230 YYLTYPE lhs_loc = lhs->nd_loc;
20231 int shareable = ctxt.shareable_constant_value;
20232 if (shareable) {
20233 switch (nd_type(lhs)) {
20234 case NODE_CDECL:
20235 case NODE_COLON2:
20236 case NODE_COLON3:
20237 break;
20238 default:
20239 shareable = 0;
20240 break;
20241 }
20242 }
20243 if (op == tOROP) {
20244 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
20245 lhs->nd_value = rhs;
20246 nd_set_loc(lhs, loc);
20247 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
20248 if (is_notop_id(vid)) {
20249 switch (id_type(vid)) {
20250 case ID_GLOBAL:
20251 case ID_INSTANCE:
20252 case ID_CLASS:
20253 asgn->nd_aid = vid;
20254 }
20255 }
20256 }
20257 else if (op == tANDOP) {
20258 if (shareable) {
20259 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
20260 }
20261 lhs->nd_value = rhs;
20262 nd_set_loc(lhs, loc);
20263 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
20264 }
20265 else {
20266 asgn = lhs;
20267 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
20268 if (shareable) {
20269 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
20270 }
20271 asgn->nd_value = rhs;
20272 nd_set_loc(asgn, loc);
20273 }
20274 }
20275 else {
20276 asgn = NEW_BEGIN(0, loc);
20277 }
20278 return asgn;
20279}
20280
20281static NODE *
20282new_ary_op_assign(struct parser_params *p, NODE *ary,
20283 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
20284{
20285 NODE *asgn;
20286
20287 args = make_list(args, args_loc);
20288 if (nd_type_p(args, NODE_BLOCK_PASS)) {
20289 args = NEW_ARGSCAT(args, rhs, loc);
20290 }
20291 else {
20292 args = arg_concat(p, args, rhs, loc);
20293 }
20294 asgn = NEW_OP_ASGN1(ary, op, args, loc);
20295 fixpos(asgn, ary);
20296 return asgn;
20297}
20298
20299static NODE *
20300new_attr_op_assign(struct parser_params *p, NODE *lhs,
20301 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
20302{
20303 NODE *asgn;
20304
20305 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
20306 fixpos(asgn, lhs);
20307 return asgn;
20308}
20309
20310static NODE *
20311new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
20312{
20313 NODE *asgn;
20314
20315 if (lhs) {
20316 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
20317 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
20318 }
20319 else {
20320 asgn = NEW_BEGIN(0, loc);
20321 }
20322 fixpos(asgn, lhs);
20323 return asgn;
20324}
20325
20326static NODE *
20327const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
20328{
20329 if (p->ctxt.in_def) {
20330 yyerror1(loc, "dynamic constant assignment");
20331 }
20332 return NEW_CDECL(0, 0, (path), loc);
20333}
20334#else
20335static VALUE
20336const_decl(struct parser_params *p, VALUE path)
20337{
20338 if (p->ctxt.in_def) {
20339 path = assign_error(p, "dynamic constant assignment", path);
20340 }
20341 return path;
20342}
20343
20344static VALUE
20345assign_error(struct parser_params *p, const char *mesg, VALUE a)
20346{
20347 a = dispatch2(assign_error, ERR_MESG(), a);
20348 ripper_error(p);
20349 return a;
20350}
20351
20352static VALUE
20353var_field(struct parser_params *p, VALUE a)
20354{
20355 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
20356}
20357#endif
20358
20359#ifndef RIPPER
20360static NODE *
20361new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
20362{
20363 NODE *result = head;
20364 if (rescue) {
20365 NODE *tmp = rescue_else ? rescue_else : rescue;
20366 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
20367
20368 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
20369 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
20370 }
20371 else if (rescue_else) {
20372 result = block_append(p, result, rescue_else);
20373 }
20374 if (ensure) {
20375 result = NEW_ENSURE(result, ensure, loc);
20376 }
20377 fixpos(result, head);
20378 return result;
20379}
20380#endif
20381
20382static void
20383warn_unused_var(struct parser_params *p, struct local_vars *local)
20384{
20385 int cnt;
20386
20387 if (!local->used) return;
20388 cnt = local->used->pos;
20389 if (cnt != local->vars->pos) {
20390 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
20391 }
20392#ifndef RIPPER
20393 ID *v = local->vars->tbl;
20394 ID *u = local->used->tbl;
20395 for (int i = 0; i < cnt; ++i) {
20396 if (!v[i] || (u[i] & LVAR_USED)) continue;
20397 if (is_private_local_id(v[i])) continue;
20398 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
20399 }
20400#endif
20401}
20402
20403static void
20404local_push(struct parser_params *p, int toplevel_scope)
20405{
20406 struct local_vars *local;
20407 int inherits_dvars = toplevel_scope && compile_for_eval;
20408 int warn_unused_vars = RTEST(ruby_verbose);
20409
20410 local = ALLOC(struct local_vars);
20411 local->prev = p->lvtbl;
20412 local->args = vtable_alloc(0);
20413 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
20414#ifndef RIPPER
20415 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
20416 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
20417 local->numparam.outer = 0;
20418 local->numparam.inner = 0;
20419 local->numparam.current = 0;
20420#endif
20421 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
20422
20423# if WARN_PAST_SCOPE
20424 local->past = 0;
20425# endif
20426 CMDARG_PUSH(0);
20427 COND_PUSH(0);
20428 p->lvtbl = local;
20429}
20430
20431static void
20432local_pop(struct parser_params *p)
20433{
20434 struct local_vars *local = p->lvtbl->prev;
20435 if (p->lvtbl->used) {
20436 warn_unused_var(p, p->lvtbl);
20437 vtable_free(p->lvtbl->used);
20438 }
20439# if WARN_PAST_SCOPE
20440 while (p->lvtbl->past) {
20441 struct vtable *past = p->lvtbl->past;
20442 p->lvtbl->past = past->prev;
20443 vtable_free(past);
20444 }
20445# endif
20446 vtable_free(p->lvtbl->args);
20447 vtable_free(p->lvtbl->vars);
20448 CMDARG_POP();
20449 COND_POP();
20450 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
20451 p->lvtbl = local;
20452}
20453
20454#ifndef RIPPER
20455static rb_ast_id_table_t *
20456local_tbl(struct parser_params *p)
20457{
20458 int cnt_args = vtable_size(p->lvtbl->args);
20459 int cnt_vars = vtable_size(p->lvtbl->vars);
20460 int cnt = cnt_args + cnt_vars;
20461 int i, j;
20462 rb_ast_id_table_t *tbl;
20463
20464 if (cnt <= 0) return 0;
20465 tbl = rb_ast_new_local_table(p->ast, cnt);
20466 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
20467 /* remove IDs duplicated to warn shadowing */
20468 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
20469 ID id = p->lvtbl->vars->tbl[i];
20470 if (!vtable_included(p->lvtbl->args, id)) {
20471 tbl->ids[j++] = id;
20472 }
20473 }
20474 if (j < cnt) {
20475 tbl = rb_ast_resize_latest_local_table(p->ast, j);
20476 }
20477
20478 return tbl;
20479}
20480
20481static NODE*
20482node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc)
20483{
20485 NODE *n;
20486
20487 a0 = local_tbl(p);
20488 n = NEW_NODE(type, a0, a1, a2, loc);
20489 return n;
20490}
20491
20492#endif
20493
20494static void
20495numparam_name(struct parser_params *p, ID id)
20496{
20497 if (!NUMPARAM_ID_P(id)) return;
20498 compile_error(p, "_%d is reserved for numbered parameter",
20499 NUMPARAM_ID_TO_IDX(id));
20500}
20501
20502static void
20503arg_var(struct parser_params *p, ID id)
20504{
20505 numparam_name(p, id);
20506 vtable_add(p->lvtbl->args, id);
20507}
20508
20509static void
20510local_var(struct parser_params *p, ID id)
20511{
20512 numparam_name(p, id);
20513 vtable_add(p->lvtbl->vars, id);
20514 if (p->lvtbl->used) {
20515 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
20516 }
20517}
20518
20519static int
20520local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
20521{
20522 struct vtable *vars, *args, *used;
20523
20524 vars = p->lvtbl->vars;
20525 args = p->lvtbl->args;
20526 used = p->lvtbl->used;
20527
20528 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
20529 vars = vars->prev;
20530 args = args->prev;
20531 if (used) used = used->prev;
20532 }
20533
20534 if (vars && vars->prev == DVARS_INHERIT) {
20535 return rb_local_defined(id, p->parent_iseq);
20536 }
20537 else if (vtable_included(args, id)) {
20538 return 1;
20539 }
20540 else {
20541 int i = vtable_included(vars, id);
20542 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
20543 return i != 0;
20544 }
20545}
20546
20547static int
20548local_id(struct parser_params *p, ID id)
20549{
20550 return local_id_ref(p, id, NULL);
20551}
20552
20553static int
20554check_forwarding_args(struct parser_params *p)
20555{
20556 if (local_id(p, idFWD_REST) &&
20557#if idFWD_KWREST
20558 local_id(p, idFWD_KWREST) &&
20559#endif
20560 local_id(p, idFWD_BLOCK)) return TRUE;
20561 compile_error(p, "unexpected ...");
20562 return FALSE;
20563}
20564
20565static void
20566add_forwarding_args(struct parser_params *p)
20567{
20568 arg_var(p, idFWD_REST);
20569#if idFWD_KWREST
20570 arg_var(p, idFWD_KWREST);
20571#endif
20572 arg_var(p, idFWD_BLOCK);
20573}
20574
20575#ifndef RIPPER
20576static NODE *
20577new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
20578{
20579 NODE *splat = NEW_SPLAT(NEW_LVAR(idFWD_REST, loc), loc);
20580#if idFWD_KWREST
20581 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
20582#endif
20583 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
20584 NODE *args = leading ? rest_arg_append(p, leading, splat, argsloc) : splat;
20585#if idFWD_KWREST
20586 args = arg_append(p, splat, new_hash(p, kwrest, loc), loc);
20587#endif
20588 return arg_blk_pass(args, block);
20589}
20590#endif
20591
20592static NODE *
20593numparam_push(struct parser_params *p)
20594{
20595#ifndef RIPPER
20596 struct local_vars *local = p->lvtbl;
20597 NODE *inner = local->numparam.inner;
20598 if (!local->numparam.outer) {
20599 local->numparam.outer = local->numparam.current;
20600 }
20601 local->numparam.inner = 0;
20602 local->numparam.current = 0;
20603 return inner;
20604#else
20605 return 0;
20606#endif
20607}
20608
20609static void
20610numparam_pop(struct parser_params *p, NODE *prev_inner)
20611{
20612#ifndef RIPPER
20613 struct local_vars *local = p->lvtbl;
20614 if (prev_inner) {
20615 /* prefer first one */
20616 local->numparam.inner = prev_inner;
20617 }
20618 else if (local->numparam.current) {
20619 /* current and inner are exclusive */
20620 local->numparam.inner = local->numparam.current;
20621 }
20622 if (p->max_numparam > NO_PARAM) {
20623 /* current and outer are exclusive */
20624 local->numparam.current = local->numparam.outer;
20625 local->numparam.outer = 0;
20626 }
20627 else {
20628 /* no numbered parameter */
20629 local->numparam.current = 0;
20630 }
20631#endif
20632}
20633
20634static const struct vtable *
20635dyna_push(struct parser_params *p)
20636{
20637 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
20638 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
20639 if (p->lvtbl->used) {
20640 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
20641 }
20642 return p->lvtbl->args;
20643}
20644
20645static void
20646dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
20647{
20648 struct vtable *tmp = *vtblp;
20649 *vtblp = tmp->prev;
20650# if WARN_PAST_SCOPE
20651 if (p->past_scope_enabled) {
20652 tmp->prev = p->lvtbl->past;
20653 p->lvtbl->past = tmp;
20654 return;
20655 }
20656# endif
20657 vtable_free(tmp);
20658}
20659
20660static void
20661dyna_pop_1(struct parser_params *p)
20662{
20663 struct vtable *tmp;
20664
20665 if ((tmp = p->lvtbl->used) != 0) {
20666 warn_unused_var(p, p->lvtbl);
20667 p->lvtbl->used = p->lvtbl->used->prev;
20668 vtable_free(tmp);
20669 }
20670 dyna_pop_vtable(p, &p->lvtbl->args);
20671 dyna_pop_vtable(p, &p->lvtbl->vars);
20672}
20673
20674static void
20675dyna_pop(struct parser_params *p, const struct vtable *lvargs)
20676{
20677 while (p->lvtbl->args != lvargs) {
20678 dyna_pop_1(p);
20679 if (!p->lvtbl->args) {
20680 struct local_vars *local = p->lvtbl->prev;
20681 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
20682 p->lvtbl = local;
20683 }
20684 }
20685 dyna_pop_1(p);
20686}
20687
20688static int
20689dyna_in_block(struct parser_params *p)
20690{
20691 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
20692}
20693
20694static int
20695dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
20696{
20697 struct vtable *vars, *args, *used;
20698 int i;
20699
20700 args = p->lvtbl->args;
20701 vars = p->lvtbl->vars;
20702 used = p->lvtbl->used;
20703
20704 while (!DVARS_TERMINAL_P(vars)) {
20705 if (vtable_included(args, id)) {
20706 return 1;
20707 }
20708 if ((i = vtable_included(vars, id)) != 0) {
20709 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
20710 return 1;
20711 }
20712 args = args->prev;
20713 vars = vars->prev;
20714 if (!vidrefp) used = 0;
20715 if (used) used = used->prev;
20716 }
20717
20718 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
20719 return rb_dvar_defined(id, p->parent_iseq);
20720 }
20721
20722 return 0;
20723}
20724
20725static int
20726dvar_defined(struct parser_params *p, ID id)
20727{
20728 return dvar_defined_ref(p, id, NULL);
20729}
20730
20731static int
20732dvar_curr(struct parser_params *p, ID id)
20733{
20734 return (vtable_included(p->lvtbl->args, id) ||
20735 vtable_included(p->lvtbl->vars, id));
20736}
20737
20738static void
20739reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
20740{
20741 compile_error(p,
20742 "regexp encoding option '%c' differs from source encoding '%s'",
20743 c, rb_enc_name(rb_enc_get(str)));
20744}
20745
20746#ifndef RIPPER
20747int
20748rb_reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
20749{
20750 int c = RE_OPTION_ENCODING_IDX(options);
20751
20752 if (c) {
20753 int opt, idx;
20754 rb_char_to_option_kcode(c, &opt, &idx);
20755 if (idx != ENCODING_GET(str) &&
20757 goto error;
20758 }
20759 ENCODING_SET(str, idx);
20760 }
20761 else if (RE_OPTION_ENCODING_NONE(options)) {
20762 if (!ENCODING_IS_ASCII8BIT(str) &&
20764 c = 'n';
20765 goto error;
20766 }
20767 rb_enc_associate(str, rb_ascii8bit_encoding());
20768 }
20769 else if (p->enc == rb_usascii_encoding()) {
20771 /* raise in re.c */
20772 rb_enc_associate(str, rb_usascii_encoding());
20773 }
20774 else {
20775 rb_enc_associate(str, rb_ascii8bit_encoding());
20776 }
20777 }
20778 return 0;
20779
20780 error:
20781 return c;
20782}
20783
20784static void
20785reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
20786{
20787 int c = rb_reg_fragment_setenc(p, str, options);
20788 if (c) reg_fragment_enc_error(p, str, c);
20789}
20790
20791static int
20792reg_fragment_check(struct parser_params* p, VALUE str, int options)
20793{
20794 VALUE err;
20795 reg_fragment_setenc(p, str, options);
20796 err = rb_reg_check_preprocess(str);
20797 if (err != Qnil) {
20798 err = rb_obj_as_string(err);
20799 compile_error(p, "%"PRIsVALUE, err);
20800 return 0;
20801 }
20802 return 1;
20803}
20804
20805typedef struct {
20806 struct parser_params* parser;
20807 rb_encoding *enc;
20808 NODE *succ_block;
20809 const YYLTYPE *loc;
20811
20812static int
20813reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
20814 int back_num, int *back_refs, OnigRegex regex, void *arg0)
20815{
20817 struct parser_params* p = arg->parser;
20818 rb_encoding *enc = arg->enc;
20819 long len = name_end - name;
20820 const char *s = (const char *)name;
20821 ID var;
20822 NODE *node, *succ;
20823
20824 if (!len) return ST_CONTINUE;
20825 if (rb_enc_symname_type(s, len, enc, (1U<<ID_LOCAL)) != ID_LOCAL)
20826 return ST_CONTINUE;
20827
20828 var = intern_cstr(s, len, enc);
20829 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
20830 if (!lvar_defined(p, var)) return ST_CONTINUE;
20831 }
20832 node = node_assign(p, assignable(p, var, 0, arg->loc), NEW_LIT(ID2SYM(var), arg->loc), NO_LEX_CTXT, arg->loc);
20833 succ = arg->succ_block;
20834 if (!succ) succ = NEW_BEGIN(0, arg->loc);
20835 succ = block_append(p, succ, node);
20836 arg->succ_block = succ;
20837 return ST_CONTINUE;
20838}
20839
20840static NODE *
20841reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
20842{
20844
20845 arg.parser = p;
20846 arg.enc = rb_enc_get(regexp);
20847 arg.succ_block = 0;
20848 arg.loc = loc;
20849 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
20850
20851 if (!arg.succ_block) return 0;
20852 return arg.succ_block->nd_next;
20853}
20854
20855static VALUE
20856parser_reg_compile(struct parser_params* p, VALUE str, int options)
20857{
20858 reg_fragment_setenc(p, str, options);
20859 return rb_parser_reg_compile(p, str, options);
20860}
20861
20862VALUE
20863rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
20864{
20865 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
20866}
20867
20868static VALUE
20869reg_compile(struct parser_params* p, VALUE str, int options)
20870{
20871 VALUE re;
20872 VALUE err;
20873
20874 err = rb_errinfo();
20875 re = parser_reg_compile(p, str, options);
20876 if (NIL_P(re)) {
20877 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
20878 rb_set_errinfo(err);
20879 compile_error(p, "%"PRIsVALUE, m);
20880 return Qnil;
20881 }
20882 return re;
20883}
20884#else
20885static VALUE
20886parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
20887{
20888 VALUE err = rb_errinfo();
20889 VALUE re;
20890 str = ripper_is_node_yylval(str) ? RNODE(str)->nd_cval : str;
20891 int c = rb_reg_fragment_setenc(p, str, options);
20892 if (c) reg_fragment_enc_error(p, str, c);
20893 re = rb_parser_reg_compile(p, str, options);
20894 if (NIL_P(re)) {
20895 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
20896 rb_set_errinfo(err);
20897 }
20898 return re;
20899}
20900#endif
20901
20902#ifndef RIPPER
20903void
20904rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
20905{
20906 struct parser_params *p;
20907 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20908 p->do_print = print;
20909 p->do_loop = loop;
20910 p->do_chomp = chomp;
20911 p->do_split = split;
20912}
20913
20914static NODE *
20915parser_append_options(struct parser_params *p, NODE *node)
20916{
20917 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
20918 const YYLTYPE *const LOC = &default_location;
20919
20920 if (p->do_print) {
20921 NODE *print = NEW_FCALL(rb_intern("print"),
20922 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
20923 LOC);
20924 node = block_append(p, node, print);
20925 }
20926
20927 if (p->do_loop) {
20928 if (p->do_split) {
20929 ID ifs = rb_intern("$;");
20930 ID fields = rb_intern("$F");
20931 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
20932 NODE *split = NEW_GASGN(fields,
20933 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
20934 rb_intern("split"), args, LOC),
20935 LOC);
20936 node = block_append(p, split, node);
20937 }
20938 if (p->do_chomp) {
20939 NODE *chomp = NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
20940 rb_intern("chomp!"), 0, LOC);
20941 node = block_append(p, chomp, node);
20942 }
20943
20944 node = NEW_WHILE(NEW_VCALL(idGets, LOC), node, 1, LOC);
20945 }
20946
20947 return node;
20948}
20949
20950void
20951rb_init_parse(void)
20952{
20953 /* just to suppress unused-function warnings */
20954 (void)nodetype;
20955 (void)nodeline;
20956}
20957
20958static ID
20959internal_id(struct parser_params *p)
20960{
20961 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
20962}
20963#endif /* !RIPPER */
20964
20965static void
20966parser_initialize(struct parser_params *p)
20967{
20968 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
20969 p->command_start = TRUE;
20970 p->ruby_sourcefile_string = Qnil;
20971 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
20972 p->node_id = 0;
20973#ifdef RIPPER
20974 p->delayed.token = Qnil;
20975 p->result = Qnil;
20976 p->parsing_thread = Qnil;
20977#else
20978 p->error_buffer = Qfalse;
20979#endif
20980 p->debug_buffer = Qnil;
20981 p->debug_output = rb_ractor_stdout();
20982 p->enc = rb_utf8_encoding();
20983}
20984
20985#ifdef RIPPER
20986#define parser_mark ripper_parser_mark
20987#define parser_free ripper_parser_free
20988#endif
20989
20990static void
20991parser_mark(void *ptr)
20992{
20993 struct parser_params *p = (struct parser_params*)ptr;
20994
20995 rb_gc_mark(p->lex.input);
20996 rb_gc_mark(p->lex.prevline);
20997 rb_gc_mark(p->lex.lastline);
20998 rb_gc_mark(p->lex.nextline);
20999 rb_gc_mark(p->ruby_sourcefile_string);
21000 rb_gc_mark((VALUE)p->lex.strterm);
21001 rb_gc_mark((VALUE)p->ast);
21002 rb_gc_mark(p->case_labels);
21003#ifndef RIPPER
21004 rb_gc_mark(p->debug_lines);
21005 rb_gc_mark(p->compile_option);
21006 rb_gc_mark(p->error_buffer);
21007#else
21008 rb_gc_mark(p->delayed.token);
21009 rb_gc_mark(p->value);
21010 rb_gc_mark(p->result);
21011 rb_gc_mark(p->parsing_thread);
21012#endif
21013 rb_gc_mark(p->debug_buffer);
21014 rb_gc_mark(p->debug_output);
21015#ifdef YYMALLOC
21016 rb_gc_mark((VALUE)p->heap);
21017#endif
21018}
21019
21020static void
21021parser_free(void *ptr)
21022{
21023 struct parser_params *p = (struct parser_params*)ptr;
21024 struct local_vars *local, *prev;
21025
21026 if (p->tokenbuf) {
21027 ruby_sized_xfree(p->tokenbuf, p->toksiz);
21028 }
21029 for (local = p->lvtbl; local; local = prev) {
21030 if (local->vars) xfree(local->vars);
21031 prev = local->prev;
21032 xfree(local);
21033 }
21034 {
21035 token_info *ptinfo;
21036 while ((ptinfo = p->token_info) != 0) {
21037 p->token_info = ptinfo->next;
21038 xfree(ptinfo);
21039 }
21040 }
21041 xfree(ptr);
21042}
21043
21044static size_t
21045parser_memsize(const void *ptr)
21046{
21047 struct parser_params *p = (struct parser_params*)ptr;
21048 struct local_vars *local;
21049 size_t size = sizeof(*p);
21050
21051 size += p->toksiz;
21052 for (local = p->lvtbl; local; local = local->prev) {
21053 size += sizeof(*local);
21054 if (local->vars) size += local->vars->capa * sizeof(ID);
21055 }
21056 return size;
21057}
21058
21059static const rb_data_type_t parser_data_type = {
21060#ifndef RIPPER
21061 "parser",
21062#else
21063 "ripper",
21064#endif
21065 {
21066 parser_mark,
21067 parser_free,
21068 parser_memsize,
21069 },
21070 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
21071};
21072
21073#ifndef RIPPER
21074#undef rb_reserved_word
21075
21076const struct kwtable *
21077rb_reserved_word(const char *str, unsigned int len)
21078{
21079 return reserved_word(str, len);
21080}
21081
21082VALUE
21083rb_parser_new(void)
21084{
21085 struct parser_params *p;
21086 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
21087 &parser_data_type, p);
21088 parser_initialize(p);
21089 return parser;
21090}
21091
21092VALUE
21093rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
21094{
21095 struct parser_params *p;
21096
21097 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21098 p->error_buffer = main ? Qfalse : Qnil;
21099 p->parent_iseq = base;
21100 return vparser;
21101}
21102
21103void
21104rb_parser_keep_script_lines(VALUE vparser)
21105{
21106 struct parser_params *p;
21107
21108 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21109 p->keep_script_lines = 1;
21110}
21111#endif
21112
21113#ifdef RIPPER
21114#define rb_parser_end_seen_p ripper_parser_end_seen_p
21115#define rb_parser_encoding ripper_parser_encoding
21116#define rb_parser_get_yydebug ripper_parser_get_yydebug
21117#define rb_parser_set_yydebug ripper_parser_set_yydebug
21118#define rb_parser_get_debug_output ripper_parser_get_debug_output
21119#define rb_parser_set_debug_output ripper_parser_set_debug_output
21120static VALUE ripper_parser_end_seen_p(VALUE vparser);
21121static VALUE ripper_parser_encoding(VALUE vparser);
21122static VALUE ripper_parser_get_yydebug(VALUE self);
21123static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
21124static VALUE ripper_parser_get_debug_output(VALUE self);
21125static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output);
21126
21127/*
21128 * call-seq:
21129 * ripper.error? -> Boolean
21130 *
21131 * Return true if parsed source has errors.
21132 */
21133static VALUE
21134ripper_error_p(VALUE vparser)
21135{
21136 struct parser_params *p;
21137
21138 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21139 return RBOOL(p->error_p);
21140}
21141#endif
21142
21143/*
21144 * call-seq:
21145 * ripper.end_seen? -> Boolean
21146 *
21147 * Return true if parsed source ended by +\_\_END\_\_+.
21148 */
21149VALUE
21150rb_parser_end_seen_p(VALUE vparser)
21151{
21152 struct parser_params *p;
21153
21154 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21155 return RBOOL(p->ruby__end__seen);
21156}
21157
21158/*
21159 * call-seq:
21160 * ripper.encoding -> encoding
21161 *
21162 * Return encoding of the source.
21163 */
21164VALUE
21165rb_parser_encoding(VALUE vparser)
21166{
21167 struct parser_params *p;
21168
21169 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21170 return rb_enc_from_encoding(p->enc);
21171}
21172
21173#ifdef RIPPER
21174/*
21175 * call-seq:
21176 * ripper.yydebug -> true or false
21177 *
21178 * Get yydebug.
21179 */
21180VALUE
21181rb_parser_get_yydebug(VALUE self)
21182{
21183 struct parser_params *p;
21184
21185 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21186 return RBOOL(p->debug);
21187}
21188#endif
21189
21190/*
21191 * call-seq:
21192 * ripper.yydebug = flag
21193 *
21194 * Set yydebug.
21195 */
21196VALUE
21197rb_parser_set_yydebug(VALUE self, VALUE flag)
21198{
21199 struct parser_params *p;
21200
21201 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21202 p->debug = RTEST(flag);
21203 return flag;
21204}
21205
21206/*
21207 * call-seq:
21208 * ripper.debug_output -> obj
21209 *
21210 * Get debug output.
21211 */
21212VALUE
21213rb_parser_get_debug_output(VALUE self)
21214{
21215 struct parser_params *p;
21216
21217 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21218 return p->debug_output;
21219}
21220
21221/*
21222 * call-seq:
21223 * ripper.debug_output = obj
21224 *
21225 * Set debug output.
21226 */
21227VALUE
21228rb_parser_set_debug_output(VALUE self, VALUE output)
21229{
21230 struct parser_params *p;
21231
21232 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21233 return p->debug_output = output;
21234}
21235
21236#ifndef RIPPER
21237#ifdef YYMALLOC
21238#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
21239/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
21240 * potential memory leak */
21241#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
21242#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
21243 (new)->cnt = (cnt), (ptr))
21244
21245void *
21246rb_parser_malloc(struct parser_params *p, size_t size)
21247{
21248 size_t cnt = HEAPCNT(1, size);
21249 rb_imemo_tmpbuf_t *n = NEWHEAP();
21250 void *ptr = xmalloc(size);
21251
21252 return ADD2HEAP(n, cnt, ptr);
21253}
21254
21255void *
21256rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
21257{
21258 size_t cnt = HEAPCNT(nelem, size);
21259 rb_imemo_tmpbuf_t *n = NEWHEAP();
21260 void *ptr = xcalloc(nelem, size);
21261
21262 return ADD2HEAP(n, cnt, ptr);
21263}
21264
21265void *
21266rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
21267{
21269 size_t cnt = HEAPCNT(1, size);
21270
21271 if (ptr && (n = p->heap) != NULL) {
21272 do {
21273 if (n->ptr == ptr) {
21274 n->ptr = ptr = xrealloc(ptr, size);
21275 if (n->cnt) n->cnt = cnt;
21276 return ptr;
21277 }
21278 } while ((n = n->next) != NULL);
21279 }
21280 n = NEWHEAP();
21281 ptr = xrealloc(ptr, size);
21282 return ADD2HEAP(n, cnt, ptr);
21283}
21284
21285void
21286rb_parser_free(struct parser_params *p, void *ptr)
21287{
21288 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
21289
21290 while ((n = *prev) != NULL) {
21291 if (n->ptr == ptr) {
21292 *prev = n->next;
21293 break;
21294 }
21295 prev = &n->next;
21296 }
21297}
21298#endif
21299
21300void
21301rb_parser_printf(struct parser_params *p, const char *fmt, ...)
21302{
21303 va_list ap;
21304 VALUE mesg = p->debug_buffer;
21305
21306 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
21307 va_start(ap, fmt);
21308 rb_str_vcatf(mesg, fmt, ap);
21309 va_end(ap);
21310 if (RSTRING_END(mesg)[-1] == '\n') {
21311 rb_io_write(p->debug_output, mesg);
21312 p->debug_buffer = Qnil;
21313 }
21314}
21315
21316static void
21317parser_compile_error(struct parser_params *p, const char *fmt, ...)
21318{
21319 va_list ap;
21320
21321 rb_io_flush(p->debug_output);
21322 p->error_p = 1;
21323 va_start(ap, fmt);
21324 p->error_buffer =
21325 rb_syntax_error_append(p->error_buffer,
21326 p->ruby_sourcefile_string,
21327 p->ruby_sourceline,
21328 rb_long2int(p->lex.pcur - p->lex.pbeg),
21329 p->enc, fmt, ap);
21330 va_end(ap);
21331}
21332
21333static size_t
21334count_char(const char *str, int c)
21335{
21336 int n = 0;
21337 while (str[n] == c) ++n;
21338 return n;
21339}
21340
21341/*
21342 * strip enclosing double-quotes, same as the default yytnamerr except
21343 * for that single-quotes matching back-quotes do not stop stripping.
21344 *
21345 * "\"`class' keyword\"" => "`class' keyword"
21346 */
21347RUBY_FUNC_EXPORTED size_t
21348rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
21349{
21350 if (*yystr == '"') {
21351 size_t yyn = 0, bquote = 0;
21352 const char *yyp = yystr;
21353
21354 while (*++yyp) {
21355 switch (*yyp) {
21356 case '`':
21357 if (!bquote) {
21358 bquote = count_char(yyp+1, '`') + 1;
21359 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
21360 yyn += bquote;
21361 yyp += bquote - 1;
21362 break;
21363 }
21364 goto default_char;
21365
21366 case '\'':
21367 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
21368 if (yyres) memcpy(yyres + yyn, yyp, bquote);
21369 yyn += bquote;
21370 yyp += bquote - 1;
21371 bquote = 0;
21372 break;
21373 }
21374 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
21375 if (yyres) memcpy(yyres + yyn, yyp, 3);
21376 yyn += 3;
21377 yyp += 2;
21378 break;
21379 }
21380 goto do_not_strip_quotes;
21381
21382 case ',':
21383 goto do_not_strip_quotes;
21384
21385 case '\\':
21386 if (*++yyp != '\\')
21387 goto do_not_strip_quotes;
21388 /* Fall through. */
21389 default_char:
21390 default:
21391 if (yyres)
21392 yyres[yyn] = *yyp;
21393 yyn++;
21394 break;
21395
21396 case '"':
21397 case '\0':
21398 if (yyres)
21399 yyres[yyn] = '\0';
21400 return yyn;
21401 }
21402 }
21403 do_not_strip_quotes: ;
21404 }
21405
21406 if (!yyres) return strlen(yystr);
21407
21408 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
21409}
21410#endif
21411
21412#ifdef RIPPER
21413#ifdef RIPPER_DEBUG
21414/* :nodoc: */
21415static VALUE
21416ripper_validate_object(VALUE self, VALUE x)
21417{
21418 if (x == Qfalse) return x;
21419 if (x == Qtrue) return x;
21420 if (x == Qnil) return x;
21421 if (x == Qundef)
21422 rb_raise(rb_eArgError, "Qundef given");
21423 if (FIXNUM_P(x)) return x;
21424 if (SYMBOL_P(x)) return x;
21425 switch (BUILTIN_TYPE(x)) {
21426 case T_STRING:
21427 case T_OBJECT:
21428 case T_ARRAY:
21429 case T_BIGNUM:
21430 case T_FLOAT:
21431 case T_COMPLEX:
21432 case T_RATIONAL:
21433 break;
21434 case T_NODE:
21435 if (!nd_type_p((NODE *)x, NODE_RIPPER)) {
21436 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
21437 }
21438 x = ((NODE *)x)->nd_rval;
21439 break;
21440 default:
21441 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
21442 (void *)x, rb_obj_classname(x));
21443 }
21444 if (!RBASIC_CLASS(x)) {
21445 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
21446 (void *)x, rb_builtin_type_name(TYPE(x)));
21447 }
21448 return x;
21449}
21450#endif
21451
21452#define validate(x) ((x) = get_value(x))
21453
21454static VALUE
21455ripper_dispatch0(struct parser_params *p, ID mid)
21456{
21457 return rb_funcall(p->value, mid, 0);
21458}
21459
21460static VALUE
21461ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
21462{
21463 validate(a);
21464 return rb_funcall(p->value, mid, 1, a);
21465}
21466
21467static VALUE
21468ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
21469{
21470 validate(a);
21471 validate(b);
21472 return rb_funcall(p->value, mid, 2, a, b);
21473}
21474
21475static VALUE
21476ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
21477{
21478 validate(a);
21479 validate(b);
21480 validate(c);
21481 return rb_funcall(p->value, mid, 3, a, b, c);
21482}
21483
21484static VALUE
21485ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
21486{
21487 validate(a);
21488 validate(b);
21489 validate(c);
21490 validate(d);
21491 return rb_funcall(p->value, mid, 4, a, b, c, d);
21492}
21493
21494static VALUE
21495ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
21496{
21497 validate(a);
21498 validate(b);
21499 validate(c);
21500 validate(d);
21501 validate(e);
21502 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
21503}
21504
21505static VALUE
21506ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
21507{
21508 validate(a);
21509 validate(b);
21510 validate(c);
21511 validate(d);
21512 validate(e);
21513 validate(f);
21514 validate(g);
21515 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
21516}
21517
21518static ID
21519ripper_get_id(VALUE v)
21520{
21521 NODE *nd;
21522 if (!RB_TYPE_P(v, T_NODE)) return 0;
21523 nd = (NODE *)v;
21524 if (!nd_type_p(nd, NODE_RIPPER)) return 0;
21525 return nd->nd_vid;
21526}
21527
21528static VALUE
21529ripper_get_value(VALUE v)
21530{
21531 NODE *nd;
21532 if (v == Qundef) return Qnil;
21533 if (!RB_TYPE_P(v, T_NODE)) return v;
21534 nd = (NODE *)v;
21535 if (!nd_type_p(nd, NODE_RIPPER)) return Qnil;
21536 return nd->nd_rval;
21537}
21538
21539static void
21540ripper_error(struct parser_params *p)
21541{
21542 p->error_p = TRUE;
21543}
21544
21545static void
21546ripper_compile_error(struct parser_params *p, const char *fmt, ...)
21547{
21548 VALUE str;
21549 va_list args;
21550
21551 va_start(args, fmt);
21552 str = rb_vsprintf(fmt, args);
21553 va_end(args);
21554 rb_funcall(p->value, rb_intern("compile_error"), 1, str);
21555 ripper_error(p);
21556}
21557
21558static VALUE
21559ripper_lex_get_generic(struct parser_params *p, VALUE src)
21560{
21561 VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
21562 if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
21564 "gets returned %"PRIsVALUE" (expected String or nil)",
21565 rb_obj_class(line));
21566 }
21567 return line;
21568}
21569
21570static VALUE
21571ripper_lex_io_get(struct parser_params *p, VALUE src)
21572{
21573 return rb_io_gets(src);
21574}
21575
21576static VALUE
21577ripper_s_allocate(VALUE klass)
21578{
21579 struct parser_params *p;
21580 VALUE self = TypedData_Make_Struct(klass, struct parser_params,
21581 &parser_data_type, p);
21582 p->value = self;
21583 return self;
21584}
21585
21586#define ripper_initialized_p(r) ((r)->lex.input != 0)
21587
21588/*
21589 * call-seq:
21590 * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
21591 *
21592 * Create a new Ripper object.
21593 * _src_ must be a String, an IO, or an Object which has #gets method.
21594 *
21595 * This method does not starts parsing.
21596 * See also Ripper#parse and Ripper.parse.
21597 */
21598static VALUE
21599ripper_initialize(int argc, VALUE *argv, VALUE self)
21600{
21601 struct parser_params *p;
21602 VALUE src, fname, lineno;
21603
21604 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21605 rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
21606 if (RB_TYPE_P(src, T_FILE)) {
21607 p->lex.gets = ripper_lex_io_get;
21608 }
21609 else if (rb_respond_to(src, id_gets)) {
21610 p->lex.gets = ripper_lex_get_generic;
21611 }
21612 else {
21613 StringValue(src);
21614 p->lex.gets = lex_get_str;
21615 }
21616 p->lex.input = src;
21617 p->eofp = 0;
21618 if (NIL_P(fname)) {
21619 fname = STR_NEW2("(ripper)");
21620 OBJ_FREEZE(fname);
21621 }
21622 else {
21623 StringValueCStr(fname);
21624 fname = rb_str_new_frozen(fname);
21625 }
21626 parser_initialize(p);
21627
21628 p->ruby_sourcefile_string = fname;
21629 p->ruby_sourcefile = RSTRING_PTR(fname);
21630 p->ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
21631
21632 return Qnil;
21633}
21634
21635static VALUE
21636ripper_parse0(VALUE parser_v)
21637{
21638 struct parser_params *p;
21639
21640 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
21641 parser_prepare(p);
21642 p->ast = rb_ast_new();
21643 ripper_yyparse((void*)p);
21644 rb_ast_dispose(p->ast);
21645 p->ast = 0;
21646 return p->result;
21647}
21648
21649static VALUE
21650ripper_ensure(VALUE parser_v)
21651{
21652 struct parser_params *p;
21653
21654 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
21655 p->parsing_thread = Qnil;
21656 return Qnil;
21657}
21658
21659/*
21660 * call-seq:
21661 * ripper.parse
21662 *
21663 * Start parsing and returns the value of the root action.
21664 */
21665static VALUE
21666ripper_parse(VALUE self)
21667{
21668 struct parser_params *p;
21669
21670 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21671 if (!ripper_initialized_p(p)) {
21672 rb_raise(rb_eArgError, "method called for uninitialized object");
21673 }
21674 if (!NIL_P(p->parsing_thread)) {
21675 if (p->parsing_thread == rb_thread_current())
21676 rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
21677 else
21678 rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
21679 }
21680 p->parsing_thread = rb_thread_current();
21681 rb_ensure(ripper_parse0, self, ripper_ensure, self);
21682
21683 return p->result;
21684}
21685
21686/*
21687 * call-seq:
21688 * ripper.column -> Integer
21689 *
21690 * Return column number of current parsing line.
21691 * This number starts from 0.
21692 */
21693static VALUE
21694ripper_column(VALUE self)
21695{
21696 struct parser_params *p;
21697 long col;
21698
21699 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21700 if (!ripper_initialized_p(p)) {
21701 rb_raise(rb_eArgError, "method called for uninitialized object");
21702 }
21703 if (NIL_P(p->parsing_thread)) return Qnil;
21704 col = p->lex.ptok - p->lex.pbeg;
21705 return LONG2NUM(col);
21706}
21707
21708/*
21709 * call-seq:
21710 * ripper.filename -> String
21711 *
21712 * Return current parsing filename.
21713 */
21714static VALUE
21715ripper_filename(VALUE self)
21716{
21717 struct parser_params *p;
21718
21719 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21720 if (!ripper_initialized_p(p)) {
21721 rb_raise(rb_eArgError, "method called for uninitialized object");
21722 }
21723 return p->ruby_sourcefile_string;
21724}
21725
21726/*
21727 * call-seq:
21728 * ripper.lineno -> Integer
21729 *
21730 * Return line number of current parsing line.
21731 * This number starts from 1.
21732 */
21733static VALUE
21734ripper_lineno(VALUE self)
21735{
21736 struct parser_params *p;
21737
21738 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21739 if (!ripper_initialized_p(p)) {
21740 rb_raise(rb_eArgError, "method called for uninitialized object");
21741 }
21742 if (NIL_P(p->parsing_thread)) return Qnil;
21743 return INT2NUM(p->ruby_sourceline);
21744}
21745
21746/*
21747 * call-seq:
21748 * ripper.state -> Integer
21749 *
21750 * Return scanner state of current token.
21751 */
21752static VALUE
21753ripper_state(VALUE self)
21754{
21755 struct parser_params *p;
21756
21757 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21758 if (!ripper_initialized_p(p)) {
21759 rb_raise(rb_eArgError, "method called for uninitialized object");
21760 }
21761 if (NIL_P(p->parsing_thread)) return Qnil;
21762 return INT2NUM(p->lex.state);
21763}
21764
21765/*
21766 * call-seq:
21767 * ripper.token -> String
21768 *
21769 * Return the current token string.
21770 */
21771static VALUE
21772ripper_token(VALUE self)
21773{
21774 struct parser_params *p;
21775 long pos, len;
21776
21777 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21778 if (!ripper_initialized_p(p)) {
21779 rb_raise(rb_eArgError, "method called for uninitialized object");
21780 }
21781 if (NIL_P(p->parsing_thread)) return Qnil;
21782 pos = p->lex.ptok - p->lex.pbeg;
21783 len = p->lex.pcur - p->lex.ptok;
21784 return rb_str_subseq(p->lex.lastline, pos, len);
21785}
21786
21787#ifdef RIPPER_DEBUG
21788/* :nodoc: */
21789static VALUE
21790ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
21791{
21792 StringValue(msg);
21793 if (obj == Qundef) {
21794 rb_raise(rb_eArgError, "%"PRIsVALUE, msg);
21795 }
21796 return Qnil;
21797}
21798
21799/* :nodoc: */
21800static VALUE
21801ripper_value(VALUE self, VALUE obj)
21802{
21803 return ULONG2NUM(obj);
21804}
21805#endif
21806
21807/*
21808 * call-seq:
21809 * Ripper.lex_state_name(integer) -> string
21810 *
21811 * Returns a string representation of lex_state.
21812 */
21813static VALUE
21814ripper_lex_state_name(VALUE self, VALUE state)
21815{
21816 return rb_parser_lex_state_name(NUM2INT(state));
21817}
21818
21819void
21820Init_ripper(void)
21821{
21822 ripper_init_eventids1();
21823 ripper_init_eventids2();
21824 id_warn = rb_intern_const("warn");
21825 id_warning = rb_intern_const("warning");
21826 id_gets = rb_intern_const("gets");
21827 id_assoc = rb_intern_const("=>");
21828
21829 (void)yystpcpy; /* may not used in newer bison */
21830
21831 InitVM(ripper);
21832}
21833
21834void
21835InitVM_ripper(void)
21836{
21837 VALUE Ripper;
21838
21839 Ripper = rb_define_class("Ripper", rb_cObject);
21840 /* version of Ripper */
21841 rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
21842 rb_define_alloc_func(Ripper, ripper_s_allocate);
21843 rb_define_method(Ripper, "initialize", ripper_initialize, -1);
21844 rb_define_method(Ripper, "parse", ripper_parse, 0);
21845 rb_define_method(Ripper, "column", ripper_column, 0);
21846 rb_define_method(Ripper, "filename", ripper_filename, 0);
21847 rb_define_method(Ripper, "lineno", ripper_lineno, 0);
21848 rb_define_method(Ripper, "state", ripper_state, 0);
21849 rb_define_method(Ripper, "token", ripper_token, 0);
21850 rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
21851 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
21852 rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
21853 rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
21854 rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0);
21855 rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1);
21856 rb_define_method(Ripper, "error?", ripper_error_p, 0);
21857#ifdef RIPPER_DEBUG
21858 rb_define_method(Ripper, "assert_Qundef", ripper_assert_Qundef, 2);
21859 rb_define_method(Ripper, "rawVALUE", ripper_value, 1);
21860 rb_define_method(Ripper, "validate_object", ripper_validate_object, 1);
21861#endif
21862
21863 rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
21864 rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
21865
21866 rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
21867
21868<% @exprs.each do |expr, desc| -%>
21869 /* <%=desc%> */
21870 rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
21871<% end %>
21872 ripper_init_eventids1_table(Ripper);
21873 ripper_init_eventids2_table(Ripper);
21874
21875# if 0
21876 /* Hack to let RDoc document SCRIPT_LINES__ */
21877
21878 /*
21879 * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
21880 * after the assignment will be added as an Array of lines with the file
21881 * name as the key.
21882 */
21883 rb_define_global_const("SCRIPT_LINES__", Qnil);
21884#endif
21885
21886}
21887#endif /* RIPPER */
21888
21889/*
21890 * Local variables:
21891 * mode: c
21892 * c-file-style: "ruby"
21893 * End:
21894 */
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
static bool rb_enc_isspace(OnigCodePoint c, rb_encoding *enc)
Identical to rb_isspace(), except it additionally takes an encoding.
Definition ctype.h:180
static bool rb_enc_isalnum(OnigCodePoint c, rb_encoding *enc)
Identical to rb_isalnum(), except it additionally takes an encoding.
Definition ctype.h:152
static bool RB_OBJ_FROZEN(VALUE obj)
Checks if an object is frozen.
Definition fl_type.h:927
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
Definition class.c:837
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
Retrieves argument from argc and argv to given VALUE references according to the format string.
Definition class.c:2406
#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:31
#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:29
#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:1744
#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 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:3025
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:360
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
Definition eval.c:675
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
Definition eval.c:1764
#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:1099
void rb_fatal(const char *fmt,...)
Raises the unsung "fatal" exception.
Definition error.c:3076
VALUE rb_eRuntimeError
RuntimeError exception.
Definition error.c:1097
VALUE rb_eArgError
ArgumentError exception.
Definition error.c:1100
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:375
VALUE rb_errinfo(void)
This is the same as $! in Ruby.
Definition eval.c:1758
VALUE rb_eSyntaxError
SyntaxError exception.
Definition error.c:1116
@ RB_WARN_CATEGORY_EXPERIMENTAL
Warning is for experimental features.
Definition error.h:51
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates, then initialises an instance of the given class.
Definition object.c:1950
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
Definition object.c:82
VALUE rb_obj_class(VALUE obj)
Queries the class of an object.
Definition object.c:188
VALUE rb_obj_freeze(VALUE obj)
Just calls rb_obj_freeze_inline() inside.
Definition object.c:1161
#define RB_OBJ_WRITTEN(old, oldv, young)
Identical to RB_OBJ_WRITE(), except it doesn't write any values, but only a WB declaration.
Definition rgengc.h:232
#define RB_OBJ_WRITE(old, slot, young)
Declaration of a "back" pointer.
Definition rgengc.h:220
Encoding relates APIs.
static const char * rb_enc_name(rb_encoding *enc)
Queries the (canonical) name of the passed encoding.
Definition encoding.h:433
static char * rb_enc_prev_char(const char *s, const char *p, const char *e, rb_encoding *enc)
Queries the previous (left) character.
Definition encoding.h:676
static bool rb_enc_asciicompat(rb_encoding *enc)
Queries if the passed encoding is in some sense compatible with ASCII.
Definition encoding.h:782
static int rb_enc_mbcput(unsigned int c, void *buf, rb_encoding *enc)
Identical to rb_enc_uint_chr(), except it writes back to the passed buffer instead of allocating one.
Definition encoding.h:657
int rb_char_to_option_kcode(int c, int *option, int *kcode)
Converts a character option to its encoding.
Definition re.c:329
int rb_enc_str_coderange(VALUE str)
Scans the passed string to collect its code range.
Definition string.c:776
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:3271
VALUE rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
Identical to rb_enc_str_new(), except it additionally takes an encoding.
Definition string.c:940
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:668
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
Definition vm_eval.c:1102
VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv)
Identical to rb_funcallv(), except it only takes public methods into account.
Definition vm_eval.c:1153
VALUE rb_io_gets(VALUE io)
Reads a "line" from the given IO.
Definition io.c:3955
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:8208
VALUE rb_io_write(VALUE io, VALUE str)
Writes the given string to the given IO.
Definition io.c:2063
VALUE rb_io_flush(VALUE io)
Flushes any buffered data within the passed IO to the underlying operating system.
Definition io.c:2162
VALUE rb_default_rs
This is the default value of rb_rs, i.e.
Definition io.c:204
VALUE rb_int_positive_pow(long x, unsigned long y)
Raises the passed x to the power of y.
Definition numeric.c:4496
ID rb_id_attrset(ID id)
Calculates an ID of attribute writer.
Definition symbol.c:113
VALUE rb_rational_new(VALUE num, VALUE den)
Constructs a Rational, with reduction.
Definition rational.c:1963
#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:88
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:3317
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:2821
#define rb_str_new(str, len)
Allocates an instance of rb_cString.
Definition string.h:1545
#define rb_str_buf_cat
Just another name of rb_str_cat.
Definition string.h:1745
#define rb_usascii_str_new(str, len)
Identical to rb_str_new, except it generates a string of "US ASCII" encoding.
Definition string.h:1579
VALUE rb_str_new_frozen(VALUE str)
Creates a frozen copy of the string, if necessary.
Definition string.c:1356
VALUE rb_str_dup(VALUE str)
Duplicates a string.
Definition string.c:1808
void rb_str_modify(VALUE str)
Declares that the string is about to be modified.
Definition string.c:2459
VALUE rb_str_cat(VALUE dst, const char *src, long srclen)
Destructively appends the passed contents to the string.
Definition string.c:3161
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:1269
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:3302
void rb_str_set_len(VALUE str, long len)
Overwrites the length of the string.
Definition string.c:3039
#define rb_strlen_lit(str)
Length of a string literal.
Definition string.h:1756
#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:1719
VALUE rb_str_resize(VALUE str, long len)
Overwrites the length of the string.
Definition string.c:3056
VALUE rb_str_buf_new(long capa)
Allocates a "string buffer".
Definition string.c:1506
#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:1561
VALUE rb_str_intern(VALUE str)
Identical to rb_to_symbol(), except it assumes the receiver being an instance of RString.
Definition symbol.c:837
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:1657
VALUE rb_thread_current(void)
Obtains the "current" thread.
Definition thread.c:2904
VALUE rb_attr_get(VALUE obj, ID name)
Identical to rb_ivar_get()
Definition variable.c:1293
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:2739
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:3043
int rb_respond_to(VALUE obj, ID mid)
Queries if the object responds to the method.
Definition vm_method.c:2765
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:775
static ID rb_intern_const(const char *str)
This is a "tiny optimisation" over rb_intern().
Definition symbol.h:276
ID rb_intern(const char *name)
Finds or creates a symbol of the given name.
Definition symbol.c:782
const char * rb_id2name(ID id)
Retrieves the name mapped to the given id.
Definition symbol.c:941
ID rb_intern_str(VALUE str)
Identical to rb_intern(), except it takes an instance of rb_cString.
Definition symbol.c:788
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:3265
void rb_define_const(VALUE klass, const char *name, VALUE val)
Defines a Ruby level constant under a namespace.
Definition variable.c:3253
#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:1201
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:1214
VALUE rb_vsprintf(const char *fmt, va_list ap)
Identical to rb_sprintf(), except it takes a va_list.
Definition sprintf.c:1195
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:1241
#define rb_long2int
Just another name of rb_long2int_inline.
Definition long.h:62
#define MEMCPY(p1, p2, type, n)
Handy macro to call memcpy.
Definition memory.h:366
#define ALLOCA_N(type, n)
Definition memory.h:286
#define RB_GC_GUARD(v)
Prevents premature destruction of local objects.
Definition memory.h:161
#define MEMMOVE(p1, p2, type, n)
Handy macro to call memmove.
Definition memory.h:378
VALUE type(ANYARGS)
ANYARGS-ed function type.
VALUE rb_ensure(type *q, VALUE w, type *e, VALUE r)
An equivalent of ensure clause.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
VALUE rb_ractor_stderr(void)
Queries the standard error of the current Ractor that is calling this function.
Definition ractor.c:2146
VALUE rb_ractor_stdout(void)
Queries the standard output of the current Ractor that is calling this function.
Definition ractor.c:2134
VALUE rb_ractor_make_shareable(VALUE obj)
Destructively transforms the passed object so that multiple Ractors can share it.
Definition ractor.c:2497
#define RARRAY_LEN
Just another name of rb_array_len.
Definition rarray.h:68
#define RARRAY_AREF(a, i)
Definition rarray.h:588
static VALUE RBASIC_CLASS(VALUE obj)
Queries the class of an object.
Definition rbasic.h:152
#define RBASIC(obj)
Convenient casting macro.
Definition rbasic.h:40
#define RREGEXP_PTR(obj)
Convenient accessor macro.
Definition rregexp.h:45
#define StringValue(v)
Ensures that the parameter object is a String.
Definition rstring.h:72
static char * RSTRING_END(VALUE str)
Queries the end of the contents pointer of the string.
Definition rstring.h:527
#define RSTRING_GETMEM(str, ptrvar, lenvar)
Convenient macro to obtain the contents and length at once.
Definition rstring.h:573
static long RSTRING_LEN(VALUE str)
Queries the length of the string.
Definition rstring.h:483
static char * RSTRING_PTR(VALUE str)
Queries the contents pointer of the string.
Definition rstring.h:497
#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:309
#define InitVM(ext)
This macro is for internal use.
Definition ruby.h:229
#define RTEST
This is an old name of RB_TEST.
Definition node.h:155
Definition lex.c:34
This is the struct that holds necessary info for a struct.
Definition rtypeddata.h:190
Definition st.h:79
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
#define SIZEOF_VALUE
Identical to sizeof(VALUE), except it is a macro that can also be used inside of preprocessor directi...
Definition value.h:69
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40
static bool RB_TYPE_P(VALUE obj, enum ruby_value_type t)
Queries if the given object is of given type.
Definition value_type.h:375