Ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498)
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
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
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*/
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 */
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
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) {
14193 mesg = rb_class_new_instance(0, 0, rb_eSyntaxError);
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#ifndef RIPPER
14284 if (p->debug_lines) {
14285 rb_enc_associate(line, p->enc);
14286 rb_ary_push(p->debug_lines, line);
14287 }
14288#endif
14289 p->line_count++;
14290 return line;
14291}
14292
14293static const rb_data_type_t parser_data_type;
14294
14295#ifndef RIPPER
14296static rb_ast_t*
14297parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
14298{
14299 struct parser_params *p;
14300
14301 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14302
14303 p->lex.gets = lex_get_str;
14304 p->lex.gets_.ptr = 0;
14305 p->lex.input = rb_str_new_frozen(s);
14306 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14307
14308 return yycompile(vparser, p, fname, line);
14309}
14310
14311rb_ast_t*
14312rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
14313{
14314 return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);
14315}
14316
14317rb_ast_t*
14318rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
14319{
14320 must_be_ascii_compatible(s);
14321 return parser_compile_string(vparser, f, s, line);
14322}
14323
14324VALUE rb_io_gets_internal(VALUE io);
14325
14326static VALUE
14327lex_io_gets(struct parser_params *p, VALUE io)
14328{
14329 return rb_io_gets_internal(io);
14330}
14331
14332rb_ast_t*
14333rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
14334{
14335 struct parser_params *p;
14336
14337 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14338
14339 p->lex.gets = lex_io_gets;
14340 p->lex.input = file;
14341 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14342
14343 return yycompile(vparser, p, fname, start);
14344}
14345
14346static VALUE
14347lex_generic_gets(struct parser_params *p, VALUE input)
14348{
14349 return (*p->lex.gets_.call)(input, p->line_count);
14350}
14351
14352rb_ast_t*
14353rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
14354{
14355 struct parser_params *p;
14356
14357 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14358
14359 p->lex.gets = lex_generic_gets;
14360 p->lex.gets_.call = lex_gets;
14361 p->lex.input = input;
14362 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14363
14364 return yycompile(vparser, p, fname, start);
14365}
14366#endif /* !RIPPER */
14367
14368#define STR_FUNC_ESCAPE 0x01
14369#define STR_FUNC_EXPAND 0x02
14370#define STR_FUNC_REGEXP 0x04
14371#define STR_FUNC_QWORDS 0x08
14372#define STR_FUNC_SYMBOL 0x10
14373#define STR_FUNC_INDENT 0x20
14374#define STR_FUNC_LABEL 0x40
14375#define STR_FUNC_LIST 0x4000
14376#define STR_FUNC_TERM 0x8000
14377
14378enum string_type {
14379 str_label = STR_FUNC_LABEL,
14380 str_squote = (0),
14381 str_dquote = (STR_FUNC_EXPAND),
14382 str_xquote = (STR_FUNC_EXPAND),
14383 str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
14384 str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
14385 str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
14386 str_ssym = (STR_FUNC_SYMBOL),
14387 str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
14388};
14389
14390static VALUE
14391parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
14392{
14393 VALUE str;
14394
14395 str = rb_enc_str_new(ptr, len, enc);
14396 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
14398 }
14399 else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) {
14401 }
14402 }
14403
14404 return str;
14405}
14406
14407#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
14408#define lex_eol_p(p) ((p)->lex.pcur >= (p)->lex.pend)
14409#define lex_eol_n_p(p,n) ((p)->lex.pcur+(n) >= (p)->lex.pend)
14410#define peek(p,c) peek_n(p, (c), 0)
14411#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
14412#define peekc(p) peekc_n(p, 0)
14413#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
14414
14415#ifdef RIPPER
14416static void
14417add_delayed_token(struct parser_params *p, const char *tok, const char *end)
14418{
14419 if (tok < end) {
14420 if (!has_delayed_token(p)) {
14421 p->delayed.token = rb_str_buf_new(end - tok);
14422 rb_enc_associate(p->delayed.token, p->enc);
14423 p->delayed.line = p->ruby_sourceline;
14424 p->delayed.col = rb_long2int(tok - p->lex.pbeg);
14425 }
14426 rb_str_buf_cat(p->delayed.token, tok, end - tok);
14427 p->lex.ptok = end;
14428 }
14429}
14430#else
14431#define add_delayed_token(p, tok, end) ((void)(tok), (void)(end))
14432#endif
14433
14434static int
14435nextline(struct parser_params *p)
14436{
14437 VALUE v = p->lex.nextline;
14438 p->lex.nextline = 0;
14439 if (!v) {
14440 if (p->eofp)
14441 return -1;
14442
14443 if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
14444 goto end_of_input;
14445 }
14446
14447 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
14448 end_of_input:
14449 p->eofp = 1;
14450 lex_goto_eol(p);
14451 return -1;
14452 }
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
14484nextc(struct parser_params *p)
14485{
14486 int c;
14487
14488 if (UNLIKELY((p->lex.pcur == p->lex.pend) || p->eofp || RTEST(p->lex.nextline))) {
14489 if (nextline(p)) 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
14499static void
14500pushback(struct parser_params *p, int c)
14501{
14502 if (c == -1) return;
14503 p->lex.pcur--;
14504 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
14505 p->lex.pcur--;
14506 }
14507}
14508
14509#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
14510
14511#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
14512#define tok(p) (p)->tokenbuf
14513#define toklen(p) (p)->tokidx
14514
14515static int
14516looking_at_eol_p(struct parser_params *p)
14517{
14518 const char *ptr = p->lex.pcur;
14519 while (ptr < p->lex.pend) {
14520 int c = (unsigned char)*ptr++;
14521 int eol = (c == '\n' || c == '#');
14522 if (eol || !ISSPACE(c)) {
14523 return eol;
14524 }
14525 }
14526 return TRUE;
14527}
14528
14529static char*
14530newtok(struct parser_params *p)
14531{
14532 p->tokidx = 0;
14533 p->tokline = p->ruby_sourceline;
14534 if (!p->tokenbuf) {
14535 p->toksiz = 60;
14536 p->tokenbuf = ALLOC_N(char, 60);
14537 }
14538 if (p->toksiz > 4096) {
14539 p->toksiz = 60;
14540 REALLOC_N(p->tokenbuf, char, 60);
14541 }
14542 return p->tokenbuf;
14543}
14544
14545static char *
14546tokspace(struct parser_params *p, int n)
14547{
14548 p->tokidx += n;
14549
14550 if (p->tokidx >= p->toksiz) {
14551 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
14552 REALLOC_N(p->tokenbuf, char, p->toksiz);
14553 }
14554 return &p->tokenbuf[p->tokidx-n];
14555}
14556
14557static void
14558tokadd(struct parser_params *p, int c)
14559{
14560 p->tokenbuf[p->tokidx++] = (char)c;
14561 if (p->tokidx >= p->toksiz) {
14562 p->toksiz *= 2;
14563 REALLOC_N(p->tokenbuf, char, p->toksiz);
14564 }
14565}
14566
14567static int
14568tok_hex(struct parser_params *p, size_t *numlen)
14569{
14570 int c;
14571
14572 c = scan_hex(p->lex.pcur, 2, numlen);
14573 if (!*numlen) {
14574 yyerror0("invalid hex escape");
14575 token_flush(p);
14576 return 0;
14577 }
14578 p->lex.pcur += *numlen;
14579 return c;
14580}
14581
14582#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
14583
14584static int
14585escaped_control_code(int c)
14586{
14587 int c2 = 0;
14588 switch (c) {
14589 case ' ':
14590 c2 = 's';
14591 break;
14592 case '\n':
14593 c2 = 'n';
14594 break;
14595 case '\t':
14596 c2 = 't';
14597 break;
14598 case '\v':
14599 c2 = 'v';
14600 break;
14601 case '\r':
14602 c2 = 'r';
14603 break;
14604 case '\f':
14605 c2 = 'f';
14606 break;
14607 }
14608 return c2;
14609}
14610
14611#define WARN_SPACE_CHAR(c, prefix) \
14612 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
14613
14614static int
14615tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
14616 int regexp_literal, int wide)
14617{
14618 size_t numlen;
14619 int codepoint = scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
14620 literal_flush(p, p->lex.pcur);
14621 p->lex.pcur += numlen;
14622 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
14623 yyerror0("invalid Unicode escape");
14624 return wide && numlen > 0;
14625 }
14626 if (codepoint > 0x10ffff) {
14627 yyerror0("invalid Unicode codepoint (too large)");
14628 return wide;
14629 }
14630 if ((codepoint & 0xfffff800) == 0xd800) {
14631 yyerror0("invalid Unicode codepoint");
14632 return wide;
14633 }
14634 if (regexp_literal) {
14635 tokcopy(p, (int)numlen);
14636 }
14637 else if (codepoint >= 0x80) {
14638 rb_encoding *utf8 = rb_utf8_encoding();
14639 if (*encp && utf8 != *encp) {
14640 YYLTYPE loc = RUBY_INIT_YYLLOC();
14641 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
14642 parser_show_error_line(p, &loc);
14643 return wide;
14644 }
14645 *encp = utf8;
14646 tokaddmbc(p, codepoint, *encp);
14647 }
14648 else {
14649 tokadd(p, codepoint);
14650 }
14651 return TRUE;
14652}
14653
14654/* return value is for ?\u3042 */
14655static void
14656tokadd_utf8(struct parser_params *p, rb_encoding **encp,
14657 int term, int symbol_literal, int regexp_literal)
14658{
14659 /*
14660 * If `term` is not -1, then we allow multiple codepoints in \u{}
14661 * upto `term` byte, otherwise we're parsing a character literal.
14662 * And then add the codepoints to the current token.
14663 */
14664 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
14665
14666 const int open_brace = '{', close_brace = '}';
14667
14668 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
14669
14670 if (peek(p, open_brace)) { /* handle \u{...} form */
14671 const char *second = NULL;
14672 int c, last = nextc(p);
14673 if (p->lex.pcur >= p->lex.pend) goto unterminated;
14674 while (ISSPACE(c = *p->lex.pcur) && ++p->lex.pcur < p->lex.pend);
14675 while (c != close_brace) {
14676 if (c == term) goto unterminated;
14677 if (second == multiple_codepoints)
14678 second = p->lex.pcur;
14679 if (regexp_literal) tokadd(p, last);
14680 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
14681 break;
14682 }
14683 while (ISSPACE(c = *p->lex.pcur)) {
14684 if (++p->lex.pcur >= p->lex.pend) goto unterminated;
14685 last = c;
14686 }
14687 if (term == -1 && !second)
14688 second = multiple_codepoints;
14689 }
14690
14691 if (c != close_brace) {
14692 unterminated:
14693 token_flush(p);
14694 yyerror0("unterminated Unicode escape");
14695 return;
14696 }
14697 if (second && second != multiple_codepoints) {
14698 const char *pcur = p->lex.pcur;
14699 p->lex.pcur = second;
14700 dispatch_scan_event(p, tSTRING_CONTENT);
14701 token_flush(p);
14702 p->lex.pcur = pcur;
14703 yyerror0(multiple_codepoints);
14704 token_flush(p);
14705 }
14706
14707 if (regexp_literal) tokadd(p, close_brace);
14708 nextc(p);
14709 }
14710 else { /* handle \uxxxx form */
14711 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
14712 token_flush(p);
14713 return;
14714 }
14715 }
14716}
14717
14718#define ESCAPE_CONTROL 1
14719#define ESCAPE_META 2
14720
14721static int
14722read_escape(struct parser_params *p, int flags, rb_encoding **encp)
14723{
14724 int c;
14725 size_t numlen;
14726
14727 switch (c = nextc(p)) {
14728 case '\\': /* Backslash */
14729 return c;
14730
14731 case 'n': /* newline */
14732 return '\n';
14733
14734 case 't': /* horizontal tab */
14735 return '\t';
14736
14737 case 'r': /* carriage-return */
14738 return '\r';
14739
14740 case 'f': /* form-feed */
14741 return '\f';
14742
14743 case 'v': /* vertical tab */
14744 return '\13';
14745
14746 case 'a': /* alarm(bell) */
14747 return '\007';
14748
14749 case 'e': /* escape */
14750 return 033;
14751
14752 case '0': case '1': case '2': case '3': /* octal constant */
14753 case '4': case '5': case '6': case '7':
14754 pushback(p, c);
14755 c = scan_oct(p->lex.pcur, 3, &numlen);
14756 p->lex.pcur += numlen;
14757 return c;
14758
14759 case 'x': /* hex constant */
14760 c = tok_hex(p, &numlen);
14761 if (numlen == 0) return 0;
14762 return c;
14763
14764 case 'b': /* backspace */
14765 return '\010';
14766
14767 case 's': /* space */
14768 return ' ';
14769
14770 case 'M':
14771 if (flags & ESCAPE_META) goto eof;
14772 if ((c = nextc(p)) != '-') {
14773 goto eof;
14774 }
14775 if ((c = nextc(p)) == '\\') {
14776 switch (peekc(p)) {
14777 case 'u': case 'U':
14778 nextc(p);
14779 goto eof;
14780 }
14781 return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
14782 }
14783 else if (c == -1 || !ISASCII(c)) goto eof;
14784 else {
14785 int c2 = escaped_control_code(c);
14786 if (c2) {
14787 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
14788 WARN_SPACE_CHAR(c2, "\\M-");
14789 }
14790 else {
14791 WARN_SPACE_CHAR(c2, "\\C-\\M-");
14792 }
14793 }
14794 else if (ISCNTRL(c)) goto eof;
14795 return ((c & 0xff) | 0x80);
14796 }
14797
14798 case 'C':
14799 if ((c = nextc(p)) != '-') {
14800 goto eof;
14801 }
14802 case 'c':
14803 if (flags & ESCAPE_CONTROL) goto eof;
14804 if ((c = nextc(p))== '\\') {
14805 switch (peekc(p)) {
14806 case 'u': case 'U':
14807 nextc(p);
14808 goto eof;
14809 }
14810 c = read_escape(p, flags|ESCAPE_CONTROL, encp);
14811 }
14812 else if (c == '?')
14813 return 0177;
14814 else if (c == -1 || !ISASCII(c)) goto eof;
14815 else {
14816 int c2 = escaped_control_code(c);
14817 if (c2) {
14818 if (ISCNTRL(c)) {
14819 if (flags & ESCAPE_META) {
14820 WARN_SPACE_CHAR(c2, "\\M-");
14821 }
14822 else {
14823 WARN_SPACE_CHAR(c2, "");
14824 }
14825 }
14826 else {
14827 if (flags & ESCAPE_META) {
14828 WARN_SPACE_CHAR(c2, "\\M-\\C-");
14829 }
14830 else {
14831 WARN_SPACE_CHAR(c2, "\\C-");
14832 }
14833 }
14834 }
14835 else if (ISCNTRL(c)) goto eof;
14836 }
14837 return c & 0x9f;
14838
14839 eof:
14840 case -1:
14841 yyerror0("Invalid escape character syntax");
14842 token_flush(p);
14843 return '\0';
14844
14845 default:
14846 return c;
14847 }
14848}
14849
14850static void
14851tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
14852{
14853 int len = rb_enc_codelen(c, enc);
14854 rb_enc_mbcput(c, tokspace(p, len), enc);
14855}
14856
14857static int
14858tokadd_escape(struct parser_params *p, rb_encoding **encp)
14859{
14860 int c;
14861 size_t numlen;
14862
14863 switch (c = nextc(p)) {
14864 case '\n':
14865 return 0; /* just ignore */
14866
14867 case '0': case '1': case '2': case '3': /* octal constant */
14868 case '4': case '5': case '6': case '7':
14869 {
14870 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
14871 if (numlen == 0) goto eof;
14872 p->lex.pcur += numlen;
14873 tokcopy(p, (int)numlen + 1);
14874 }
14875 return 0;
14876
14877 case 'x': /* hex constant */
14878 {
14879 tok_hex(p, &numlen);
14880 if (numlen == 0) return -1;
14881 tokcopy(p, (int)numlen + 2);
14882 }
14883 return 0;
14884
14885 eof:
14886 case -1:
14887 yyerror0("Invalid escape character syntax");
14888 token_flush(p);
14889 return -1;
14890
14891 default:
14892 tokadd(p, '\\');
14893 tokadd(p, c);
14894 }
14895 return 0;
14896}
14897
14898static int
14899regx_options(struct parser_params *p)
14900{
14901 int kcode = 0;
14902 int kopt = 0;
14903 int options = 0;
14904 int c, opt, kc;
14905
14906 newtok(p);
14907 while (c = nextc(p), ISALPHA(c)) {
14908 if (c == 'o') {
14909 options |= RE_OPTION_ONCE;
14910 }
14911 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
14912 if (kc >= 0) {
14913 if (kc != rb_ascii8bit_encindex()) kcode = c;
14914 kopt = opt;
14915 }
14916 else {
14917 options |= opt;
14918 }
14919 }
14920 else {
14921 tokadd(p, c);
14922 }
14923 }
14924 options |= kopt;
14925 pushback(p, c);
14926 if (toklen(p)) {
14927 YYLTYPE loc = RUBY_INIT_YYLLOC();
14928 tokfix(p);
14929 compile_error(p, "unknown regexp option%s - %*s",
14930 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
14931 parser_show_error_line(p, &loc);
14932 }
14933 return options | RE_OPTION_ENCODING(kcode);
14934}
14935
14936static int
14937tokadd_mbchar(struct parser_params *p, int c)
14938{
14939 int len = parser_precise_mbclen(p, p->lex.pcur-1);
14940 if (len < 0) return -1;
14941 tokadd(p, c);
14942 p->lex.pcur += --len;
14943 if (len > 0) tokcopy(p, len);
14944 return c;
14945}
14946
14947static inline int
14948simple_re_meta(int c)
14949{
14950 switch (c) {
14951 case '$': case '*': case '+': case '.':
14952 case '?': case '^': case '|':
14953 case ')': case ']': case '}': case '>':
14954 return TRUE;
14955 default:
14956 return FALSE;
14957 }
14958}
14959
14960static int
14961parser_update_heredoc_indent(struct parser_params *p, int c)
14962{
14963 if (p->heredoc_line_indent == -1) {
14964 if (c == '\n') p->heredoc_line_indent = 0;
14965 }
14966 else {
14967 if (c == ' ') {
14968 p->heredoc_line_indent++;
14969 return TRUE;
14970 }
14971 else if (c == '\t') {
14972 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
14973 p->heredoc_line_indent = w * TAB_WIDTH;
14974 return TRUE;
14975 }
14976 else if (c != '\n') {
14977 if (p->heredoc_indent > p->heredoc_line_indent) {
14978 p->heredoc_indent = p->heredoc_line_indent;
14979 }
14980 p->heredoc_line_indent = -1;
14981 }
14982 }
14983 return FALSE;
14984}
14985
14986static void
14987parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
14988{
14989 YYLTYPE loc = RUBY_INIT_YYLLOC();
14990 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
14991 compile_error(p, "%s mixed within %s source", n1, n2);
14992 parser_show_error_line(p, &loc);
14993}
14994
14995static void
14996parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
14997{
14998 const char *pos = p->lex.pcur;
14999 p->lex.pcur = beg;
15000 parser_mixed_error(p, enc1, enc2);
15001 p->lex.pcur = pos;
15002}
15003
15004static int
15005tokadd_string(struct parser_params *p,
15006 int func, int term, int paren, long *nest,
15007 rb_encoding **encp, rb_encoding **enc)
15008{
15009 int c;
15010 bool erred = false;
15011
15012#define mixed_error(enc1, enc2) \
15013 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
15014#define mixed_escape(beg, enc1, enc2) \
15015 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
15016
15017 while ((c = nextc(p)) != -1) {
15018 if (p->heredoc_indent > 0) {
15019 parser_update_heredoc_indent(p, c);
15020 }
15021
15022 if (paren && c == paren) {
15023 ++*nest;
15024 }
15025 else if (c == term) {
15026 if (!nest || !*nest) {
15027 pushback(p, c);
15028 break;
15029 }
15030 --*nest;
15031 }
15032 else if ((func & STR_FUNC_EXPAND) && c == '#' && p->lex.pcur < p->lex.pend) {
15033 int c2 = *p->lex.pcur;
15034 if (c2 == '$' || c2 == '@' || c2 == '{') {
15035 pushback(p, c);
15036 break;
15037 }
15038 }
15039 else if (c == '\\') {
15040 literal_flush(p, p->lex.pcur - 1);
15041 c = nextc(p);
15042 switch (c) {
15043 case '\n':
15044 if (func & STR_FUNC_QWORDS) break;
15045 if (func & STR_FUNC_EXPAND) {
15046 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
15047 continue;
15048 if (c == term) {
15049 c = '\\';
15050 goto terminate;
15051 }
15052 }
15053 tokadd(p, '\\');
15054 break;
15055
15056 case '\\':
15057 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
15058 break;
15059
15060 case 'u':
15061 if ((func & STR_FUNC_EXPAND) == 0) {
15062 tokadd(p, '\\');
15063 break;
15064 }
15065 tokadd_utf8(p, enc, term,
15066 func & STR_FUNC_SYMBOL,
15067 func & STR_FUNC_REGEXP);
15068 continue;
15069
15070 default:
15071 if (c == -1) return -1;
15072 if (!ISASCII(c)) {
15073 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
15074 goto non_ascii;
15075 }
15076 if (func & STR_FUNC_REGEXP) {
15077 switch (c) {
15078 case 'c':
15079 case 'C':
15080 case 'M': {
15081 pushback(p, c);
15082 c = read_escape(p, 0, enc);
15083
15084 int i;
15085 char escbuf[5];
15086 snprintf(escbuf, sizeof(escbuf), "\\x%02X", c);
15087 for (i = 0; i < 4; i++) {
15088 tokadd(p, escbuf[i]);
15089 }
15090 continue;
15091 }
15092 }
15093
15094 if (c == term && !simple_re_meta(c)) {
15095 tokadd(p, c);
15096 continue;
15097 }
15098 pushback(p, c);
15099 if ((c = tokadd_escape(p, enc)) < 0)
15100 return -1;
15101 if (*enc && *enc != *encp) {
15102 mixed_escape(p->lex.ptok+2, *enc, *encp);
15103 }
15104 continue;
15105 }
15106 else if (func & STR_FUNC_EXPAND) {
15107 pushback(p, c);
15108 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
15109 c = read_escape(p, 0, enc);
15110 }
15111 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
15112 /* ignore backslashed spaces in %w */
15113 }
15114 else if (c != term && !(paren && c == paren)) {
15115 tokadd(p, '\\');
15116 pushback(p, c);
15117 continue;
15118 }
15119 }
15120 }
15121 else if (!parser_isascii(p)) {
15122 non_ascii:
15123 if (!*enc) {
15124 *enc = *encp;
15125 }
15126 else if (*enc != *encp) {
15127 mixed_error(*enc, *encp);
15128 continue;
15129 }
15130 if (tokadd_mbchar(p, c) == -1) return -1;
15131 continue;
15132 }
15133 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
15134 pushback(p, c);
15135 break;
15136 }
15137 if (c & 0x80) {
15138 if (!*enc) {
15139 *enc = *encp;
15140 }
15141 else if (*enc != *encp) {
15142 mixed_error(*enc, *encp);
15143 continue;
15144 }
15145 }
15146 tokadd(p, c);
15147 }
15148 terminate:
15149 if (*enc) *encp = *enc;
15150 return c;
15151}
15152
15153static inline rb_strterm_t *
15154new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
15155{
15156 return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
15157}
15158
15159/* imemo_parser_strterm for literal */
15160#define NEW_STRTERM(func, term, paren) \
15161 new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
15162
15163#ifdef RIPPER
15164static void
15165flush_string_content(struct parser_params *p, rb_encoding *enc)
15166{
15167 VALUE content = yylval.val;
15168 if (!ripper_is_node_yylval(content))
15169 content = ripper_new_yylval(p, 0, 0, content);
15170 if (has_delayed_token(p)) {
15171 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
15172 if (len > 0) {
15173 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
15174 }
15175 dispatch_delayed_token(p, tSTRING_CONTENT);
15176 p->lex.ptok = p->lex.pcur;
15177 RNODE(content)->nd_rval = yylval.val;
15178 }
15179 dispatch_scan_event(p, tSTRING_CONTENT);
15180 if (yylval.val != content)
15181 RNODE(content)->nd_rval = yylval.val;
15182 yylval.val = content;
15183}
15184#else
15185#define flush_string_content(p, enc) ((void)(enc))
15186#endif
15187
15188RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
15189/* this can be shared with ripper, since it's independent from struct
15190 * parser_params. */
15191#ifndef RIPPER
15192#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
15193#define SPECIAL_PUNCT(idx) ( \
15194 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', 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('0', idx))
15200const unsigned int ruby_global_name_punct_bits[] = {
15201 SPECIAL_PUNCT(0),
15202 SPECIAL_PUNCT(1),
15203 SPECIAL_PUNCT(2),
15204};
15205#undef BIT
15206#undef SPECIAL_PUNCT
15207#endif
15208
15209static enum yytokentype
15210parser_peek_variable_name(struct parser_params *p)
15211{
15212 int c;
15213 const char *ptr = p->lex.pcur;
15214
15215 if (ptr + 1 >= p->lex.pend) return 0;
15216 c = *ptr++;
15217 switch (c) {
15218 case '$':
15219 if ((c = *ptr) == '-') {
15220 if (++ptr >= p->lex.pend) return 0;
15221 c = *ptr;
15222 }
15223 else if (is_global_name_punct(c) || ISDIGIT(c)) {
15224 return tSTRING_DVAR;
15225 }
15226 break;
15227 case '@':
15228 if ((c = *ptr) == '@') {
15229 if (++ptr >= p->lex.pend) return 0;
15230 c = *ptr;
15231 }
15232 break;
15233 case '{':
15234 p->lex.pcur = ptr;
15235 p->command_start = TRUE;
15236 return tSTRING_DBEG;
15237 default:
15238 return 0;
15239 }
15240 if (!ISASCII(c) || c == '_' || ISALPHA(c))
15241 return tSTRING_DVAR;
15242 return 0;
15243}
15244
15245#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
15246#define IS_END() IS_lex_state(EXPR_END_ANY)
15247#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
15248#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
15249#define IS_LABEL_POSSIBLE() (\
15250 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
15251 IS_ARG())
15252#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
15253#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
15254
15255static inline enum yytokentype
15256parser_string_term(struct parser_params *p, int func)
15257{
15258 p->lex.strterm = 0;
15259 if (func & STR_FUNC_REGEXP) {
15260 set_yylval_num(regx_options(p));
15261 dispatch_scan_event(p, tREGEXP_END);
15262 SET_LEX_STATE(EXPR_END);
15263 return tREGEXP_END;
15264 }
15265 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
15266 nextc(p);
15267 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
15268 return tLABEL_END;
15269 }
15270 SET_LEX_STATE(EXPR_END);
15271 return tSTRING_END;
15272}
15273
15274static enum yytokentype
15275parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
15276{
15277 int func = (int)quote->u1.func;
15278 int term = (int)quote->u3.term;
15279 int paren = (int)quote->u2.paren;
15280 int c, space = 0;
15281 rb_encoding *enc = p->enc;
15282 rb_encoding *base_enc = 0;
15283 VALUE lit;
15284
15285 if (func & STR_FUNC_TERM) {
15286 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
15287 SET_LEX_STATE(EXPR_END);
15288 p->lex.strterm = 0;
15289 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
15290 }
15291 c = nextc(p);
15292 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
15293 do {c = nextc(p);} while (ISSPACE(c));
15294 space = 1;
15295 }
15296 if (func & STR_FUNC_LIST) {
15297 quote->u1.func &= ~STR_FUNC_LIST;
15298 space = 1;
15299 }
15300 if (c == term && !quote->u0.nest) {
15301 if (func & STR_FUNC_QWORDS) {
15302 quote->u1.func |= STR_FUNC_TERM;
15303 pushback(p, c); /* dispatch the term at tSTRING_END */
15304 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
15305 return ' ';
15306 }
15307 return parser_string_term(p, func);
15308 }
15309 if (space) {
15310 pushback(p, c);
15311 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
15312 return ' ';
15313 }
15314 newtok(p);
15315 if ((func & STR_FUNC_EXPAND) && c == '#') {
15316 int t = parser_peek_variable_name(p);
15317 if (t) return t;
15318 tokadd(p, '#');
15319 c = nextc(p);
15320 }
15321 pushback(p, c);
15322 if (tokadd_string(p, func, term, paren, &quote->u0.nest,
15323 &enc, &base_enc) == -1) {
15324 if (p->eofp) {
15325#ifndef RIPPER
15326# define unterminated_literal(mesg) yyerror0(mesg)
15327#else
15328# define unterminated_literal(mesg) compile_error(p, mesg)
15329#endif
15330 literal_flush(p, p->lex.pcur);
15331 if (func & STR_FUNC_QWORDS) {
15332 /* no content to add, bailing out here */
15333 unterminated_literal("unterminated list meets end of file");
15334 p->lex.strterm = 0;
15335 return tSTRING_END;
15336 }
15337 if (func & STR_FUNC_REGEXP) {
15338 unterminated_literal("unterminated regexp meets end of file");
15339 }
15340 else {
15341 unterminated_literal("unterminated string meets end of file");
15342 }
15343 quote->u1.func |= STR_FUNC_TERM;
15344 }
15345 }
15346
15347 tokfix(p);
15348 lit = STR_NEW3(tok(p), toklen(p), enc, func);
15349 set_yylval_str(lit);
15350 flush_string_content(p, enc);
15351
15352 return tSTRING_CONTENT;
15353}
15354
15355static enum yytokentype
15356heredoc_identifier(struct parser_params *p)
15357{
15358 /*
15359 * term_len is length of `<<"END"` except `END`,
15360 * in this case term_len is 4 (<, <, " and ").
15361 */
15362 long len, offset = p->lex.pcur - p->lex.pbeg;
15363 int c = nextc(p), term, func = 0, quote = 0;
15364 enum yytokentype token = tSTRING_BEG;
15365 int indent = 0;
15366
15367 if (c == '-') {
15368 c = nextc(p);
15369 func = STR_FUNC_INDENT;
15370 offset++;
15371 }
15372 else if (c == '~') {
15373 c = nextc(p);
15374 func = STR_FUNC_INDENT;
15375 offset++;
15376 indent = INT_MAX;
15377 }
15378 switch (c) {
15379 case '\'':
15380 func |= str_squote; goto quoted;
15381 case '"':
15382 func |= str_dquote; goto quoted;
15383 case '`':
15384 token = tXSTRING_BEG;
15385 func |= str_xquote; goto quoted;
15386
15387 quoted:
15388 quote++;
15389 offset++;
15390 term = c;
15391 len = 0;
15392 while ((c = nextc(p)) != term) {
15393 if (c == -1 || c == '\r' || c == '\n') {
15394 yyerror0("unterminated here document identifier");
15395 return -1;
15396 }
15397 }
15398 break;
15399
15400 default:
15401 if (!parser_is_identchar(p)) {
15402 pushback(p, c);
15403 if (func & STR_FUNC_INDENT) {
15404 pushback(p, indent > 0 ? '~' : '-');
15405 }
15406 return 0;
15407 }
15408 func |= str_dquote;
15409 do {
15410 int n = parser_precise_mbclen(p, p->lex.pcur-1);
15411 if (n < 0) return 0;
15412 p->lex.pcur += --n;
15413 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
15414 pushback(p, c);
15415 break;
15416 }
15417
15418 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
15419 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
15420 yyerror0("too long here document identifier");
15421 dispatch_scan_event(p, tHEREDOC_BEG);
15422 lex_goto_eol(p);
15423
15424 p->lex.strterm = new_strterm(0, 0, 0, p->lex.lastline);
15425 p->lex.strterm->flags |= STRTERM_HEREDOC;
15426 rb_strterm_heredoc_t *here = &p->lex.strterm->u.heredoc;
15427 here->offset = offset;
15428 here->sourceline = p->ruby_sourceline;
15429 here->length = (int)len;
15430 here->quote = quote;
15431 here->func = func;
15432
15433 token_flush(p);
15434 p->heredoc_indent = indent;
15435 p->heredoc_line_indent = 0;
15436 return token;
15437}
15438
15439static void
15440heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
15441{
15442 VALUE line;
15443
15444 p->lex.strterm = 0;
15445 line = here->lastline;
15446 p->lex.lastline = line;
15447 p->lex.pbeg = RSTRING_PTR(line);
15448 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
15449 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
15450 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
15451 p->heredoc_end = p->ruby_sourceline;
15452 p->ruby_sourceline = (int)here->sourceline;
15453 if (p->eofp) p->lex.nextline = Qnil;
15454 p->eofp = 0;
15455}
15456
15457static int
15458dedent_string(VALUE string, int width)
15459{
15460 char *str;
15461 long len;
15462 int i, col = 0;
15463
15464 RSTRING_GETMEM(string, str, len);
15465 for (i = 0; i < len && col < width; i++) {
15466 if (str[i] == ' ') {
15467 col++;
15468 }
15469 else if (str[i] == '\t') {
15470 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
15471 if (n > width) break;
15472 col = n;
15473 }
15474 else {
15475 break;
15476 }
15477 }
15478 if (!i) return 0;
15479 rb_str_modify(string);
15480 str = RSTRING_PTR(string);
15481 if (RSTRING_LEN(string) != len)
15482 rb_fatal("literal string changed: %+"PRIsVALUE, string);
15483 MEMMOVE(str, str + i, char, len - i);
15484 rb_str_set_len(string, len - i);
15485 return i;
15486}
15487
15488#ifndef RIPPER
15489static NODE *
15490heredoc_dedent(struct parser_params *p, NODE *root)
15491{
15492 NODE *node, *str_node, *prev_node;
15493 int indent = p->heredoc_indent;
15494 VALUE prev_lit = 0;
15495
15496 if (indent <= 0) return root;
15497 p->heredoc_indent = 0;
15498 if (!root) return root;
15499
15500 prev_node = node = str_node = root;
15501 if (nd_type_p(root, NODE_LIST)) str_node = root->nd_head;
15502
15503 while (str_node) {
15504 VALUE lit = str_node->nd_lit;
15505 if (str_node->flags & NODE_FL_NEWLINE) {
15506 dedent_string(lit, indent);
15507 }
15508 if (!prev_lit) {
15509 prev_lit = lit;
15510 }
15511 else if (!literal_concat0(p, prev_lit, lit)) {
15512 return 0;
15513 }
15514 else {
15515 NODE *end = node->nd_end;
15516 node = prev_node->nd_next = node->nd_next;
15517 if (!node) {
15518 if (nd_type_p(prev_node, NODE_DSTR))
15519 nd_set_type(prev_node, NODE_STR);
15520 break;
15521 }
15522 node->nd_end = end;
15523 goto next_str;
15524 }
15525
15526 str_node = 0;
15527 while ((node = (prev_node = node)->nd_next) != 0) {
15528 next_str:
15529 if (!nd_type_p(node, NODE_LIST)) break;
15530 if ((str_node = node->nd_head) != 0) {
15531 enum node_type type = nd_type(str_node);
15532 if (type == NODE_STR || type == NODE_DSTR) break;
15533 prev_lit = 0;
15534 str_node = 0;
15535 }
15536 }
15537 }
15538 return root;
15539}
15540#else /* RIPPER */
15541static VALUE
15542heredoc_dedent(struct parser_params *p, VALUE array)
15543{
15544 int indent = p->heredoc_indent;
15545
15546 if (indent <= 0) return array;
15547 p->heredoc_indent = 0;
15548 dispatch2(heredoc_dedent, array, INT2NUM(indent));
15549 return array;
15550}
15551
15552/*
15553 * call-seq:
15554 * Ripper.dedent_string(input, width) -> Integer
15555 *
15556 * USE OF RIPPER LIBRARY ONLY.
15557 *
15558 * Strips up to +width+ leading whitespaces from +input+,
15559 * and returns the stripped column width.
15560 */
15561static VALUE
15562parser_dedent_string(VALUE self, VALUE input, VALUE width)
15563{
15564 int wid, col;
15565
15566 StringValue(input);
15567 wid = NUM2UINT(width);
15568 col = dedent_string(input, wid);
15569 return INT2NUM(col);
15570}
15571#endif
15572
15573static int
15574whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
15575{
15576 const char *ptr = p->lex.pbeg;
15577 long n;
15578
15579 if (indent) {
15580 while (*ptr && ISSPACE(*ptr)) ptr++;
15581 }
15582 n = p->lex.pend - (ptr + len);
15583 if (n < 0) return FALSE;
15584 if (n > 0 && ptr[len] != '\n') {
15585 if (ptr[len] != '\r') return FALSE;
15586 if (n <= 1 || ptr[len+1] != '\n') return FALSE;
15587 }
15588 return strncmp(eos, ptr, len) == 0;
15589}
15590
15591static int
15592word_match_p(struct parser_params *p, const char *word, long len)
15593{
15594 if (strncmp(p->lex.pcur, word, len)) return 0;
15595 if (p->lex.pcur + len == p->lex.pend) return 1;
15596 int c = (unsigned char)p->lex.pcur[len];
15597 if (ISSPACE(c)) return 1;
15598 switch (c) {
15599 case '\0': case '\004': case '\032': return 1;
15600 }
15601 return 0;
15602}
15603
15604#define NUM_SUFFIX_R (1<<0)
15605#define NUM_SUFFIX_I (1<<1)
15606#define NUM_SUFFIX_ALL 3
15607
15608static int
15609number_literal_suffix(struct parser_params *p, int mask)
15610{
15611 int c, result = 0;
15612 const char *lastp = p->lex.pcur;
15613
15614 while ((c = nextc(p)) != -1) {
15615 if ((mask & NUM_SUFFIX_I) && c == 'i') {
15616 result |= (mask & NUM_SUFFIX_I);
15617 mask &= ~NUM_SUFFIX_I;
15618 /* r after i, rational of complex is disallowed */
15619 mask &= ~NUM_SUFFIX_R;
15620 continue;
15621 }
15622 if ((mask & NUM_SUFFIX_R) && c == 'r') {
15623 result |= (mask & NUM_SUFFIX_R);
15624 mask &= ~NUM_SUFFIX_R;
15625 continue;
15626 }
15627 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
15628 p->lex.pcur = lastp;
15629 literal_flush(p, p->lex.pcur);
15630 return 0;
15631 }
15632 pushback(p, c);
15633 break;
15634 }
15635 return result;
15636}
15637
15638static enum yytokentype
15639set_number_literal(struct parser_params *p, VALUE v,
15640 enum yytokentype type, int suffix)
15641{
15642 if (suffix & NUM_SUFFIX_I) {
15643 v = rb_complex_raw(INT2FIX(0), v);
15644 type = tIMAGINARY;
15645 }
15646 set_yylval_literal(v);
15647 SET_LEX_STATE(EXPR_END);
15648 return type;
15649}
15650
15651static enum yytokentype
15652set_integer_literal(struct parser_params *p, VALUE v, int suffix)
15653{
15654 enum yytokentype type = tINTEGER;
15655 if (suffix & NUM_SUFFIX_R) {
15656 v = rb_rational_raw1(v);
15657 type = tRATIONAL;
15658 }
15659 return set_number_literal(p, v, type, suffix);
15660}
15661
15662#ifdef RIPPER
15663static void
15664dispatch_heredoc_end(struct parser_params *p)
15665{
15666 VALUE str;
15667 if (has_delayed_token(p))
15668 dispatch_delayed_token(p, tSTRING_CONTENT);
15669 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
15670 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
15671 lex_goto_eol(p);
15672 token_flush(p);
15673}
15674
15675#else
15676#define dispatch_heredoc_end(p) ((void)0)
15677#endif
15678
15679static enum yytokentype
15680here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
15681{
15682 int c, func, indent = 0;
15683 const char *eos, *ptr, *ptr_end;
15684 long len;
15685 VALUE str = 0;
15686 rb_encoding *enc = p->enc;
15687 rb_encoding *base_enc = 0;
15688 int bol;
15689
15690 eos = RSTRING_PTR(here->lastline) + here->offset;
15691 len = here->length;
15692 indent = (func = here->func) & STR_FUNC_INDENT;
15693
15694 if ((c = nextc(p)) == -1) {
15695 error:
15696#ifdef RIPPER
15697 if (!has_delayed_token(p)) {
15698 dispatch_scan_event(p, tSTRING_CONTENT);
15699 }
15700 else {
15701 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
15702 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
15703 int cr = ENC_CODERANGE_UNKNOWN;
15704 rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);
15705 if (cr != ENC_CODERANGE_7BIT &&
15706 p->enc == rb_usascii_encoding() &&
15707 enc != rb_utf8_encoding()) {
15708 enc = rb_ascii8bit_encoding();
15709 }
15710 }
15711 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
15712 }
15713 dispatch_delayed_token(p, tSTRING_CONTENT);
15714 }
15715 lex_goto_eol(p);
15716#endif
15717 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15718 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
15719 (int)len, eos);
15720 token_flush(p);
15721 p->lex.strterm = 0;
15722 SET_LEX_STATE(EXPR_END);
15723 return tSTRING_END;
15724 }
15725 bol = was_bol(p);
15726 if (!bol) {
15727 /* not beginning of line, cannot be the terminator */
15728 }
15729 else if (p->heredoc_line_indent == -1) {
15730 /* `heredoc_line_indent == -1` means
15731 * - "after an interpolation in the same line", or
15732 * - "in a continuing line"
15733 */
15734 p->heredoc_line_indent = 0;
15735 }
15736 else if (whole_match_p(p, eos, len, indent)) {
15737 dispatch_heredoc_end(p);
15738 restore:
15739 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15740 token_flush(p);
15741 p->lex.strterm = 0;
15742 SET_LEX_STATE(EXPR_END);
15743 return tSTRING_END;
15744 }
15745
15746 if (!(func & STR_FUNC_EXPAND)) {
15747 do {
15748 ptr = RSTRING_PTR(p->lex.lastline);
15749 ptr_end = p->lex.pend;
15750 if (ptr_end > ptr) {
15751 switch (ptr_end[-1]) {
15752 case '\n':
15753 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
15754 ptr_end++;
15755 break;
15756 }
15757 case '\r':
15758 --ptr_end;
15759 }
15760 }
15761
15762 if (p->heredoc_indent > 0) {
15763 long i = 0;
15764 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
15765 i++;
15766 p->heredoc_line_indent = 0;
15767 }
15768
15769 if (str)
15770 rb_str_cat(str, ptr, ptr_end - ptr);
15771 else
15772 str = STR_NEW(ptr, ptr_end - ptr);
15773 if (ptr_end < p->lex.pend) rb_str_cat(str, "\n", 1);
15774 lex_goto_eol(p);
15775 if (p->heredoc_indent > 0) {
15776 goto flush_str;
15777 }
15778 if (nextc(p) == -1) {
15779 if (str) {
15780 str = 0;
15781 }
15782 goto error;
15783 }
15784 } while (!whole_match_p(p, eos, len, indent));
15785 }
15786 else {
15787 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
15788 newtok(p);
15789 if (c == '#') {
15790 int t = parser_peek_variable_name(p);
15791 if (p->heredoc_line_indent != -1) {
15792 if (p->heredoc_indent > p->heredoc_line_indent) {
15793 p->heredoc_indent = p->heredoc_line_indent;
15794 }
15795 p->heredoc_line_indent = -1;
15796 }
15797 if (t) return t;
15798 tokadd(p, '#');
15799 c = nextc(p);
15800 }
15801 do {
15802 pushback(p, c);
15803 enc = p->enc;
15804 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
15805 if (p->eofp) goto error;
15806 goto restore;
15807 }
15808 if (c != '\n') {
15809 if (c == '\\') p->heredoc_line_indent = -1;
15810 flush:
15811 str = STR_NEW3(tok(p), toklen(p), enc, func);
15812 flush_str:
15813 set_yylval_str(str);
15814#ifndef RIPPER
15815 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15816#endif
15817 flush_string_content(p, enc);
15818 return tSTRING_CONTENT;
15819 }
15820 tokadd(p, nextc(p));
15821 if (p->heredoc_indent > 0) {
15822 lex_goto_eol(p);
15823 goto flush;
15824 }
15825 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
15826 if ((c = nextc(p)) == -1) goto error;
15827 } while (!whole_match_p(p, eos, len, indent));
15828 str = STR_NEW3(tok(p), toklen(p), enc, func);
15829 }
15830 dispatch_heredoc_end(p);
15831#ifdef RIPPER
15832 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
15833 yylval.val, str);
15834#endif
15835 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15836 token_flush(p);
15837 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
15838 set_yylval_str(str);
15839#ifndef RIPPER
15840 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15841#endif
15842 return tSTRING_CONTENT;
15843}
15844
15845#include "lex.c"
15846
15847static int
15848arg_ambiguous(struct parser_params *p, char c)
15849{
15850#ifndef RIPPER
15851 if (c == '/') {
15852 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
15853 }
15854 else {
15855 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
15856 }
15857#else
15858 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
15859#endif
15860 return TRUE;
15861}
15862
15863static ID
15864#ifndef RIPPER
15865formal_argument(struct parser_params *p, ID lhs)
15866#else
15867formal_argument(struct parser_params *p, VALUE lhs)
15868#endif
15869{
15870 ID id = get_id(lhs);
15871
15872 switch (id_type(id)) {
15873 case ID_LOCAL:
15874 break;
15875#ifndef RIPPER
15876# define ERR(mesg) yyerror0(mesg)
15877#else
15878# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
15879#endif
15880 case ID_CONST:
15881 ERR("formal argument cannot be a constant");
15882 return 0;
15883 case ID_INSTANCE:
15884 ERR("formal argument cannot be an instance variable");
15885 return 0;
15886 case ID_GLOBAL:
15887 ERR("formal argument cannot be a global variable");
15888 return 0;
15889 case ID_CLASS:
15890 ERR("formal argument cannot be a class variable");
15891 return 0;
15892 default:
15893 ERR("formal argument must be local variable");
15894 return 0;
15895#undef ERR
15896 }
15897 shadowing_lvar(p, id);
15898 return lhs;
15899}
15900
15901static int
15902lvar_defined(struct parser_params *p, ID id)
15903{
15904 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
15905}
15906
15907/* emacsen -*- hack */
15908static long
15909parser_encode_length(struct parser_params *p, const char *name, long len)
15910{
15911 long nlen;
15912
15913 if (len > 5 && name[nlen = len - 5] == '-') {
15914 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
15915 return nlen;
15916 }
15917 if (len > 4 && name[nlen = len - 4] == '-') {
15918 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
15919 return nlen;
15920 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
15921 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
15922 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
15923 return nlen;
15924 }
15925 return len;
15926}
15927
15928static void
15929parser_set_encode(struct parser_params *p, const char *name)
15930{
15931 int idx = rb_enc_find_index(name);
15932 rb_encoding *enc;
15933 VALUE excargs[3];
15934
15935 if (idx < 0) {
15936 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
15937 error:
15938 excargs[0] = rb_eArgError;
15939 excargs[2] = rb_make_backtrace();
15940 rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", p->ruby_sourcefile_string, p->ruby_sourceline));
15941 rb_exc_raise(rb_make_exception(3, excargs));
15942 }
15943 enc = rb_enc_from_index(idx);
15944 if (!rb_enc_asciicompat(enc)) {
15945 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
15946 goto error;
15947 }
15948 p->enc = enc;
15949#ifndef RIPPER
15950 if (p->debug_lines) {
15951 VALUE lines = p->debug_lines;
15952 long i, n = RARRAY_LEN(lines);
15953 for (i = 0; i < n; ++i) {
15954 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
15955 }
15956 }
15957#endif
15958}
15959
15960static int
15961comment_at_top(struct parser_params *p)
15962{
15963 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
15964 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
15965 while (ptr < ptr_end) {
15966 if (!ISSPACE(*ptr)) return 0;
15967 ptr++;
15968 }
15969 return 1;
15970}
15971
15972typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
15973typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
15974
15975static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
15976
15977static void
15978magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
15979{
15980 if (!comment_at_top(p)) {
15981 return;
15982 }
15983 parser_set_encode(p, val);
15984}
15985
15986static int
15987parser_get_bool(struct parser_params *p, const char *name, const char *val)
15988{
15989 switch (*val) {
15990 case 't': case 'T':
15991 if (STRCASECMP(val, "true") == 0) {
15992 return TRUE;
15993 }
15994 break;
15995 case 'f': case 'F':
15996 if (STRCASECMP(val, "false") == 0) {
15997 return FALSE;
15998 }
15999 break;
16000 }
16001 return parser_invalid_pragma_value(p, name, val);
16002}
16003
16004static int
16005parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
16006{
16007 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
16008 return -1;
16009}
16010
16011static void
16012parser_set_token_info(struct parser_params *p, const char *name, const char *val)
16013{
16014 int b = parser_get_bool(p, name, val);
16015 if (b >= 0) p->token_info_enabled = b;
16016}
16017
16018static void
16019parser_set_compile_option_flag(struct parser_params *p, const char *name, const char *val)
16020{
16021 int b;
16022
16023 if (p->token_seen) {
16024 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
16025 return;
16026 }
16027
16028 b = parser_get_bool(p, name, val);
16029 if (b < 0) return;
16030
16031 if (!p->compile_option)
16032 p->compile_option = rb_obj_hide(rb_ident_hash_new());
16033 rb_hash_aset(p->compile_option, ID2SYM(rb_intern(name)),
16034 RBOOL(b));
16035}
16036
16037static void
16038parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
16039{
16040 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
16041 if (*s == ' ' || *s == '\t') continue;
16042 if (*s == '#') break;
16043 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
16044 return;
16045 }
16046
16047 switch (*val) {
16048 case 'n': case 'N':
16049 if (STRCASECMP(val, "none") == 0) {
16050 p->ctxt.shareable_constant_value = shareable_none;
16051 return;
16052 }
16053 break;
16054 case 'l': case 'L':
16055 if (STRCASECMP(val, "literal") == 0) {
16056 p->ctxt.shareable_constant_value = shareable_literal;
16057 return;
16058 }
16059 break;
16060 case 'e': case 'E':
16061 if (STRCASECMP(val, "experimental_copy") == 0) {
16062 p->ctxt.shareable_constant_value = shareable_copy;
16063 return;
16064 }
16065 if (STRCASECMP(val, "experimental_everything") == 0) {
16066 p->ctxt.shareable_constant_value = shareable_everything;
16067 return;
16068 }
16069 break;
16070 }
16071 parser_invalid_pragma_value(p, name, val);
16072}
16073
16074# if WARN_PAST_SCOPE
16075static void
16076parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
16077{
16078 int b = parser_get_bool(p, name, val);
16079 if (b >= 0) p->past_scope_enabled = b;
16080}
16081# endif
16082
16084 const char *name;
16085 rb_magic_comment_setter_t func;
16086 rb_magic_comment_length_t length;
16087};
16088
16089static const struct magic_comment magic_comments[] = {
16090 {"coding", magic_comment_encoding, parser_encode_length},
16091 {"encoding", magic_comment_encoding, parser_encode_length},
16092 {"frozen_string_literal", parser_set_compile_option_flag},
16093 {"shareable_constant_value", parser_set_shareable_constant_value},
16094 {"warn_indent", parser_set_token_info},
16095# if WARN_PAST_SCOPE
16096 {"warn_past_scope", parser_set_past_scope},
16097# endif
16098};
16099
16100static const char *
16101magic_comment_marker(const char *str, long len)
16102{
16103 long i = 2;
16104
16105 while (i < len) {
16106 switch (str[i]) {
16107 case '-':
16108 if (str[i-1] == '*' && str[i-2] == '-') {
16109 return str + i + 1;
16110 }
16111 i += 2;
16112 break;
16113 case '*':
16114 if (i + 1 >= len) return 0;
16115 if (str[i+1] != '-') {
16116 i += 4;
16117 }
16118 else if (str[i-1] != '-') {
16119 i += 2;
16120 }
16121 else {
16122 return str + i + 2;
16123 }
16124 break;
16125 default:
16126 i += 3;
16127 break;
16128 }
16129 }
16130 return 0;
16131}
16132
16133static int
16134parser_magic_comment(struct parser_params *p, const char *str, long len)
16135{
16136 int indicator = 0;
16137 VALUE name = 0, val = 0;
16138 const char *beg, *end, *vbeg, *vend;
16139#define str_copy(_s, _p, _n) ((_s) \
16140 ? (void)(rb_str_resize((_s), (_n)), \
16141 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
16142 : (void)((_s) = STR_NEW((_p), (_n))))
16143
16144 if (len <= 7) return FALSE;
16145 if (!!(beg = magic_comment_marker(str, len))) {
16146 if (!(end = magic_comment_marker(beg, str + len - beg)))
16147 return FALSE;
16148 indicator = TRUE;
16149 str = beg;
16150 len = end - beg - 3;
16151 }
16152
16153 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
16154 while (len > 0) {
16155 const struct magic_comment *mc = magic_comments;
16156 char *s;
16157 int i;
16158 long n = 0;
16159
16160 for (; len > 0 && *str; str++, --len) {
16161 switch (*str) {
16162 case '\'': case '"': case ':': case ';':
16163 continue;
16164 }
16165 if (!ISSPACE(*str)) break;
16166 }
16167 for (beg = str; len > 0; str++, --len) {
16168 switch (*str) {
16169 case '\'': case '"': case ':': case ';':
16170 break;
16171 default:
16172 if (ISSPACE(*str)) break;
16173 continue;
16174 }
16175 break;
16176 }
16177 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
16178 if (!len) break;
16179 if (*str != ':') {
16180 if (!indicator) return FALSE;
16181 continue;
16182 }
16183
16184 do str++; while (--len > 0 && ISSPACE(*str));
16185 if (!len) break;
16186 if (*str == '"') {
16187 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
16188 if (*str == '\\') {
16189 --len;
16190 ++str;
16191 }
16192 }
16193 vend = str;
16194 if (len) {
16195 --len;
16196 ++str;
16197 }
16198 }
16199 else {
16200 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
16201 vend = str;
16202 }
16203 if (indicator) {
16204 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
16205 }
16206 else {
16207 while (len > 0 && (ISSPACE(*str))) --len, str++;
16208 if (len) return FALSE;
16209 }
16210
16211 n = end - beg;
16212 str_copy(name, beg, n);
16213 s = RSTRING_PTR(name);
16214 for (i = 0; i < n; ++i) {
16215 if (s[i] == '-') s[i] = '_';
16216 }
16217 do {
16218 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
16219 n = vend - vbeg;
16220 if (mc->length) {
16221 n = (*mc->length)(p, vbeg, n);
16222 }
16223 str_copy(val, vbeg, n);
16224 (*mc->func)(p, mc->name, RSTRING_PTR(val));
16225 break;
16226 }
16227 } while (++mc < magic_comments + numberof(magic_comments));
16228#ifdef RIPPER
16229 str_copy(val, vbeg, vend - vbeg);
16230 dispatch2(magic_comment, name, val);
16231#endif
16232 }
16233
16234 return TRUE;
16235}
16236
16237static void
16238set_file_encoding(struct parser_params *p, const char *str, const char *send)
16239{
16240 int sep = 0;
16241 const char *beg = str;
16242 VALUE s;
16243
16244 for (;;) {
16245 if (send - str <= 6) return;
16246 switch (str[6]) {
16247 case 'C': case 'c': str += 6; continue;
16248 case 'O': case 'o': str += 5; continue;
16249 case 'D': case 'd': str += 4; continue;
16250 case 'I': case 'i': str += 3; continue;
16251 case 'N': case 'n': str += 2; continue;
16252 case 'G': case 'g': str += 1; continue;
16253 case '=': case ':':
16254 sep = 1;
16255 str += 6;
16256 break;
16257 default:
16258 str += 6;
16259 if (ISSPACE(*str)) break;
16260 continue;
16261 }
16262 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
16263 sep = 0;
16264 }
16265 for (;;) {
16266 do {
16267 if (++str >= send) return;
16268 } while (ISSPACE(*str));
16269 if (sep) break;
16270 if (*str != '=' && *str != ':') return;
16271 sep = 1;
16272 str++;
16273 }
16274 beg = str;
16275 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
16276 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
16277 parser_set_encode(p, RSTRING_PTR(s));
16278 rb_str_resize(s, 0);
16279}
16280
16281static void
16282parser_prepare(struct parser_params *p)
16283{
16284 int c = nextc(p);
16285 p->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
16286 switch (c) {
16287 case '#':
16288 if (peek(p, '!')) p->has_shebang = 1;
16289 break;
16290 case 0xef: /* UTF-8 BOM marker */
16291 if (p->lex.pend - p->lex.pcur >= 2 &&
16292 (unsigned char)p->lex.pcur[0] == 0xbb &&
16293 (unsigned char)p->lex.pcur[1] == 0xbf) {
16294 p->enc = rb_utf8_encoding();
16295 p->lex.pcur += 2;
16296 p->lex.pbeg = p->lex.pcur;
16297 return;
16298 }
16299 break;
16300 case EOF:
16301 return;
16302 }
16303 pushback(p, c);
16304 p->enc = rb_enc_get(p->lex.lastline);
16305}
16306
16307#ifndef RIPPER
16308#define ambiguous_operator(tok, op, syn) ( \
16309 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
16310 rb_warning0("even though it seems like "syn""))
16311#else
16312#define ambiguous_operator(tok, op, syn) \
16313 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
16314#endif
16315#define warn_balanced(tok, op, syn) ((void) \
16316 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
16317 space_seen && !ISSPACE(c) && \
16318 (ambiguous_operator(tok, op, syn), 0)), \
16319 (enum yytokentype)(tok))
16320
16321static VALUE
16322parse_rational(struct parser_params *p, char *str, int len, int seen_point)
16323{
16324 VALUE v;
16325 char *point = &str[seen_point];
16326 size_t fraclen = len-seen_point-1;
16327 memmove(point, point+1, fraclen+1);
16328 v = rb_cstr_to_inum(str, 10, FALSE);
16329 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
16330}
16331
16332static enum yytokentype
16333no_digits(struct parser_params *p)
16334{
16335 yyerror0("numeric literal without digits");
16336 if (peek(p, '_')) nextc(p);
16337 /* dummy 0, for tUMINUS_NUM at numeric */
16338 return set_integer_literal(p, INT2FIX(0), 0);
16339}
16340
16341static enum yytokentype
16342parse_numeric(struct parser_params *p, int c)
16343{
16344 int is_float, seen_point, seen_e, nondigit;
16345 int suffix;
16346
16347 is_float = seen_point = seen_e = nondigit = 0;
16348 SET_LEX_STATE(EXPR_END);
16349 newtok(p);
16350 if (c == '-' || c == '+') {
16351 tokadd(p, c);
16352 c = nextc(p);
16353 }
16354 if (c == '0') {
16355 int start = toklen(p);
16356 c = nextc(p);
16357 if (c == 'x' || c == 'X') {
16358 /* hexadecimal */
16359 c = nextc(p);
16360 if (c != -1 && ISXDIGIT(c)) {
16361 do {
16362 if (c == '_') {
16363 if (nondigit) break;
16364 nondigit = c;
16365 continue;
16366 }
16367 if (!ISXDIGIT(c)) break;
16368 nondigit = 0;
16369 tokadd(p, c);
16370 } while ((c = nextc(p)) != -1);
16371 }
16372 pushback(p, c);
16373 tokfix(p);
16374 if (toklen(p) == start) {
16375 return no_digits(p);
16376 }
16377 else if (nondigit) goto trailing_uc;
16378 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16379 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
16380 }
16381 if (c == 'b' || c == 'B') {
16382 /* binary */
16383 c = nextc(p);
16384 if (c == '0' || c == '1') {
16385 do {
16386 if (c == '_') {
16387 if (nondigit) break;
16388 nondigit = c;
16389 continue;
16390 }
16391 if (c != '0' && c != '1') break;
16392 nondigit = 0;
16393 tokadd(p, c);
16394 } while ((c = nextc(p)) != -1);
16395 }
16396 pushback(p, c);
16397 tokfix(p);
16398 if (toklen(p) == start) {
16399 return no_digits(p);
16400 }
16401 else if (nondigit) goto trailing_uc;
16402 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16403 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
16404 }
16405 if (c == 'd' || c == 'D') {
16406 /* decimal */
16407 c = nextc(p);
16408 if (c != -1 && ISDIGIT(c)) {
16409 do {
16410 if (c == '_') {
16411 if (nondigit) break;
16412 nondigit = c;
16413 continue;
16414 }
16415 if (!ISDIGIT(c)) break;
16416 nondigit = 0;
16417 tokadd(p, c);
16418 } while ((c = nextc(p)) != -1);
16419 }
16420 pushback(p, c);
16421 tokfix(p);
16422 if (toklen(p) == start) {
16423 return no_digits(p);
16424 }
16425 else if (nondigit) goto trailing_uc;
16426 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16427 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
16428 }
16429 if (c == '_') {
16430 /* 0_0 */
16431 goto octal_number;
16432 }
16433 if (c == 'o' || c == 'O') {
16434 /* prefixed octal */
16435 c = nextc(p);
16436 if (c == -1 || c == '_' || !ISDIGIT(c)) {
16437 return no_digits(p);
16438 }
16439 }
16440 if (c >= '0' && c <= '7') {
16441 /* octal */
16442 octal_number:
16443 do {
16444 if (c == '_') {
16445 if (nondigit) break;
16446 nondigit = c;
16447 continue;
16448 }
16449 if (c < '0' || c > '9') break;
16450 if (c > '7') goto invalid_octal;
16451 nondigit = 0;
16452 tokadd(p, c);
16453 } while ((c = nextc(p)) != -1);
16454 if (toklen(p) > start) {
16455 pushback(p, c);
16456 tokfix(p);
16457 if (nondigit) goto trailing_uc;
16458 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16459 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
16460 }
16461 if (nondigit) {
16462 pushback(p, c);
16463 goto trailing_uc;
16464 }
16465 }
16466 if (c > '7' && c <= '9') {
16467 invalid_octal:
16468 yyerror0("Invalid octal digit");
16469 }
16470 else if (c == '.' || c == 'e' || c == 'E') {
16471 tokadd(p, '0');
16472 }
16473 else {
16474 pushback(p, c);
16475 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16476 return set_integer_literal(p, INT2FIX(0), suffix);
16477 }
16478 }
16479
16480 for (;;) {
16481 switch (c) {
16482 case '0': case '1': case '2': case '3': case '4':
16483 case '5': case '6': case '7': case '8': case '9':
16484 nondigit = 0;
16485 tokadd(p, c);
16486 break;
16487
16488 case '.':
16489 if (nondigit) goto trailing_uc;
16490 if (seen_point || seen_e) {
16491 goto decode_num;
16492 }
16493 else {
16494 int c0 = nextc(p);
16495 if (c0 == -1 || !ISDIGIT(c0)) {
16496 pushback(p, c0);
16497 goto decode_num;
16498 }
16499 c = c0;
16500 }
16501 seen_point = toklen(p);
16502 tokadd(p, '.');
16503 tokadd(p, c);
16504 is_float++;
16505 nondigit = 0;
16506 break;
16507
16508 case 'e':
16509 case 'E':
16510 if (nondigit) {
16511 pushback(p, c);
16512 c = nondigit;
16513 goto decode_num;
16514 }
16515 if (seen_e) {
16516 goto decode_num;
16517 }
16518 nondigit = c;
16519 c = nextc(p);
16520 if (c != '-' && c != '+' && !ISDIGIT(c)) {
16521 pushback(p, c);
16522 nondigit = 0;
16523 goto decode_num;
16524 }
16525 tokadd(p, nondigit);
16526 seen_e++;
16527 is_float++;
16528 tokadd(p, c);
16529 nondigit = (c == '-' || c == '+') ? c : 0;
16530 break;
16531
16532 case '_': /* `_' in number just ignored */
16533 if (nondigit) goto decode_num;
16534 nondigit = c;
16535 break;
16536
16537 default:
16538 goto decode_num;
16539 }
16540 c = nextc(p);
16541 }
16542
16543 decode_num:
16544 pushback(p, c);
16545 if (nondigit) {
16546 trailing_uc:
16547 literal_flush(p, p->lex.pcur - 1);
16548 YYLTYPE loc = RUBY_INIT_YYLLOC();
16549 compile_error(p, "trailing `%c' in number", nondigit);
16550 parser_show_error_line(p, &loc);
16551 }
16552 tokfix(p);
16553 if (is_float) {
16554 enum yytokentype type = tFLOAT;
16555 VALUE v;
16556
16557 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
16558 if (suffix & NUM_SUFFIX_R) {
16559 type = tRATIONAL;
16560 v = parse_rational(p, tok(p), toklen(p), seen_point);
16561 }
16562 else {
16563 double d = strtod(tok(p), 0);
16564 if (errno == ERANGE) {
16565 rb_warning1("Float %s out of range", WARN_S(tok(p)));
16566 errno = 0;
16567 }
16568 v = DBL2NUM(d);
16569 }
16570 return set_number_literal(p, v, type, suffix);
16571 }
16572 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16573 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
16574}
16575
16576static enum yytokentype
16577parse_qmark(struct parser_params *p, int space_seen)
16578{
16579 rb_encoding *enc;
16580 register int c;
16581 VALUE lit;
16582
16583 if (IS_END()) {
16584 SET_LEX_STATE(EXPR_VALUE);
16585 return '?';
16586 }
16587 c = nextc(p);
16588 if (c == -1) {
16589 compile_error(p, "incomplete character syntax");
16590 return 0;
16591 }
16592 if (rb_enc_isspace(c, p->enc)) {
16593 if (!IS_ARG()) {
16594 int c2 = escaped_control_code(c);
16595 if (c2) {
16596 WARN_SPACE_CHAR(c2, "?");
16597 }
16598 }
16599 ternary:
16600 pushback(p, c);
16601 SET_LEX_STATE(EXPR_VALUE);
16602 return '?';
16603 }
16604 newtok(p);
16605 enc = p->enc;
16606 if (!parser_isascii(p)) {
16607 if (tokadd_mbchar(p, c) == -1) return 0;
16608 }
16609 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
16610 p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
16611 if (space_seen) {
16612 const char *start = p->lex.pcur - 1, *ptr = start;
16613 do {
16614 int n = parser_precise_mbclen(p, ptr);
16615 if (n < 0) return -1;
16616 ptr += n;
16617 } while (ptr < p->lex.pend && is_identchar(ptr, p->lex.pend, p->enc));
16618 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
16619 " a conditional operator, put a space after `?'",
16620 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
16621 }
16622 goto ternary;
16623 }
16624 else if (c == '\\') {
16625 if (peek(p, 'u')) {
16626 nextc(p);
16627 enc = rb_utf8_encoding();
16628 tokadd_utf8(p, &enc, -1, 0, 0);
16629 }
16630 else if (!lex_eol_p(p) && !(c = *p->lex.pcur, ISASCII(c))) {
16631 nextc(p);
16632 if (tokadd_mbchar(p, c) == -1) return 0;
16633 }
16634 else {
16635 c = read_escape(p, 0, &enc);
16636 tokadd(p, c);
16637 }
16638 }
16639 else {
16640 tokadd(p, c);
16641 }
16642 tokfix(p);
16643 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
16644 set_yylval_str(lit);
16645 SET_LEX_STATE(EXPR_END);
16646 return tCHAR;
16647}
16648
16649static enum yytokentype
16650parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
16651{
16652 register int c;
16653 const char *ptok = p->lex.pcur;
16654
16655 if (IS_BEG()) {
16656 int term;
16657 int paren;
16658
16659 c = nextc(p);
16660 quotation:
16661 if (c == -1) goto unterminated;
16662 if (!ISALNUM(c)) {
16663 term = c;
16664 if (!ISASCII(c)) goto unknown;
16665 c = 'Q';
16666 }
16667 else {
16668 term = nextc(p);
16669 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
16670 unknown:
16671 pushback(p, term);
16672 c = parser_precise_mbclen(p, p->lex.pcur);
16673 if (c < 0) return 0;
16674 p->lex.pcur += c;
16675 yyerror0("unknown type of %string");
16676 return 0;
16677 }
16678 }
16679 if (term == -1) {
16680 unterminated:
16681 compile_error(p, "unterminated quoted string meets end of file");
16682 return 0;
16683 }
16684 paren = term;
16685 if (term == '(') term = ')';
16686 else if (term == '[') term = ']';
16687 else if (term == '{') term = '}';
16688 else if (term == '<') term = '>';
16689 else paren = 0;
16690
16691 p->lex.ptok = ptok-1;
16692 switch (c) {
16693 case 'Q':
16694 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
16695 return tSTRING_BEG;
16696
16697 case 'q':
16698 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
16699 return tSTRING_BEG;
16700
16701 case 'W':
16702 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16703 return tWORDS_BEG;
16704
16705 case 'w':
16706 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16707 return tQWORDS_BEG;
16708
16709 case 'I':
16710 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16711 return tSYMBOLS_BEG;
16712
16713 case 'i':
16714 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16715 return tQSYMBOLS_BEG;
16716
16717 case 'x':
16718 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
16719 return tXSTRING_BEG;
16720
16721 case 'r':
16722 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
16723 return tREGEXP_BEG;
16724
16725 case 's':
16726 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
16727 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
16728 return tSYMBEG;
16729
16730 default:
16731 yyerror0("unknown type of %string");
16732 return 0;
16733 }
16734 }
16735 if ((c = nextc(p)) == '=') {
16736 set_yylval_id('%');
16737 SET_LEX_STATE(EXPR_BEG);
16738 return tOP_ASGN;
16739 }
16740 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
16741 goto quotation;
16742 }
16743 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16744 pushback(p, c);
16745 return warn_balanced('%', "%%", "string literal");
16746}
16747
16748static int
16749tokadd_ident(struct parser_params *p, int c)
16750{
16751 do {
16752 if (tokadd_mbchar(p, c) == -1) return -1;
16753 c = nextc(p);
16754 } while (parser_is_identchar(p));
16755 pushback(p, c);
16756 return 0;
16757}
16758
16759static ID
16760tokenize_ident(struct parser_params *p, const enum lex_state_e last_state)
16761{
16762 ID ident = TOK_INTERN();
16763
16764 set_yylval_name(ident);
16765
16766 return ident;
16767}
16768
16769static int
16770parse_numvar(struct parser_params *p)
16771{
16772 size_t len;
16773 int overflow;
16774 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
16775 const unsigned long nth_ref_max =
16776 ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
16777 /* NTH_REF is left-shifted to be ORed with back-ref flag and
16778 * turned into a Fixnum, in compile.c */
16779
16780 if (overflow || n > nth_ref_max) {
16781 /* compile_error()? */
16782 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
16783 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
16784 }
16785 else {
16786 return (int)n;
16787 }
16788}
16789
16790static enum yytokentype
16791parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
16792{
16793 const char *ptr = p->lex.pcur;
16794 register int c;
16795
16796 SET_LEX_STATE(EXPR_END);
16797 p->lex.ptok = ptr - 1; /* from '$' */
16798 newtok(p);
16799 c = nextc(p);
16800 switch (c) {
16801 case '_': /* $_: last read line string */
16802 c = nextc(p);
16803 if (parser_is_identchar(p)) {
16804 tokadd(p, '$');
16805 tokadd(p, '_');
16806 break;
16807 }
16808 pushback(p, c);
16809 c = '_';
16810 /* fall through */
16811 case '~': /* $~: match-data */
16812 case '*': /* $*: argv */
16813 case '$': /* $$: pid */
16814 case '?': /* $?: last status */
16815 case '!': /* $!: error string */
16816 case '@': /* $@: error position */
16817 case '/': /* $/: input record separator */
16818 case '\\': /* $\: output record separator */
16819 case ';': /* $;: field separator */
16820 case ',': /* $,: output field separator */
16821 case '.': /* $.: last read line number */
16822 case '=': /* $=: ignorecase */
16823 case ':': /* $:: load path */
16824 case '<': /* $<: reading filename */
16825 case '>': /* $>: default output handle */
16826 case '\"': /* $": already loaded files */
16827 tokadd(p, '$');
16828 tokadd(p, c);
16829 goto gvar;
16830
16831 case '-':
16832 tokadd(p, '$');
16833 tokadd(p, c);
16834 c = nextc(p);
16835 if (parser_is_identchar(p)) {
16836 if (tokadd_mbchar(p, c) == -1) return 0;
16837 }
16838 else {
16839 pushback(p, c);
16840 pushback(p, '-');
16841 return '$';
16842 }
16843 gvar:
16844 set_yylval_name(TOK_INTERN());
16845 return tGVAR;
16846
16847 case '&': /* $&: last match */
16848 case '`': /* $`: string before last match */
16849 case '\'': /* $': string after last match */
16850 case '+': /* $+: string matches last paren. */
16851 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
16852 tokadd(p, '$');
16853 tokadd(p, c);
16854 goto gvar;
16855 }
16856 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
16857 return tBACK_REF;
16858
16859 case '1': case '2': case '3':
16860 case '4': case '5': case '6':
16861 case '7': case '8': case '9':
16862 tokadd(p, '$');
16863 do {
16864 tokadd(p, c);
16865 c = nextc(p);
16866 } while (c != -1 && ISDIGIT(c));
16867 pushback(p, c);
16868 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
16869 tokfix(p);
16870 c = parse_numvar(p);
16871 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
16872 return tNTH_REF;
16873
16874 default:
16875 if (!parser_is_identchar(p)) {
16876 YYLTYPE loc = RUBY_INIT_YYLLOC();
16877 if (c == -1 || ISSPACE(c)) {
16878 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
16879 }
16880 else {
16881 pushback(p, c);
16882 compile_error(p, "`$%c' is not allowed as a global variable name", c);
16883 }
16884 parser_show_error_line(p, &loc);
16885 set_yylval_noname();
16886 return tGVAR;
16887 }
16888 /* fall through */
16889 case '0':
16890 tokadd(p, '$');
16891 }
16892
16893 if (tokadd_ident(p, c)) return 0;
16894 SET_LEX_STATE(EXPR_END);
16895 tokenize_ident(p, last_state);
16896 return tGVAR;
16897}
16898
16899#ifndef RIPPER
16900static bool
16901parser_numbered_param(struct parser_params *p, int n)
16902{
16903 if (n < 0) return false;
16904
16905 if (DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev)) {
16906 return false;
16907 }
16908 if (p->max_numparam == ORDINAL_PARAM) {
16909 compile_error(p, "ordinary parameter is defined");
16910 return false;
16911 }
16912 struct vtable *args = p->lvtbl->args;
16913 if (p->max_numparam < n) {
16914 p->max_numparam = n;
16915 }
16916 while (n > args->pos) {
16917 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
16918 }
16919 return true;
16920}
16921#endif
16922
16923static enum yytokentype
16924parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
16925{
16926 const char *ptr = p->lex.pcur;
16927 enum yytokentype result = tIVAR;
16928 register int c = nextc(p);
16929 YYLTYPE loc;
16930
16931 p->lex.ptok = ptr - 1; /* from '@' */
16932 newtok(p);
16933 tokadd(p, '@');
16934 if (c == '@') {
16935 result = tCVAR;
16936 tokadd(p, '@');
16937 c = nextc(p);
16938 }
16939 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
16940 if (c == -1 || !parser_is_identchar(p)) {
16941 pushback(p, c);
16942 RUBY_SET_YYLLOC(loc);
16943 if (result == tIVAR) {
16944 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
16945 }
16946 else {
16947 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
16948 }
16949 parser_show_error_line(p, &loc);
16950 set_yylval_noname();
16951 SET_LEX_STATE(EXPR_END);
16952 return result;
16953 }
16954 else if (ISDIGIT(c)) {
16955 pushback(p, c);
16956 RUBY_SET_YYLLOC(loc);
16957 if (result == tIVAR) {
16958 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
16959 }
16960 else {
16961 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
16962 }
16963 parser_show_error_line(p, &loc);
16964 set_yylval_noname();
16965 SET_LEX_STATE(EXPR_END);
16966 return result;
16967 }
16968
16969 if (tokadd_ident(p, c)) return 0;
16970 tokenize_ident(p, last_state);
16971 return result;
16972}
16973
16974static enum yytokentype
16975parse_ident(struct parser_params *p, int c, int cmd_state)
16976{
16977 enum yytokentype result;
16978 int mb = ENC_CODERANGE_7BIT;
16979 const enum lex_state_e last_state = p->lex.state;
16980 ID ident;
16981
16982 do {
16983 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
16984 if (tokadd_mbchar(p, c) == -1) return 0;
16985 c = nextc(p);
16986 } while (parser_is_identchar(p));
16987 if ((c == '!' || c == '?') && !peek(p, '=')) {
16988 result = tFID;
16989 tokadd(p, c);
16990 }
16991 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
16992 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
16993 result = tIDENTIFIER;
16994 tokadd(p, c);
16995 }
16996 else {
16997 result = tCONSTANT; /* assume provisionally */
16998 pushback(p, c);
16999 }
17000 tokfix(p);
17001
17002 if (IS_LABEL_POSSIBLE()) {
17003 if (IS_LABEL_SUFFIX(0)) {
17004 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
17005 nextc(p);
17006 set_yylval_name(TOK_INTERN());
17007 return tLABEL;
17008 }
17009 }
17010 if (mb == ENC_CODERANGE_7BIT && !IS_lex_state(EXPR_DOT)) {
17011 const struct kwtable *kw;
17012
17013 /* See if it is a reserved word. */
17014 kw = rb_reserved_word(tok(p), toklen(p));
17015 if (kw) {
17016 enum lex_state_e state = p->lex.state;
17017 if (IS_lex_state_for(state, EXPR_FNAME)) {
17018 SET_LEX_STATE(EXPR_ENDFN);
17019 set_yylval_name(rb_intern2(tok(p), toklen(p)));
17020 return kw->id[0];
17021 }
17022 SET_LEX_STATE(kw->state);
17023 if (IS_lex_state(EXPR_BEG)) {
17024 p->command_start = TRUE;
17025 }
17026 if (kw->id[0] == keyword_do) {
17027 if (lambda_beginning_p()) {
17028 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
17029 return keyword_do_LAMBDA;
17030 }
17031 if (COND_P()) return keyword_do_cond;
17032 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
17033 return keyword_do_block;
17034 return keyword_do;
17035 }
17036 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED)))
17037 return kw->id[0];
17038 else {
17039 if (kw->id[0] != kw->id[1])
17040 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
17041 return kw->id[1];
17042 }
17043 }
17044 }
17045
17046 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
17047 if (cmd_state) {
17048 SET_LEX_STATE(EXPR_CMDARG);
17049 }
17050 else {
17051 SET_LEX_STATE(EXPR_ARG);
17052 }
17053 }
17054 else if (p->lex.state == EXPR_FNAME) {
17055 SET_LEX_STATE(EXPR_ENDFN);
17056 }
17057 else {
17058 SET_LEX_STATE(EXPR_END);
17059 }
17060
17061 ident = tokenize_ident(p, last_state);
17062 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
17063 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
17064 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
17065 lvar_defined(p, ident)) {
17066 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
17067 }
17068 return result;
17069}
17070
17071static enum yytokentype
17072parser_yylex(struct parser_params *p)
17073{
17074 register int c;
17075 int space_seen = 0;
17076 int cmd_state;
17077 int label;
17078 enum lex_state_e last_state;
17079 int fallthru = FALSE;
17080 int token_seen = p->token_seen;
17081
17082 if (p->lex.strterm) {
17083 if (p->lex.strterm->flags & STRTERM_HEREDOC) {
17084 return here_document(p, &p->lex.strterm->u.heredoc);
17085 }
17086 else {
17087 token_flush(p);
17088 return parse_string(p, &p->lex.strterm->u.literal);
17089 }
17090 }
17091 cmd_state = p->command_start;
17092 p->command_start = FALSE;
17093 p->token_seen = TRUE;
17094 retry:
17095 last_state = p->lex.state;
17096#ifndef RIPPER
17097 token_flush(p);
17098#endif
17099 switch (c = nextc(p)) {
17100 case '\0': /* NUL */
17101 case '\004': /* ^D */
17102 case '\032': /* ^Z */
17103 case -1: /* end of script. */
17104 return 0;
17105
17106 /* white spaces */
17107 case '\r':
17108 if (!p->cr_seen) {
17109 p->cr_seen = TRUE;
17110 /* carried over with p->lex.nextline for nextc() */
17111 rb_warn0("encountered \\r in middle of line, treated as a mere space");
17112 }
17113 /* fall through */
17114 case ' ': case '\t': case '\f':
17115 case '\13': /* '\v' */
17116 space_seen = 1;
17117#ifdef RIPPER
17118 while ((c = nextc(p))) {
17119 switch (c) {
17120 case ' ': case '\t': case '\f': case '\r':
17121 case '\13': /* '\v' */
17122 break;
17123 default:
17124 goto outofloop;
17125 }
17126 }
17127 outofloop:
17128 pushback(p, c);
17129 dispatch_scan_event(p, tSP);
17130#endif
17131 goto retry;
17132
17133 case '#': /* it's a comment */
17134 p->token_seen = token_seen;
17135 /* no magic_comment in shebang line */
17136 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
17137 if (comment_at_top(p)) {
17138 set_file_encoding(p, p->lex.pcur, p->lex.pend);
17139 }
17140 }
17141 lex_goto_eol(p);
17142 dispatch_scan_event(p, tCOMMENT);
17143 fallthru = TRUE;
17144 /* fall through */
17145 case '\n':
17146 p->token_seen = token_seen;
17147 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
17148 !IS_lex_state(EXPR_LABELED));
17149 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
17150 if (!fallthru) {
17151 dispatch_scan_event(p, tIGNORED_NL);
17152 }
17153 fallthru = FALSE;
17154 if (!c && p->ctxt.in_kwarg) {
17155 goto normal_newline;
17156 }
17157 goto retry;
17158 }
17159 while (1) {
17160 switch (c = nextc(p)) {
17161 case ' ': case '\t': case '\f': case '\r':
17162 case '\13': /* '\v' */
17163 space_seen = 1;
17164 break;
17165 case '#':
17166 pushback(p, c);
17167 if (space_seen) dispatch_scan_event(p, tSP);
17168 goto retry;
17169 case '&':
17170 case '.': {
17171 dispatch_delayed_token(p, tIGNORED_NL);
17172 if (peek(p, '.') == (c == '&')) {
17173 pushback(p, c);
17174 dispatch_scan_event(p, tSP);
17175 goto retry;
17176 }
17177 }
17178 default:
17179 p->ruby_sourceline--;
17180 p->lex.nextline = p->lex.lastline;
17181 case -1: /* EOF no decrement*/
17182#ifndef RIPPER
17183 if (p->lex.prevline && !p->eofp) p->lex.lastline = p->lex.prevline;
17184 p->lex.pbeg = RSTRING_PTR(p->lex.lastline);
17185 p->lex.pend = p->lex.pcur = p->lex.pbeg + RSTRING_LEN(p->lex.lastline);
17186 pushback(p, 1); /* always pushback */
17187 p->lex.ptok = p->lex.pcur;
17188#else
17189 lex_goto_eol(p);
17190 if (c != -1) {
17191 p->lex.ptok = p->lex.pcur;
17192 }
17193#endif
17194 goto normal_newline;
17195 }
17196 }
17197 normal_newline:
17198 p->command_start = TRUE;
17199 SET_LEX_STATE(EXPR_BEG);
17200 return '\n';
17201
17202 case '*':
17203 if ((c = nextc(p)) == '*') {
17204 if ((c = nextc(p)) == '=') {
17205 set_yylval_id(idPow);
17206 SET_LEX_STATE(EXPR_BEG);
17207 return tOP_ASGN;
17208 }
17209 pushback(p, c);
17210 if (IS_SPCARG(c)) {
17211 rb_warning0("`**' interpreted as argument prefix");
17212 c = tDSTAR;
17213 }
17214 else if (IS_BEG()) {
17215 c = tDSTAR;
17216 }
17217 else {
17218 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
17219 }
17220 }
17221 else {
17222 if (c == '=') {
17223 set_yylval_id('*');
17224 SET_LEX_STATE(EXPR_BEG);
17225 return tOP_ASGN;
17226 }
17227 pushback(p, c);
17228 if (IS_SPCARG(c)) {
17229 rb_warning0("`*' interpreted as argument prefix");
17230 c = tSTAR;
17231 }
17232 else if (IS_BEG()) {
17233 c = tSTAR;
17234 }
17235 else {
17236 c = warn_balanced('*', "*", "argument prefix");
17237 }
17238 }
17239 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17240 return c;
17241
17242 case '!':
17243 c = nextc(p);
17244 if (IS_AFTER_OPERATOR()) {
17245 SET_LEX_STATE(EXPR_ARG);
17246 if (c == '@') {
17247 return '!';
17248 }
17249 }
17250 else {
17251 SET_LEX_STATE(EXPR_BEG);
17252 }
17253 if (c == '=') {
17254 return tNEQ;
17255 }
17256 if (c == '~') {
17257 return tNMATCH;
17258 }
17259 pushback(p, c);
17260 return '!';
17261
17262 case '=':
17263 if (was_bol(p)) {
17264 /* skip embedded rd document */
17265 if (word_match_p(p, "begin", 5)) {
17266 int first_p = TRUE;
17267
17268 lex_goto_eol(p);
17269 dispatch_scan_event(p, tEMBDOC_BEG);
17270 for (;;) {
17271 lex_goto_eol(p);
17272 if (!first_p) {
17273 dispatch_scan_event(p, tEMBDOC);
17274 }
17275 first_p = FALSE;
17276 c = nextc(p);
17277 if (c == -1) {
17278 compile_error(p, "embedded document meets end of file");
17279 return 0;
17280 }
17281 if (c == '=' && word_match_p(p, "end", 3)) {
17282 break;
17283 }
17284 pushback(p, c);
17285 }
17286 lex_goto_eol(p);
17287 dispatch_scan_event(p, tEMBDOC_END);
17288 goto retry;
17289 }
17290 }
17291
17292 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17293 if ((c = nextc(p)) == '=') {
17294 if ((c = nextc(p)) == '=') {
17295 return tEQQ;
17296 }
17297 pushback(p, c);
17298 return tEQ;
17299 }
17300 if (c == '~') {
17301 return tMATCH;
17302 }
17303 else if (c == '>') {
17304 return tASSOC;
17305 }
17306 pushback(p, c);
17307 return '=';
17308
17309 case '<':
17310 c = nextc(p);
17311 if (c == '<' &&
17312 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
17313 !IS_END() &&
17314 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
17315 int token = heredoc_identifier(p);
17316 if (token) return token < 0 ? 0 : token;
17317 }
17318 if (IS_AFTER_OPERATOR()) {
17319 SET_LEX_STATE(EXPR_ARG);
17320 }
17321 else {
17322 if (IS_lex_state(EXPR_CLASS))
17323 p->command_start = TRUE;
17324 SET_LEX_STATE(EXPR_BEG);
17325 }
17326 if (c == '=') {
17327 if ((c = nextc(p)) == '>') {
17328 return tCMP;
17329 }
17330 pushback(p, c);
17331 return tLEQ;
17332 }
17333 if (c == '<') {
17334 if ((c = nextc(p)) == '=') {
17335 set_yylval_id(idLTLT);
17336 SET_LEX_STATE(EXPR_BEG);
17337 return tOP_ASGN;
17338 }
17339 pushback(p, c);
17340 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
17341 }
17342 pushback(p, c);
17343 return '<';
17344
17345 case '>':
17346 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17347 if ((c = nextc(p)) == '=') {
17348 return tGEQ;
17349 }
17350 if (c == '>') {
17351 if ((c = nextc(p)) == '=') {
17352 set_yylval_id(idGTGT);
17353 SET_LEX_STATE(EXPR_BEG);
17354 return tOP_ASGN;
17355 }
17356 pushback(p, c);
17357 return tRSHFT;
17358 }
17359 pushback(p, c);
17360 return '>';
17361
17362 case '"':
17363 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
17364 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
17365 p->lex.ptok = p->lex.pcur-1;
17366 return tSTRING_BEG;
17367
17368 case '`':
17369 if (IS_lex_state(EXPR_FNAME)) {
17370 SET_LEX_STATE(EXPR_ENDFN);
17371 return c;
17372 }
17373 if (IS_lex_state(EXPR_DOT)) {
17374 if (cmd_state)
17375 SET_LEX_STATE(EXPR_CMDARG);
17376 else
17377 SET_LEX_STATE(EXPR_ARG);
17378 return c;
17379 }
17380 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
17381 return tXSTRING_BEG;
17382
17383 case '\'':
17384 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
17385 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
17386 p->lex.ptok = p->lex.pcur-1;
17387 return tSTRING_BEG;
17388
17389 case '?':
17390 return parse_qmark(p, space_seen);
17391
17392 case '&':
17393 if ((c = nextc(p)) == '&') {
17394 SET_LEX_STATE(EXPR_BEG);
17395 if ((c = nextc(p)) == '=') {
17396 set_yylval_id(idANDOP);
17397 SET_LEX_STATE(EXPR_BEG);
17398 return tOP_ASGN;
17399 }
17400 pushback(p, c);
17401 return tANDOP;
17402 }
17403 else if (c == '=') {
17404 set_yylval_id('&');
17405 SET_LEX_STATE(EXPR_BEG);
17406 return tOP_ASGN;
17407 }
17408 else if (c == '.') {
17409 set_yylval_id(idANDDOT);
17410 SET_LEX_STATE(EXPR_DOT);
17411 return tANDDOT;
17412 }
17413 pushback(p, c);
17414 if (IS_SPCARG(c)) {
17415 if ((c != ':') ||
17416 (c = peekc_n(p, 1)) == -1 ||
17417 !(c == '\'' || c == '"' ||
17418 is_identchar((p->lex.pcur+1), p->lex.pend, p->enc))) {
17419 rb_warning0("`&' interpreted as argument prefix");
17420 }
17421 c = tAMPER;
17422 }
17423 else if (IS_BEG()) {
17424 c = tAMPER;
17425 }
17426 else {
17427 c = warn_balanced('&', "&", "argument prefix");
17428 }
17429 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17430 return c;
17431
17432 case '|':
17433 if ((c = nextc(p)) == '|') {
17434 SET_LEX_STATE(EXPR_BEG);
17435 if ((c = nextc(p)) == '=') {
17436 set_yylval_id(idOROP);
17437 SET_LEX_STATE(EXPR_BEG);
17438 return tOP_ASGN;
17439 }
17440 pushback(p, c);
17441 if (IS_lex_state_for(last_state, EXPR_BEG)) {
17442 c = '|';
17443 pushback(p, '|');
17444 return c;
17445 }
17446 return tOROP;
17447 }
17448 if (c == '=') {
17449 set_yylval_id('|');
17450 SET_LEX_STATE(EXPR_BEG);
17451 return tOP_ASGN;
17452 }
17453 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
17454 pushback(p, c);
17455 return '|';
17456
17457 case '+':
17458 c = nextc(p);
17459 if (IS_AFTER_OPERATOR()) {
17460 SET_LEX_STATE(EXPR_ARG);
17461 if (c == '@') {
17462 return tUPLUS;
17463 }
17464 pushback(p, c);
17465 return '+';
17466 }
17467 if (c == '=') {
17468 set_yylval_id('+');
17469 SET_LEX_STATE(EXPR_BEG);
17470 return tOP_ASGN;
17471 }
17472 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
17473 SET_LEX_STATE(EXPR_BEG);
17474 pushback(p, c);
17475 if (c != -1 && ISDIGIT(c)) {
17476 return parse_numeric(p, '+');
17477 }
17478 return tUPLUS;
17479 }
17480 SET_LEX_STATE(EXPR_BEG);
17481 pushback(p, c);
17482 return warn_balanced('+', "+", "unary operator");
17483
17484 case '-':
17485 c = nextc(p);
17486 if (IS_AFTER_OPERATOR()) {
17487 SET_LEX_STATE(EXPR_ARG);
17488 if (c == '@') {
17489 return tUMINUS;
17490 }
17491 pushback(p, c);
17492 return '-';
17493 }
17494 if (c == '=') {
17495 set_yylval_id('-');
17496 SET_LEX_STATE(EXPR_BEG);
17497 return tOP_ASGN;
17498 }
17499 if (c == '>') {
17500 SET_LEX_STATE(EXPR_ENDFN);
17501 return tLAMBDA;
17502 }
17503 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
17504 SET_LEX_STATE(EXPR_BEG);
17505 pushback(p, c);
17506 if (c != -1 && ISDIGIT(c)) {
17507 return tUMINUS_NUM;
17508 }
17509 return tUMINUS;
17510 }
17511 SET_LEX_STATE(EXPR_BEG);
17512 pushback(p, c);
17513 return warn_balanced('-', "-", "unary operator");
17514
17515 case '.': {
17516 int is_beg = IS_BEG();
17517 SET_LEX_STATE(EXPR_BEG);
17518 if ((c = nextc(p)) == '.') {
17519 if ((c = nextc(p)) == '.') {
17520 if (p->ctxt.in_argdef) {
17521 SET_LEX_STATE(EXPR_ENDARG);
17522 return tBDOT3;
17523 }
17524 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
17525 rb_warn0("... at EOL, should be parenthesized?");
17526 }
17527 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
17528 if (IS_lex_state_for(last_state, EXPR_LABEL))
17529 return tDOT3;
17530 }
17531 return is_beg ? tBDOT3 : tDOT3;
17532 }
17533 pushback(p, c);
17534 return is_beg ? tBDOT2 : tDOT2;
17535 }
17536 pushback(p, c);
17537 if (c != -1 && ISDIGIT(c)) {
17538 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
17539 parse_numeric(p, '.');
17540 if (ISDIGIT(prev)) {
17541 yyerror0("unexpected fraction part after numeric literal");
17542 }
17543 else {
17544 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
17545 }
17546 SET_LEX_STATE(EXPR_END);
17547 p->lex.ptok = p->lex.pcur;
17548 goto retry;
17549 }
17550 set_yylval_id('.');
17551 SET_LEX_STATE(EXPR_DOT);
17552 return '.';
17553 }
17554
17555 case '0': case '1': case '2': case '3': case '4':
17556 case '5': case '6': case '7': case '8': case '9':
17557 return parse_numeric(p, c);
17558
17559 case ')':
17560 COND_POP();
17561 CMDARG_POP();
17562 SET_LEX_STATE(EXPR_ENDFN);
17563 p->lex.paren_nest--;
17564 return c;
17565
17566 case ']':
17567 COND_POP();
17568 CMDARG_POP();
17569 SET_LEX_STATE(EXPR_END);
17570 p->lex.paren_nest--;
17571 return c;
17572
17573 case '}':
17574 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
17575 if (!p->lex.brace_nest--) return tSTRING_DEND;
17576 COND_POP();
17577 CMDARG_POP();
17578 SET_LEX_STATE(EXPR_END);
17579 p->lex.paren_nest--;
17580 return c;
17581
17582 case ':':
17583 c = nextc(p);
17584 if (c == ':') {
17585 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
17586 SET_LEX_STATE(EXPR_BEG);
17587 return tCOLON3;
17588 }
17589 set_yylval_id(idCOLON2);
17590 SET_LEX_STATE(EXPR_DOT);
17591 return tCOLON2;
17592 }
17593 if (IS_END() || ISSPACE(c) || c == '#') {
17594 pushback(p, c);
17595 c = warn_balanced(':', ":", "symbol literal");
17596 SET_LEX_STATE(EXPR_BEG);
17597 return c;
17598 }
17599 switch (c) {
17600 case '\'':
17601 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
17602 break;
17603 case '"':
17604 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
17605 break;
17606 default:
17607 pushback(p, c);
17608 break;
17609 }
17610 SET_LEX_STATE(EXPR_FNAME);
17611 return tSYMBEG;
17612
17613 case '/':
17614 if (IS_BEG()) {
17615 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
17616 return tREGEXP_BEG;
17617 }
17618 if ((c = nextc(p)) == '=') {
17619 set_yylval_id('/');
17620 SET_LEX_STATE(EXPR_BEG);
17621 return tOP_ASGN;
17622 }
17623 pushback(p, c);
17624 if (IS_SPCARG(c)) {
17625 arg_ambiguous(p, '/');
17626 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
17627 return tREGEXP_BEG;
17628 }
17629 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17630 return warn_balanced('/', "/", "regexp literal");
17631
17632 case '^':
17633 if ((c = nextc(p)) == '=') {
17634 set_yylval_id('^');
17635 SET_LEX_STATE(EXPR_BEG);
17636 return tOP_ASGN;
17637 }
17638 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17639 pushback(p, c);
17640 return '^';
17641
17642 case ';':
17643 SET_LEX_STATE(EXPR_BEG);
17644 p->command_start = TRUE;
17645 return ';';
17646
17647 case ',':
17648 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17649 return ',';
17650
17651 case '~':
17652 if (IS_AFTER_OPERATOR()) {
17653 if ((c = nextc(p)) != '@') {
17654 pushback(p, c);
17655 }
17656 SET_LEX_STATE(EXPR_ARG);
17657 }
17658 else {
17659 SET_LEX_STATE(EXPR_BEG);
17660 }
17661 return '~';
17662
17663 case '(':
17664 if (IS_BEG()) {
17665 c = tLPAREN;
17666 }
17667 else if (!space_seen) {
17668 /* foo( ... ) => method call, no ambiguity */
17669 }
17670 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
17671 c = tLPAREN_ARG;
17672 }
17673 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
17674 rb_warning0("parentheses after method name is interpreted as "
17675 "an argument list, not a decomposed argument");
17676 }
17677 p->lex.paren_nest++;
17678 COND_PUSH(0);
17679 CMDARG_PUSH(0);
17680 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17681 return c;
17682
17683 case '[':
17684 p->lex.paren_nest++;
17685 if (IS_AFTER_OPERATOR()) {
17686 if ((c = nextc(p)) == ']') {
17687 p->lex.paren_nest--;
17688 SET_LEX_STATE(EXPR_ARG);
17689 if ((c = nextc(p)) == '=') {
17690 return tASET;
17691 }
17692 pushback(p, c);
17693 return tAREF;
17694 }
17695 pushback(p, c);
17696 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
17697 return '[';
17698 }
17699 else if (IS_BEG()) {
17700 c = tLBRACK;
17701 }
17702 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
17703 c = tLBRACK;
17704 }
17705 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17706 COND_PUSH(0);
17707 CMDARG_PUSH(0);
17708 return c;
17709
17710 case '{':
17711 ++p->lex.brace_nest;
17712 if (lambda_beginning_p())
17713 c = tLAMBEG;
17714 else if (IS_lex_state(EXPR_LABELED))
17715 c = tLBRACE; /* hash */
17716 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
17717 c = '{'; /* block (primary) */
17718 else if (IS_lex_state(EXPR_ENDARG))
17719 c = tLBRACE_ARG; /* block (expr) */
17720 else
17721 c = tLBRACE; /* hash */
17722 if (c != tLBRACE) {
17723 p->command_start = TRUE;
17724 SET_LEX_STATE(EXPR_BEG);
17725 }
17726 else {
17727 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17728 }
17729 ++p->lex.paren_nest; /* after lambda_beginning_p() */
17730 COND_PUSH(0);
17731 CMDARG_PUSH(0);
17732 return c;
17733
17734 case '\\':
17735 c = nextc(p);
17736 if (c == '\n') {
17737 space_seen = 1;
17738 dispatch_scan_event(p, tSP);
17739 goto retry; /* skip \\n */
17740 }
17741 if (c == ' ') return tSP;
17742 if (ISSPACE(c)) return c;
17743 pushback(p, c);
17744 return '\\';
17745
17746 case '%':
17747 return parse_percent(p, space_seen, last_state);
17748
17749 case '$':
17750 return parse_gvar(p, last_state);
17751
17752 case '@':
17753 return parse_atmark(p, last_state);
17754
17755 case '_':
17756 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
17757 p->ruby__end__seen = 1;
17758 p->eofp = 1;
17759#ifndef RIPPER
17760 return -1;
17761#else
17762 lex_goto_eol(p);
17763 dispatch_scan_event(p, k__END__);
17764 return 0;
17765#endif
17766 }
17767 newtok(p);
17768 break;
17769
17770 default:
17771 if (!parser_is_identchar(p)) {
17772 compile_error(p, "Invalid char `\\x%02X' in expression", c);
17773 token_flush(p);
17774 goto retry;
17775 }
17776
17777 newtok(p);
17778 break;
17779 }
17780
17781 return parse_ident(p, c, cmd_state);
17782}
17783
17784static enum yytokentype
17785yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
17786{
17787 enum yytokentype t;
17788
17789 p->lval = lval;
17790 lval->val = Qundef;
17791 t = parser_yylex(p);
17792
17793 if (p->lex.strterm && (p->lex.strterm->flags & STRTERM_HEREDOC))
17794 RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*yylloc);
17795 else
17796 RUBY_SET_YYLLOC(*yylloc);
17797
17798 if (has_delayed_token(p))
17799 dispatch_delayed_token(p, t);
17800 else if (t != 0)
17801 dispatch_scan_event(p, t);
17802
17803 return t;
17804}
17805
17806#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
17807
17808static NODE*
17809node_newnode(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2, const rb_code_location_t *loc)
17810{
17811 NODE *n = rb_ast_newnode(p->ast, type);
17812
17813 rb_node_init(n, type, a0, a1, a2);
17814
17815 nd_set_loc(n, loc);
17816 nd_set_node_id(n, parser_get_node_id(p));
17817 return n;
17818}
17819
17820static NODE *
17821nd_set_loc(NODE *nd, const YYLTYPE *loc)
17822{
17823 nd->nd_loc = *loc;
17824 nd_set_line(nd, loc->beg_pos.lineno);
17825 return nd;
17826}
17827
17828#ifndef RIPPER
17829static enum node_type
17830nodetype(NODE *node) /* for debug */
17831{
17832 return (enum node_type)nd_type(node);
17833}
17834
17835static int
17836nodeline(NODE *node)
17837{
17838 return nd_line(node);
17839}
17840
17841static NODE*
17842newline_node(NODE *node)
17843{
17844 if (node) {
17845 node = remove_begin(node);
17846 node->flags |= NODE_FL_NEWLINE;
17847 }
17848 return node;
17849}
17850
17851static void
17852fixpos(NODE *node, NODE *orig)
17853{
17854 if (!node) return;
17855 if (!orig) return;
17856 nd_set_line(node, nd_line(orig));
17857}
17858
17859static void
17860parser_warning(struct parser_params *p, NODE *node, const char *mesg)
17861{
17862 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17863}
17864
17865static void
17866parser_warn(struct parser_params *p, NODE *node, const char *mesg)
17867{
17868 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17869}
17870
17871static NODE*
17872block_append(struct parser_params *p, NODE *head, NODE *tail)
17873{
17874 NODE *end, *h = head, *nd;
17875
17876 if (tail == 0) return head;
17877
17878 if (h == 0) return tail;
17879 switch (nd_type(h)) {
17880 case NODE_LIT:
17881 case NODE_STR:
17882 case NODE_SELF:
17883 case NODE_TRUE:
17884 case NODE_FALSE:
17885 case NODE_NIL:
17886 parser_warning(p, h, "unused literal ignored");
17887 return tail;
17888 default:
17889 h = end = NEW_BLOCK(head, &head->nd_loc);
17890 end->nd_end = end;
17891 head = end;
17892 break;
17893 case NODE_BLOCK:
17894 end = h->nd_end;
17895 break;
17896 }
17897
17898 nd = end->nd_head;
17899 switch (nd_type(nd)) {
17900 case NODE_RETURN:
17901 case NODE_BREAK:
17902 case NODE_NEXT:
17903 case NODE_REDO:
17904 case NODE_RETRY:
17905 if (RTEST(ruby_verbose)) {
17906 parser_warning(p, tail, "statement not reached");
17907 }
17908 break;
17909
17910 default:
17911 break;
17912 }
17913
17914 if (!nd_type_p(tail, NODE_BLOCK)) {
17915 tail = NEW_BLOCK(tail, &tail->nd_loc);
17916 tail->nd_end = tail;
17917 }
17918 end->nd_next = tail;
17919 h->nd_end = tail->nd_end;
17920 nd_set_last_loc(head, nd_last_loc(tail));
17921 return head;
17922}
17923
17924/* append item to the list */
17925static NODE*
17926list_append(struct parser_params *p, NODE *list, NODE *item)
17927{
17928 NODE *last;
17929
17930 if (list == 0) return NEW_LIST(item, &item->nd_loc);
17931 if (list->nd_next) {
17932 last = list->nd_next->nd_end;
17933 }
17934 else {
17935 last = list;
17936 }
17937
17938 list->nd_alen += 1;
17939 last->nd_next = NEW_LIST(item, &item->nd_loc);
17940 list->nd_next->nd_end = last->nd_next;
17941
17942 nd_set_last_loc(list, nd_last_loc(item));
17943
17944 return list;
17945}
17946
17947/* concat two lists */
17948static NODE*
17949list_concat(NODE *head, NODE *tail)
17950{
17951 NODE *last;
17952
17953 if (head->nd_next) {
17954 last = head->nd_next->nd_end;
17955 }
17956 else {
17957 last = head;
17958 }
17959
17960 head->nd_alen += tail->nd_alen;
17961 last->nd_next = tail;
17962 if (tail->nd_next) {
17963 head->nd_next->nd_end = tail->nd_next->nd_end;
17964 }
17965 else {
17966 head->nd_next->nd_end = tail;
17967 }
17968
17969 nd_set_last_loc(head, nd_last_loc(tail));
17970
17971 return head;
17972}
17973
17974static int
17975literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
17976{
17977 if (NIL_P(tail)) return 1;
17978 if (!rb_enc_compatible(head, tail)) {
17979 compile_error(p, "string literal encodings differ (%s / %s)",
17980 rb_enc_name(rb_enc_get(head)),
17981 rb_enc_name(rb_enc_get(tail)));
17982 rb_str_resize(head, 0);
17983 rb_str_resize(tail, 0);
17984 return 0;
17985 }
17986 rb_str_buf_append(head, tail);
17987 return 1;
17988}
17989
17990static VALUE
17991string_literal_head(enum node_type htype, NODE *head)
17992{
17993 if (htype != NODE_DSTR) return Qfalse;
17994 if (head->nd_next) {
17995 head = head->nd_next->nd_end->nd_head;
17996 if (!head || !nd_type_p(head, NODE_STR)) return Qfalse;
17997 }
17998 const VALUE lit = head->nd_lit;
17999 ASSUME(lit != Qfalse);
18000 return lit;
18001}
18002
18003/* concat two string literals */
18004static NODE *
18005literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
18006{
18007 enum node_type htype;
18008 VALUE lit;
18009
18010 if (!head) return tail;
18011 if (!tail) return head;
18012
18013 htype = nd_type(head);
18014 if (htype == NODE_EVSTR) {
18015 head = new_dstr(p, head, loc);
18016 htype = NODE_DSTR;
18017 }
18018 if (p->heredoc_indent > 0) {
18019 switch (htype) {
18020 case NODE_STR:
18021 nd_set_type(head, NODE_DSTR);
18022 case NODE_DSTR:
18023 return list_append(p, head, tail);
18024 default:
18025 break;
18026 }
18027 }
18028 switch (nd_type(tail)) {
18029 case NODE_STR:
18030 if ((lit = string_literal_head(htype, head)) != Qfalse) {
18031 htype = NODE_STR;
18032 }
18033 else {
18034 lit = head->nd_lit;
18035 }
18036 if (htype == NODE_STR) {
18037 if (!literal_concat0(p, lit, tail->nd_lit)) {
18038 error:
18039 rb_discard_node(p, head);
18040 rb_discard_node(p, tail);
18041 return 0;
18042 }
18043 rb_discard_node(p, tail);
18044 }
18045 else {
18046 list_append(p, head, tail);
18047 }
18048 break;
18049
18050 case NODE_DSTR:
18051 if (htype == NODE_STR) {
18052 if (!literal_concat0(p, head->nd_lit, tail->nd_lit))
18053 goto error;
18054 tail->nd_lit = head->nd_lit;
18055 rb_discard_node(p, head);
18056 head = tail;
18057 }
18058 else if (NIL_P(tail->nd_lit)) {
18059 append:
18060 head->nd_alen += tail->nd_alen - 1;
18061 if (!head->nd_next) {
18062 head->nd_next = tail->nd_next;
18063 }
18064 else if (tail->nd_next) {
18065 head->nd_next->nd_end->nd_next = tail->nd_next;
18066 head->nd_next->nd_end = tail->nd_next->nd_end;
18067 }
18068 rb_discard_node(p, tail);
18069 }
18070 else if ((lit = string_literal_head(htype, head)) != Qfalse) {
18071 if (!literal_concat0(p, lit, tail->nd_lit))
18072 goto error;
18073 tail->nd_lit = Qnil;
18074 goto append;
18075 }
18076 else {
18077 list_concat(head, NEW_NODE(NODE_LIST, NEW_STR(tail->nd_lit, loc), tail->nd_alen, tail->nd_next, loc));
18078 }
18079 break;
18080
18081 case NODE_EVSTR:
18082 if (htype == NODE_STR) {
18083 nd_set_type(head, NODE_DSTR);
18084 head->nd_alen = 1;
18085 }
18086 list_append(p, head, tail);
18087 break;
18088 }
18089 return head;
18090}
18091
18092static NODE *
18093evstr2dstr(struct parser_params *p, NODE *node)
18094{
18095 if (nd_type_p(node, NODE_EVSTR)) {
18096 node = new_dstr(p, node, &node->nd_loc);
18097 }
18098 return node;
18099}
18100
18101static NODE *
18102new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18103{
18104 NODE *head = node;
18105
18106 if (node) {
18107 switch (nd_type(node)) {
18108 case NODE_STR:
18109 nd_set_type(node, NODE_DSTR);
18110 return node;
18111 case NODE_DSTR:
18112 break;
18113 case NODE_EVSTR:
18114 return node;
18115 }
18116 }
18117 return NEW_EVSTR(head, loc);
18118}
18119
18120static NODE *
18121new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18122{
18123 VALUE lit = STR_NEW0();
18124 NODE *dstr = NEW_DSTR(lit, loc);
18125 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18126 return list_append(p, dstr, node);
18127}
18128
18129static NODE *
18130call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
18131 const YYLTYPE *op_loc, const YYLTYPE *loc)
18132{
18133 NODE *expr;
18134 value_expr(recv);
18135 value_expr(arg1);
18136 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
18137 nd_set_line(expr, op_loc->beg_pos.lineno);
18138 return expr;
18139}
18140
18141static NODE *
18142call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
18143{
18144 NODE *opcall;
18145 value_expr(recv);
18146 opcall = NEW_OPCALL(recv, id, 0, loc);
18147 nd_set_line(opcall, op_loc->beg_pos.lineno);
18148 return opcall;
18149}
18150
18151static NODE *
18152new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
18153{
18154 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
18155 nd_set_line(qcall, op_loc->beg_pos.lineno);
18156 return qcall;
18157}
18158
18159static NODE*
18160new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
18161{
18162 NODE *ret;
18163 if (block) block_dup_check(p, args, block);
18164 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
18165 if (block) ret = method_add_block(p, ret, block, loc);
18166 fixpos(ret, recv);
18167 return ret;
18168}
18169
18170#define nd_once_body(node) (nd_type_p((node), NODE_ONCE) ? (node)->nd_body : node)
18171static NODE*
18172match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
18173{
18174 NODE *n;
18175 int line = op_loc->beg_pos.lineno;
18176
18177 value_expr(node1);
18178 value_expr(node2);
18179 if (node1 && (n = nd_once_body(node1)) != 0) {
18180 switch (nd_type(n)) {
18181 case NODE_DREGX:
18182 {
18183 NODE *match = NEW_MATCH2(node1, node2, loc);
18184 nd_set_line(match, line);
18185 return match;
18186 }
18187
18188 case NODE_LIT:
18189 if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
18190 const VALUE lit = n->nd_lit;
18191 NODE *match = NEW_MATCH2(node1, node2, loc);
18192 match->nd_args = reg_named_capture_assign(p, lit, loc);
18193 nd_set_line(match, line);
18194 return match;
18195 }
18196 }
18197 }
18198
18199 if (node2 && (n = nd_once_body(node2)) != 0) {
18200 NODE *match3;
18201
18202 switch (nd_type(n)) {
18203 case NODE_LIT:
18204 if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
18205 /* fallthru */
18206 case NODE_DREGX:
18207 match3 = NEW_MATCH3(node2, node1, loc);
18208 return match3;
18209 }
18210 }
18211
18212 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
18213 nd_set_line(n, line);
18214 return n;
18215}
18216
18217# if WARN_PAST_SCOPE
18218static int
18219past_dvar_p(struct parser_params *p, ID id)
18220{
18221 struct vtable *past = p->lvtbl->past;
18222 while (past) {
18223 if (vtable_included(past, id)) return 1;
18224 past = past->prev;
18225 }
18226 return 0;
18227}
18228# endif
18229
18230static int
18231numparam_nested_p(struct parser_params *p)
18232{
18233 struct local_vars *local = p->lvtbl;
18234 NODE *outer = local->numparam.outer;
18235 NODE *inner = local->numparam.inner;
18236 if (outer || inner) {
18237 NODE *used = outer ? outer : inner;
18238 compile_error(p, "numbered parameter is already used in\n"
18239 "%s:%d: %s block here",
18240 p->ruby_sourcefile, nd_line(used),
18241 outer ? "outer" : "inner");
18242 parser_show_error_line(p, &used->nd_loc);
18243 return 1;
18244 }
18245 return 0;
18246}
18247
18248static NODE*
18249gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
18250{
18251 ID *vidp = NULL;
18252 NODE *node;
18253 switch (id) {
18254 case keyword_self:
18255 return NEW_SELF(loc);
18256 case keyword_nil:
18257 return NEW_NIL(loc);
18258 case keyword_true:
18259 return NEW_TRUE(loc);
18260 case keyword_false:
18261 return NEW_FALSE(loc);
18262 case keyword__FILE__:
18263 {
18264 VALUE file = p->ruby_sourcefile_string;
18265 if (NIL_P(file))
18266 file = rb_str_new(0, 0);
18267 else
18268 file = rb_str_dup(file);
18269 node = NEW_STR(file, loc);
18270 RB_OBJ_WRITTEN(p->ast, Qnil, file);
18271 }
18272 return node;
18273 case keyword__LINE__:
18274 return NEW_LIT(INT2FIX(p->tokline), loc);
18275 case keyword__ENCODING__:
18276 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
18277 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
18278 return node;
18279
18280 }
18281 switch (id_type(id)) {
18282 case ID_LOCAL:
18283 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
18284 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
18285 if (id == p->cur_arg) {
18286 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
18287 return 0;
18288 }
18289 if (vidp) *vidp |= LVAR_USED;
18290 node = NEW_DVAR(id, loc);
18291 return node;
18292 }
18293 if (local_id_ref(p, id, &vidp)) {
18294 if (id == p->cur_arg) {
18295 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
18296 return 0;
18297 }
18298 if (vidp) *vidp |= LVAR_USED;
18299 node = NEW_LVAR(id, loc);
18300 return node;
18301 }
18302 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
18303 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
18304 if (numparam_nested_p(p)) return 0;
18305 node = NEW_DVAR(id, loc);
18306 struct local_vars *local = p->lvtbl;
18307 if (!local->numparam.current) local->numparam.current = node;
18308 return node;
18309 }
18310# if WARN_PAST_SCOPE
18311 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
18312 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
18313 }
18314# endif
18315 /* method call without arguments */
18316 return NEW_VCALL(id, loc);
18317 case ID_GLOBAL:
18318 return NEW_GVAR(id, loc);
18319 case ID_INSTANCE:
18320 return NEW_IVAR(id, loc);
18321 case ID_CONST:
18322 return NEW_CONST(id, loc);
18323 case ID_CLASS:
18324 return NEW_CVAR(id, loc);
18325 }
18326 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
18327 return 0;
18328}
18329
18330static NODE *
18331opt_arg_append(NODE *opt_list, NODE *opt)
18332{
18333 NODE *opts = opt_list;
18334 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
18335
18336 while (opts->nd_next) {
18337 opts = opts->nd_next;
18338 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
18339 }
18340 opts->nd_next = opt;
18341
18342 return opt_list;
18343}
18344
18345static NODE *
18346kwd_append(NODE *kwlist, NODE *kw)
18347{
18348 if (kwlist) {
18349 NODE *kws = kwlist;
18350 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
18351 while (kws->nd_next) {
18352 kws = kws->nd_next;
18353 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
18354 }
18355 kws->nd_next = kw;
18356 }
18357 return kwlist;
18358}
18359
18360static NODE *
18361new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
18362{
18363 return NEW_DEFINED(remove_begin_all(expr), loc);
18364}
18365
18366static NODE*
18367symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
18368{
18369 enum node_type type = nd_type(symbol);
18370 switch (type) {
18371 case NODE_DSTR:
18372 nd_set_type(symbol, NODE_DSYM);
18373 break;
18374 case NODE_STR:
18375 nd_set_type(symbol, NODE_LIT);
18376 RB_OBJ_WRITTEN(p->ast, Qnil, symbol->nd_lit = rb_str_intern(symbol->nd_lit));
18377 break;
18378 default:
18379 compile_error(p, "unexpected node as symbol: %s", ruby_node_name(type));
18380 }
18381 return list_append(p, symbols, symbol);
18382}
18383
18384static NODE *
18385new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
18386{
18387 NODE *list, *prev;
18388 VALUE lit;
18389
18390 if (!node) {
18391 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
18392 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
18393 return node;
18394 }
18395 switch (nd_type(node)) {
18396 case NODE_STR:
18397 {
18398 VALUE src = node->nd_lit;
18399 nd_set_type(node, NODE_LIT);
18400 nd_set_loc(node, loc);
18401 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
18402 }
18403 break;
18404 default:
18405 lit = STR_NEW0();
18406 node = NEW_NODE(NODE_DSTR, lit, 1, NEW_LIST(node, loc), loc);
18407 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18408 /* fall through */
18409 case NODE_DSTR:
18410 nd_set_type(node, NODE_DREGX);
18411 nd_set_loc(node, loc);
18412 node->nd_cflag = options & RE_OPTION_MASK;
18413 if (!NIL_P(node->nd_lit)) reg_fragment_check(p, node->nd_lit, options);
18414 for (list = (prev = node)->nd_next; list; list = list->nd_next) {
18415 NODE *frag = list->nd_head;
18416 enum node_type type = nd_type(frag);
18417 if (type == NODE_STR || (type == NODE_DSTR && !frag->nd_next)) {
18418 VALUE tail = frag->nd_lit;
18419 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(prev->nd_lit)) {
18420 VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
18421 if (!literal_concat0(p, lit, tail)) {
18422 return NEW_NIL(loc); /* dummy node on error */
18423 }
18424 rb_str_resize(tail, 0);
18425 prev->nd_next = list->nd_next;
18426 rb_discard_node(p, list->nd_head);
18427 rb_discard_node(p, list);
18428 list = prev;
18429 }
18430 else {
18431 prev = list;
18432 }
18433 }
18434 else {
18435 prev = 0;
18436 }
18437 }
18438 if (!node->nd_next) {
18439 VALUE src = node->nd_lit;
18440 nd_set_type(node, NODE_LIT);
18441 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
18442 }
18443 if (options & RE_OPTION_ONCE) {
18444 node = NEW_NODE(NODE_ONCE, 0, node, 0, loc);
18445 }
18446 break;
18447 }
18448 return node;
18449}
18450
18451static NODE *
18452new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
18453{
18454 if (!k) return 0;
18455 return NEW_KW_ARG(0, (k), loc);
18456}
18457
18458static NODE *
18459new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18460{
18461 if (!node) {
18462 VALUE lit = STR_NEW0();
18463 NODE *xstr = NEW_XSTR(lit, loc);
18464 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18465 return xstr;
18466 }
18467 switch (nd_type(node)) {
18468 case NODE_STR:
18469 nd_set_type(node, NODE_XSTR);
18470 nd_set_loc(node, loc);
18471 break;
18472 case NODE_DSTR:
18473 nd_set_type(node, NODE_DXSTR);
18474 nd_set_loc(node, loc);
18475 break;
18476 default:
18477 node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node, loc), loc);
18478 break;
18479 }
18480 return node;
18481}
18482
18483static void
18484check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
18485{
18486 VALUE lit;
18487
18488 if (!arg || !p->case_labels) return;
18489
18490 lit = rb_node_case_when_optimizable_literal(arg);
18491 if (lit == Qundef) return;
18492 if (nd_type_p(arg, NODE_STR)) {
18493 RB_OBJ_WRITTEN(p->ast, Qnil, arg->nd_lit = lit);
18494 }
18495
18496 if (NIL_P(p->case_labels)) {
18497 p->case_labels = rb_obj_hide(rb_hash_new());
18498 }
18499 else {
18500 VALUE line = rb_hash_lookup(p->case_labels, lit);
18501 if (!NIL_P(line)) {
18502 rb_warning1("duplicated `when' clause with line %d is ignored",
18503 WARN_IVAL(line));
18504 return;
18505 }
18506 }
18507 rb_hash_aset(p->case_labels, lit, INT2NUM(p->ruby_sourceline));
18508}
18509
18510#else /* !RIPPER */
18511static int
18512id_is_var(struct parser_params *p, ID id)
18513{
18514 if (is_notop_id(id)) {
18515 switch (id & ID_SCOPE_MASK) {
18516 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
18517 return 1;
18518 case ID_LOCAL:
18519 if (dyna_in_block(p)) {
18520 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
18521 }
18522 if (local_id(p, id)) return 1;
18523 /* method call without arguments */
18524 return 0;
18525 }
18526 }
18527 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
18528 return 0;
18529}
18530
18531static VALUE
18532new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
18533{
18534 VALUE src = 0, err;
18535 int options = 0;
18536 if (ripper_is_node_yylval(re)) {
18537 src = RNODE(re)->nd_cval;
18538 re = RNODE(re)->nd_rval;
18539 }
18540 if (ripper_is_node_yylval(opt)) {
18541 options = (int)RNODE(opt)->nd_tag;
18542 opt = RNODE(opt)->nd_rval;
18543 }
18544 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
18545 compile_error(p, "%"PRIsVALUE, err);
18546 }
18547 return dispatch2(regexp_literal, re, opt);
18548}
18549#endif /* !RIPPER */
18550
18551static inline enum lex_state_e
18552parser_set_lex_state(struct parser_params *p, enum lex_state_e ls, int line)
18553{
18554 if (p->debug) {
18555 ls = rb_parser_trace_lex_state(p, p->lex.state, ls, line);
18556 }
18557 return p->lex.state = ls;
18558}
18559
18560#ifndef RIPPER
18561static const char rb_parser_lex_state_names[][8] = {
18562 "BEG", "END", "ENDARG", "ENDFN", "ARG",
18563 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
18564 "LABEL", "LABELED","FITEM",
18565};
18566
18567static VALUE
18568append_lex_state_name(enum lex_state_e state, VALUE buf)
18569{
18570 int i, sep = 0;
18571 unsigned int mask = 1;
18572 static const char none[] = "NONE";
18573
18574 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
18575 if ((unsigned)state & mask) {
18576 if (sep) {
18577 rb_str_cat(buf, "|", 1);
18578 }
18579 sep = 1;
18580 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
18581 }
18582 }
18583 if (!sep) {
18584 rb_str_cat(buf, none, sizeof(none)-1);
18585 }
18586 return buf;
18587}
18588
18589static void
18590flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
18591{
18592 VALUE mesg = p->debug_buffer;
18593
18594 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
18595 p->debug_buffer = Qnil;
18596 rb_io_puts(1, &mesg, out);
18597 }
18598 if (!NIL_P(str) && RSTRING_LEN(str)) {
18599 rb_io_write(p->debug_output, str);
18600 }
18601}
18602
18603enum lex_state_e
18604rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
18605 enum lex_state_e to, int line)
18606{
18607 VALUE mesg;
18608 mesg = rb_str_new_cstr("lex_state: ");
18609 append_lex_state_name(from, mesg);
18610 rb_str_cat_cstr(mesg, " -> ");
18611 append_lex_state_name(to, mesg);
18612 rb_str_catf(mesg, " at line %d\n", line);
18613 flush_debug_buffer(p, p->debug_output, mesg);
18614 return to;
18615}
18616
18617VALUE
18618rb_parser_lex_state_name(enum lex_state_e state)
18619{
18620 return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
18621}
18622
18623static void
18624append_bitstack_value(stack_type stack, VALUE mesg)
18625{
18626 if (stack == 0) {
18627 rb_str_cat_cstr(mesg, "0");
18628 }
18629 else {
18630 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
18631 for (; mask && !(stack & mask); mask >>= 1) continue;
18632 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
18633 }
18634}
18635
18636void
18637rb_parser_show_bitstack(struct parser_params *p, stack_type stack,
18638 const char *name, int line)
18639{
18640 VALUE mesg = rb_sprintf("%s: ", name);
18641 append_bitstack_value(stack, mesg);
18642 rb_str_catf(mesg, " at line %d\n", line);
18643 flush_debug_buffer(p, p->debug_output, mesg);
18644}
18645
18646void
18647rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
18648{
18649 va_list ap;
18650 VALUE mesg = rb_str_new_cstr("internal parser error: ");
18651
18652 va_start(ap, fmt);
18653 rb_str_vcatf(mesg, fmt, ap);
18654 va_end(ap);
18655 yyerror0(RSTRING_PTR(mesg));
18656 RB_GC_GUARD(mesg);
18657
18658 mesg = rb_str_new(0, 0);
18659 append_lex_state_name(p->lex.state, mesg);
18660 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
18661 rb_str_resize(mesg, 0);
18662 append_bitstack_value(p->cond_stack, mesg);
18663 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
18664 rb_str_resize(mesg, 0);
18665 append_bitstack_value(p->cmdarg_stack, mesg);
18666 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
18667 if (p->debug_output == rb_ractor_stdout())
18668 p->debug_output = rb_ractor_stderr();
18669 p->debug = TRUE;
18670}
18671
18672static YYLTYPE *
18673rb_parser_set_pos(YYLTYPE *yylloc, int sourceline, int beg_pos, int end_pos)
18674{
18675 yylloc->beg_pos.lineno = sourceline;
18676 yylloc->beg_pos.column = beg_pos;
18677 yylloc->end_pos.lineno = sourceline;
18678 yylloc->end_pos.column = end_pos;
18679 return yylloc;
18680}
18681
18682YYLTYPE *
18683rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
18684{
18685 int sourceline = here->sourceline;
18686 int beg_pos = (int)here->offset - here->quote
18687 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
18688 int end_pos = (int)here->offset + here->length + here->quote;
18689
18690 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
18691}
18692
18693YYLTYPE *
18694rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
18695{
18696 int sourceline = p->ruby_sourceline;
18697 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
18698 int end_pos = (int)(p->lex.ptok - p->lex.pbeg);
18699 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
18700}
18701
18702YYLTYPE *
18703rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
18704{
18705 int sourceline = p->ruby_sourceline;
18706 int beg_pos = (int)(p->lex.ptok - p->lex.pbeg);
18707 int end_pos = (int)(p->lex.pcur - p->lex.pbeg);
18708 return rb_parser_set_pos(yylloc, sourceline, beg_pos, end_pos);
18709}
18710#endif /* !RIPPER */
18711
18712static int
18713assignable0(struct parser_params *p, ID id, const char **err)
18714{
18715 if (!id) return -1;
18716 switch (id) {
18717 case keyword_self:
18718 *err = "Can't change the value of self";
18719 return -1;
18720 case keyword_nil:
18721 *err = "Can't assign to nil";
18722 return -1;
18723 case keyword_true:
18724 *err = "Can't assign to true";
18725 return -1;
18726 case keyword_false:
18727 *err = "Can't assign to false";
18728 return -1;
18729 case keyword__FILE__:
18730 *err = "Can't assign to __FILE__";
18731 return -1;
18732 case keyword__LINE__:
18733 *err = "Can't assign to __LINE__";
18734 return -1;
18735 case keyword__ENCODING__:
18736 *err = "Can't assign to __ENCODING__";
18737 return -1;
18738 }
18739 switch (id_type(id)) {
18740 case ID_LOCAL:
18741 if (dyna_in_block(p)) {
18742 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
18743 compile_error(p, "Can't assign to numbered parameter _%d",
18744 NUMPARAM_ID_TO_IDX(id));
18745 return -1;
18746 }
18747 if (dvar_curr(p, id)) return NODE_DASGN;
18748 if (dvar_defined(p, id)) return NODE_DASGN;
18749 if (local_id(p, id)) return NODE_LASGN;
18750 dyna_var(p, id);
18751 return NODE_DASGN;
18752 }
18753 else {
18754 if (!local_id(p, id)) local_var(p, id);
18755 return NODE_LASGN;
18756 }
18757 break;
18758 case ID_GLOBAL: return NODE_GASGN;
18759 case ID_INSTANCE: return NODE_IASGN;
18760 case ID_CONST:
18761 if (!p->ctxt.in_def) return NODE_CDECL;
18762 *err = "dynamic constant assignment";
18763 return -1;
18764 case ID_CLASS: return NODE_CVASGN;
18765 default:
18766 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
18767 }
18768 return -1;
18769}
18770
18771#ifndef RIPPER
18772static NODE*
18773assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
18774{
18775 const char *err = 0;
18776 int node_type = assignable0(p, id, &err);
18777 switch (node_type) {
18778 case NODE_DASGN: return NEW_DASGN(id, val, loc);
18779 case NODE_LASGN: return NEW_LASGN(id, val, loc);
18780 case NODE_GASGN: return NEW_GASGN(id, val, loc);
18781 case NODE_IASGN: return NEW_IASGN(id, val, loc);
18782 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
18783 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
18784 }
18785 if (err) yyerror1(loc, err);
18786 return NEW_BEGIN(0, loc);
18787}
18788#else
18789static VALUE
18790assignable(struct parser_params *p, VALUE lhs)
18791{
18792 const char *err = 0;
18793 assignable0(p, get_id(lhs), &err);
18794 if (err) lhs = assign_error(p, err, lhs);
18795 return lhs;
18796}
18797#endif
18798
18799static int
18800is_private_local_id(ID name)
18801{
18802 VALUE s;
18803 if (name == idUScore) return 1;
18804 if (!is_local_id(name)) return 0;
18805 s = rb_id2str(name);
18806 if (!s) return 0;
18807 return RSTRING_PTR(s)[0] == '_';
18808}
18809
18810static int
18811shadowing_lvar_0(struct parser_params *p, ID name)
18812{
18813 if (is_private_local_id(name)) return 1;
18814 if (dyna_in_block(p)) {
18815 if (dvar_curr(p, name)) {
18816 yyerror0("duplicated argument name");
18817 }
18818 else if (dvar_defined(p, name) || local_id(p, name)) {
18819 vtable_add(p->lvtbl->vars, name);
18820 if (p->lvtbl->used) {
18821 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline | LVAR_USED);
18822 }
18823 return 0;
18824 }
18825 }
18826 else {
18827 if (local_id(p, name)) {
18828 yyerror0("duplicated argument name");
18829 }
18830 }
18831 return 1;
18832}
18833
18834static ID
18835shadowing_lvar(struct parser_params *p, ID name)
18836{
18837 shadowing_lvar_0(p, name);
18838 return name;
18839}
18840
18841static void
18842new_bv(struct parser_params *p, ID name)
18843{
18844 if (!name) return;
18845 if (!is_local_id(name)) {
18846 compile_error(p, "invalid local variable - %"PRIsVALUE,
18847 rb_id2str(name));
18848 return;
18849 }
18850 if (!shadowing_lvar_0(p, name)) return;
18851 dyna_var(p, name);
18852}
18853
18854#ifndef RIPPER
18855static NODE *
18856aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
18857{
18858 return NEW_ATTRASGN(recv, tASET, idx, loc);
18859}
18860
18861static void
18862block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
18863{
18864 if (node2 && node1 && nd_type_p(node1, NODE_BLOCK_PASS)) {
18865 compile_error(p, "both block arg and actual block given");
18866 }
18867}
18868
18869static NODE *
18870attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
18871{
18872 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
18873 return NEW_ATTRASGN(recv, id, 0, loc);
18874}
18875
18876static void
18877rb_backref_error(struct parser_params *p, NODE *node)
18878{
18879 switch (nd_type(node)) {
18880 case NODE_NTH_REF:
18881 compile_error(p, "Can't set variable $%ld", node->nd_nth);
18882 break;
18883 case NODE_BACK_REF:
18884 compile_error(p, "Can't set variable $%c", (int)node->nd_nth);
18885 break;
18886 }
18887}
18888#else
18889static VALUE
18890backref_error(struct parser_params *p, NODE *ref, VALUE expr)
18891{
18892 VALUE mesg = rb_str_new_cstr("Can't set variable ");
18893 rb_str_append(mesg, ref->nd_cval);
18894 return dispatch2(assign_error, mesg, expr);
18895}
18896#endif
18897
18898#ifndef RIPPER
18899static NODE *
18900arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18901{
18902 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
18903 switch (nd_type(node1)) {
18904 case NODE_LIST:
18905 return list_append(p, node1, node2);
18906 case NODE_BLOCK_PASS:
18907 node1->nd_head = arg_append(p, node1->nd_head, node2, loc);
18908 node1->nd_loc.end_pos = node1->nd_head->nd_loc.end_pos;
18909 return node1;
18910 case NODE_ARGSPUSH:
18911 node1->nd_body = list_append(p, NEW_LIST(node1->nd_body, &node1->nd_body->nd_loc), node2);
18912 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18913 nd_set_type(node1, NODE_ARGSCAT);
18914 return node1;
18915 case NODE_ARGSCAT:
18916 if (!nd_type_p(node1->nd_body, NODE_LIST)) break;
18917 node1->nd_body = list_append(p, node1->nd_body, node2);
18918 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18919 return node1;
18920 }
18921 return NEW_ARGSPUSH(node1, node2, loc);
18922}
18923
18924static NODE *
18925arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18926{
18927 if (!node2) return node1;
18928 switch (nd_type(node1)) {
18929 case NODE_BLOCK_PASS:
18930 if (node1->nd_head)
18931 node1->nd_head = arg_concat(p, node1->nd_head, node2, loc);
18932 else
18933 node1->nd_head = NEW_LIST(node2, loc);
18934 return node1;
18935 case NODE_ARGSPUSH:
18936 if (!nd_type_p(node2, NODE_LIST)) break;
18937 node1->nd_body = list_concat(NEW_LIST(node1->nd_body, loc), node2);
18938 nd_set_type(node1, NODE_ARGSCAT);
18939 return node1;
18940 case NODE_ARGSCAT:
18941 if (!nd_type_p(node2, NODE_LIST) ||
18942 !nd_type_p(node1->nd_body, NODE_LIST)) break;
18943 node1->nd_body = list_concat(node1->nd_body, node2);
18944 return node1;
18945 }
18946 return NEW_ARGSCAT(node1, node2, loc);
18947}
18948
18949static NODE *
18950last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
18951{
18952 NODE *n1;
18953 if ((n1 = splat_array(args)) != 0) {
18954 return list_append(p, n1, last_arg);
18955 }
18956 return arg_append(p, args, last_arg, loc);
18957}
18958
18959static NODE *
18960rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
18961{
18962 NODE *n1;
18963 if ((nd_type_p(rest_arg, NODE_LIST)) && (n1 = splat_array(args)) != 0) {
18964 return list_concat(n1, rest_arg);
18965 }
18966 return arg_concat(p, args, rest_arg, loc);
18967}
18968
18969static NODE *
18970splat_array(NODE* node)
18971{
18972 if (nd_type_p(node, NODE_SPLAT)) node = node->nd_head;
18973 if (nd_type_p(node, NODE_LIST)) return node;
18974 return 0;
18975}
18976
18977static void
18978mark_lvar_used(struct parser_params *p, NODE *rhs)
18979{
18980 ID *vidp = NULL;
18981 if (!rhs) return;
18982 switch (nd_type(rhs)) {
18983 case NODE_LASGN:
18984 if (local_id_ref(p, rhs->nd_vid, &vidp)) {
18985 if (vidp) *vidp |= LVAR_USED;
18986 }
18987 break;
18988 case NODE_DASGN:
18989 if (dvar_defined_ref(p, rhs->nd_vid, &vidp)) {
18990 if (vidp) *vidp |= LVAR_USED;
18991 }
18992 break;
18993#if 0
18994 case NODE_MASGN:
18995 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
18996 mark_lvar_used(p, rhs->nd_head);
18997 }
18998 break;
18999#endif
19000 }
19001}
19002
19003static NODE *
19004const_decl_path(struct parser_params *p, NODE **dest)
19005{
19006 NODE *n = *dest;
19007 if (!nd_type_p(n, NODE_CALL)) {
19008 const YYLTYPE *loc = &n->nd_loc;
19009 VALUE path;
19010 if (n->nd_vid) {
19011 path = rb_id2str(n->nd_vid);
19012 }
19013 else {
19014 n = n->nd_else;
19015 path = rb_ary_new();
19016 for (; n && nd_type_p(n, NODE_COLON2); n = n->nd_head) {
19017 rb_ary_push(path, rb_id2str(n->nd_mid));
19018 }
19019 if (n && nd_type_p(n, NODE_CONST)) {
19020 // Const::Name
19021 rb_ary_push(path, rb_id2str(n->nd_vid));
19022 }
19023 else if (n && nd_type_p(n, NODE_COLON3)) {
19024 // ::Const::Name
19025 rb_ary_push(path, rb_str_new(0, 0));
19026 }
19027 else {
19028 // expression::Name
19029 rb_ary_push(path, rb_str_new_cstr("..."));
19030 }
19031 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
19032 path = rb_fstring(path);
19033 }
19034 *dest = n = NEW_LIT(path, loc);
19035 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
19036 }
19037 return n;
19038}
19039
19040extern VALUE rb_mRubyVMFrozenCore;
19041
19042static NODE *
19043make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
19044{
19045 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
19046
19047 if (copy) {
19048 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
19049 NEW_LIST(value, loc), loc);
19050 }
19051 else {
19052 return NEW_CALL(fcore, rb_intern("make_shareable"),
19053 NEW_LIST(value, loc), loc);
19054 }
19055}
19056
19057static NODE *
19058ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
19059{
19060 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
19061 NODE *args = NEW_LIST(value, loc);
19062 args = list_append(p, args, const_decl_path(p, dest));
19063 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
19064}
19065
19066static int is_static_content(NODE *node);
19067
19068static VALUE
19069shareable_literal_value(NODE *node)
19070{
19071 if (!node) return Qnil;
19072 enum node_type type = nd_type(node);
19073 switch (type) {
19074 case NODE_TRUE:
19075 return Qtrue;
19076 case NODE_FALSE:
19077 return Qfalse;
19078 case NODE_NIL:
19079 return Qnil;
19080 case NODE_LIT:
19081 return node->nd_lit;
19082 default:
19083 return Qundef;
19084 }
19085}
19086
19087#ifndef SHAREABLE_BARE_EXPRESSION
19088#define SHAREABLE_BARE_EXPRESSION 1
19089#endif
19090
19091static NODE *
19092shareable_literal_constant(struct parser_params *p, enum shareability shareable,
19093 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
19094{
19095# define shareable_literal_constant_next(n) \
19096 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
19097 VALUE lit = Qnil;
19098
19099 if (!value) return 0;
19100 enum node_type type = nd_type(value);
19101 switch (type) {
19102 case NODE_TRUE:
19103 case NODE_FALSE:
19104 case NODE_NIL:
19105 case NODE_LIT:
19106 return value;
19107
19108 case NODE_DSTR:
19109 if (shareable == shareable_literal) {
19110 value = NEW_CALL(value, idUMinus, 0, loc);
19111 }
19112 return value;
19113
19114 case NODE_STR:
19115 lit = rb_fstring(value->nd_lit);
19116 nd_set_type(value, NODE_LIT);
19117 RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
19118 return value;
19119
19120 case NODE_ZLIST:
19121 lit = rb_ary_new();
19122 OBJ_FREEZE_RAW(lit);
19123 NODE *n = NEW_LIT(lit, loc);
19124 RB_OBJ_WRITTEN(p->ast, Qnil, n->nd_lit);
19125 return n;
19126
19127 case NODE_LIST:
19128 lit = rb_ary_new();
19129 for (NODE *n = value; n; n = n->nd_next) {
19130 NODE *elt = n->nd_head;
19131 if (elt) {
19132 elt = shareable_literal_constant_next(elt);
19133 if (elt) {
19134 n->nd_head = elt;
19135 }
19136 else if (RTEST(lit)) {
19137 rb_ary_clear(lit);
19138 lit = Qfalse;
19139 }
19140 }
19141 if (RTEST(lit)) {
19142 VALUE e = shareable_literal_value(elt);
19143 if (e != Qundef) {
19144 rb_ary_push(lit, e);
19145 }
19146 else {
19147 rb_ary_clear(lit);
19148 lit = Qnil; /* make shareable at runtime */
19149 }
19150 }
19151 }
19152 break;
19153
19154 case NODE_HASH:
19155 if (!value->nd_brace) return 0;
19156 lit = rb_hash_new();
19157 for (NODE *n = value->nd_head; n; n = n->nd_next->nd_next) {
19158 NODE *key = n->nd_head;
19159 NODE *val = n->nd_next->nd_head;
19160 if (key) {
19161 key = shareable_literal_constant_next(key);
19162 if (key) {
19163 n->nd_head = key;
19164 }
19165 else if (RTEST(lit)) {
19166 rb_hash_clear(lit);
19167 lit = Qfalse;
19168 }
19169 }
19170 if (val) {
19171 val = shareable_literal_constant_next(val);
19172 if (val) {
19173 n->nd_next->nd_head = val;
19174 }
19175 else if (RTEST(lit)) {
19176 rb_hash_clear(lit);
19177 lit = Qfalse;
19178 }
19179 }
19180 if (RTEST(lit)) {
19181 VALUE k = shareable_literal_value(key);
19182 VALUE v = shareable_literal_value(val);
19183 if (k != Qundef && v != Qundef) {
19184 rb_hash_aset(lit, k, v);
19185 }
19186 else {
19187 rb_hash_clear(lit);
19188 lit = Qnil; /* make shareable at runtime */
19189 }
19190 }
19191 }
19192 break;
19193
19194 default:
19195 if (shareable == shareable_literal &&
19196 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
19197 return ensure_shareable_node(p, dest, value, loc);
19198 }
19199 return 0;
19200 }
19201
19202 /* Array or Hash */
19203 if (!lit) return 0;
19204 if (NIL_P(lit)) {
19205 // if shareable_literal, all elements should have been ensured
19206 // as shareable
19207 value = make_shareable_node(p, value, false, loc);
19208 }
19209 else {
19210 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
19211 RB_OBJ_WRITTEN(p->ast, Qnil, value->nd_lit);
19212 }
19213
19214 return value;
19215# undef shareable_literal_constant_next
19216}
19217
19218static NODE *
19219shareable_constant_value(struct parser_params *p, enum shareability shareable,
19220 NODE *lhs, NODE *value, const YYLTYPE *loc)
19221{
19222 if (!value) return 0;
19223 switch (shareable) {
19224 case shareable_none:
19225 return value;
19226
19227 case shareable_literal:
19228 {
19229 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
19230 if (lit) return lit;
19231 return value;
19232 }
19233 break;
19234
19235 case shareable_copy:
19236 case shareable_everything:
19237 {
19238 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
19239 if (lit) return lit;
19240 return make_shareable_node(p, value, shareable == shareable_copy, loc);
19241 }
19242 break;
19243
19244 default:
19246 }
19247}
19248
19249static NODE *
19250node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
19251{
19252 if (!lhs) return 0;
19253
19254 switch (nd_type(lhs)) {
19255 case NODE_CDECL:
19256 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
19257 /* fallthru */
19258
19259 case NODE_GASGN:
19260 case NODE_IASGN:
19261 case NODE_LASGN:
19262 case NODE_DASGN:
19263 case NODE_MASGN:
19264 case NODE_CVASGN:
19265 lhs->nd_value = rhs;
19266 nd_set_loc(lhs, loc);
19267 break;
19268
19269 case NODE_ATTRASGN:
19270 lhs->nd_args = arg_append(p, lhs->nd_args, rhs, loc);
19271 nd_set_loc(lhs, loc);
19272 break;
19273
19274 default:
19275 /* should not happen */
19276 break;
19277 }
19278
19279 return lhs;
19280}
19281
19282static NODE *
19283value_expr_check(struct parser_params *p, NODE *node)
19284{
19285 NODE *void_node = 0, *vn;
19286
19287 if (!node) {
19288 rb_warning0("empty expression");
19289 }
19290 while (node) {
19291 switch (nd_type(node)) {
19292 case NODE_RETURN:
19293 case NODE_BREAK:
19294 case NODE_NEXT:
19295 case NODE_REDO:
19296 case NODE_RETRY:
19297 return void_node ? void_node : node;
19298
19299 case NODE_CASE3:
19300 if (!node->nd_body || !nd_type_p(node->nd_body, NODE_IN)) {
19301 compile_error(p, "unexpected node");
19302 return NULL;
19303 }
19304 if (node->nd_body->nd_body) {
19305 return NULL;
19306 }
19307 /* single line pattern matching */
19308 return void_node ? void_node : node;
19309
19310 case NODE_BLOCK:
19311 while (node->nd_next) {
19312 node = node->nd_next;
19313 }
19314 node = node->nd_head;
19315 break;
19316
19317 case NODE_BEGIN:
19318 node = node->nd_body;
19319 break;
19320
19321 case NODE_IF:
19322 case NODE_UNLESS:
19323 if (!node->nd_body) {
19324 return NULL;
19325 }
19326 else if (!node->nd_else) {
19327 return NULL;
19328 }
19329 vn = value_expr_check(p, node->nd_body);
19330 if (!vn) return NULL;
19331 if (!void_node) void_node = vn;
19332 node = node->nd_else;
19333 break;
19334
19335 case NODE_AND:
19336 case NODE_OR:
19337 node = node->nd_1st;
19338 break;
19339
19340 case NODE_LASGN:
19341 case NODE_DASGN:
19342 case NODE_MASGN:
19343 mark_lvar_used(p, node);
19344 return NULL;
19345
19346 default:
19347 return NULL;
19348 }
19349 }
19350
19351 return NULL;
19352}
19353
19354static int
19355value_expr_gen(struct parser_params *p, NODE *node)
19356{
19357 NODE *void_node = value_expr_check(p, node);
19358 if (void_node) {
19359 yyerror1(&void_node->nd_loc, "void value expression");
19360 /* or "control never reach"? */
19361 return FALSE;
19362 }
19363 return TRUE;
19364}
19365static void
19366void_expr(struct parser_params *p, NODE *node)
19367{
19368 const char *useless = 0;
19369
19370 if (!RTEST(ruby_verbose)) return;
19371
19372 if (!node || !(node = nd_once_body(node))) return;
19373 switch (nd_type(node)) {
19374 case NODE_OPCALL:
19375 switch (node->nd_mid) {
19376 case '+':
19377 case '-':
19378 case '*':
19379 case '/':
19380 case '%':
19381 case tPOW:
19382 case tUPLUS:
19383 case tUMINUS:
19384 case '|':
19385 case '^':
19386 case '&':
19387 case tCMP:
19388 case '>':
19389 case tGEQ:
19390 case '<':
19391 case tLEQ:
19392 case tEQ:
19393 case tNEQ:
19394 useless = rb_id2name(node->nd_mid);
19395 break;
19396 }
19397 break;
19398
19399 case NODE_LVAR:
19400 case NODE_DVAR:
19401 case NODE_GVAR:
19402 case NODE_IVAR:
19403 case NODE_CVAR:
19404 case NODE_NTH_REF:
19405 case NODE_BACK_REF:
19406 useless = "a variable";
19407 break;
19408 case NODE_CONST:
19409 useless = "a constant";
19410 break;
19411 case NODE_LIT:
19412 case NODE_STR:
19413 case NODE_DSTR:
19414 case NODE_DREGX:
19415 useless = "a literal";
19416 break;
19417 case NODE_COLON2:
19418 case NODE_COLON3:
19419 useless = "::";
19420 break;
19421 case NODE_DOT2:
19422 useless = "..";
19423 break;
19424 case NODE_DOT3:
19425 useless = "...";
19426 break;
19427 case NODE_SELF:
19428 useless = "self";
19429 break;
19430 case NODE_NIL:
19431 useless = "nil";
19432 break;
19433 case NODE_TRUE:
19434 useless = "true";
19435 break;
19436 case NODE_FALSE:
19437 useless = "false";
19438 break;
19439 case NODE_DEFINED:
19440 useless = "defined?";
19441 break;
19442 }
19443
19444 if (useless) {
19445 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
19446 }
19447}
19448
19449static NODE *
19450void_stmts(struct parser_params *p, NODE *node)
19451{
19452 NODE *const n = node;
19453 if (!RTEST(ruby_verbose)) return n;
19454 if (!node) return n;
19455 if (!nd_type_p(node, NODE_BLOCK)) return n;
19456
19457 while (node->nd_next) {
19458 void_expr(p, node->nd_head);
19459 node = node->nd_next;
19460 }
19461 return n;
19462}
19463
19464static NODE *
19465remove_begin(NODE *node)
19466{
19467 NODE **n = &node, *n1 = node;
19468 while (n1 && nd_type_p(n1, NODE_BEGIN) && n1->nd_body) {
19469 *n = n1 = n1->nd_body;
19470 }
19471 return node;
19472}
19473
19474static NODE *
19475remove_begin_all(NODE *node)
19476{
19477 NODE **n = &node, *n1 = node;
19478 while (n1 && nd_type_p(n1, NODE_BEGIN)) {
19479 *n = n1 = n1->nd_body;
19480 }
19481 return node;
19482}
19483
19484static void
19485reduce_nodes(struct parser_params *p, NODE **body)
19486{
19487 NODE *node = *body;
19488
19489 if (!node) {
19490 *body = NEW_NIL(&NULL_LOC);
19491 return;
19492 }
19493#define subnodes(n1, n2) \
19494 ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
19495 (!node->n2) ? (body = &node->n1, 1) : \
19496 (reduce_nodes(p, &node->n1), body = &node->n2, 1))
19497
19498 while (node) {
19499 int newline = (int)(node->flags & NODE_FL_NEWLINE);
19500 switch (nd_type(node)) {
19501 end:
19502 case NODE_NIL:
19503 *body = 0;
19504 return;
19505 case NODE_RETURN:
19506 *body = node = node->nd_stts;
19507 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19508 continue;
19509 case NODE_BEGIN:
19510 *body = node = node->nd_body;
19511 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19512 continue;
19513 case NODE_BLOCK:
19514 body = &node->nd_end->nd_head;
19515 break;
19516 case NODE_IF:
19517 case NODE_UNLESS:
19518 if (subnodes(nd_body, nd_else)) break;
19519 return;
19520 case NODE_CASE:
19521 body = &node->nd_body;
19522 break;
19523 case NODE_WHEN:
19524 if (!subnodes(nd_body, nd_next)) goto end;
19525 break;
19526 case NODE_ENSURE:
19527 if (!subnodes(nd_head, nd_resq)) goto end;
19528 break;
19529 case NODE_RESCUE:
19530 if (node->nd_else) {
19531 body = &node->nd_resq;
19532 break;
19533 }
19534 if (!subnodes(nd_head, nd_resq)) goto end;
19535 break;
19536 default:
19537 return;
19538 }
19539 node = *body;
19540 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19541 }
19542
19543#undef subnodes
19544}
19545
19546static int
19547is_static_content(NODE *node)
19548{
19549 if (!node) return 1;
19550 switch (nd_type(node)) {
19551 case NODE_HASH:
19552 if (!(node = node->nd_head)) break;
19553 case NODE_LIST:
19554 do {
19555 if (!is_static_content(node->nd_head)) return 0;
19556 } while ((node = node->nd_next) != 0);
19557 case NODE_LIT:
19558 case NODE_STR:
19559 case NODE_NIL:
19560 case NODE_TRUE:
19561 case NODE_FALSE:
19562 case NODE_ZLIST:
19563 break;
19564 default:
19565 return 0;
19566 }
19567 return 1;
19568}
19569
19570static int
19571assign_in_cond(struct parser_params *p, NODE *node)
19572{
19573 switch (nd_type(node)) {
19574 case NODE_MASGN:
19575 case NODE_LASGN:
19576 case NODE_DASGN:
19577 case NODE_GASGN:
19578 case NODE_IASGN:
19579 break;
19580
19581 default:
19582 return 0;
19583 }
19584
19585 if (!node->nd_value) return 1;
19586 if (is_static_content(node->nd_value)) {
19587 /* reports always */
19588 parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
19589 }
19590 return 1;
19591}
19592
19593enum cond_type {
19594 COND_IN_OP,
19595 COND_IN_COND,
19596 COND_IN_FF
19597};
19598
19599#define SWITCH_BY_COND_TYPE(t, w, arg) \
19600 switch (t) { \
19601 case COND_IN_OP: break; \
19602 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
19603 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
19604 }
19605
19606static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
19607
19608static NODE*
19609range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19610{
19611 enum node_type type;
19612
19613 if (node == 0) return 0;
19614
19615 type = nd_type(node);
19616 value_expr(node);
19617 if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
19618 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
19619 ID lineno = rb_intern("$.");
19620 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
19621 }
19622 return cond0(p, node, COND_IN_FF, loc);
19623}
19624
19625static NODE*
19626cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc)
19627{
19628 if (node == 0) return 0;
19629 if (!(node = nd_once_body(node))) return 0;
19630 assign_in_cond(p, node);
19631
19632 switch (nd_type(node)) {
19633 case NODE_DSTR:
19634 case NODE_EVSTR:
19635 case NODE_STR:
19636 SWITCH_BY_COND_TYPE(type, warn, "string ")
19637 break;
19638
19639 case NODE_DREGX:
19640 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
19641
19642 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
19643
19644 case NODE_AND:
19645 case NODE_OR:
19646 node->nd_1st = cond0(p, node->nd_1st, COND_IN_COND, loc);
19647 node->nd_2nd = cond0(p, node->nd_2nd, COND_IN_COND, loc);
19648 break;
19649
19650 case NODE_DOT2:
19651 case NODE_DOT3:
19652 node->nd_beg = range_op(p, node->nd_beg, loc);
19653 node->nd_end = range_op(p, node->nd_end, loc);
19654 if (nd_type_p(node, NODE_DOT2)) nd_set_type(node,NODE_FLIP2);
19655 else if (nd_type_p(node, NODE_DOT3)) nd_set_type(node, NODE_FLIP3);
19656 break;
19657
19658 case NODE_DSYM:
19659 warn_symbol:
19660 SWITCH_BY_COND_TYPE(type, warning, "symbol ")
19661 break;
19662
19663 case NODE_LIT:
19664 if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
19665 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
19666 nd_set_type(node, NODE_MATCH);
19667 }
19668 else if (node->nd_lit == Qtrue ||
19669 node->nd_lit == Qfalse) {
19670 /* booleans are OK, e.g., while true */
19671 }
19672 else if (SYMBOL_P(node->nd_lit)) {
19673 goto warn_symbol;
19674 }
19675 else {
19676 SWITCH_BY_COND_TYPE(type, warning, "")
19677 }
19678 default:
19679 break;
19680 }
19681 return node;
19682}
19683
19684static NODE*
19685cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19686{
19687 if (node == 0) return 0;
19688 return cond0(p, node, COND_IN_COND, loc);
19689}
19690
19691static NODE*
19692method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19693{
19694 if (node == 0) return 0;
19695 return cond0(p, node, COND_IN_OP, loc);
19696}
19697
19698static NODE*
19699new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
19700{
19701 YYLTYPE loc = {*pos, *pos};
19702 return NEW_NIL(&loc);
19703}
19704
19705static NODE*
19706new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
19707{
19708 if (!cc) return right;
19709 cc = cond0(p, cc, COND_IN_COND, loc);
19710 return newline_node(NEW_IF(cc, left, right, loc));
19711}
19712
19713static NODE*
19714new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
19715{
19716 if (!cc) return right;
19717 cc = cond0(p, cc, COND_IN_COND, loc);
19718 return newline_node(NEW_UNLESS(cc, left, right, loc));
19719}
19720
19721static NODE*
19722logop(struct parser_params *p, ID id, NODE *left, NODE *right,
19723 const YYLTYPE *op_loc, const YYLTYPE *loc)
19724{
19725 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
19726 NODE *op;
19727 value_expr(left);
19728 if (left && nd_type_p(left, type)) {
19729 NODE *node = left, *second;
19730 while ((second = node->nd_2nd) != 0 && nd_type_p(second, type)) {
19731 node = second;
19732 }
19733 node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
19734 nd_set_line(node->nd_2nd, op_loc->beg_pos.lineno);
19735 left->nd_loc.end_pos = loc->end_pos;
19736 return left;
19737 }
19738 op = NEW_NODE(type, left, right, 0, loc);
19739 nd_set_line(op, op_loc->beg_pos.lineno);
19740 return op;
19741}
19742
19743static void
19744no_blockarg(struct parser_params *p, NODE *node)
19745{
19746 if (node && nd_type_p(node, NODE_BLOCK_PASS)) {
19747 compile_error(p, "block argument should not be given");
19748 }
19749}
19750
19751static NODE *
19752ret_args(struct parser_params *p, NODE *node)
19753{
19754 if (node) {
19755 no_blockarg(p, node);
19756 if (nd_type_p(node, NODE_LIST)) {
19757 if (node->nd_next == 0) {
19758 node = node->nd_head;
19759 }
19760 else {
19761 nd_set_type(node, NODE_VALUES);
19762 }
19763 }
19764 }
19765 return node;
19766}
19767
19768static NODE *
19769new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19770{
19771 if (node) no_blockarg(p, node);
19772
19773 return NEW_YIELD(node, loc);
19774}
19775
19776static VALUE
19777negate_lit(struct parser_params *p, VALUE lit)
19778{
19779 if (FIXNUM_P(lit)) {
19780 return LONG2FIX(-FIX2LONG(lit));
19781 }
19782 if (SPECIAL_CONST_P(lit)) {
19783#if USE_FLONUM
19784 if (FLONUM_P(lit)) {
19785 return DBL2NUM(-RFLOAT_VALUE(lit));
19786 }
19787#endif
19788 goto unknown;
19789 }
19790 switch (BUILTIN_TYPE(lit)) {
19791 case T_BIGNUM:
19792 BIGNUM_NEGATE(lit);
19793 lit = rb_big_norm(lit);
19794 break;
19795 case T_RATIONAL:
19796 RATIONAL_SET_NUM(lit, negate_lit(p, RRATIONAL(lit)->num));
19797 break;
19798 case T_COMPLEX:
19799 RCOMPLEX_SET_REAL(lit, negate_lit(p, RCOMPLEX(lit)->real));
19800 RCOMPLEX_SET_IMAG(lit, negate_lit(p, RCOMPLEX(lit)->imag));
19801 break;
19802 case T_FLOAT:
19803 lit = DBL2NUM(-RFLOAT_VALUE(lit));
19804 break;
19805 unknown:
19806 default:
19807 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
19808 rb_builtin_class_name(lit));
19809 break;
19810 }
19811 return lit;
19812}
19813
19814static NODE *
19815arg_blk_pass(NODE *node1, NODE *node2)
19816{
19817 if (node2) {
19818 if (!node1) return node2;
19819 node2->nd_head = node1;
19820 nd_set_first_lineno(node2, nd_first_lineno(node1));
19821 nd_set_first_column(node2, nd_first_column(node1));
19822 return node2;
19823 }
19824 return node1;
19825}
19826
19827static bool
19828args_info_empty_p(struct rb_args_info *args)
19829{
19830 if (args->pre_args_num) return false;
19831 if (args->post_args_num) return false;
19832 if (args->rest_arg) return false;
19833 if (args->opt_args) return false;
19834 if (args->block_arg) return false;
19835 if (args->kw_args) return false;
19836 if (args->kw_rest_arg) return false;
19837 return true;
19838}
19839
19840static NODE*
19841new_args(struct parser_params *p, NODE *pre_args, NODE *opt_args, ID rest_arg, NODE *post_args, NODE *tail, const YYLTYPE *loc)
19842{
19843 int saved_line = p->ruby_sourceline;
19844 struct rb_args_info *args = tail->nd_ainfo;
19845
19846 if (args->block_arg == idFWD_BLOCK) {
19847 if (rest_arg) {
19848 yyerror1(&tail->nd_loc, "... after rest argument");
19849 return tail;
19850 }
19851 rest_arg = idFWD_REST;
19852 }
19853
19854 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
19855 args->pre_init = pre_args ? pre_args->nd_next : 0;
19856
19857 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
19858 args->post_init = post_args ? post_args->nd_next : 0;
19859 args->first_post_arg = post_args ? post_args->nd_pid : 0;
19860
19861 args->rest_arg = rest_arg;
19862
19863 args->opt_args = opt_args;
19864
19865 args->ruby2_keywords = rest_arg == idFWD_REST;
19866
19867 p->ruby_sourceline = saved_line;
19868 nd_set_loc(tail, loc);
19869
19870 return tail;
19871}
19872
19873static NODE*
19874new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
19875{
19876 int saved_line = p->ruby_sourceline;
19877 NODE *node;
19878 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19879 struct rb_args_info *args = ZALLOC(struct rb_args_info);
19880 rb_imemo_tmpbuf_set_ptr(tmpbuf, args);
19881 args->imemo = tmpbuf;
19882 node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
19883 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19884 if (p->error_p) return node;
19885
19886 args->block_arg = block;
19887 args->kw_args = kw_args;
19888
19889 if (kw_args) {
19890 /*
19891 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
19892 * variable order: k1, kr1, k2, &b, internal_id, krest
19893 * #=> <reorder>
19894 * variable order: kr1, k1, k2, internal_id, krest, &b
19895 */
19896 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
19897 struct vtable *vtargs = p->lvtbl->args;
19898 NODE *kwn = kw_args;
19899
19900 if (block) block = vtargs->tbl[vtargs->pos-1];
19901 vtable_pop(vtargs, !!block + !!kw_rest_arg);
19902 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
19903 while (kwn) {
19904 if (!NODE_REQUIRED_KEYWORD_P(kwn->nd_body))
19905 --kw_vars;
19906 --required_kw_vars;
19907 kwn = kwn->nd_next;
19908 }
19909
19910 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
19911 ID vid = kwn->nd_body->nd_vid;
19912 if (NODE_REQUIRED_KEYWORD_P(kwn->nd_body)) {
19913 *required_kw_vars++ = vid;
19914 }
19915 else {
19916 *kw_vars++ = vid;
19917 }
19918 }
19919
19920 arg_var(p, kw_bits);
19921 if (kw_rest_arg) arg_var(p, kw_rest_arg);
19922 if (block) arg_var(p, block);
19923
19924 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
19925 args->kw_rest_arg->nd_cflag = kw_bits;
19926 }
19927 else if (kw_rest_arg == idNil) {
19928 args->no_kwarg = 1;
19929 }
19930 else if (kw_rest_arg) {
19931 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
19932 }
19933
19934 p->ruby_sourceline = saved_line;
19935 return node;
19936}
19937
19938static NODE *
19939args_with_numbered(struct parser_params *p, NODE *args, int max_numparam)
19940{
19941 if (max_numparam > NO_PARAM) {
19942 if (!args) {
19943 YYLTYPE loc = RUBY_INIT_YYLLOC();
19944 args = new_args_tail(p, 0, 0, 0, 0);
19945 nd_set_loc(args, &loc);
19946 }
19947 args->nd_ainfo->pre_args_num = max_numparam;
19948 }
19949 return args;
19950}
19951
19952static NODE*
19953new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
19954{
19955 struct rb_ary_pattern_info *apinfo = aryptn->nd_apinfo;
19956
19957 aryptn->nd_pconst = constant;
19958
19959 if (pre_arg) {
19960 NODE *pre_args = NEW_LIST(pre_arg, loc);
19961 if (apinfo->pre_args) {
19962 apinfo->pre_args = list_concat(pre_args, apinfo->pre_args);
19963 }
19964 else {
19965 apinfo->pre_args = pre_args;
19966 }
19967 }
19968 return aryptn;
19969}
19970
19971static NODE*
19972new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc)
19973{
19974 int saved_line = p->ruby_sourceline;
19975 NODE *node;
19976 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19977 struct rb_ary_pattern_info *apinfo = ZALLOC(struct rb_ary_pattern_info);
19978 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
19979 node = NEW_NODE(NODE_ARYPTN, 0, tmpbuf, apinfo, loc);
19980 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19981
19982 apinfo->pre_args = pre_args;
19983
19984 if (has_rest) {
19985 if (rest_arg) {
19986 apinfo->rest_arg = assignable(p, rest_arg, 0, loc);
19987 }
19988 else {
19989 apinfo->rest_arg = NODE_SPECIAL_NO_NAME_REST;
19990 }
19991 }
19992 else {
19993 apinfo->rest_arg = NULL;
19994 }
19995
19996 apinfo->post_args = post_args;
19997
19998 p->ruby_sourceline = saved_line;
19999 return node;
20000}
20001
20002static NODE*
20003new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
20004{
20005 fndptn->nd_pconst = constant;
20006
20007 return fndptn;
20008}
20009
20010static NODE*
20011new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc)
20012{
20013 int saved_line = p->ruby_sourceline;
20014 NODE *node;
20015 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
20016 struct rb_fnd_pattern_info *fpinfo = ZALLOC(struct rb_fnd_pattern_info);
20017 rb_imemo_tmpbuf_set_ptr(tmpbuf, fpinfo);
20018 node = NEW_NODE(NODE_FNDPTN, 0, tmpbuf, fpinfo, loc);
20019 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
20020
20021 fpinfo->pre_rest_arg = pre_rest_arg ? assignable(p, pre_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
20022 fpinfo->args = args;
20023 fpinfo->post_rest_arg = post_rest_arg ? assignable(p, post_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
20024
20025 p->ruby_sourceline = saved_line;
20026 return node;
20027}
20028
20029static NODE*
20030new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
20031{
20032 hshptn->nd_pconst = constant;
20033 return hshptn;
20034}
20035
20036static NODE*
20037new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
20038{
20039 int saved_line = p->ruby_sourceline;
20040 NODE *node, *kw_rest_arg_node;
20041
20042 if (kw_rest_arg == idNil) {
20043 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
20044 }
20045 else if (kw_rest_arg) {
20046 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
20047 }
20048 else {
20049 kw_rest_arg_node = NULL;
20050 }
20051
20052 node = NEW_NODE(NODE_HSHPTN, 0, kw_args, kw_rest_arg_node, loc);
20053
20054 p->ruby_sourceline = saved_line;
20055 return node;
20056}
20057
20058static NODE*
20059dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
20060{
20061 VALUE lit;
20062
20063 if (!node) {
20064 return NEW_LIT(ID2SYM(idNULL), loc);
20065 }
20066
20067 switch (nd_type(node)) {
20068 case NODE_DSTR:
20069 nd_set_type(node, NODE_DSYM);
20070 nd_set_loc(node, loc);
20071 break;
20072 case NODE_STR:
20073 lit = node->nd_lit;
20074 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = ID2SYM(rb_intern_str(lit)));
20075 nd_set_type(node, NODE_LIT);
20076 nd_set_loc(node, loc);
20077 break;
20078 default:
20079 node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node, loc), loc);
20080 break;
20081 }
20082 return node;
20083}
20084
20085static int
20086append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
20087{
20088 NODE *node = (NODE *)v;
20089 NODE **result = (NODE **)h;
20090 node->nd_alen = 2;
20091 node->nd_next->nd_end = node->nd_next;
20092 node->nd_next->nd_next = 0;
20093 if (*result)
20094 list_concat(*result, node);
20095 else
20096 *result = node;
20097 return ST_CONTINUE;
20098}
20099
20100static bool
20101hash_literal_key_p(VALUE k)
20102{
20103 switch (OBJ_BUILTIN_TYPE(k)) {
20104 case T_NODE:
20105 return false;
20106 default:
20107 return true;
20108 }
20109}
20110
20111static int
20112literal_cmp(VALUE val, VALUE lit)
20113{
20114 if (val == lit) return 0;
20115 if (!hash_literal_key_p(val) || !hash_literal_key_p(lit)) return -1;
20116 return rb_iseq_cdhash_cmp(val, lit);
20117}
20118
20119static st_index_t
20120literal_hash(VALUE a)
20121{
20122 if (!hash_literal_key_p(a)) return (st_index_t)a;
20123 return rb_iseq_cdhash_hash(a);
20124}
20125
20126static const struct st_hash_type literal_type = {
20127 literal_cmp,
20128 literal_hash,
20129};
20130
20131static NODE *
20132remove_duplicate_keys(struct parser_params *p, NODE *hash)
20133{
20134 st_table *literal_keys = st_init_table_with_size(&literal_type, hash->nd_alen / 2);
20135 NODE *result = 0;
20136 NODE *last_expr = 0;
20137 rb_code_location_t loc = hash->nd_loc;
20138 while (hash && hash->nd_head && hash->nd_next) {
20139 NODE *head = hash->nd_head;
20140 NODE *value = hash->nd_next;
20141 NODE *next = value->nd_next;
20142 st_data_t key = (st_data_t)head;
20143 st_data_t data;
20144 value->nd_next = 0;
20145 if (nd_type_p(head, NODE_LIT) &&
20146 st_delete(literal_keys, (key = (st_data_t)head->nd_lit, &key), &data)) {
20147 NODE *dup_value = ((NODE *)data)->nd_next;
20148 rb_compile_warn(p->ruby_sourcefile, nd_line((NODE *)data),
20149 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
20150 head->nd_lit, nd_line(head));
20151 if (dup_value == last_expr) {
20152 value->nd_head = block_append(p, dup_value->nd_head, value->nd_head);
20153 }
20154 else {
20155 last_expr->nd_head = block_append(p, dup_value->nd_head, last_expr->nd_head);
20156 }
20157 }
20158 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
20159 last_expr = nd_type_p(head, NODE_LIT) ? value : head;
20160 hash = next;
20161 }
20162 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
20163 st_free_table(literal_keys);
20164 if (hash) {
20165 if (!result) result = hash;
20166 else list_concat(result, hash);
20167 }
20168 result->nd_loc = loc;
20169 return result;
20170}
20171
20172static NODE *
20173new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
20174{
20175 if (hash) hash = remove_duplicate_keys(p, hash);
20176 return NEW_HASH(hash, loc);
20177}
20178#endif
20179
20180static void
20181error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
20182{
20183 if (is_private_local_id(id)) {
20184 return;
20185 }
20186 if (st_is_member(p->pvtbl, id)) {
20187 yyerror1(loc, "duplicated variable name");
20188 }
20189 else {
20190 st_insert(p->pvtbl, (st_data_t)id, 0);
20191 }
20192}
20193
20194static void
20195error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
20196{
20197 if (!p->pktbl) {
20198 p->pktbl = st_init_numtable();
20199 }
20200 else if (st_is_member(p->pktbl, key)) {
20201 yyerror1(loc, "duplicated key name");
20202 return;
20203 }
20204 st_insert(p->pktbl, (st_data_t)key, 0);
20205}
20206
20207#ifndef RIPPER
20208static NODE *
20209new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
20210{
20211 return NEW_HASH(hash, loc);
20212}
20213#endif /* !RIPPER */
20214
20215#ifndef RIPPER
20216static NODE *
20217new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
20218{
20219 NODE *asgn;
20220
20221 if (lhs) {
20222 ID vid = lhs->nd_vid;
20223 YYLTYPE lhs_loc = lhs->nd_loc;
20224 int shareable = ctxt.shareable_constant_value;
20225 if (shareable) {
20226 switch (nd_type(lhs)) {
20227 case NODE_CDECL:
20228 case NODE_COLON2:
20229 case NODE_COLON3:
20230 break;
20231 default:
20232 shareable = 0;
20233 break;
20234 }
20235 }
20236 if (op == tOROP) {
20237 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
20238 lhs->nd_value = rhs;
20239 nd_set_loc(lhs, loc);
20240 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
20241 if (is_notop_id(vid)) {
20242 switch (id_type(vid)) {
20243 case ID_GLOBAL:
20244 case ID_INSTANCE:
20245 case ID_CLASS:
20246 asgn->nd_aid = vid;
20247 }
20248 }
20249 }
20250 else if (op == tANDOP) {
20251 if (shareable) {
20252 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
20253 }
20254 lhs->nd_value = rhs;
20255 nd_set_loc(lhs, loc);
20256 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
20257 }
20258 else {
20259 asgn = lhs;
20260 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
20261 if (shareable) {
20262 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
20263 }
20264 asgn->nd_value = rhs;
20265 nd_set_loc(asgn, loc);
20266 }
20267 }
20268 else {
20269 asgn = NEW_BEGIN(0, loc);
20270 }
20271 return asgn;
20272}
20273
20274static NODE *
20275new_ary_op_assign(struct parser_params *p, NODE *ary,
20276 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
20277{
20278 NODE *asgn;
20279
20280 args = make_list(args, args_loc);
20281 if (nd_type_p(args, NODE_BLOCK_PASS)) {
20282 args = NEW_ARGSCAT(args, rhs, loc);
20283 }
20284 else {
20285 args = arg_concat(p, args, rhs, loc);
20286 }
20287 asgn = NEW_OP_ASGN1(ary, op, args, loc);
20288 fixpos(asgn, ary);
20289 return asgn;
20290}
20291
20292static NODE *
20293new_attr_op_assign(struct parser_params *p, NODE *lhs,
20294 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
20295{
20296 NODE *asgn;
20297
20298 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
20299 fixpos(asgn, lhs);
20300 return asgn;
20301}
20302
20303static NODE *
20304new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
20305{
20306 NODE *asgn;
20307
20308 if (lhs) {
20309 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
20310 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
20311 }
20312 else {
20313 asgn = NEW_BEGIN(0, loc);
20314 }
20315 fixpos(asgn, lhs);
20316 return asgn;
20317}
20318
20319static NODE *
20320const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
20321{
20322 if (p->ctxt.in_def) {
20323 yyerror1(loc, "dynamic constant assignment");
20324 }
20325 return NEW_CDECL(0, 0, (path), loc);
20326}
20327#else
20328static VALUE
20329const_decl(struct parser_params *p, VALUE path)
20330{
20331 if (p->ctxt.in_def) {
20332 path = assign_error(p, "dynamic constant assignment", path);
20333 }
20334 return path;
20335}
20336
20337static VALUE
20338assign_error(struct parser_params *p, const char *mesg, VALUE a)
20339{
20340 a = dispatch2(assign_error, ERR_MESG(), a);
20341 ripper_error(p);
20342 return a;
20343}
20344
20345static VALUE
20346var_field(struct parser_params *p, VALUE a)
20347{
20348 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
20349}
20350#endif
20351
20352#ifndef RIPPER
20353static NODE *
20354new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
20355{
20356 NODE *result = head;
20357 if (rescue) {
20358 NODE *tmp = rescue_else ? rescue_else : rescue;
20359 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
20360
20361 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
20362 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
20363 }
20364 else if (rescue_else) {
20365 result = block_append(p, result, rescue_else);
20366 }
20367 if (ensure) {
20368 result = NEW_ENSURE(result, ensure, loc);
20369 }
20370 fixpos(result, head);
20371 return result;
20372}
20373#endif
20374
20375static void
20376warn_unused_var(struct parser_params *p, struct local_vars *local)
20377{
20378 int cnt;
20379
20380 if (!local->used) return;
20381 cnt = local->used->pos;
20382 if (cnt != local->vars->pos) {
20383 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
20384 }
20385#ifndef RIPPER
20386 ID *v = local->vars->tbl;
20387 ID *u = local->used->tbl;
20388 for (int i = 0; i < cnt; ++i) {
20389 if (!v[i] || (u[i] & LVAR_USED)) continue;
20390 if (is_private_local_id(v[i])) continue;
20391 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
20392 }
20393#endif
20394}
20395
20396static void
20397local_push(struct parser_params *p, int toplevel_scope)
20398{
20399 struct local_vars *local;
20400 int inherits_dvars = toplevel_scope && compile_for_eval;
20401 int warn_unused_vars = RTEST(ruby_verbose);
20402
20403 local = ALLOC(struct local_vars);
20404 local->prev = p->lvtbl;
20405 local->args = vtable_alloc(0);
20406 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
20407#ifndef RIPPER
20408 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
20409 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
20410 local->numparam.outer = 0;
20411 local->numparam.inner = 0;
20412 local->numparam.current = 0;
20413#endif
20414 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
20415
20416# if WARN_PAST_SCOPE
20417 local->past = 0;
20418# endif
20419 CMDARG_PUSH(0);
20420 COND_PUSH(0);
20421 p->lvtbl = local;
20422}
20423
20424static void
20425local_pop(struct parser_params *p)
20426{
20427 struct local_vars *local = p->lvtbl->prev;
20428 if (p->lvtbl->used) {
20429 warn_unused_var(p, p->lvtbl);
20430 vtable_free(p->lvtbl->used);
20431 }
20432# if WARN_PAST_SCOPE
20433 while (p->lvtbl->past) {
20434 struct vtable *past = p->lvtbl->past;
20435 p->lvtbl->past = past->prev;
20436 vtable_free(past);
20437 }
20438# endif
20439 vtable_free(p->lvtbl->args);
20440 vtable_free(p->lvtbl->vars);
20441 CMDARG_POP();
20442 COND_POP();
20443 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
20444 p->lvtbl = local;
20445}
20446
20447#ifndef RIPPER
20448static rb_ast_id_table_t *
20449local_tbl(struct parser_params *p)
20450{
20451 int cnt_args = vtable_size(p->lvtbl->args);
20452 int cnt_vars = vtable_size(p->lvtbl->vars);
20453 int cnt = cnt_args + cnt_vars;
20454 int i, j;
20455 rb_ast_id_table_t *tbl;
20456
20457 if (cnt <= 0) return 0;
20458 tbl = rb_ast_new_local_table(p->ast, cnt);
20459 MEMCPY(tbl->ids, p->lvtbl->args->tbl, ID, cnt_args);
20460 /* remove IDs duplicated to warn shadowing */
20461 for (i = 0, j = cnt_args; i < cnt_vars; ++i) {
20462 ID id = p->lvtbl->vars->tbl[i];
20463 if (!vtable_included(p->lvtbl->args, id)) {
20464 tbl->ids[j++] = id;
20465 }
20466 }
20467 if (j < cnt) {
20468 tbl = rb_ast_resize_latest_local_table(p->ast, j);
20469 }
20470
20471 return tbl;
20472}
20473
20474static NODE*
20475node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc)
20476{
20478 NODE *n;
20479
20480 a0 = local_tbl(p);
20481 n = NEW_NODE(type, a0, a1, a2, loc);
20482 return n;
20483}
20484
20485#endif
20486
20487static void
20488numparam_name(struct parser_params *p, ID id)
20489{
20490 if (!NUMPARAM_ID_P(id)) return;
20491 compile_error(p, "_%d is reserved for numbered parameter",
20492 NUMPARAM_ID_TO_IDX(id));
20493}
20494
20495static void
20496arg_var(struct parser_params *p, ID id)
20497{
20498 numparam_name(p, id);
20499 vtable_add(p->lvtbl->args, id);
20500}
20501
20502static void
20503local_var(struct parser_params *p, ID id)
20504{
20505 numparam_name(p, id);
20506 vtable_add(p->lvtbl->vars, id);
20507 if (p->lvtbl->used) {
20508 vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
20509 }
20510}
20511
20512static int
20513local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
20514{
20515 struct vtable *vars, *args, *used;
20516
20517 vars = p->lvtbl->vars;
20518 args = p->lvtbl->args;
20519 used = p->lvtbl->used;
20520
20521 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
20522 vars = vars->prev;
20523 args = args->prev;
20524 if (used) used = used->prev;
20525 }
20526
20527 if (vars && vars->prev == DVARS_INHERIT) {
20528 return rb_local_defined(id, p->parent_iseq);
20529 }
20530 else if (vtable_included(args, id)) {
20531 return 1;
20532 }
20533 else {
20534 int i = vtable_included(vars, id);
20535 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
20536 return i != 0;
20537 }
20538}
20539
20540static int
20541local_id(struct parser_params *p, ID id)
20542{
20543 return local_id_ref(p, id, NULL);
20544}
20545
20546static int
20547check_forwarding_args(struct parser_params *p)
20548{
20549 if (local_id(p, idFWD_REST) &&
20550#if idFWD_KWREST
20551 local_id(p, idFWD_KWREST) &&
20552#endif
20553 local_id(p, idFWD_BLOCK)) return TRUE;
20554 compile_error(p, "unexpected ...");
20555 return FALSE;
20556}
20557
20558static void
20559add_forwarding_args(struct parser_params *p)
20560{
20561 arg_var(p, idFWD_REST);
20562#if idFWD_KWREST
20563 arg_var(p, idFWD_KWREST);
20564#endif
20565 arg_var(p, idFWD_BLOCK);
20566}
20567
20568#ifndef RIPPER
20569static NODE *
20570new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
20571{
20572 NODE *splat = NEW_SPLAT(NEW_LVAR(idFWD_REST, loc), loc);
20573#if idFWD_KWREST
20574 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
20575#endif
20576 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
20577 NODE *args = leading ? rest_arg_append(p, leading, splat, argsloc) : splat;
20578#if idFWD_KWREST
20579 args = arg_append(p, splat, new_hash(p, kwrest, loc), loc);
20580#endif
20581 return arg_blk_pass(args, block);
20582}
20583#endif
20584
20585static NODE *
20586numparam_push(struct parser_params *p)
20587{
20588#ifndef RIPPER
20589 struct local_vars *local = p->lvtbl;
20590 NODE *inner = local->numparam.inner;
20591 if (!local->numparam.outer) {
20592 local->numparam.outer = local->numparam.current;
20593 }
20594 local->numparam.inner = 0;
20595 local->numparam.current = 0;
20596 return inner;
20597#else
20598 return 0;
20599#endif
20600}
20601
20602static void
20603numparam_pop(struct parser_params *p, NODE *prev_inner)
20604{
20605#ifndef RIPPER
20606 struct local_vars *local = p->lvtbl;
20607 if (prev_inner) {
20608 /* prefer first one */
20609 local->numparam.inner = prev_inner;
20610 }
20611 else if (local->numparam.current) {
20612 /* current and inner are exclusive */
20613 local->numparam.inner = local->numparam.current;
20614 }
20615 if (p->max_numparam > NO_PARAM) {
20616 /* current and outer are exclusive */
20617 local->numparam.current = local->numparam.outer;
20618 local->numparam.outer = 0;
20619 }
20620 else {
20621 /* no numbered parameter */
20622 local->numparam.current = 0;
20623 }
20624#endif
20625}
20626
20627static const struct vtable *
20628dyna_push(struct parser_params *p)
20629{
20630 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
20631 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
20632 if (p->lvtbl->used) {
20633 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
20634 }
20635 return p->lvtbl->args;
20636}
20637
20638static void
20639dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
20640{
20641 struct vtable *tmp = *vtblp;
20642 *vtblp = tmp->prev;
20643# if WARN_PAST_SCOPE
20644 if (p->past_scope_enabled) {
20645 tmp->prev = p->lvtbl->past;
20646 p->lvtbl->past = tmp;
20647 return;
20648 }
20649# endif
20650 vtable_free(tmp);
20651}
20652
20653static void
20654dyna_pop_1(struct parser_params *p)
20655{
20656 struct vtable *tmp;
20657
20658 if ((tmp = p->lvtbl->used) != 0) {
20659 warn_unused_var(p, p->lvtbl);
20660 p->lvtbl->used = p->lvtbl->used->prev;
20661 vtable_free(tmp);
20662 }
20663 dyna_pop_vtable(p, &p->lvtbl->args);
20664 dyna_pop_vtable(p, &p->lvtbl->vars);
20665}
20666
20667static void
20668dyna_pop(struct parser_params *p, const struct vtable *lvargs)
20669{
20670 while (p->lvtbl->args != lvargs) {
20671 dyna_pop_1(p);
20672 if (!p->lvtbl->args) {
20673 struct local_vars *local = p->lvtbl->prev;
20674 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
20675 p->lvtbl = local;
20676 }
20677 }
20678 dyna_pop_1(p);
20679}
20680
20681static int
20682dyna_in_block(struct parser_params *p)
20683{
20684 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
20685}
20686
20687static int
20688dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
20689{
20690 struct vtable *vars, *args, *used;
20691 int i;
20692
20693 args = p->lvtbl->args;
20694 vars = p->lvtbl->vars;
20695 used = p->lvtbl->used;
20696
20697 while (!DVARS_TERMINAL_P(vars)) {
20698 if (vtable_included(args, id)) {
20699 return 1;
20700 }
20701 if ((i = vtable_included(vars, id)) != 0) {
20702 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
20703 return 1;
20704 }
20705 args = args->prev;
20706 vars = vars->prev;
20707 if (!vidrefp) used = 0;
20708 if (used) used = used->prev;
20709 }
20710
20711 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
20712 return rb_dvar_defined(id, p->parent_iseq);
20713 }
20714
20715 return 0;
20716}
20717
20718static int
20719dvar_defined(struct parser_params *p, ID id)
20720{
20721 return dvar_defined_ref(p, id, NULL);
20722}
20723
20724static int
20725dvar_curr(struct parser_params *p, ID id)
20726{
20727 return (vtable_included(p->lvtbl->args, id) ||
20728 vtable_included(p->lvtbl->vars, id));
20729}
20730
20731static void
20732reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
20733{
20734 compile_error(p,
20735 "regexp encoding option '%c' differs from source encoding '%s'",
20736 c, rb_enc_name(rb_enc_get(str)));
20737}
20738
20739#ifndef RIPPER
20740int
20741rb_reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
20742{
20743 int c = RE_OPTION_ENCODING_IDX(options);
20744
20745 if (c) {
20746 int opt, idx;
20747 rb_char_to_option_kcode(c, &opt, &idx);
20748 if (idx != ENCODING_GET(str) &&
20750 goto error;
20751 }
20752 ENCODING_SET(str, idx);
20753 }
20754 else if (RE_OPTION_ENCODING_NONE(options)) {
20755 if (!ENCODING_IS_ASCII8BIT(str) &&
20757 c = 'n';
20758 goto error;
20759 }
20761 }
20762 else if (p->enc == rb_usascii_encoding()) {
20764 /* raise in re.c */
20766 }
20767 else {
20769 }
20770 }
20771 return 0;
20772
20773 error:
20774 return c;
20775}
20776
20777static void
20778reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
20779{
20780 int c = rb_reg_fragment_setenc(p, str, options);
20781 if (c) reg_fragment_enc_error(p, str, c);
20782}
20783
20784static int
20785reg_fragment_check(struct parser_params* p, VALUE str, int options)
20786{
20787 VALUE err;
20788 reg_fragment_setenc(p, str, options);
20789 err = rb_reg_check_preprocess(str);
20790 if (err != Qnil) {
20791 err = rb_obj_as_string(err);
20792 compile_error(p, "%"PRIsVALUE, err);
20793 return 0;
20794 }
20795 return 1;
20796}
20797
20798typedef struct {
20799 struct parser_params* parser;
20800 rb_encoding *enc;
20801 NODE *succ_block;
20802 const YYLTYPE *loc;
20804
20805static int
20806reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
20807 int back_num, int *back_refs, OnigRegex regex, void *arg0)
20808{
20810 struct parser_params* p = arg->parser;
20811 rb_encoding *enc = arg->enc;
20812 long len = name_end - name;
20813 const char *s = (const char *)name;
20814 ID var;
20815 NODE *node, *succ;
20816
20817 if (!len) return ST_CONTINUE;
20818 if (rb_enc_symname_type(s, len, enc, (1U<<ID_LOCAL)) != ID_LOCAL)
20819 return ST_CONTINUE;
20820
20821 var = intern_cstr(s, len, enc);
20822 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
20823 if (!lvar_defined(p, var)) return ST_CONTINUE;
20824 }
20825 node = node_assign(p, assignable(p, var, 0, arg->loc), NEW_LIT(ID2SYM(var), arg->loc), NO_LEX_CTXT, arg->loc);
20826 succ = arg->succ_block;
20827 if (!succ) succ = NEW_BEGIN(0, arg->loc);
20828 succ = block_append(p, succ, node);
20829 arg->succ_block = succ;
20830 return ST_CONTINUE;
20831}
20832
20833static NODE *
20834reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
20835{
20837
20838 arg.parser = p;
20839 arg.enc = rb_enc_get(regexp);
20840 arg.succ_block = 0;
20841 arg.loc = loc;
20842 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
20843
20844 if (!arg.succ_block) return 0;
20845 return arg.succ_block->nd_next;
20846}
20847
20848static VALUE
20849parser_reg_compile(struct parser_params* p, VALUE str, int options)
20850{
20851 reg_fragment_setenc(p, str, options);
20852 return rb_parser_reg_compile(p, str, options);
20853}
20854
20855VALUE
20856rb_parser_reg_compile(struct parser_params* p, VALUE str, int options)
20857{
20858 return rb_reg_compile(str, options & RE_OPTION_MASK, p->ruby_sourcefile, p->ruby_sourceline);
20859}
20860
20861static VALUE
20862reg_compile(struct parser_params* p, VALUE str, int options)
20863{
20864 VALUE re;
20865 VALUE err;
20866
20867 err = rb_errinfo();
20868 re = parser_reg_compile(p, str, options);
20869 if (NIL_P(re)) {
20870 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
20871 rb_set_errinfo(err);
20872 compile_error(p, "%"PRIsVALUE, m);
20873 return Qnil;
20874 }
20875 return re;
20876}
20877#else
20878static VALUE
20879parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
20880{
20881 VALUE err = rb_errinfo();
20882 VALUE re;
20883 str = ripper_is_node_yylval(str) ? RNODE(str)->nd_cval : str;
20884 int c = rb_reg_fragment_setenc(p, str, options);
20885 if (c) reg_fragment_enc_error(p, str, c);
20886 re = rb_parser_reg_compile(p, str, options);
20887 if (NIL_P(re)) {
20888 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
20889 rb_set_errinfo(err);
20890 }
20891 return re;
20892}
20893#endif
20894
20895#ifndef RIPPER
20896void
20897rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
20898{
20899 struct parser_params *p;
20900 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20901 p->do_print = print;
20902 p->do_loop = loop;
20903 p->do_chomp = chomp;
20904 p->do_split = split;
20905}
20906
20907static NODE *
20908parser_append_options(struct parser_params *p, NODE *node)
20909{
20910 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
20911 const YYLTYPE *const LOC = &default_location;
20912
20913 if (p->do_print) {
20914 NODE *print = NEW_FCALL(rb_intern("print"),
20915 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
20916 LOC);
20917 node = block_append(p, node, print);
20918 }
20919
20920 if (p->do_loop) {
20921 if (p->do_split) {
20922 ID ifs = rb_intern("$;");
20923 ID fields = rb_intern("$F");
20924 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
20925 NODE *split = NEW_GASGN(fields,
20926 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
20927 rb_intern("split"), args, LOC),
20928 LOC);
20929 node = block_append(p, split, node);
20930 }
20931 if (p->do_chomp) {
20932 NODE *chomp = NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
20933 rb_intern("chomp!"), 0, LOC);
20934 node = block_append(p, chomp, node);
20935 }
20936
20937 node = NEW_WHILE(NEW_VCALL(idGets, LOC), node, 1, LOC);
20938 }
20939
20940 return node;
20941}
20942
20943void
20944rb_init_parse(void)
20945{
20946 /* just to suppress unused-function warnings */
20947 (void)nodetype;
20948 (void)nodeline;
20949}
20950
20951static ID
20952internal_id(struct parser_params *p)
20953{
20954 return rb_make_temporary_id(vtable_size(p->lvtbl->args) + vtable_size(p->lvtbl->vars));
20955}
20956#endif /* !RIPPER */
20957
20958static void
20959parser_initialize(struct parser_params *p)
20960{
20961 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
20962 p->command_start = TRUE;
20963 p->ruby_sourcefile_string = Qnil;
20964 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
20965 p->node_id = 0;
20966#ifdef RIPPER
20967 p->delayed.token = Qnil;
20968 p->result = Qnil;
20969 p->parsing_thread = Qnil;
20970#else
20971 p->error_buffer = Qfalse;
20972#endif
20973 p->debug_buffer = Qnil;
20974 p->debug_output = rb_ractor_stdout();
20975 p->enc = rb_utf8_encoding();
20976}
20977
20978#ifdef RIPPER
20979#define parser_mark ripper_parser_mark
20980#define parser_free ripper_parser_free
20981#endif
20982
20983static void
20984parser_mark(void *ptr)
20985{
20986 struct parser_params *p = (struct parser_params*)ptr;
20987
20988 rb_gc_mark(p->lex.input);
20989 rb_gc_mark(p->lex.prevline);
20990 rb_gc_mark(p->lex.lastline);
20991 rb_gc_mark(p->lex.nextline);
20992 rb_gc_mark(p->ruby_sourcefile_string);
20993 rb_gc_mark((VALUE)p->lex.strterm);
20994 rb_gc_mark((VALUE)p->ast);
20995 rb_gc_mark(p->case_labels);
20996#ifndef RIPPER
20997 rb_gc_mark(p->debug_lines);
20998 rb_gc_mark(p->compile_option);
20999 rb_gc_mark(p->error_buffer);
21000#else
21001 rb_gc_mark(p->delayed.token);
21002 rb_gc_mark(p->value);
21003 rb_gc_mark(p->result);
21004 rb_gc_mark(p->parsing_thread);
21005#endif
21006 rb_gc_mark(p->debug_buffer);
21007 rb_gc_mark(p->debug_output);
21008#ifdef YYMALLOC
21009 rb_gc_mark((VALUE)p->heap);
21010#endif
21011}
21012
21013static void
21014parser_free(void *ptr)
21015{
21016 struct parser_params *p = (struct parser_params*)ptr;
21017 struct local_vars *local, *prev;
21018
21019 if (p->tokenbuf) {
21020 ruby_sized_xfree(p->tokenbuf, p->toksiz);
21021 }
21022 for (local = p->lvtbl; local; local = prev) {
21023 if (local->vars) xfree(local->vars);
21024 prev = local->prev;
21025 xfree(local);
21026 }
21027 {
21028 token_info *ptinfo;
21029 while ((ptinfo = p->token_info) != 0) {
21030 p->token_info = ptinfo->next;
21031 xfree(ptinfo);
21032 }
21033 }
21034 xfree(ptr);
21035}
21036
21037static size_t
21038parser_memsize(const void *ptr)
21039{
21040 struct parser_params *p = (struct parser_params*)ptr;
21041 struct local_vars *local;
21042 size_t size = sizeof(*p);
21043
21044 size += p->toksiz;
21045 for (local = p->lvtbl; local; local = local->prev) {
21046 size += sizeof(*local);
21047 if (local->vars) size += local->vars->capa * sizeof(ID);
21048 }
21049 return size;
21050}
21051
21052static const rb_data_type_t parser_data_type = {
21053#ifndef RIPPER
21054 "parser",
21055#else
21056 "ripper",
21057#endif
21058 {
21059 parser_mark,
21060 parser_free,
21061 parser_memsize,
21062 },
21063 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
21064};
21065
21066#ifndef RIPPER
21067#undef rb_reserved_word
21068
21069const struct kwtable *
21070rb_reserved_word(const char *str, unsigned int len)
21071{
21072 return reserved_word(str, len);
21073}
21074
21075VALUE
21076rb_parser_new(void)
21077{
21078 struct parser_params *p;
21079 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
21080 &parser_data_type, p);
21081 parser_initialize(p);
21082 return parser;
21083}
21084
21085VALUE
21086rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
21087{
21088 struct parser_params *p;
21089
21090 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21091 p->error_buffer = main ? Qfalse : Qnil;
21092 p->parent_iseq = base;
21093 return vparser;
21094}
21095
21096void
21097rb_parser_keep_script_lines(VALUE vparser)
21098{
21099 struct parser_params *p;
21100
21101 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21102 p->keep_script_lines = 1;
21103}
21104#endif
21105
21106#ifdef RIPPER
21107#define rb_parser_end_seen_p ripper_parser_end_seen_p
21108#define rb_parser_encoding ripper_parser_encoding
21109#define rb_parser_get_yydebug ripper_parser_get_yydebug
21110#define rb_parser_set_yydebug ripper_parser_set_yydebug
21111#define rb_parser_get_debug_output ripper_parser_get_debug_output
21112#define rb_parser_set_debug_output ripper_parser_set_debug_output
21113static VALUE ripper_parser_end_seen_p(VALUE vparser);
21114static VALUE ripper_parser_encoding(VALUE vparser);
21115static VALUE ripper_parser_get_yydebug(VALUE self);
21116static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
21117static VALUE ripper_parser_get_debug_output(VALUE self);
21118static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output);
21119
21120/*
21121 * call-seq:
21122 * ripper.error? -> Boolean
21123 *
21124 * Return true if parsed source has errors.
21125 */
21126static VALUE
21127ripper_error_p(VALUE vparser)
21128{
21129 struct parser_params *p;
21130
21131 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21132 return RBOOL(p->error_p);
21133}
21134#endif
21135
21136/*
21137 * call-seq:
21138 * ripper.end_seen? -> Boolean
21139 *
21140 * Return true if parsed source ended by +\_\_END\_\_+.
21141 */
21142VALUE
21143rb_parser_end_seen_p(VALUE vparser)
21144{
21145 struct parser_params *p;
21146
21147 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21148 return RBOOL(p->ruby__end__seen);
21149}
21150
21151/*
21152 * call-seq:
21153 * ripper.encoding -> encoding
21154 *
21155 * Return encoding of the source.
21156 */
21157VALUE
21158rb_parser_encoding(VALUE vparser)
21159{
21160 struct parser_params *p;
21161
21162 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
21163 return rb_enc_from_encoding(p->enc);
21164}
21165
21166#ifdef RIPPER
21167/*
21168 * call-seq:
21169 * ripper.yydebug -> true or false
21170 *
21171 * Get yydebug.
21172 */
21173VALUE
21174rb_parser_get_yydebug(VALUE self)
21175{
21176 struct parser_params *p;
21177
21178 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21179 return RBOOL(p->debug);
21180}
21181#endif
21182
21183/*
21184 * call-seq:
21185 * ripper.yydebug = flag
21186 *
21187 * Set yydebug.
21188 */
21189VALUE
21190rb_parser_set_yydebug(VALUE self, VALUE flag)
21191{
21192 struct parser_params *p;
21193
21194 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21195 p->debug = RTEST(flag);
21196 return flag;
21197}
21198
21199/*
21200 * call-seq:
21201 * ripper.debug_output -> obj
21202 *
21203 * Get debug output.
21204 */
21205VALUE
21206rb_parser_get_debug_output(VALUE self)
21207{
21208 struct parser_params *p;
21209
21210 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21211 return p->debug_output;
21212}
21213
21214/*
21215 * call-seq:
21216 * ripper.debug_output = obj
21217 *
21218 * Set debug output.
21219 */
21220VALUE
21221rb_parser_set_debug_output(VALUE self, VALUE output)
21222{
21223 struct parser_params *p;
21224
21225 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21226 return p->debug_output = output;
21227}
21228
21229#ifndef RIPPER
21230#ifdef YYMALLOC
21231#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
21232/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
21233 * potential memory leak */
21234#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
21235#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
21236 (new)->cnt = (cnt), (ptr))
21237
21238void *
21239rb_parser_malloc(struct parser_params *p, size_t size)
21240{
21241 size_t cnt = HEAPCNT(1, size);
21242 rb_imemo_tmpbuf_t *n = NEWHEAP();
21243 void *ptr = xmalloc(size);
21244
21245 return ADD2HEAP(n, cnt, ptr);
21246}
21247
21248void *
21249rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
21250{
21251 size_t cnt = HEAPCNT(nelem, size);
21252 rb_imemo_tmpbuf_t *n = NEWHEAP();
21253 void *ptr = xcalloc(nelem, size);
21254
21255 return ADD2HEAP(n, cnt, ptr);
21256}
21257
21258void *
21259rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
21260{
21262 size_t cnt = HEAPCNT(1, size);
21263
21264 if (ptr && (n = p->heap) != NULL) {
21265 do {
21266 if (n->ptr == ptr) {
21267 n->ptr = ptr = xrealloc(ptr, size);
21268 if (n->cnt) n->cnt = cnt;
21269 return ptr;
21270 }
21271 } while ((n = n->next) != NULL);
21272 }
21273 n = NEWHEAP();
21274 ptr = xrealloc(ptr, size);
21275 return ADD2HEAP(n, cnt, ptr);
21276}
21277
21278void
21279rb_parser_free(struct parser_params *p, void *ptr)
21280{
21281 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
21282
21283 while ((n = *prev) != NULL) {
21284 if (n->ptr == ptr) {
21285 *prev = n->next;
21286 break;
21287 }
21288 prev = &n->next;
21289 }
21290}
21291#endif
21292
21293void
21294rb_parser_printf(struct parser_params *p, const char *fmt, ...)
21295{
21296 va_list ap;
21297 VALUE mesg = p->debug_buffer;
21298
21299 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
21300 va_start(ap, fmt);
21301 rb_str_vcatf(mesg, fmt, ap);
21302 va_end(ap);
21303 if (RSTRING_END(mesg)[-1] == '\n') {
21304 rb_io_write(p->debug_output, mesg);
21305 p->debug_buffer = Qnil;
21306 }
21307}
21308
21309static void
21310parser_compile_error(struct parser_params *p, const char *fmt, ...)
21311{
21312 va_list ap;
21313
21314 rb_io_flush(p->debug_output);
21315 p->error_p = 1;
21316 va_start(ap, fmt);
21317 p->error_buffer =
21318 rb_syntax_error_append(p->error_buffer,
21319 p->ruby_sourcefile_string,
21320 p->ruby_sourceline,
21321 rb_long2int(p->lex.pcur - p->lex.pbeg),
21322 p->enc, fmt, ap);
21323 va_end(ap);
21324}
21325
21326static size_t
21327count_char(const char *str, int c)
21328{
21329 int n = 0;
21330 while (str[n] == c) ++n;
21331 return n;
21332}
21333
21334/*
21335 * strip enclosing double-quotes, same as the default yytnamerr except
21336 * for that single-quotes matching back-quotes do not stop stripping.
21337 *
21338 * "\"`class' keyword\"" => "`class' keyword"
21339 */
21340RUBY_FUNC_EXPORTED size_t
21341rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
21342{
21343 if (*yystr == '"') {
21344 size_t yyn = 0, bquote = 0;
21345 const char *yyp = yystr;
21346
21347 while (*++yyp) {
21348 switch (*yyp) {
21349 case '`':
21350 if (!bquote) {
21351 bquote = count_char(yyp+1, '`') + 1;
21352 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
21353 yyn += bquote;
21354 yyp += bquote - 1;
21355 break;
21356 }
21357 goto default_char;
21358
21359 case '\'':
21360 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
21361 if (yyres) memcpy(yyres + yyn, yyp, bquote);
21362 yyn += bquote;
21363 yyp += bquote - 1;
21364 bquote = 0;
21365 break;
21366 }
21367 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
21368 if (yyres) memcpy(yyres + yyn, yyp, 3);
21369 yyn += 3;
21370 yyp += 2;
21371 break;
21372 }
21373 goto do_not_strip_quotes;
21374
21375 case ',':
21376 goto do_not_strip_quotes;
21377
21378 case '\\':
21379 if (*++yyp != '\\')
21380 goto do_not_strip_quotes;
21381 /* Fall through. */
21382 default_char:
21383 default:
21384 if (yyres)
21385 yyres[yyn] = *yyp;
21386 yyn++;
21387 break;
21388
21389 case '"':
21390 case '\0':
21391 if (yyres)
21392 yyres[yyn] = '\0';
21393 return yyn;
21394 }
21395 }
21396 do_not_strip_quotes: ;
21397 }
21398
21399 if (!yyres) return strlen(yystr);
21400
21401 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
21402}
21403#endif
21404
21405#ifdef RIPPER
21406#ifdef RIPPER_DEBUG
21407/* :nodoc: */
21408static VALUE
21409ripper_validate_object(VALUE self, VALUE x)
21410{
21411 if (x == Qfalse) return x;
21412 if (x == Qtrue) return x;
21413 if (x == Qnil) return x;
21414 if (x == Qundef)
21415 rb_raise(rb_eArgError, "Qundef given");
21416 if (FIXNUM_P(x)) return x;
21417 if (SYMBOL_P(x)) return x;
21418 switch (BUILTIN_TYPE(x)) {
21419 case T_STRING:
21420 case T_OBJECT:
21421 case T_ARRAY:
21422 case T_BIGNUM:
21423 case T_FLOAT:
21424 case T_COMPLEX:
21425 case T_RATIONAL:
21426 break;
21427 case T_NODE:
21428 if (!nd_type_p((NODE *)x, NODE_RIPPER)) {
21429 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
21430 }
21431 x = ((NODE *)x)->nd_rval;
21432 break;
21433 default:
21434 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
21435 (void *)x, rb_obj_classname(x));
21436 }
21437 if (!RBASIC_CLASS(x)) {
21438 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
21439 (void *)x, rb_builtin_type_name(TYPE(x)));
21440 }
21441 return x;
21442}
21443#endif
21444
21445#define validate(x) ((x) = get_value(x))
21446
21447static VALUE
21448ripper_dispatch0(struct parser_params *p, ID mid)
21449{
21450 return rb_funcall(p->value, mid, 0);
21451}
21452
21453static VALUE
21454ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
21455{
21456 validate(a);
21457 return rb_funcall(p->value, mid, 1, a);
21458}
21459
21460static VALUE
21461ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
21462{
21463 validate(a);
21464 validate(b);
21465 return rb_funcall(p->value, mid, 2, a, b);
21466}
21467
21468static VALUE
21469ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
21470{
21471 validate(a);
21472 validate(b);
21473 validate(c);
21474 return rb_funcall(p->value, mid, 3, a, b, c);
21475}
21476
21477static VALUE
21478ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
21479{
21480 validate(a);
21481 validate(b);
21482 validate(c);
21483 validate(d);
21484 return rb_funcall(p->value, mid, 4, a, b, c, d);
21485}
21486
21487static VALUE
21488ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
21489{
21490 validate(a);
21491 validate(b);
21492 validate(c);
21493 validate(d);
21494 validate(e);
21495 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
21496}
21497
21498static VALUE
21499ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
21500{
21501 validate(a);
21502 validate(b);
21503 validate(c);
21504 validate(d);
21505 validate(e);
21506 validate(f);
21507 validate(g);
21508 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
21509}
21510
21511static ID
21512ripper_get_id(VALUE v)
21513{
21514 NODE *nd;
21515 if (!RB_TYPE_P(v, T_NODE)) return 0;
21516 nd = (NODE *)v;
21517 if (!nd_type_p(nd, NODE_RIPPER)) return 0;
21518 return nd->nd_vid;
21519}
21520
21521static VALUE
21522ripper_get_value(VALUE v)
21523{
21524 NODE *nd;
21525 if (v == Qundef) return Qnil;
21526 if (!RB_TYPE_P(v, T_NODE)) return v;
21527 nd = (NODE *)v;
21528 if (!nd_type_p(nd, NODE_RIPPER)) return Qnil;
21529 return nd->nd_rval;
21530}
21531
21532static void
21533ripper_error(struct parser_params *p)
21534{
21535 p->error_p = TRUE;
21536}
21537
21538static void
21539ripper_compile_error(struct parser_params *p, const char *fmt, ...)
21540{
21541 VALUE str;
21542 va_list args;
21543
21544 va_start(args, fmt);
21545 str = rb_vsprintf(fmt, args);
21546 va_end(args);
21547 rb_funcall(p->value, rb_intern("compile_error"), 1, str);
21548 ripper_error(p);
21549}
21550
21551static VALUE
21552ripper_lex_get_generic(struct parser_params *p, VALUE src)
21553{
21554 VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
21555 if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
21556 rb_raise(rb_eTypeError,
21557 "gets returned %"PRIsVALUE" (expected String or nil)",
21558 rb_obj_class(line));
21559 }
21560 return line;
21561}
21562
21563static VALUE
21564ripper_lex_io_get(struct parser_params *p, VALUE src)
21565{
21566 return rb_io_gets(src);
21567}
21568
21569static VALUE
21570ripper_s_allocate(VALUE klass)
21571{
21572 struct parser_params *p;
21573 VALUE self = TypedData_Make_Struct(klass, struct parser_params,
21574 &parser_data_type, p);
21575 p->value = self;
21576 return self;
21577}
21578
21579#define ripper_initialized_p(r) ((r)->lex.input != 0)
21580
21581/*
21582 * call-seq:
21583 * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
21584 *
21585 * Create a new Ripper object.
21586 * _src_ must be a String, an IO, or an Object which has #gets method.
21587 *
21588 * This method does not starts parsing.
21589 * See also Ripper#parse and Ripper.parse.
21590 */
21591static VALUE
21592ripper_initialize(int argc, VALUE *argv, VALUE self)
21593{
21594 struct parser_params *p;
21595 VALUE src, fname, lineno;
21596
21597 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21598 rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
21599 if (RB_TYPE_P(src, T_FILE)) {
21600 p->lex.gets = ripper_lex_io_get;
21601 }
21602 else if (rb_respond_to(src, id_gets)) {
21603 p->lex.gets = ripper_lex_get_generic;
21604 }
21605 else {
21606 StringValue(src);
21607 p->lex.gets = lex_get_str;
21608 }
21609 p->lex.input = src;
21610 p->eofp = 0;
21611 if (NIL_P(fname)) {
21612 fname = STR_NEW2("(ripper)");
21613 OBJ_FREEZE(fname);
21614 }
21615 else {
21616 StringValueCStr(fname);
21617 fname = rb_str_new_frozen(fname);
21618 }
21619 parser_initialize(p);
21620
21621 p->ruby_sourcefile_string = fname;
21622 p->ruby_sourcefile = RSTRING_PTR(fname);
21623 p->ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
21624
21625 return Qnil;
21626}
21627
21628static VALUE
21629ripper_parse0(VALUE parser_v)
21630{
21631 struct parser_params *p;
21632
21633 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
21634 parser_prepare(p);
21635 p->ast = rb_ast_new();
21636 ripper_yyparse((void*)p);
21637 rb_ast_dispose(p->ast);
21638 p->ast = 0;
21639 return p->result;
21640}
21641
21642static VALUE
21643ripper_ensure(VALUE parser_v)
21644{
21645 struct parser_params *p;
21646
21647 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
21648 p->parsing_thread = Qnil;
21649 return Qnil;
21650}
21651
21652/*
21653 * call-seq:
21654 * ripper.parse
21655 *
21656 * Start parsing and returns the value of the root action.
21657 */
21658static VALUE
21659ripper_parse(VALUE self)
21660{
21661 struct parser_params *p;
21662
21663 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21664 if (!ripper_initialized_p(p)) {
21665 rb_raise(rb_eArgError, "method called for uninitialized object");
21666 }
21667 if (!NIL_P(p->parsing_thread)) {
21668 if (p->parsing_thread == rb_thread_current())
21669 rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
21670 else
21671 rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
21672 }
21673 p->parsing_thread = rb_thread_current();
21674 rb_ensure(ripper_parse0, self, ripper_ensure, self);
21675
21676 return p->result;
21677}
21678
21679/*
21680 * call-seq:
21681 * ripper.column -> Integer
21682 *
21683 * Return column number of current parsing line.
21684 * This number starts from 0.
21685 */
21686static VALUE
21687ripper_column(VALUE self)
21688{
21689 struct parser_params *p;
21690 long col;
21691
21692 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21693 if (!ripper_initialized_p(p)) {
21694 rb_raise(rb_eArgError, "method called for uninitialized object");
21695 }
21696 if (NIL_P(p->parsing_thread)) return Qnil;
21697 col = p->lex.ptok - p->lex.pbeg;
21698 return LONG2NUM(col);
21699}
21700
21701/*
21702 * call-seq:
21703 * ripper.filename -> String
21704 *
21705 * Return current parsing filename.
21706 */
21707static VALUE
21708ripper_filename(VALUE self)
21709{
21710 struct parser_params *p;
21711
21712 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21713 if (!ripper_initialized_p(p)) {
21714 rb_raise(rb_eArgError, "method called for uninitialized object");
21715 }
21716 return p->ruby_sourcefile_string;
21717}
21718
21719/*
21720 * call-seq:
21721 * ripper.lineno -> Integer
21722 *
21723 * Return line number of current parsing line.
21724 * This number starts from 1.
21725 */
21726static VALUE
21727ripper_lineno(VALUE self)
21728{
21729 struct parser_params *p;
21730
21731 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21732 if (!ripper_initialized_p(p)) {
21733 rb_raise(rb_eArgError, "method called for uninitialized object");
21734 }
21735 if (NIL_P(p->parsing_thread)) return Qnil;
21736 return INT2NUM(p->ruby_sourceline);
21737}
21738
21739/*
21740 * call-seq:
21741 * ripper.state -> Integer
21742 *
21743 * Return scanner state of current token.
21744 */
21745static VALUE
21746ripper_state(VALUE self)
21747{
21748 struct parser_params *p;
21749
21750 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21751 if (!ripper_initialized_p(p)) {
21752 rb_raise(rb_eArgError, "method called for uninitialized object");
21753 }
21754 if (NIL_P(p->parsing_thread)) return Qnil;
21755 return INT2NUM(p->lex.state);
21756}
21757
21758/*
21759 * call-seq:
21760 * ripper.token -> String
21761 *
21762 * Return the current token string.
21763 */
21764static VALUE
21765ripper_token(VALUE self)
21766{
21767 struct parser_params *p;
21768 long pos, len;
21769
21770 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21771 if (!ripper_initialized_p(p)) {
21772 rb_raise(rb_eArgError, "method called for uninitialized object");
21773 }
21774 if (NIL_P(p->parsing_thread)) return Qnil;
21775 pos = p->lex.ptok - p->lex.pbeg;
21776 len = p->lex.pcur - p->lex.ptok;
21777 return rb_str_subseq(p->lex.lastline, pos, len);
21778}
21779
21780#ifdef RIPPER_DEBUG
21781/* :nodoc: */
21782static VALUE
21783ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
21784{
21785 StringValue(msg);
21786 if (obj == Qundef) {
21787 rb_raise(rb_eArgError, "%"PRIsVALUE, msg);
21788 }
21789 return Qnil;
21790}
21791
21792/* :nodoc: */
21793static VALUE
21794ripper_value(VALUE self, VALUE obj)
21795{
21796 return ULONG2NUM(obj);
21797}
21798#endif
21799
21800/*
21801 * call-seq:
21802 * Ripper.lex_state_name(integer) -> string
21803 *
21804 * Returns a string representation of lex_state.
21805 */
21806static VALUE
21807ripper_lex_state_name(VALUE self, VALUE state)
21808{
21809 return rb_parser_lex_state_name(NUM2INT(state));
21810}
21811
21812void
21813Init_ripper(void)
21814{
21815 ripper_init_eventids1();
21816 ripper_init_eventids2();
21817 id_warn = rb_intern_const("warn");
21818 id_warning = rb_intern_const("warning");
21819 id_gets = rb_intern_const("gets");
21820 id_assoc = rb_intern_const("=>");
21821
21822 (void)yystpcpy; /* may not used in newer bison */
21823
21824 InitVM(ripper);
21825}
21826
21827void
21828InitVM_ripper(void)
21829{
21830 VALUE Ripper;
21831
21832 Ripper = rb_define_class("Ripper", rb_cObject);
21833 /* version of Ripper */
21834 rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
21835 rb_define_alloc_func(Ripper, ripper_s_allocate);
21836 rb_define_method(Ripper, "initialize", ripper_initialize, -1);
21837 rb_define_method(Ripper, "parse", ripper_parse, 0);
21838 rb_define_method(Ripper, "column", ripper_column, 0);
21839 rb_define_method(Ripper, "filename", ripper_filename, 0);
21840 rb_define_method(Ripper, "lineno", ripper_lineno, 0);
21841 rb_define_method(Ripper, "state", ripper_state, 0);
21842 rb_define_method(Ripper, "token", ripper_token, 0);
21843 rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
21844 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
21845 rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
21846 rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
21847 rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0);
21848 rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1);
21849 rb_define_method(Ripper, "error?", ripper_error_p, 0);
21850#ifdef RIPPER_DEBUG
21851 rb_define_method(Ripper, "assert_Qundef", ripper_assert_Qundef, 2);
21852 rb_define_method(Ripper, "rawVALUE", ripper_value, 1);
21853 rb_define_method(Ripper, "validate_object", ripper_validate_object, 1);
21854#endif
21855
21856 rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
21857 rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
21858
21859 rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
21860
21861<% @exprs.each do |expr, desc| -%>
21862 /* <%=desc%> */
21863 rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
21864<% end %>
21865 ripper_init_eventids1_table(Ripper);
21866 ripper_init_eventids2_table(Ripper);
21867
21868# if 0
21869 /* Hack to let RDoc document SCRIPT_LINES__ */
21870
21871 /*
21872 * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
21873 * after the assignment will be added as an Array of lines with the file
21874 * name as the key.
21875 */
21876 rb_define_global_const("SCRIPT_LINES__", Qnil);
21877#endif
21878
21879}
21880#endif /* RIPPER */
21881
21882/*
21883 * Local variables:
21884 * mode: c
21885 * c-file-style: "ruby"
21886 * End:
21887 */
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
Definition: cxxanyargs.hpp:685
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
Definition: cxxanyargs.hpp:677
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
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a method.
Definition: class.c:1914
#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:3021
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:671
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
Definition: eval.c:1760
#define ruby_verbose
This variable controls whether the interpreter is in debug mode.
Definition: error.h:459
void rb_fatal(const char *fmt,...)
Raises the unsung "fatal" exception.
Definition: error.c:3072
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_ensure(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*e_proc)(VALUE), VALUE data2)
An equivalent to ensure clause.
Definition: eval.c:979
VALUE rb_errinfo(void)
This is the same as $! in Ruby.
Definition: eval.c:1754
@ RB_WARN_CATEGORY_EXPERIMENTAL
Warning is for experimental features.
Definition: error.h:51
#define RB_OBJ_WRITTEN(old, oldv, young)
Identical to RB_OBJ_WRITE(), except it doesn't write any values, but only a WB declaration.
Definition: rgengc.h:232
#define RB_OBJ_WRITE(old, slot, young)
Declaration of a "back" pointer.
Definition: rgengc.h:220
Encoding relates APIs.
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
Queries the number of bytes of the character at the passed pointer.
Definition: encoding.c:1234
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
Identical to rb_enc_associate(), except it takes an encoding itself instead of its index.
Definition: encoding.c:1066
rb_encoding * rb_utf8_encoding(void)
Queries the encoding that represents UTF-8.
Definition: encoding.c:1527
rb_encoding * rb_ascii8bit_encoding(void)
Queries the encoding that represents ASCII-8BIT a.k.a.
Definition: encoding.c:1515
int rb_enc_codelen(int code, rb_encoding *enc)
Queries the number of bytes requested to represent the passed code point using the passed encoding.
Definition: encoding.c:1284
static const char * rb_enc_name(rb_encoding *enc)
Queries the (canonical) name of the passed encoding.
Definition: encoding.h:433
rb_encoding * rb_enc_get(VALUE obj)
Identical to rb_enc_get_index(), except the return type.
Definition: encoding.c:1072
rb_encoding * rb_enc_from_index(int idx)
Identical to rb_find_encoding(), except it takes an encoding index instead of a Ruby object.
Definition: encoding.c:414
int rb_ascii8bit_encindex(void)
Identical to rb_ascii8bit_encoding(), except it returns the encoding's index instead of the encoding ...
Definition: encoding.c:1521
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
VALUE rb_enc_from_encoding(rb_encoding *enc)
Queries the Ruby-level counterpart instance of rb_cEncoding that corresponds to the passed encoding.
Definition: encoding.c:188
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
VALUE rb_enc_associate_index(VALUE obj, int encindex)
Identical to rb_enc_set_index(), except it additionally does contents fix-up depending on the passed ...
Definition: encoding.c:1038
rb_encoding * rb_enc_compatible(VALUE str1, VALUE str2)
Look for the "common" encoding between the two.
Definition: encoding.c:1176
rb_encoding * rb_usascii_encoding(void)
Queries the encoding that represents US-ASCII.
Definition: encoding.c:1539
int rb_enc_find_index(const char *name)
Queries the index of the encoding.
Definition: encoding.c:881
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
void rb_gc_register_mark_object(VALUE object)
Inform the garbage collector that object is a live Ruby object that should not be moved.
Definition: gc.c:8686
VALUE rb_ary_reverse(VALUE ary)
Destructively reverses the passed array in-place.
Definition: array.c:2995
VALUE rb_ary_unshift(VALUE ary, VALUE elem)
Destructively prepends the passed item at the beginning of the passed array.
Definition: array.c:1661
VALUE rb_ary_new(void)
Allocates a new, empty array.
Definition: array.c:750
VALUE rb_ary_clear(VALUE ary)
Destructively removes everything form an array.
Definition: array.c:4465
VALUE rb_ary_push(VALUE ary, VALUE elem)
Special case of rb_ary_cat() that it adds only one element.
Definition: array.c:1308
VALUE rb_ary_new_from_args(long n,...)
Constructs an array from the passed objects.
Definition: array.c:756
VALUE rb_ary_join(VALUE ary, VALUE sep)
Recursively stringises the elements of the passed array, flattens that result, then joins the sequenc...
Definition: array.c:2777
VALUE rb_big_norm(VALUE x)
Normalises the passed bignum.
Definition: bignum.c:3163
VALUE rb_cstr_to_inum(const char *str, int base, int badcheck)
Parses C's string to convert into a Ruby's integer.
Definition: bignum.c:4022
VALUE rb_complex_raw(VALUE real, VALUE imag)
Identical to rb_complex_new(), except it assumes both arguments are not instances of rb_cComplex.
Definition: complex.c:1522
VALUE rb_make_exception(int argc, const VALUE *argv)
Constructs an exception object from the list of arguments, in a manner similar to Ruby's raise.
Definition: eval.c:817
void rb_gc_mark(VALUE obj)
Marks an object.
Definition: gc.c:6774
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
Inserts or replaces ("upsert"s) the objects into the given hash table.
Definition: hash.c:2903
VALUE rb_hash_lookup(VALUE hash, VALUE key)
Identical to rb_hash_aref(), except it always returns RUBY_Qnil for misshits.
Definition: hash.c:2108
VALUE rb_hash_clear(VALUE hash)
Swipes everything out of the passed hash table.
Definition: hash.c:2829
VALUE rb_hash_new(void)
Creates a new, empty hash object.
Definition: hash.c:1529
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
VALUE rb_str_buf_cat(VALUE, const char *, long)
Just another name of rb_str_cat.
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_usascii_str_new(const char *ptr, long len)
Identical to rb_str_new(), except it generates a string of "US ASCII" encoding.
Definition: string.c:924
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
VALUE rb_str_new(const char *ptr, long len)
Allocates an instance of rb_cString.
Definition: string.c:918
VALUE rb_str_new_cstr(const char *ptr)
Identical to rb_str_new(), except it assumes the passed pointer is a pointer to a C string.
Definition: string.c:952
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
VALUE rb_str_cat_cstr(VALUE dst, const char *src)
Identical to rb_str_cat(), except it assumes the passed pointer is a pointer to a C string.
Definition: string.c:3171
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
VALUE rb_id2str(ID id)
Identical to rb_id2name(), except it returns a Ruby's String instead of C's.
Definition: symbol.c:935
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.
Definition: cxxanyargs.hpp:56
int st_foreach(st_table *q, int_type *w, st_data_t e)
Iteration over the given table.
Definition: cxxanyargs.hpp:432
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition: nonnull.h:27
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: parse.h:205
Definition: lex.c:34
This is the struct that holds necessary info for a struct.
Definition: parse.c:255
Definition: parse.h:183
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