Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
parse.c
Go to the documentation of this file.
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/ruby.h"
83#include "ruby/st.h"
84#include "ruby/encoding.h"
85#include "internal.h"
86#include "node.h"
87#include "parse.h"
88#include "symbol.h"
89#include "regenc.h"
90#include <stdio.h>
91#include <errno.h>
92#include <ctype.h>
93#include "probes.h"
94
95#ifndef WARN_PAST_SCOPE
96# define WARN_PAST_SCOPE 0
97#endif
98
99#define TAB_WIDTH 8
100
101#define yydebug (p->debug) /* disable the global variable definition */
102
103#define YYMALLOC(size) rb_parser_malloc(p, (size))
104#define YYREALLOC(ptr, size) rb_parser_realloc(p, (ptr), (size))
105#define YYCALLOC(nelem, size) rb_parser_calloc(p, (nelem), (size))
106#define YYFREE(ptr) rb_parser_free(p, (ptr))
107#define YYFPRINTF rb_parser_printf
108#define YY_LOCATION_PRINT(File, loc) \
109 rb_parser_printf(p, "%d.%d-%d.%d", \
110 (loc).beg_pos.lineno, (loc).beg_pos.column,\
111 (loc).end_pos.lineno, (loc).end_pos.column)
112#define YYLLOC_DEFAULT(Current, Rhs, N) \
113 do \
114 if (N) \
115 { \
116 (Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
117 (Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
118 } \
119 else \
120 { \
121 (Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
122 (Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
123 } \
124 while (0)
125
126#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
127 rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
128#define RUBY_SET_YYLLOC_OF_NONE(Current) \
129 rb_parser_set_location_of_none(p, &(Current))
130#define RUBY_SET_YYLLOC(Current) \
131 rb_parser_set_location(p, &(Current))
132#define RUBY_INIT_YYLLOC() \
133 { \
134 {p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
135 {p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
136 }
137
139 EXPR_BEG_bit, /* ignore newline, +/- is a sign. */
140 EXPR_END_bit, /* newline significant, +/- is an operator. */
141 EXPR_ENDARG_bit, /* ditto, and unbound braces. */
142 EXPR_ENDFN_bit, /* ditto, and unbound braces. */
143 EXPR_ARG_bit, /* newline significant, +/- is an operator. */
144 EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */
145 EXPR_MID_bit, /* newline significant, +/- is an operator. */
146 EXPR_FNAME_bit, /* ignore newline, no reserved words. */
147 EXPR_DOT_bit, /* right after `.' or `::', no reserved words. */
148 EXPR_CLASS_bit, /* immediate after `class', no here document. */
149 EXPR_LABEL_bit, /* flag bit, label is allowed. */
150 EXPR_LABELED_bit, /* flag bit, just after a label. */
151 EXPR_FITEM_bit, /* symbol literal as FNAME. */
154/* examine combinations */
156#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit)
158 DEF_EXPR(END),
159 DEF_EXPR(ENDARG),
160 DEF_EXPR(ENDFN),
161 DEF_EXPR(ARG),
162 DEF_EXPR(CMDARG),
163 DEF_EXPR(MID),
164 DEF_EXPR(FNAME),
165 DEF_EXPR(DOT),
166 DEF_EXPR(CLASS),
168 DEF_EXPR(LABELED),
169 DEF_EXPR(FITEM),
170 EXPR_VALUE = EXPR_BEG,
171 EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS),
172 EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG),
173 EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN),
174 EXPR_NONE = 0
176#define IS_lex_state_for(x, ls) ((x) & (ls))
177#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
178#define IS_lex_state(ls) IS_lex_state_for(p->lex.state, (ls))
179#define IS_lex_state_all(ls) IS_lex_state_all_for(p->lex.state, (ls))
180
181# define SET_LEX_STATE(ls) \
182 (p->lex.state = \
183 (p->debug ? \
184 rb_parser_trace_lex_state(p, p->lex.state, (ls), __LINE__) : \
185 (enum lex_state_e)(ls)))
186
188
189static const rb_code_location_t NULL_LOC = { {0, -1}, {0, -1} };
190
191# define SHOW_BITSTACK(stack, name) (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
192# define BITSTACK_PUSH(stack, n) (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
193# define BITSTACK_POP(stack) (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
194# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
195# define BITSTACK_SET(stack, n) ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
196
197/* A flag to identify keyword_do_cond, "do" keyword after condition expression.
198 Examples: `while ... do`, `until ... do`, and `for ... in ... do` */
199#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
200#define COND_POP() BITSTACK_POP(cond_stack)
201#define COND_P() BITSTACK_SET_P(cond_stack)
202#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
203
204/* A flag to identify keyword_do_block; "do" keyword after command_call.
205 Example: `foo 1, 2 do`. */
206#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
207#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
208#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
209#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
210
211struct vtable {
212 ID *tbl;
213 int pos;
214 int capa;
215 struct vtable *prev;
216};
217
218struct local_vars {
219 struct vtable *args;
220 struct vtable *vars;
221 struct vtable *used;
222# if WARN_PAST_SCOPE
223 struct vtable *past;
224# endif
225 struct local_vars *prev;
226# ifndef RIPPER
227 struct {
228 NODE *outer, *inner, *current;
230# endif
231};
232
233enum {
237};
238
239#define NUMPARAM_ID_P(id) numparam_id_p(id)
240#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1)
241#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1))
242static int
243numparam_id_p(ID id)
244{
245 if (!is_local_id(id)) return 0;
246 unsigned int idx = NUMPARAM_ID_TO_IDX(id);
247 return idx > 0 && idx <= NUMPARAM_MAX;
248}
249static void numparam_name(struct parser_params *p, ID id);
250
251#define DVARS_INHERIT ((void*)1)
252#define DVARS_TOPSCOPE NULL
253#define DVARS_TERMINAL_P(tbl) ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
254
255typedef struct token_info {
256 const char *token;
258 int indent;
259 int nonspc;
260 struct token_info *next;
262
264
265/*
266 Structure of Lexer Buffer:
267
268 lex.pbeg lex.ptok lex.pcur lex.pend
269 | | | |
270 |------------+------------+------------|
271 |<---------->|
272 token
273*/
274struct parser_params {
276
277 YYSTYPE *lval;
278
279 struct {
281 VALUE (*gets)(struct parser_params*,VALUE);
282 VALUE input;
286 const char *pbeg;
287 const char *pcur;
288 const char *pend;
289 const char *ptok;
290 union {
291 long ptr;
292 VALUE (*call)(VALUE, int);
294 enum lex_state_e state;
295 /* track the nest level of any parens "()[]{}" */
296 int paren_nest;
297 /* keep p->lex.paren_nest at the beginning of lambda "->" to detect tLAMBEG and keyword_do_LAMBDA */
298 int lpar_beg;
299 /* track the nest level of only braces "{}" */
300 int brace_nest;
304 int tokidx;
305 int toksiz;
306 int tokline;
307 int heredoc_end;
308 int heredoc_indent;
310 char *tokenbuf;
311 struct local_vars *lvtbl;
314 int line_count;
315 int ruby_sourceline; /* current line no. */
316 const char *ruby_sourcefile; /* current source file */
322
325
326 ID cur_arg;
327
328 rb_ast_t *ast;
329 int node_id;
330
331 int max_numparam;
332
333 unsigned int command_start:1;
334 unsigned int eofp: 1;
335 unsigned int ruby__end__seen: 1;
336 unsigned int debug: 1;
337 unsigned int has_shebang: 1;
338 unsigned int in_defined: 1;
339 unsigned int in_kwarg: 1;
340 unsigned int in_def: 1;
341 unsigned int in_class: 1;
342 unsigned int token_seen: 1;
343 unsigned int token_info_enabled: 1;
344# if WARN_PAST_SCOPE
345 unsigned int past_scope_enabled: 1;
346# endif
347 unsigned int error_p: 1;
348 unsigned int cr_seen: 1;
349
350#ifndef RIPPER
351 /* Ruby core only */
352
353 unsigned int do_print: 1;
354 unsigned int do_loop: 1;
355 unsigned int do_chomp: 1;
356 unsigned int do_split: 1;
357 unsigned int warn_location: 1;
358
363 const struct rb_iseq_struct *parent_iseq;
364#else
365 /* Ripper only */
366
367 struct {
368 VALUE token;
369 int line;
370 int col;
371 } delayed;
372
373 VALUE value;
374 VALUE result;
375 VALUE parsing_thread;
376#endif
377};
378
379#define intern_cstr(n,l,en) rb_intern3(n,l,en)
380
381#define STR_NEW(ptr,len) rb_enc_str_new((ptr),(len),p->enc)
382#define STR_NEW0() rb_enc_str_new(0,0,p->enc)
383#define STR_NEW2(ptr) rb_enc_str_new((ptr),strlen(ptr),p->enc)
384#define STR_NEW3(ptr,len,e,func) parser_str_new((ptr),(len),(e),(func),p->enc)
385#define TOK_INTERN() intern_cstr(tok(p), toklen(p), p->enc)
386
387static st_table *
388push_pvtbl(struct parser_params *p)
389{
390 st_table *tbl = p->pvtbl;
391 p->pvtbl = st_init_numtable();
392 return tbl;
393}
394
395static void
396pop_pvtbl(struct parser_params *p, st_table *tbl)
397{
399 p->pvtbl = tbl;
400}
401
402static st_table *
403push_pktbl(struct parser_params *p)
404{
405 st_table *tbl = p->pktbl;
406 p->pktbl = 0;
407 return tbl;
408}
409
410static void
411pop_pktbl(struct parser_params *p, st_table *tbl)
412{
413 if (p->pktbl) st_free_table(p->pktbl);
414 p->pktbl = tbl;
415}
416
417static int parser_yyerror(struct parser_params*, const YYLTYPE *yylloc, const char*);
418#define yyerror0(msg) parser_yyerror(p, NULL, (msg))
419#define yyerror1(loc, msg) parser_yyerror(p, (loc), (msg))
420#define yyerror(yylloc, p, msg) parser_yyerror(p, yylloc, msg)
421#define token_flush(ptr) ((ptr)->lex.ptok = (ptr)->lex.pcur)
422
423#ifdef RIPPER
424#define compile_for_eval (0)
425#else
426#define compile_for_eval (p->parent_iseq != 0)
427#endif
428
429#define token_column ((int)(p->lex.ptok - p->lex.pbeg))
430
431#define CALL_Q_P(q) ((q) == TOKEN2VAL(tANDDOT))
432#define NODE_CALL_Q(q) (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
433#define NEW_QCALL(q,r,m,a,loc) NEW_NODE(NODE_CALL_Q(q),r,m,a,loc)
434
435#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
436
437static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
438
439#ifndef RIPPER
440static inline void
441rb_discard_node(struct parser_params *p, NODE *n)
442{
444}
445#endif
446
447#ifdef RIPPER
448static inline VALUE
449add_mark_object(struct parser_params *p, VALUE obj)
450{
451 if (!SPECIAL_CONST_P(obj)
452 && !RB_TYPE_P(obj, T_NODE) /* Ripper jumbles NODE objects and other objects... */
453 ) {
455 }
456 return obj;
457}
458#else
459static NODE* node_newnode_with_locals(struct parser_params *, enum node_type, VALUE, VALUE, const rb_code_location_t*);
460#endif
461
462static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE, const rb_code_location_t*);
463#define rb_node_newnode(type, a1, a2, a3, loc) node_newnode(p, (type), (a1), (a2), (a3), (loc))
464
465static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
466
467static int
468parser_get_node_id(struct parser_params *p)
469{
470 int node_id = p->node_id;
471 p->node_id++;
472 return node_id;
473}
474
475#ifndef RIPPER
476static inline void
477set_line_body(NODE *body, int line)
478{
479 if (!body) return;
480 switch (nd_type(body)) {
481 case NODE_RESCUE:
482 case NODE_ENSURE:
483 nd_set_line(body, line);
484 }
485}
486
487#define yyparse ruby_yyparse
488
489static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
490static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
491#define new_nil(loc) NEW_NIL(loc)
492static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
493static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
494static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
495
496static NODE *newline_node(NODE*);
497static void fixpos(NODE*,NODE*);
498
499static int value_expr_gen(struct parser_params*,NODE*);
500static void void_expr(struct parser_params*,NODE*);
501static NODE *remove_begin(NODE*);
502static NODE *remove_begin_all(NODE*);
503#define value_expr(node) value_expr_gen(p, (node) = remove_begin(node))
504static NODE *void_stmts(struct parser_params*,NODE*);
505static void reduce_nodes(struct parser_params*,NODE**);
506static void block_dup_check(struct parser_params*,NODE*,NODE*);
507
508static NODE *block_append(struct parser_params*,NODE*,NODE*);
509static NODE *list_append(struct parser_params*,NODE*,NODE*);
510static NODE *list_concat(NODE*,NODE*);
511static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
512static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
513static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
514static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
515static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
516static NODE *evstr2dstr(struct parser_params*,NODE*);
517static NODE *splat_array(NODE*);
518static void mark_lvar_used(struct parser_params *p, NODE *rhs);
519
520static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
521static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
522static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
523static 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);
524static 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;}
525
526static bool args_info_empty_p(struct rb_args_info *args);
527static NODE *new_args(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*,const YYLTYPE*);
528static NODE *new_args_tail(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
529static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
530static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc);
531static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
532static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
533static NODE *new_case3(struct parser_params *p, NODE *val, NODE *pat, const YYLTYPE *loc);
534
535static NODE *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
536static NODE *args_with_numbered(struct parser_params*,NODE*,int);
537
538static VALUE negate_lit(struct parser_params*, VALUE);
539static NODE *ret_args(struct parser_params*,NODE*);
540static NODE *arg_blk_pass(NODE*,NODE*);
541static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
542static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
543
544static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
545static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
546
547static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
548static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
549
550static void rb_backref_error(struct parser_params*,NODE*);
551static NODE *node_assign(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
552
553static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *loc);
554static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
555static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
556static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *loc);
557static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
558
559static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
560
561static NODE *opt_arg_append(NODE*, NODE*);
562static NODE *kwd_append(NODE*, NODE*);
563
564static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
565static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
566
567static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
568
569static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
570
571#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
572
573static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
574
575static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
576
577static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
578
579static ID *local_tbl(struct parser_params*);
580
581static VALUE reg_compile(struct parser_params*, VALUE, int);
582static void reg_fragment_setenc(struct parser_params*, VALUE, int);
583static int reg_fragment_check(struct parser_params*, VALUE, int);
584static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
585
586static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
587static NODE *heredoc_dedent(struct parser_params*,NODE*);
588
589static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
590
591#define get_id(id) (id)
592#define get_value(val) (val)
593#define get_num(num) (num)
594#else /* RIPPER */
595#define NODE_RIPPER NODE_CDECL
596
597static inline int ripper_is_node_yylval(VALUE n);
598
599static inline VALUE
600ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
601{
602 if (ripper_is_node_yylval(c)) c = RNODE(c)->nd_cval;
603 add_mark_object(p, b);
604 add_mark_object(p, c);
605 return (VALUE)NEW_CDECL(a, b, c, &NULL_LOC);
606}
607
608static inline int
609ripper_is_node_yylval(VALUE n)
610{
611 return RB_TYPE_P(n, T_NODE) && nd_type(RNODE(n)) == NODE_RIPPER;
612}
613
614#define value_expr(node) ((void)(node))
615#define remove_begin(node) (node)
616#define void_stmts(p,x) (x)
617#define rb_dvar_defined(id, base) 0
618#define rb_local_defined(id, base) 0
619static ID ripper_get_id(VALUE);
620#define get_id(id) ripper_get_id(id)
621static VALUE ripper_get_value(VALUE);
622#define get_value(val) ripper_get_value(val)
623#define get_num(num) (int)get_id(num)
624static VALUE assignable(struct parser_params*,VALUE);
625static int id_is_var(struct parser_params *p, ID id);
626
627#define method_cond(p,node,loc) (node)
628#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
629#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
630#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
631#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
632
633#define new_nil(loc) Qnil
634
635static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
636
637static VALUE const_decl(struct parser_params *p, VALUE path);
638
639static VALUE var_field(struct parser_params *p, VALUE a);
640static VALUE assign_error(struct parser_params *p, VALUE a);
641
642static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
643
644#endif /* !RIPPER */
645
646/* forward declaration */
648
650VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
654void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
655PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
660
661static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
662static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
663static ID formal_argument(struct parser_params*, ID);
664static ID shadowing_lvar(struct parser_params*,ID);
665static void new_bv(struct parser_params*,ID);
666
667static void local_push(struct parser_params*,int);
668static void local_pop(struct parser_params*);
669static void local_var(struct parser_params*, ID);
670static void arg_var(struct parser_params*, ID);
671static int local_id(struct parser_params *p, ID id);
672static int local_id_ref(struct parser_params*, ID, ID **);
673#ifndef RIPPER
674static ID internal_id(struct parser_params*);
675#endif
676
677static const struct vtable *dyna_push(struct parser_params *);
678static void dyna_pop(struct parser_params*, const struct vtable *);
679static int dyna_in_block(struct parser_params*);
680#define dyna_var(p, id) local_var(p, id)
681static int dvar_defined(struct parser_params*, ID);
682static int dvar_defined_ref(struct parser_params*, ID, ID**);
683static int dvar_curr(struct parser_params*,ID);
684
685static int lvar_defined(struct parser_params*, ID);
686
687static NODE *numparam_push(struct parser_params *p);
688static void numparam_pop(struct parser_params *p, NODE *prev_inner);
689
690#ifdef RIPPER
691# define METHOD_NOT idNOT
692#else
693# define METHOD_NOT '!'
694#endif
695
696#define idFWD_REST '*'
697#ifdef RUBY3_KEYWORDS
698#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
699#else
700#define idFWD_KWREST 0
701#endif
702#define idFWD_BLOCK '&'
703
704#define RE_OPTION_ONCE (1<<16)
705#define RE_OPTION_ENCODING_SHIFT 8
706#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
707#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
708#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
709#define RE_OPTION_MASK 0xff
710#define RE_OPTION_ARG_ENCODING_NONE 32
711
712/* structs for managing terminator of string literal and heredocment */
713typedef struct rb_strterm_literal_struct {
714 union {
715 VALUE dummy;
716 long nest;
717 } u0;
718 union {
719 VALUE dummy;
720 long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
721 } u1;
722 union {
723 VALUE dummy;
724 long paren; /* '(' of `%q(...)` */
725 } u2;
726 union {
727 VALUE dummy;
728 long term; /* ')' of `%q(...)` */
729 } u3;
731
732#define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
733
735 VALUE lastline; /* the string of line that contains `<<"END"` */
736 long offset; /* the column of END in `<<"END"` */
737 int sourceline; /* lineno of the line that contains `<<"END"` */
738 unsigned length /* the length of END in `<<"END"` */
739#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
741# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
742#else
743# define HERETERM_LENGTH_MAX UINT_MAX
744#endif
745 ;
746#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
747 unsigned quote: 1;
748 unsigned func: 8;
749#else
752#endif
753};
755
756#define STRTERM_HEREDOC IMEMO_FL_USER0
757
758struct rb_strterm_struct {
759 VALUE flags;
760 union {
763 } u;
764};
765
766#ifndef RIPPER
767void
769{
770 rb_strterm_t *strterm = (rb_strterm_t*)obj;
771 if (RBASIC(obj)->flags & STRTERM_HEREDOC) {
772 rb_strterm_heredoc_t *heredoc = &strterm->u.heredoc;
773 rb_gc_mark(heredoc->lastline);
774 }
775}
776#endif
777
778#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
779size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
780
781#define TOKEN2ID(tok) ( \
782 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
783 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
784 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
785 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
786 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
787 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
788 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
789
790/****** Ripper *******/
791
792#ifdef RIPPER
793#define RIPPER_VERSION "0.1.0"
794
795static inline VALUE intern_sym(const char *name);
796
797#include "eventids1.c"
798#include "eventids2.c"
799
800static VALUE ripper_dispatch0(struct parser_params*,ID);
801static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
802static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
803static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
804static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
805static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
806static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
807static void ripper_error(struct parser_params *p);
808
809#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
810#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
811#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
812#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
813#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
814#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
815#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))
816
817#define yyparse ripper_yyparse
818
819#define ID2VAL(id) STATIC_ID2SYM(id)
820#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
821#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
822
823#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
824 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
825
826#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
827
828static inline VALUE
829new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
830{
831 NODE *t = (NODE *)tail;
832 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value, block = t->u3.value;
833 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, escape_Qundef(block));
834}
835
836static inline VALUE
837new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
838{
839 NODE *t = rb_node_newnode(NODE_ARGS_AUX, kw_args, kw_rest_arg, block, &NULL_LOC);
840 add_mark_object(p, kw_args);
841 add_mark_object(p, kw_rest_arg);
842 add_mark_object(p, block);
843 return (VALUE)t;
844}
845
846static inline VALUE
847args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
848{
849 return args;
850}
851
852static VALUE
853new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
854{
855 NODE *t = (NODE *)aryptn;
856 struct rb_ary_pattern_info *apinfo = t->nd_apinfo;
858
859 if (apinfo) {
860 pre_args = rb_ary_entry(apinfo->imemo, 0);
861 rest_arg = rb_ary_entry(apinfo->imemo, 1);
862 post_args = rb_ary_entry(apinfo->imemo, 2);
863 }
864
865 if (!NIL_P(pre_arg)) {
866 if (!NIL_P(pre_args)) {
867 rb_ary_unshift(pre_args, pre_arg);
868 }
869 else {
870 pre_args = rb_ary_new_from_args(1, pre_arg);
871 }
872 }
873 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
874}
875
876static VALUE
877new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
878{
879 NODE *t;
880 struct rb_ary_pattern_info *apinfo;
881
882 if (has_rest) {
883 rest_arg = dispatch1(var_field, rest_arg ? rest_arg : Qnil);
884 }
885 else {
886 rest_arg = Qnil;
887 }
888
890 apinfo = ZALLOC(struct rb_ary_pattern_info);
891 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
892 apinfo->imemo = rb_ary_new_from_args(4, pre_args, rest_arg, post_args, tmpbuf);
893
894 t = rb_node_newnode(NODE_ARYPTN, Qnil, Qnil, (VALUE)apinfo, &NULL_LOC);
895 RB_OBJ_WRITTEN(p->ast, Qnil, apinfo->imemo);
896
897 return (VALUE)t;
898}
899
900#define new_hash(p,h,l) rb_ary_new_from_args(0)
901
902static VALUE
903new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
904{
905 return ary;
906}
907
908static VALUE
909new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
910{
911 NODE *t = (NODE *)hshptn;
912 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value;
913 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
914}
915
916static VALUE
917new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
918{
919 NODE *t;
920 if (kw_rest_arg) {
921 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
922 }
923 else {
924 kw_rest_arg = Qnil;
925 }
926 t = rb_node_newnode(NODE_HSHPTN, kw_args, kw_rest_arg, 0, &NULL_LOC);
927
928 add_mark_object(p, kw_args);
929 add_mark_object(p, kw_rest_arg);
930 return (VALUE)t;
931}
932
933#define new_defined(p,expr,loc) dispatch1(defined, (expr))
934
935static VALUE heredoc_dedent(struct parser_params*,VALUE);
936
937#else
938#define ID2VAL(id) (id)
939#define TOKEN2VAL(t) ID2VAL(t)
940#define KWD2EID(t, v) keyword_##t
941#endif /* RIPPER */
942
943#ifndef RIPPER
944# define Qnone 0
945# define Qnull 0
946# define ifndef_ripper(x) (x)
947#else
948# define Qnone Qnil
949# define Qnull Qundef
950# define ifndef_ripper(x)
951#endif
952
953# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
954# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
955# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
956# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
957# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
958# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
959# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
960# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
961# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
962# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
963# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
964# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
965# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
966# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
967# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
968# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
969# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
970# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
971# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
972# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
973#ifdef RIPPER
974static ID id_warn, id_warning, id_gets, id_assoc;
975# define WARN_S_L(s,l) STR_NEW(s,l)
976# define WARN_S(s) STR_NEW2(s)
977# define WARN_I(i) INT2NUM(i)
978# define WARN_ID(i) rb_id2str(i)
979# define WARN_IVAL(i) i
980# define PRIsWARN "s"
981# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
982# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
983# ifdef HAVE_VA_ARGS_MACRO
984# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
985# else
986# define WARN_CALL rb_funcall
987# endif
988# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
989# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
990# ifdef HAVE_VA_ARGS_MACRO
991# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
992# else
993# define WARNING_CALL rb_funcall
994# endif
995PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
996# define compile_error ripper_compile_error
997#else
998# define WARN_S_L(s,l) s
999# define WARN_S(s) s
1000# define WARN_I(i) i
1001# define WARN_ID(i) rb_id2name(i)
1002# define WARN_IVAL(i) NUM2INT(i)
1003# define PRIsWARN PRIsVALUE
1004# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1005# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1006# define WARN_CALL rb_compile_warn
1007# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1008# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1009# define WARNING_CALL rb_compile_warning
1010PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1011# define compile_error parser_compile_error
1012#endif
1013
1014static void token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc);
1015static void token_info_push(struct parser_params*, const char *token, const rb_code_location_t *loc);
1016static void token_info_pop(struct parser_params*, const char *token, const rb_code_location_t *loc);
1017static void token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc);
1018
1019#define WARN_EOL(tok) \
1020 (looking_at_eol_p(p) ? \
1021 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1022 (void)0)
1023static int looking_at_eol_p(struct parser_params *p);
1024
1025#line 1026 "parse.c"
1026
1027# ifndef YY_CAST
1028# ifdef __cplusplus
1029# define YY_CAST(Type, Val) static_cast<Type> (Val)
1030# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1031# else
1032# define YY_CAST(Type, Val) ((Type) (Val))
1033# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1034# endif
1035# endif
1036# ifndef YY_NULLPTR
1037# if defined __cplusplus
1038# if 201103L <= __cplusplus
1039# define YY_NULLPTR nullptr
1040# else
1041# define YY_NULLPTR 0
1042# endif
1043# else
1044# define YY_NULLPTR ((void*)0)
1045# endif
1046# endif
1047
1048/* Use api.header.include to #include this header
1049 instead of duplicating it here. */
1050#ifndef YY_YY_Y_TAB_H_INCLUDED
1051# define YY_YY_Y_TAB_H_INCLUDED
1052/* Debug traces. */
1053#ifndef YYDEBUG
1054# define YYDEBUG 0
1055#endif
1056#if YYDEBUG
1057#ifndef yydebug
1058extern int yydebug;
1059#endif
1060#endif
1061
1062/* Token kinds. */
1063#ifndef YYTOKENTYPE
1064# define YYTOKENTYPE
1065 enum yytokentype
1066 {
1067 YYEMPTY = -2,
1068 END_OF_INPUT = 0, /* "end-of-input" */
1069 YYerror = 256, /* error */
1070 YYUNDEF = 257, /* "invalid token" */
1071 keyword_class = 258, /* "`class'" */
1072 keyword_module = 259, /* "`module'" */
1073 keyword_def = 260, /* "`def'" */
1074 keyword_undef = 261, /* "`undef'" */
1075 keyword_begin = 262, /* "`begin'" */
1076 keyword_rescue = 263, /* "`rescue'" */
1077 keyword_ensure = 264, /* "`ensure'" */
1078 keyword_end = 265, /* "`end'" */
1079 keyword_if = 266, /* "`if'" */
1080 keyword_unless = 267, /* "`unless'" */
1081 keyword_then = 268, /* "`then'" */
1082 keyword_elsif = 269, /* "`elsif'" */
1083 keyword_else = 270, /* "`else'" */
1084 keyword_case = 271, /* "`case'" */
1085 keyword_when = 272, /* "`when'" */
1086 keyword_while = 273, /* "`while'" */
1087 keyword_until = 274, /* "`until'" */
1088 keyword_for = 275, /* "`for'" */
1089 keyword_break = 276, /* "`break'" */
1090 keyword_next = 277, /* "`next'" */
1091 keyword_redo = 278, /* "`redo'" */
1092 keyword_retry = 279, /* "`retry'" */
1093 keyword_in = 280, /* "`in'" */
1094 keyword_do = 281, /* "`do'" */
1095 keyword_do_cond = 282, /* "`do' for condition" */
1096 keyword_do_block = 283, /* "`do' for block" */
1097 keyword_do_LAMBDA = 284, /* "`do' for lambda" */
1098 keyword_return = 285, /* "`return'" */
1099 keyword_yield = 286, /* "`yield'" */
1100 keyword_super = 287, /* "`super'" */
1101 keyword_self = 288, /* "`self'" */
1102 keyword_nil = 289, /* "`nil'" */
1103 keyword_true = 290, /* "`true'" */
1104 keyword_false = 291, /* "`false'" */
1105 keyword_and = 292, /* "`and'" */
1106 keyword_or = 293, /* "`or'" */
1107 keyword_not = 294, /* "`not'" */
1108 modifier_if = 295, /* "`if' modifier" */
1109 modifier_unless = 296, /* "`unless' modifier" */
1110 modifier_while = 297, /* "`while' modifier" */
1111 modifier_until = 298, /* "`until' modifier" */
1112 modifier_rescue = 299, /* "`rescue' modifier" */
1113 keyword_alias = 300, /* "`alias'" */
1114 keyword_defined = 301, /* "`defined?'" */
1115 keyword_BEGIN = 302, /* "`BEGIN'" */
1116 keyword_END = 303, /* "`END'" */
1117 keyword__LINE__ = 304, /* "`__LINE__'" */
1118 keyword__FILE__ = 305, /* "`__FILE__'" */
1119 keyword__ENCODING__ = 306, /* "`__ENCODING__'" */
1120 tIDENTIFIER = 307, /* "local variable or method" */
1121 tFID = 308, /* "method" */
1122 tGVAR = 309, /* "global variable" */
1123 tIVAR = 310, /* "instance variable" */
1124 tCONSTANT = 311, /* "constant" */
1125 tCVAR = 312, /* "class variable" */
1126 tLABEL = 313, /* tLABEL */
1127 tINTEGER = 314, /* "integer literal" */
1128 tFLOAT = 315, /* "float literal" */
1129 tRATIONAL = 316, /* "rational literal" */
1130 tIMAGINARY = 317, /* "imaginary literal" */
1131 tCHAR = 318, /* "char literal" */
1132 tNTH_REF = 319, /* "numbered reference" */
1133 tBACK_REF = 320, /* "back reference" */
1134 tSTRING_CONTENT = 321, /* "literal content" */
1135 tREGEXP_END = 322, /* tREGEXP_END */
1136 tSP = 323, /* "escaped space" */
1137 tUPLUS = 132, /* "unary+" */
1138 tUMINUS = 133, /* "unary-" */
1139 tPOW = 134, /* "**" */
1140 tCMP = 135, /* "<=>" */
1141 tEQ = 140, /* "==" */
1142 tEQQ = 141, /* "===" */
1143 tNEQ = 142, /* "!=" */
1144 tGEQ = 139, /* ">=" */
1145 tLEQ = 138, /* "<=" */
1146 tANDOP = 148, /* "&&" */
1147 tOROP = 149, /* "||" */
1148 tMATCH = 143, /* "=~" */
1149 tNMATCH = 144, /* "!~" */
1150 tDOT2 = 128, /* ".." */
1151 tDOT3 = 129, /* "..." */
1152 tBDOT2 = 130, /* "(.." */
1153 tBDOT3 = 131, /* "(..." */
1154 tAREF = 145, /* "[]" */
1155 tASET = 146, /* "[]=" */
1156 tLSHFT = 136, /* "<<" */
1157 tRSHFT = 137, /* ">>" */
1158 tANDDOT = 150, /* "&." */
1159 tCOLON2 = 147, /* "::" */
1160 tCOLON3 = 324, /* ":: at EXPR_BEG" */
1161 tOP_ASGN = 325, /* "operator-assignment" */
1162 tASSOC = 326, /* "=>" */
1163 tLPAREN = 327, /* "(" */
1164 tLPAREN_ARG = 328, /* "( arg" */
1165 tRPAREN = 329, /* ")" */
1166 tLBRACK = 330, /* "[" */
1167 tLBRACE = 331, /* "{" */
1168 tLBRACE_ARG = 332, /* "{ arg" */
1169 tSTAR = 333, /* "*" */
1170 tDSTAR = 334, /* "**arg" */
1171 tAMPER = 335, /* "&" */
1172 tLAMBDA = 336, /* "->" */
1173 tSYMBEG = 337, /* "symbol literal" */
1174 tSTRING_BEG = 338, /* "string literal" */
1175 tXSTRING_BEG = 339, /* "backtick literal" */
1176 tREGEXP_BEG = 340, /* "regexp literal" */
1177 tWORDS_BEG = 341, /* "word list" */
1178 tQWORDS_BEG = 342, /* "verbatim word list" */
1179 tSYMBOLS_BEG = 343, /* "symbol list" */
1180 tQSYMBOLS_BEG = 344, /* "verbatim symbol list" */
1181 tSTRING_END = 345, /* "terminator" */
1182 tSTRING_DEND = 346, /* "'}'" */
1183 tSTRING_DBEG = 347, /* tSTRING_DBEG */
1184 tSTRING_DVAR = 348, /* tSTRING_DVAR */
1185 tLAMBEG = 349, /* tLAMBEG */
1186 tLABEL_END = 350, /* tLABEL_END */
1187 tLOWEST = 351, /* tLOWEST */
1188 tUMINUS_NUM = 352, /* tUMINUS_NUM */
1189 tLAST_TOKEN = 353 /* tLAST_TOKEN */
1190 };
1191 typedef enum yytokentype yytoken_kind_t;
1192#endif
1193
1194/* Value type. */
1195#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1196union YYSTYPE
1197{
1198#line 1006 "parse.y"
1199
1200 VALUE val;
1201 NODE *node;
1202 ID id;
1203 int num;
1204 st_table *tbl;
1205 const struct vtable *vars;
1206 struct rb_strterm_struct *strterm;
1207
1208#line 1207 "parse.c"
1209
1210};
1211typedef union YYSTYPE YYSTYPE;
1212# define YYSTYPE_IS_TRIVIAL 1
1213# define YYSTYPE_IS_DECLARED 1
1214#endif
1215
1216/* Location type. */
1217#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
1218typedef struct YYLTYPE YYLTYPE;
1219struct YYLTYPE
1220{
1221 int first_line;
1222 int first_column;
1223 int last_line;
1224 int last_column;
1225};
1226# define YYLTYPE_IS_DECLARED 1
1227# define YYLTYPE_IS_TRIVIAL 1
1228#endif
1229
1230
1231
1232
1233int yyparse (struct parser_params *p);
1234
1235
1236#endif /* !YY_YY_Y_TAB_H_INCLUDED */
1237/* Symbol kind. */
1239{
1241 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1242 YYSYMBOL_YYerror = 1, /* error */
1243 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1244 YYSYMBOL_keyword_class = 3, /* "`class'" */
1245 YYSYMBOL_keyword_module = 4, /* "`module'" */
1246 YYSYMBOL_keyword_def = 5, /* "`def'" */
1247 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
1248 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
1249 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
1250 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
1251 YYSYMBOL_keyword_end = 10, /* "`end'" */
1252 YYSYMBOL_keyword_if = 11, /* "`if'" */
1253 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
1254 YYSYMBOL_keyword_then = 13, /* "`then'" */
1255 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
1256 YYSYMBOL_keyword_else = 15, /* "`else'" */
1257 YYSYMBOL_keyword_case = 16, /* "`case'" */
1258 YYSYMBOL_keyword_when = 17, /* "`when'" */
1259 YYSYMBOL_keyword_while = 18, /* "`while'" */
1260 YYSYMBOL_keyword_until = 19, /* "`until'" */
1261 YYSYMBOL_keyword_for = 20, /* "`for'" */
1262 YYSYMBOL_keyword_break = 21, /* "`break'" */
1263 YYSYMBOL_keyword_next = 22, /* "`next'" */
1264 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
1265 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
1266 YYSYMBOL_keyword_in = 25, /* "`in'" */
1267 YYSYMBOL_keyword_do = 26, /* "`do'" */
1268 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
1269 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
1270 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
1271 YYSYMBOL_keyword_return = 30, /* "`return'" */
1272 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
1273 YYSYMBOL_keyword_super = 32, /* "`super'" */
1274 YYSYMBOL_keyword_self = 33, /* "`self'" */
1275 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
1276 YYSYMBOL_keyword_true = 35, /* "`true'" */
1277 YYSYMBOL_keyword_false = 36, /* "`false'" */
1278 YYSYMBOL_keyword_and = 37, /* "`and'" */
1279 YYSYMBOL_keyword_or = 38, /* "`or'" */
1280 YYSYMBOL_keyword_not = 39, /* "`not'" */
1281 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
1282 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
1283 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
1284 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
1285 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
1286 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
1287 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
1288 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
1289 YYSYMBOL_keyword_END = 48, /* "`END'" */
1290 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
1291 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
1292 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
1293 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
1294 YYSYMBOL_tFID = 53, /* "method" */
1295 YYSYMBOL_tGVAR = 54, /* "global variable" */
1296 YYSYMBOL_tIVAR = 55, /* "instance variable" */
1297 YYSYMBOL_tCONSTANT = 56, /* "constant" */
1298 YYSYMBOL_tCVAR = 57, /* "class variable" */
1299 YYSYMBOL_tLABEL = 58, /* tLABEL */
1300 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
1301 YYSYMBOL_tFLOAT = 60, /* "float literal" */
1302 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
1303 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
1304 YYSYMBOL_tCHAR = 63, /* "char literal" */
1305 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
1306 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
1307 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
1308 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
1309 YYSYMBOL_68_ = 68, /* '.' */
1310 YYSYMBOL_69_backslash_ = 69, /* "backslash" */
1311 YYSYMBOL_tSP = 70, /* "escaped space" */
1312 YYSYMBOL_71_escaped_horizontal_tab_ = 71, /* "escaped horizontal tab" */
1313 YYSYMBOL_72_escaped_form_feed_ = 72, /* "escaped form feed" */
1314 YYSYMBOL_73_escaped_carriage_return_ = 73, /* "escaped carriage return" */
1315 YYSYMBOL_74_escaped_vertical_tab_ = 74, /* "escaped vertical tab" */
1316 YYSYMBOL_tUPLUS = 75, /* "unary+" */
1317 YYSYMBOL_tUMINUS = 76, /* "unary-" */
1318 YYSYMBOL_tPOW = 77, /* "**" */
1319 YYSYMBOL_tCMP = 78, /* "<=>" */
1320 YYSYMBOL_tEQ = 79, /* "==" */
1321 YYSYMBOL_tEQQ = 80, /* "===" */
1322 YYSYMBOL_tNEQ = 81, /* "!=" */
1323 YYSYMBOL_tGEQ = 82, /* ">=" */
1324 YYSYMBOL_tLEQ = 83, /* "<=" */
1325 YYSYMBOL_tANDOP = 84, /* "&&" */
1326 YYSYMBOL_tOROP = 85, /* "||" */
1327 YYSYMBOL_tMATCH = 86, /* "=~" */
1328 YYSYMBOL_tNMATCH = 87, /* "!~" */
1329 YYSYMBOL_tDOT2 = 88, /* ".." */
1330 YYSYMBOL_tDOT3 = 89, /* "..." */
1331 YYSYMBOL_tBDOT2 = 90, /* "(.." */
1332 YYSYMBOL_tBDOT3 = 91, /* "(..." */
1333 YYSYMBOL_tAREF = 92, /* "[]" */
1334 YYSYMBOL_tASET = 93, /* "[]=" */
1335 YYSYMBOL_tLSHFT = 94, /* "<<" */
1336 YYSYMBOL_tRSHFT = 95, /* ">>" */
1337 YYSYMBOL_tANDDOT = 96, /* "&." */
1338 YYSYMBOL_tCOLON2 = 97, /* "::" */
1339 YYSYMBOL_tCOLON3 = 98, /* ":: at EXPR_BEG" */
1340 YYSYMBOL_tOP_ASGN = 99, /* "operator-assignment" */
1341 YYSYMBOL_tASSOC = 100, /* "=>" */
1342 YYSYMBOL_tLPAREN = 101, /* "(" */
1343 YYSYMBOL_tLPAREN_ARG = 102, /* "( arg" */
1344 YYSYMBOL_tRPAREN = 103, /* ")" */
1345 YYSYMBOL_tLBRACK = 104, /* "[" */
1346 YYSYMBOL_tLBRACE = 105, /* "{" */
1347 YYSYMBOL_tLBRACE_ARG = 106, /* "{ arg" */
1348 YYSYMBOL_tSTAR = 107, /* "*" */
1349 YYSYMBOL_tDSTAR = 108, /* "**arg" */
1350 YYSYMBOL_tAMPER = 109, /* "&" */
1351 YYSYMBOL_tLAMBDA = 110, /* "->" */
1352 YYSYMBOL_tSYMBEG = 111, /* "symbol literal" */
1353 YYSYMBOL_tSTRING_BEG = 112, /* "string literal" */
1354 YYSYMBOL_tXSTRING_BEG = 113, /* "backtick literal" */
1355 YYSYMBOL_tREGEXP_BEG = 114, /* "regexp literal" */
1356 YYSYMBOL_tWORDS_BEG = 115, /* "word list" */
1357 YYSYMBOL_tQWORDS_BEG = 116, /* "verbatim word list" */
1358 YYSYMBOL_tSYMBOLS_BEG = 117, /* "symbol list" */
1359 YYSYMBOL_tQSYMBOLS_BEG = 118, /* "verbatim symbol list" */
1360 YYSYMBOL_tSTRING_END = 119, /* "terminator" */
1361 YYSYMBOL_tSTRING_DEND = 120, /* "'}'" */
1362 YYSYMBOL_tSTRING_DBEG = 121, /* tSTRING_DBEG */
1363 YYSYMBOL_tSTRING_DVAR = 122, /* tSTRING_DVAR */
1364 YYSYMBOL_tLAMBEG = 123, /* tLAMBEG */
1365 YYSYMBOL_tLABEL_END = 124, /* tLABEL_END */
1366 YYSYMBOL_tLOWEST = 125, /* tLOWEST */
1367 YYSYMBOL_126_ = 126, /* '=' */
1368 YYSYMBOL_127_ = 127, /* '?' */
1369 YYSYMBOL_128_ = 128, /* ':' */
1370 YYSYMBOL_129_ = 129, /* '>' */
1371 YYSYMBOL_130_ = 130, /* '<' */
1372 YYSYMBOL_131_ = 131, /* '|' */
1373 YYSYMBOL_132_ = 132, /* '^' */
1374 YYSYMBOL_133_ = 133, /* '&' */
1375 YYSYMBOL_134_ = 134, /* '+' */
1376 YYSYMBOL_135_ = 135, /* '-' */
1377 YYSYMBOL_136_ = 136, /* '*' */
1378 YYSYMBOL_137_ = 137, /* '/' */
1379 YYSYMBOL_138_ = 138, /* '%' */
1380 YYSYMBOL_tUMINUS_NUM = 139, /* tUMINUS_NUM */
1381 YYSYMBOL_140_ = 140, /* '!' */
1382 YYSYMBOL_141_ = 141, /* '~' */
1383 YYSYMBOL_tLAST_TOKEN = 142, /* tLAST_TOKEN */
1384 YYSYMBOL_143_ = 143, /* '{' */
1385 YYSYMBOL_144_ = 144, /* '}' */
1386 YYSYMBOL_145_ = 145, /* '[' */
1387 YYSYMBOL_146_ = 146, /* ',' */
1388 YYSYMBOL_147_ = 147, /* '`' */
1389 YYSYMBOL_148_ = 148, /* '(' */
1390 YYSYMBOL_149_ = 149, /* ')' */
1391 YYSYMBOL_150_ = 150, /* ']' */
1392 YYSYMBOL_151_ = 151, /* ';' */
1393 YYSYMBOL_152_ = 152, /* ' ' */
1394 YYSYMBOL_153_n_ = 153, /* '\n' */
1395 YYSYMBOL_YYACCEPT = 154, /* $accept */
1396 YYSYMBOL_program = 155, /* program */
1397 YYSYMBOL_156_1 = 156, /* $@1 */
1398 YYSYMBOL_top_compstmt = 157, /* top_compstmt */
1399 YYSYMBOL_top_stmts = 158, /* top_stmts */
1400 YYSYMBOL_top_stmt = 159, /* top_stmt */
1401 YYSYMBOL_begin_block = 160, /* begin_block */
1402 YYSYMBOL_bodystmt = 161, /* bodystmt */
1403 YYSYMBOL_162_2 = 162, /* $@2 */
1404 YYSYMBOL_compstmt = 163, /* compstmt */
1405 YYSYMBOL_stmts = 164, /* stmts */
1406 YYSYMBOL_stmt_or_begin = 165, /* stmt_or_begin */
1407 YYSYMBOL_166_3 = 166, /* $@3 */
1408 YYSYMBOL_stmt = 167, /* stmt */
1409 YYSYMBOL_168_4 = 168, /* $@4 */
1410 YYSYMBOL_command_asgn = 169, /* command_asgn */
1411 YYSYMBOL_command_rhs = 170, /* command_rhs */
1412 YYSYMBOL_expr = 171, /* expr */
1413 YYSYMBOL_172_5 = 172, /* @5 */
1414 YYSYMBOL_173_6 = 173, /* @6 */
1415 YYSYMBOL_174_7 = 174, /* $@7 */
1416 YYSYMBOL_expr_value = 175, /* expr_value */
1417 YYSYMBOL_expr_value_do = 176, /* expr_value_do */
1418 YYSYMBOL_177_8 = 177, /* $@8 */
1419 YYSYMBOL_178_9 = 178, /* $@9 */
1420 YYSYMBOL_command_call = 179, /* command_call */
1421 YYSYMBOL_block_command = 180, /* block_command */
1422 YYSYMBOL_cmd_brace_block = 181, /* cmd_brace_block */
1423 YYSYMBOL_fcall = 182, /* fcall */
1424 YYSYMBOL_command = 183, /* command */
1425 YYSYMBOL_mlhs = 184, /* mlhs */
1426 YYSYMBOL_mlhs_inner = 185, /* mlhs_inner */
1427 YYSYMBOL_mlhs_basic = 186, /* mlhs_basic */
1428 YYSYMBOL_mlhs_item = 187, /* mlhs_item */
1429 YYSYMBOL_mlhs_head = 188, /* mlhs_head */
1430 YYSYMBOL_mlhs_post = 189, /* mlhs_post */
1431 YYSYMBOL_mlhs_node = 190, /* mlhs_node */
1432 YYSYMBOL_lhs = 191, /* lhs */
1433 YYSYMBOL_cname = 192, /* cname */
1434 YYSYMBOL_cpath = 193, /* cpath */
1435 YYSYMBOL_fname = 194, /* fname */
1436 YYSYMBOL_fitem = 195, /* fitem */
1437 YYSYMBOL_undef_list = 196, /* undef_list */
1438 YYSYMBOL_197_10 = 197, /* $@10 */
1439 YYSYMBOL_op = 198, /* op */
1440 YYSYMBOL_reswords = 199, /* reswords */
1441 YYSYMBOL_arg = 200, /* arg */
1442 YYSYMBOL_201_11 = 201, /* $@11 */
1443 YYSYMBOL_relop = 202, /* relop */
1444 YYSYMBOL_rel_expr = 203, /* rel_expr */
1445 YYSYMBOL_arg_value = 204, /* arg_value */
1446 YYSYMBOL_aref_args = 205, /* aref_args */
1447 YYSYMBOL_arg_rhs = 206, /* arg_rhs */
1448 YYSYMBOL_paren_args = 207, /* paren_args */
1449 YYSYMBOL_opt_paren_args = 208, /* opt_paren_args */
1450 YYSYMBOL_opt_call_args = 209, /* opt_call_args */
1451 YYSYMBOL_call_args = 210, /* call_args */
1452 YYSYMBOL_command_args = 211, /* command_args */
1453 YYSYMBOL_212_12 = 212, /* $@12 */
1454 YYSYMBOL_block_arg = 213, /* block_arg */
1455 YYSYMBOL_opt_block_arg = 214, /* opt_block_arg */
1456 YYSYMBOL_args = 215, /* args */
1457 YYSYMBOL_mrhs_arg = 216, /* mrhs_arg */
1458 YYSYMBOL_mrhs = 217, /* mrhs */
1459 YYSYMBOL_primary = 218, /* primary */
1460 YYSYMBOL_219_13 = 219, /* $@13 */
1461 YYSYMBOL_220_14 = 220, /* $@14 */
1462 YYSYMBOL_221_15 = 221, /* $@15 */
1463 YYSYMBOL_222_16 = 222, /* $@16 */
1464 YYSYMBOL_223_17 = 223, /* $@17 */
1465 YYSYMBOL_224_18 = 224, /* @18 */
1466 YYSYMBOL_225_19 = 225, /* @19 */
1467 YYSYMBOL_226_20 = 226, /* $@20 */
1468 YYSYMBOL_227_21 = 227, /* @21 */
1469 YYSYMBOL_228_22 = 228, /* $@22 */
1470 YYSYMBOL_229_23 = 229, /* @23 */
1471 YYSYMBOL_230_24 = 230, /* @24 */
1472 YYSYMBOL_231_25 = 231, /* @25 */
1473 YYSYMBOL_232_26 = 232, /* @26 */
1474 YYSYMBOL_primary_value = 233, /* primary_value */
1475 YYSYMBOL_k_begin = 234, /* k_begin */
1476 YYSYMBOL_k_if = 235, /* k_if */
1477 YYSYMBOL_k_unless = 236, /* k_unless */
1478 YYSYMBOL_k_while = 237, /* k_while */
1479 YYSYMBOL_k_until = 238, /* k_until */
1480 YYSYMBOL_k_case = 239, /* k_case */
1481 YYSYMBOL_k_for = 240, /* k_for */
1482 YYSYMBOL_k_class = 241, /* k_class */
1483 YYSYMBOL_k_module = 242, /* k_module */
1484 YYSYMBOL_k_def = 243, /* k_def */
1485 YYSYMBOL_k_do = 244, /* k_do */
1486 YYSYMBOL_k_do_block = 245, /* k_do_block */
1487 YYSYMBOL_k_rescue = 246, /* k_rescue */
1488 YYSYMBOL_k_ensure = 247, /* k_ensure */
1489 YYSYMBOL_k_when = 248, /* k_when */
1490 YYSYMBOL_k_else = 249, /* k_else */
1491 YYSYMBOL_k_elsif = 250, /* k_elsif */
1492 YYSYMBOL_k_end = 251, /* k_end */
1493 YYSYMBOL_k_return = 252, /* k_return */
1494 YYSYMBOL_then = 253, /* then */
1495 YYSYMBOL_do = 254, /* do */
1496 YYSYMBOL_if_tail = 255, /* if_tail */
1497 YYSYMBOL_opt_else = 256, /* opt_else */
1498 YYSYMBOL_for_var = 257, /* for_var */
1499 YYSYMBOL_f_marg = 258, /* f_marg */
1500 YYSYMBOL_f_marg_list = 259, /* f_marg_list */
1501 YYSYMBOL_f_margs = 260, /* f_margs */
1502 YYSYMBOL_f_rest_marg = 261, /* f_rest_marg */
1503 YYSYMBOL_block_args_tail = 262, /* block_args_tail */
1504 YYSYMBOL_opt_block_args_tail = 263, /* opt_block_args_tail */
1505 YYSYMBOL_block_param = 264, /* block_param */
1506 YYSYMBOL_opt_block_param = 265, /* opt_block_param */
1507 YYSYMBOL_block_param_def = 266, /* block_param_def */
1508 YYSYMBOL_opt_bv_decl = 267, /* opt_bv_decl */
1509 YYSYMBOL_bv_decls = 268, /* bv_decls */
1510 YYSYMBOL_bvar = 269, /* bvar */
1511 YYSYMBOL_lambda = 270, /* lambda */
1512 YYSYMBOL_271_27 = 271, /* @27 */
1513 YYSYMBOL_272_28 = 272, /* @28 */
1514 YYSYMBOL_273_29 = 273, /* @29 */
1515 YYSYMBOL_274_30 = 274, /* @30 */
1516 YYSYMBOL_275_31 = 275, /* $@31 */
1517 YYSYMBOL_f_larglist = 276, /* f_larglist */
1518 YYSYMBOL_lambda_body = 277, /* lambda_body */
1519 YYSYMBOL_do_block = 278, /* do_block */
1520 YYSYMBOL_block_call = 279, /* block_call */
1521 YYSYMBOL_method_call = 280, /* method_call */
1522 YYSYMBOL_brace_block = 281, /* brace_block */
1523 YYSYMBOL_brace_body = 282, /* brace_body */
1524 YYSYMBOL_283_32 = 283, /* @32 */
1525 YYSYMBOL_284_33 = 284, /* @33 */
1526 YYSYMBOL_285_34 = 285, /* @34 */
1527 YYSYMBOL_do_body = 286, /* do_body */
1528 YYSYMBOL_287_35 = 287, /* @35 */
1529 YYSYMBOL_288_36 = 288, /* @36 */
1530 YYSYMBOL_289_37 = 289, /* @37 */
1531 YYSYMBOL_case_args = 290, /* case_args */
1532 YYSYMBOL_case_body = 291, /* case_body */
1533 YYSYMBOL_cases = 292, /* cases */
1534 YYSYMBOL_p_case_body = 293, /* p_case_body */
1535 YYSYMBOL_294_38 = 294, /* @38 */
1536 YYSYMBOL_295_39 = 295, /* @39 */
1537 YYSYMBOL_296_40 = 296, /* @40 */
1538 YYSYMBOL_297_41 = 297, /* $@41 */
1539 YYSYMBOL_298_42 = 298, /* $@42 */
1540 YYSYMBOL_299_43 = 299, /* $@43 */
1541 YYSYMBOL_p_cases = 300, /* p_cases */
1542 YYSYMBOL_p_top_expr = 301, /* p_top_expr */
1543 YYSYMBOL_p_top_expr_body = 302, /* p_top_expr_body */
1544 YYSYMBOL_p_expr = 303, /* p_expr */
1545 YYSYMBOL_p_as = 304, /* p_as */
1546 YYSYMBOL_p_alt = 305, /* p_alt */
1547 YYSYMBOL_p_lparen = 306, /* p_lparen */
1548 YYSYMBOL_p_lbracket = 307, /* p_lbracket */
1549 YYSYMBOL_p_expr_basic = 308, /* p_expr_basic */
1550 YYSYMBOL_309_44 = 309, /* @44 */
1551 YYSYMBOL_310_45 = 310, /* @45 */
1552 YYSYMBOL_311_46 = 311, /* @46 */
1553 YYSYMBOL_p_args = 312, /* p_args */
1554 YYSYMBOL_p_args_head = 313, /* p_args_head */
1555 YYSYMBOL_p_args_tail = 314, /* p_args_tail */
1556 YYSYMBOL_p_args_post = 315, /* p_args_post */
1557 YYSYMBOL_p_arg = 316, /* p_arg */
1558 YYSYMBOL_p_kwargs = 317, /* p_kwargs */
1559 YYSYMBOL_p_kwarg = 318, /* p_kwarg */
1560 YYSYMBOL_p_kw = 319, /* p_kw */
1561 YYSYMBOL_p_kw_label = 320, /* p_kw_label */
1562 YYSYMBOL_p_kwrest = 321, /* p_kwrest */
1563 YYSYMBOL_p_kwnorest = 322, /* p_kwnorest */
1564 YYSYMBOL_p_value = 323, /* p_value */
1565 YYSYMBOL_p_primitive = 324, /* p_primitive */
1566 YYSYMBOL_325_47 = 325, /* $@47 */
1567 YYSYMBOL_p_variable = 326, /* p_variable */
1568 YYSYMBOL_p_var_ref = 327, /* p_var_ref */
1569 YYSYMBOL_p_const = 328, /* p_const */
1570 YYSYMBOL_opt_rescue = 329, /* opt_rescue */
1571 YYSYMBOL_exc_list = 330, /* exc_list */
1572 YYSYMBOL_exc_var = 331, /* exc_var */
1573 YYSYMBOL_opt_ensure = 332, /* opt_ensure */
1574 YYSYMBOL_literal = 333, /* literal */
1575 YYSYMBOL_strings = 334, /* strings */
1576 YYSYMBOL_string = 335, /* string */
1577 YYSYMBOL_string1 = 336, /* string1 */
1578 YYSYMBOL_xstring = 337, /* xstring */
1579 YYSYMBOL_regexp = 338, /* regexp */
1580 YYSYMBOL_words = 339, /* words */
1581 YYSYMBOL_word_list = 340, /* word_list */
1582 YYSYMBOL_word = 341, /* word */
1583 YYSYMBOL_symbols = 342, /* symbols */
1584 YYSYMBOL_symbol_list = 343, /* symbol_list */
1585 YYSYMBOL_qwords = 344, /* qwords */
1586 YYSYMBOL_qsymbols = 345, /* qsymbols */
1587 YYSYMBOL_qword_list = 346, /* qword_list */
1588 YYSYMBOL_qsym_list = 347, /* qsym_list */
1589 YYSYMBOL_string_contents = 348, /* string_contents */
1590 YYSYMBOL_xstring_contents = 349, /* xstring_contents */
1591 YYSYMBOL_regexp_contents = 350, /* regexp_contents */
1592 YYSYMBOL_string_content = 351, /* string_content */
1593 YYSYMBOL_352_48 = 352, /* @48 */
1594 YYSYMBOL_353_49 = 353, /* $@49 */
1595 YYSYMBOL_354_50 = 354, /* @50 */
1596 YYSYMBOL_355_51 = 355, /* @51 */
1597 YYSYMBOL_356_52 = 356, /* @52 */
1598 YYSYMBOL_357_53 = 357, /* @53 */
1599 YYSYMBOL_string_dvar = 358, /* string_dvar */
1600 YYSYMBOL_symbol = 359, /* symbol */
1601 YYSYMBOL_ssym = 360, /* ssym */
1602 YYSYMBOL_sym = 361, /* sym */
1603 YYSYMBOL_dsym = 362, /* dsym */
1604 YYSYMBOL_numeric = 363, /* numeric */
1605 YYSYMBOL_simple_numeric = 364, /* simple_numeric */
1606 YYSYMBOL_user_variable = 365, /* user_variable */
1607 YYSYMBOL_keyword_variable = 366, /* keyword_variable */
1608 YYSYMBOL_var_ref = 367, /* var_ref */
1609 YYSYMBOL_var_lhs = 368, /* var_lhs */
1610 YYSYMBOL_backref = 369, /* backref */
1611 YYSYMBOL_superclass = 370, /* superclass */
1612 YYSYMBOL_371_54 = 371, /* $@54 */
1613 YYSYMBOL_f_arglist = 372, /* f_arglist */
1614 YYSYMBOL_373_55 = 373, /* @55 */
1615 YYSYMBOL_args_tail = 374, /* args_tail */
1616 YYSYMBOL_opt_args_tail = 375, /* opt_args_tail */
1617 YYSYMBOL_f_args = 376, /* f_args */
1618 YYSYMBOL_args_forward = 377, /* args_forward */
1619 YYSYMBOL_f_bad_arg = 378, /* f_bad_arg */
1620 YYSYMBOL_f_norm_arg = 379, /* f_norm_arg */
1621 YYSYMBOL_f_arg_asgn = 380, /* f_arg_asgn */
1622 YYSYMBOL_f_arg_item = 381, /* f_arg_item */
1623 YYSYMBOL_f_arg = 382, /* f_arg */
1624 YYSYMBOL_f_label = 383, /* f_label */
1625 YYSYMBOL_f_kw = 384, /* f_kw */
1626 YYSYMBOL_f_block_kw = 385, /* f_block_kw */
1627 YYSYMBOL_f_block_kwarg = 386, /* f_block_kwarg */
1628 YYSYMBOL_f_kwarg = 387, /* f_kwarg */
1629 YYSYMBOL_kwrest_mark = 388, /* kwrest_mark */
1630 YYSYMBOL_f_no_kwarg = 389, /* f_no_kwarg */
1631 YYSYMBOL_f_kwrest = 390, /* f_kwrest */
1632 YYSYMBOL_f_opt = 391, /* f_opt */
1633 YYSYMBOL_f_block_opt = 392, /* f_block_opt */
1634 YYSYMBOL_f_block_optarg = 393, /* f_block_optarg */
1635 YYSYMBOL_f_optarg = 394, /* f_optarg */
1636 YYSYMBOL_restarg_mark = 395, /* restarg_mark */
1637 YYSYMBOL_f_rest_arg = 396, /* f_rest_arg */
1638 YYSYMBOL_blkarg_mark = 397, /* blkarg_mark */
1639 YYSYMBOL_f_block_arg = 398, /* f_block_arg */
1640 YYSYMBOL_opt_f_block_arg = 399, /* opt_f_block_arg */
1641 YYSYMBOL_singleton = 400, /* singleton */
1642 YYSYMBOL_401_56 = 401, /* $@56 */
1643 YYSYMBOL_assoc_list = 402, /* assoc_list */
1644 YYSYMBOL_assocs = 403, /* assocs */
1645 YYSYMBOL_assoc = 404, /* assoc */
1646 YYSYMBOL_operation = 405, /* operation */
1647 YYSYMBOL_operation2 = 406, /* operation2 */
1648 YYSYMBOL_operation3 = 407, /* operation3 */
1649 YYSYMBOL_dot_or_colon = 408, /* dot_or_colon */
1650 YYSYMBOL_call_op = 409, /* call_op */
1651 YYSYMBOL_call_op2 = 410, /* call_op2 */
1652 YYSYMBOL_opt_terms = 411, /* opt_terms */
1653 YYSYMBOL_opt_nl = 412, /* opt_nl */
1654 YYSYMBOL_rparen = 413, /* rparen */
1655 YYSYMBOL_rbracket = 414, /* rbracket */
1656 YYSYMBOL_rbrace = 415, /* rbrace */
1657 YYSYMBOL_trailer = 416, /* trailer */
1658 YYSYMBOL_term = 417, /* term */
1659 YYSYMBOL_terms = 418, /* terms */
1660 YYSYMBOL_none = 419 /* none */
1663
1664
1665
1666
1667#ifdef short
1668# undef short
1669#endif
1670
1671/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
1672 <limits.h> and (if available) <stdint.h> are included
1673 so that the code can choose integer types of a good width. */
1674
1675#ifndef __PTRDIFF_MAX__
1676# include <limits.h> /* INFRINGES ON USER NAME SPACE */
1677# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
1678# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
1679# define YY_STDINT_H
1680# endif
1681#endif
1682
1683/* Narrow types that promote to a signed type and that can represent a
1684 signed or unsigned integer of at least N bits. In tables they can
1685 save space and decrease cache pressure. Promoting to a signed type
1686 helps avoid bugs in integer arithmetic. */
1687
1688#ifdef __INT_LEAST8_MAX__
1689typedef __INT_LEAST8_TYPE__ yytype_int8;
1690#elif defined YY_STDINT_H
1692#else
1693typedef signed char yytype_int8;
1694#endif
1695
1696#ifdef __INT_LEAST16_MAX__
1697typedef __INT_LEAST16_TYPE__ yytype_int16;
1698#elif defined YY_STDINT_H
1700#else
1701typedef short yytype_int16;
1702#endif
1703
1704/* Work around bug in HP-UX 11.23, which defines these macros
1705 incorrectly for preprocessor constants. This workaround can likely
1706 be removed in 2023, as HPE has promised support for HP-UX 11.23
1707 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
1708 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
1709#ifdef __hpux
1710# undef UINT_LEAST8_MAX
1711# undef UINT_LEAST16_MAX
1712# define UINT_LEAST8_MAX 255
1713# define UINT_LEAST16_MAX 65535
1714#endif
1715
1716#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
1717typedef __UINT_LEAST8_TYPE__ yytype_uint8;
1718#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
1719 && UINT_LEAST8_MAX <= INT_MAX)
1721#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
1722typedef unsigned char yytype_uint8;
1723#else
1724typedef short yytype_uint8;
1725#endif
1726
1727#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
1728typedef __UINT_LEAST16_TYPE__ yytype_uint16;
1729#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
1730 && UINT_LEAST16_MAX <= INT_MAX)
1732#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
1733typedef unsigned short yytype_uint16;
1734#else
1735typedef int yytype_uint16;
1736#endif
1737
1738#ifndef YYPTRDIFF_T
1739# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
1740# define YYPTRDIFF_T __PTRDIFF_TYPE__
1741# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
1742# elif defined PTRDIFF_MAX
1743# ifndef ptrdiff_t
1744# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1745# endif
1746# define YYPTRDIFF_T ptrdiff_t
1747# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
1748# else
1749# define YYPTRDIFF_T long
1750# define YYPTRDIFF_MAXIMUM LONG_MAX
1751# endif
1752#endif
1753
1754#ifndef YYSIZE_T
1755# ifdef __SIZE_TYPE__
1756# define YYSIZE_T __SIZE_TYPE__
1757# elif defined size_t
1758# define YYSIZE_T size_t
1759# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
1760# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1761# define YYSIZE_T size_t
1762# else
1763# define YYSIZE_T unsigned
1764# endif
1765#endif
1766
1767#define YYSIZE_MAXIMUM \
1768 YY_CAST (YYPTRDIFF_T, \
1769 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
1770 ? YYPTRDIFF_MAXIMUM \
1771 : YY_CAST (YYSIZE_T, -1)))
1772
1773#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
1774
1775
1776/* Stored state numbers (used for stacks). */
1778
1779/* State numbers in computations. */
1781
1782#ifndef YY_
1783# if defined YYENABLE_NLS && YYENABLE_NLS
1784# if ENABLE_NLS
1785# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1786# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
1787# endif
1788# endif
1789# ifndef YY_
1790# define YY_(Msgid) Msgid
1791# endif
1792#endif
1793
1794
1795#ifndef YY_ATTRIBUTE_PURE
1796# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
1797# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
1798# else
1799# define YY_ATTRIBUTE_PURE
1800# endif
1801#endif
1802
1803#ifndef YY_ATTRIBUTE_UNUSED
1804# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
1805# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
1806# else
1807# define YY_ATTRIBUTE_UNUSED
1808# endif
1809#endif
1810
1811/* Suppress unused-variable warnings by "using" E. */
1812#if ! defined lint || defined __GNUC__
1813# define YY_USE(E) ((void) (E))
1814#else
1815# define YY_USE(E) /* empty */
1816#endif
1817
1818/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1819#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
1820# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
1821# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1822 _Pragma ("GCC diagnostic push") \
1823 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
1824# else
1825# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1826 _Pragma ("GCC diagnostic push") \
1827 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
1828 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1829# endif
1830# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1831 _Pragma ("GCC diagnostic pop")
1832#else
1833# define YY_INITIAL_VALUE(Value) Value
1834#endif
1835#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1836# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1837# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1838#endif
1839#ifndef YY_INITIAL_VALUE
1840# define YY_INITIAL_VALUE(Value) /* Nothing. */
1841#endif
1842
1843#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
1844# define YY_IGNORE_USELESS_CAST_BEGIN \
1845 _Pragma ("GCC diagnostic push") \
1846 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
1847# define YY_IGNORE_USELESS_CAST_END \
1848 _Pragma ("GCC diagnostic pop")
1849#endif
1850#ifndef YY_IGNORE_USELESS_CAST_BEGIN
1851# define YY_IGNORE_USELESS_CAST_BEGIN
1852# define YY_IGNORE_USELESS_CAST_END
1853#endif
1854
1855
1856#define YY_ASSERT(E) ((void) (0 && (E)))
1857
1858#if 1
1859
1860/* The parser invokes alloca or malloc; define the necessary symbols. */
1861
1862# ifdef YYSTACK_USE_ALLOCA
1863# if YYSTACK_USE_ALLOCA
1864# ifdef __GNUC__
1865# define YYSTACK_ALLOC __builtin_alloca
1866# elif defined __BUILTIN_VA_ARG_INCR
1867# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1868# elif defined _AIX
1869# define YYSTACK_ALLOC __alloca
1870# elif defined _MSC_VER
1871# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1872# define alloca _alloca
1873# else
1874# define YYSTACK_ALLOC alloca
1875# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
1876# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1877 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
1878# ifndef EXIT_SUCCESS
1879# define EXIT_SUCCESS 0
1880# endif
1881# endif
1882# endif
1883# endif
1884# endif
1885
1886# ifdef YYSTACK_ALLOC
1887 /* Pacify GCC's 'empty if-body' warning. */
1888# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1889# ifndef YYSTACK_ALLOC_MAXIMUM
1890 /* The OS might guarantee only one guard page at the bottom of the stack,
1891 and a page size can be as small as 4096 bytes. So we cannot safely
1892 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1893 to allow for a few compiler-allocated temporary stack slots. */
1894# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1895# endif
1896# else
1897# define YYSTACK_ALLOC YYMALLOC
1898# define YYSTACK_FREE YYFREE
1899# ifndef YYSTACK_ALLOC_MAXIMUM
1900# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1901# endif
1902# if (defined __cplusplus && ! defined EXIT_SUCCESS \
1903 && ! ((defined YYMALLOC || defined malloc) \
1904 && (defined YYFREE || defined free)))
1905# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1906# ifndef EXIT_SUCCESS
1907# define EXIT_SUCCESS 0
1908# endif
1909# endif
1910# ifndef YYMALLOC
1911# define YYMALLOC malloc
1912# if ! defined malloc && ! defined EXIT_SUCCESS
1913void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1914# endif
1915# endif
1916# ifndef YYFREE
1917# define YYFREE free
1918# if ! defined free && ! defined EXIT_SUCCESS
1919void free (void *); /* INFRINGES ON USER NAME SPACE */
1920# endif
1921# endif
1922# endif
1923#endif /* 1 */
1924
1925#if (! defined yyoverflow \
1926 && (! defined __cplusplus \
1927 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
1928 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1929
1930/* A type that is properly aligned for any stack member. */
1931union yyalloc
1932{
1936};
1937
1938/* The size of the maximum gap between one aligned stack and the next. */
1939# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
1940
1941/* The size of an array large to enough to hold all stacks, each with
1942 N elements. */
1943# define YYSTACK_BYTES(N) \
1944 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
1945 + YYSIZEOF (YYLTYPE)) \
1946 + 2 * YYSTACK_GAP_MAXIMUM)
1947
1948# define YYCOPY_NEEDED 1
1949
1950/* Relocate STACK from its old location to the new one. The
1951 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1952 elements in the stack, and YYPTR gives the new location of the
1953 stack. Advance YYPTR to a properly aligned location for the next
1954 stack. */
1955# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1956 do \
1957 { \
1958 YYPTRDIFF_T yynewbytes; \
1959 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1960 Stack = &yyptr->Stack_alloc; \
1961 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
1962 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
1963 } \
1964 while (0)
1965
1966#endif
1967
1968#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
1969/* Copy COUNT objects from SRC to DST. The source and destination do
1970 not overlap. */
1971# ifndef YYCOPY
1972# if defined __GNUC__ && 1 < __GNUC__
1973# define YYCOPY(Dst, Src, Count) \
1974 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
1975# else
1976# define YYCOPY(Dst, Src, Count) \
1977 do \
1978 { \
1979 YYPTRDIFF_T yyi; \
1980 for (yyi = 0; yyi < (Count); yyi++) \
1981 (Dst)[yyi] = (Src)[yyi]; \
1982 } \
1983 while (0)
1984# endif
1985# endif
1986#endif /* !YYCOPY_NEEDED */
1987
1988/* YYFINAL -- State number of the termination state. */
1989#define YYFINAL 3
1990/* YYLAST -- Last index in YYTABLE. */
1991#define YYLAST 13883
1992
1993/* YYNTOKENS -- Number of terminals. */
1994#define YYNTOKENS 154
1995/* YYNNTS -- Number of nonterminals. */
1996#define YYNNTS 266
1997/* YYNRULES -- Number of rules. */
1998#define YYNRULES 761
1999/* YYNSTATES -- Number of states. */
2000#define YYNSTATES 1251
2001
2002/* YYMAXUTOK -- Last valid token kind. */
2003#define YYMAXUTOK 353
2004
2005
2006/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2007 as returned by yylex, with out-of-bounds checking. */
2008#define YYTRANSLATE(YYX) \
2009 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2010 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2011 : YYSYMBOL_YYUNDEF)
2012
2013/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2014 as returned by yylex. */
2015static const yytype_uint8 yytranslate[] =
2016{
2017 0, 2, 2, 2, 2, 2, 2, 2, 2, 71,
2018 153, 74, 72, 73, 2, 2, 2, 2, 2, 2,
2019 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2020 2, 2, 152, 140, 2, 2, 2, 138, 133, 2,
2021 148, 149, 136, 134, 146, 135, 68, 137, 2, 2,
2022 2, 2, 2, 2, 2, 2, 2, 2, 128, 151,
2023 130, 126, 129, 127, 2, 2, 2, 2, 2, 2,
2024 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2025 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2026 2, 145, 69, 150, 132, 2, 147, 2, 2, 2,
2027 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2028 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2029 2, 2, 2, 143, 131, 144, 141, 2, 88, 89,
2030 90, 91, 75, 76, 77, 78, 94, 95, 83, 82,
2031 79, 80, 81, 86, 87, 92, 93, 97, 84, 85,
2032 96, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2033 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2034 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2035 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2036 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2037 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2038 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2039 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2040 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2041 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2042 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2043 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2044 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2045 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2046 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2047 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2048 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2049 65, 66, 67, 70, 98, 99, 100, 101, 102, 103,
2050 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2051 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2052 124, 125, 139, 142
2053};
2054
2055#if YYDEBUG
2056/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2057static const yytype_int16 yyrline[] =
2058{
2059 0, 1204, 1204, 1204, 1230, 1236, 1243, 1250, 1257, 1263,
2060 1264, 1270, 1283, 1281, 1292, 1303, 1309, 1316, 1323, 1330,
2061 1336, 1341, 1340, 1350, 1350, 1357, 1364, 1374, 1382, 1389,
2062 1397, 1405, 1417, 1429, 1439, 1453, 1454, 1462, 1470, 1479,
2063 1486, 1489, 1496, 1503, 1511, 1518, 1525, 1533, 1540, 1550,
2064 1555, 1564, 1567, 1568, 1572, 1576, 1580, 1585, 1592, 1594,
2065 1584, 1602, 1605, 1612, 1612, 1612, 1618, 1619, 1622, 1623,
2066 1632, 1642, 1652, 1661, 1672, 1679, 1686, 1693, 1700, 1708,
2067 1716, 1723, 1730, 1739, 1740, 1749, 1750, 1759, 1766, 1773,
2068 1780, 1787, 1794, 1801, 1808, 1815, 1822, 1831, 1832, 1841,
2069 1848, 1857, 1864, 1873, 1880, 1887, 1894, 1904, 1911, 1921,
2070 1928, 1935, 1945, 1952, 1959, 1966, 1973, 1980, 1987, 1994,
2071 2001, 2011, 2018, 2021, 2028, 2035, 2044, 2045, 2046, 2047,
2072 2052, 2055, 2062, 2065, 2072, 2072, 2082, 2083, 2084, 2085,
2073 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095,
2074 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105,
2075 2106, 2107, 2108, 2109, 2110, 2111, 2114, 2114, 2114, 2115,
2076 2115, 2116, 2116, 2116, 2117, 2117, 2117, 2117, 2118, 2118,
2077 2118, 2118, 2119, 2119, 2119, 2120, 2120, 2120, 2120, 2121,
2078 2121, 2121, 2121, 2122, 2122, 2122, 2122, 2123, 2123, 2123,
2079 2123, 2124, 2124, 2124, 2124, 2125, 2125, 2128, 2135, 2142,
2080 2150, 2158, 2166, 2174, 2182, 2189, 2197, 2206, 2215, 2227,
2081 2239, 2251, 2263, 2267, 2271, 2275, 2279, 2283, 2287, 2291,
2082 2295, 2299, 2303, 2307, 2311, 2315, 2316, 2320, 2324, 2328,
2083 2332, 2336, 2340, 2344, 2348, 2352, 2356, 2360, 2360, 2365,
2084 2374, 2380, 2381, 2382, 2383, 2386, 2390, 2397, 2404, 2405,
2085 2409, 2416, 2425, 2430, 2441, 2448, 2474, 2503, 2504, 2507,
2086 2508, 2509, 2513, 2520, 2529, 2537, 2544, 2552, 2560, 2564,
2087 2564, 2601, 2610, 2614, 2620, 2627, 2634, 2641, 2650, 2651,
2088 2654, 2661, 2668, 2677, 2678, 2679, 2680, 2681, 2682, 2683,
2089 2684, 2685, 2686, 2687, 2695, 2694, 2709, 2709, 2716, 2716,
2090 2724, 2732, 2739, 2746, 2753, 2761, 2768, 2775, 2782, 2789,
2091 2789, 2794, 2798, 2802, 2809, 2810, 2819, 2818, 2829, 2840,
2092 2851, 2861, 2872, 2871, 2888, 2887, 2902, 2911, 2956, 2955,
2093 2979, 2978, 3001, 3000, 3024, 3030, 3023, 3050, 3051, 3050,
2094 3076, 3083, 3090, 3097, 3106, 3113, 3119, 3136, 3142, 3148,
2095 3154, 3160, 3166, 3172, 3178, 3184, 3190, 3196, 3202, 3208,
2096 3214, 3229, 3236, 3242, 3249, 3250, 3251, 3254, 3255, 3258,
2097 3259, 3271, 3272, 3281, 3282, 3285, 3293, 3302, 3309, 3318,
2098 3325, 3332, 3339, 3346, 3355, 3363, 3372, 3376, 3380, 3384,
2099 3388, 3394, 3399, 3404, 3408, 3412, 3416, 3420, 3424, 3432,
2100 3436, 3440, 3444, 3448, 3452, 3456, 3460, 3464, 3470, 3471,
2101 3477, 3486, 3498, 3502, 3511, 3513, 3517, 3522, 3528, 3531,
2102 3535, 3539, 3543, 3528, 3567, 3575, 3585, 3590, 3596, 3606,
2103 3620, 3627, 3634, 3643, 3652, 3660, 3668, 3675, 3683, 3691,
2104 3698, 3705, 3718, 3726, 3736, 3737, 3741, 3736, 3758, 3759,
2105 3763, 3758, 3782, 3790, 3797, 3805, 3814, 3826, 3827, 3831,
2106 3837, 3838, 3840, 3841, 3842, 3830, 3855, 3856, 3859, 3860,
2107 3868, 3878, 3879, 3884, 3892, 3896, 3902, 3905, 3914, 3917,
2108 3924, 3927, 3928, 3930, 3931, 3940, 3949, 3954, 3963, 3972,
2109 3977, 3977, 3982, 3988, 3987, 3999, 4004, 4004, 4011, 4020,
2110 4024, 4033, 4037, 4041, 4045, 4049, 4052, 4056, 4065, 4069,
2111 4073, 4077, 4083, 4084, 4093, 4102, 4106, 4110, 4114, 4118,
2112 4122, 4128, 4130, 4139, 4147, 4161, 4162, 4185, 4189, 4195,
2113 4201, 4202, 4211, 4220, 4232, 4244, 4245, 4246, 4247, 4259,
2114 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4289,
2115 4288, 4301, 4311, 4324, 4331, 4338, 4347, 4359, 4362, 4369,
2116 4376, 4379, 4383, 4386, 4393, 4396, 4397, 4400, 4417, 4418,
2117 4419, 4428, 4438, 4447, 4453, 4463, 4469, 4478, 4480, 4489,
2118 4499, 4505, 4514, 4523, 4533, 4539, 4549, 4555, 4565, 4575,
2119 4594, 4600, 4610, 4620, 4661, 4664, 4663, 4680, 4684, 4689,
2120 4693, 4697, 4679, 4718, 4725, 4732, 4739, 4742, 4743, 4746,
2121 4756, 4757, 4758, 4759, 4762, 4772, 4773, 4783, 4784, 4785,
2122 4786, 4789, 4790, 4791, 4792, 4793, 4796, 4797, 4798, 4799,
2123 4800, 4801, 4802, 4805, 4818, 4827, 4834, 4843, 4844, 4848,
2124 4847, 4857, 4865, 4874, 4889, 4904, 4904, 4918, 4922, 4926,
2125 4930, 4934, 4940, 4945, 4950, 4954, 4958, 4962, 4966, 4970,
2126 4974, 4978, 4982, 4986, 4990, 4994, 4998, 5002, 5007, 5013,
2127 5022, 5030, 5038, 5046, 5056, 5057, 5065, 5074, 5082, 5103,
2128 5105, 5118, 5128, 5136, 5146, 5153, 5162, 5169, 5179, 5186,
2129 5195, 5196, 5199, 5207, 5215, 5225, 5235, 5245, 5252, 5261,
2130 5268, 5277, 5278, 5281, 5289, 5299, 5300, 5303, 5313, 5317,
2131 5323, 5328, 5328, 5352, 5353, 5362, 5364, 5387, 5398, 5405,
2132 5413, 5432, 5433, 5434, 5437, 5438, 5439, 5440, 5443, 5444,
2133 5445, 5448, 5449, 5452, 5453, 5456, 5457, 5460, 5461, 5464,
2134 5465, 5468, 5471, 5474, 5477, 5478, 5479, 5482, 5483, 5486,
2135 5487, 5491
2136};
2137#endif
2138
2140#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2141
2142#if 1
2143/* The user-facing name of the symbol whose (internal) number is
2144 YYSYMBOL. No bounds checking. */
2145static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2146
2147/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2148 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2149static const char *const yytname[] =
2150{
2151 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2152 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2153 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2154 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2155 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2156 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2157 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2158 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2159 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2160 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2161 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2162 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2163 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2164 "\"method\"", "\"global variable\"", "\"instance variable\"",
2165 "\"constant\"", "\"class variable\"", "tLABEL", "\"integer literal\"",
2166 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2167 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2168 "\"literal content\"", "tREGEXP_END", "'.'", "\"backslash\"",
2169 "\"escaped space\"", "\"escaped horizontal tab\"",
2170 "\"escaped form feed\"", "\"escaped carriage return\"",
2171 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2172 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2173 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2174 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2175 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2176 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2177 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2178 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2179 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2180 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2181 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tLOWEST", "'='", "'?'", "':'",
2182 "'>'", "'<'", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'",
2183 "tUMINUS_NUM", "'!'", "'~'", "tLAST_TOKEN", "'{'", "'}'", "'['", "','",
2184 "'`'", "'('", "')'", "']'", "';'", "' '", "'\\n'", "$accept", "program",
2185 "$@1", "top_compstmt", "top_stmts", "top_stmt", "begin_block",
2186 "bodystmt", "$@2", "compstmt", "stmts", "stmt_or_begin", "$@3", "stmt",
2187 "$@4", "command_asgn", "command_rhs", "expr", "@5", "@6", "$@7",
2188 "expr_value", "expr_value_do", "$@8", "$@9", "command_call",
2189 "block_command", "cmd_brace_block", "fcall", "command", "mlhs",
2190 "mlhs_inner", "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post",
2191 "mlhs_node", "lhs", "cname", "cpath", "fname", "fitem", "undef_list",
2192 "$@10", "op", "reswords", "arg", "$@11", "relop", "rel_expr",
2193 "arg_value", "aref_args", "arg_rhs", "paren_args", "opt_paren_args",
2194 "opt_call_args", "call_args", "command_args", "$@12", "block_arg",
2195 "opt_block_arg", "args", "mrhs_arg", "mrhs", "primary", "$@13", "$@14",
2196 "$@15", "$@16", "$@17", "@18", "@19", "$@20", "@21", "$@22", "@23",
2197 "@24", "@25", "@26", "primary_value", "k_begin", "k_if", "k_unless",
2198 "k_while", "k_until", "k_case", "k_for", "k_class", "k_module", "k_def",
2199 "k_do", "k_do_block", "k_rescue", "k_ensure", "k_when", "k_else",
2200 "k_elsif", "k_end", "k_return", "then", "do", "if_tail", "opt_else",
2201 "for_var", "f_marg", "f_marg_list", "f_margs", "f_rest_marg",
2202 "block_args_tail", "opt_block_args_tail", "block_param",
2203 "opt_block_param", "block_param_def", "opt_bv_decl", "bv_decls", "bvar",
2204 "lambda", "@27", "@28", "@29", "@30", "$@31", "f_larglist",
2205 "lambda_body", "do_block", "block_call", "method_call", "brace_block",
2206 "brace_body", "@32", "@33", "@34", "do_body", "@35", "@36", "@37",
2207 "case_args", "case_body", "cases", "p_case_body", "@38", "@39", "@40",
2208 "$@41", "$@42", "$@43", "p_cases", "p_top_expr", "p_top_expr_body",
2209 "p_expr", "p_as", "p_alt", "p_lparen", "p_lbracket", "p_expr_basic",
2210 "@44", "@45", "@46", "p_args", "p_args_head", "p_args_tail",
2211 "p_args_post", "p_arg", "p_kwargs", "p_kwarg", "p_kw", "p_kw_label",
2212 "p_kwrest", "p_kwnorest", "p_value", "p_primitive", "$@47", "p_variable",
2213 "p_var_ref", "p_const", "opt_rescue", "exc_list", "exc_var",
2214 "opt_ensure", "literal", "strings", "string", "string1", "xstring",
2215 "regexp", "words", "word_list", "word", "symbols", "symbol_list",
2216 "qwords", "qsymbols", "qword_list", "qsym_list", "string_contents",
2217 "xstring_contents", "regexp_contents", "string_content", "@48", "$@49",
2218 "@50", "@51", "@52", "@53", "string_dvar", "symbol", "ssym", "sym",
2219 "dsym", "numeric", "simple_numeric", "user_variable", "keyword_variable",
2220 "var_ref", "var_lhs", "backref", "superclass", "$@54", "f_arglist",
2221 "@55", "args_tail", "opt_args_tail", "f_args", "args_forward",
2222 "f_bad_arg", "f_norm_arg", "f_arg_asgn", "f_arg_item", "f_arg",
2223 "f_label", "f_kw", "f_block_kw", "f_block_kwarg", "f_kwarg",
2224 "kwrest_mark", "f_no_kwarg", "f_kwrest", "f_opt", "f_block_opt",
2225 "f_block_optarg", "f_optarg", "restarg_mark", "f_rest_arg",
2226 "blkarg_mark", "f_block_arg", "opt_f_block_arg", "singleton", "$@56",
2227 "assoc_list", "assocs", "assoc", "operation", "operation2", "operation3",
2228 "dot_or_colon", "call_op", "call_op2", "opt_terms", "opt_nl", "rparen",
2229 "rbracket", "rbrace", "trailer", "term", "terms", "none", YY_NULLPTR
2230};
2231
2232static const char *
2233yysymbol_name (yysymbol_kind_t yysymbol)
2234{
2235 return yytname[yysymbol];
2236}
2237#endif
2238
2239#define YYPACT_NINF (-1040)
2240
2241#define yypact_value_is_default(Yyn) \
2242 ((Yyn) == YYPACT_NINF)
2243
2244#define YYTABLE_NINF (-762)
2245
2246#define yytable_value_is_error(Yyn) \
2247 ((Yyn) == YYTABLE_NINF)
2248
2249/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2250 STATE-NUM. */
2251static const yytype_int16 yypact[] =
2252{
2253 -1040, 114, 3745, -1040, 9167, -1040, -1040, -1040, 8625, -1040,
2254 -1040, -1040, -1040, -1040, -1040, -1040, 9293, 9293, -1040, -1040,
2255 -1040, 5085, 4644, -1040, -1040, -1040, -1040, 384, 8480, -27,
2256 236, 280, -1040, -1040, -1040, 3909, 4791, -1040, -1040, 4056,
2257 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, 11057, 11057,
2258 11057, 11057, 124, 6680, 9419, 9923, 10301, 8909, -1040, 8335,
2259 -1040, -1040, -1040, 282, 316, 388, 413, 996, 11183, 11057,
2260 -1040, 799, -1040, 1065, -1040, 374, -1040, -1040, 367, 549,
2261 495, -1040, 485, 11435, -1040, 520, 1591, 398, 65, 348,
2262 -1040, 11309, 11309, -1040, -1040, 7662, 11557, 11679, 11801, 8189,
2263 9293, 424, 95, -1040, -1040, 544, -1040, -1040, -1040, -1040,
2264 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, 323, 435,
2265 -1040, 570, 518, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2266 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2267 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2268 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2269 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2270 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2271 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2272 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2273 -1040, -1040, 547, -1040, -1040, -1040, 580, 11057, 634, 6831,
2274 11057, 11057, 11057, -1040, 11057, -1040, 613, 4181, 679, -1040,
2275 -1040, 640, 496, 353, 453, 696, 553, 655, -1040, -1040,
2276 7536, -1040, 9293, 9545, -1040, -1040, 7788, -1040, 11309, 863,
2277 -1040, 671, 6982, -1040, 7133, -1040, -1040, 702, 708, 367,
2278 -1040, 531, -1040, 759, 4328, 4328, 551, 9419, -1040, 6680,
2279 713, 799, -1040, 1065, -27, 745, -1040, 1065, -27, 750,
2280 -33, 38, -1040, 679, 765, 38, -1040, -27, 838, 996,
2281 11923, 769, -1040, 536, 562, 605, 659, -1040, -1040, -1040,
2282 -1040, -1040, 600, -1040, 716, 911, 438, -1040, -1040, -1040,
2283 -1040, 843, -1040, -1040, -1040, -1040, -1040, -1040, -1040, 7914,
2284 11309, 11309, 11309, 11309, 9419, 11309, 11309, -1040, -1040, -1040,
2285 824, -1040, -1040, -1040, -1040, -1040, 10427, -1040, 6680, 9038,
2286 794, 10427, -1040, 11057, 11057, 11057, 11057, 11057, -1040, -1040,
2287 11057, 11057, 11057, 11057, 11057, 11057, 11057, 11057, 11057, -1040,
2288 -1040, 11057, 11057, 11057, 11057, 11057, 11057, 11057, 11057, 11057,
2289 11057, -1040, -1040, 12386, 9293, 12476, 5824, 374, 106, 106,
2290 7284, 11309, 7284, 799, -1040, 798, 885, -1040, -1040, 662,
2291 928, 117, 127, 141, 439, 670, 11309, 880, -1040, 832,
2292 701, -1040, -1040, -1040, -1040, 34, 78, 415, 543, 558,
2293 612, 626, 632, 720, -1040, -1040, -1040, 732, -1040, -1040,
2294 -1040, 13736, -1040, -1040, 11183, 11183, -1040, -1040, 585, -1040,
2295 -1040, -1040, 777, 11057, 11057, 9671, -1040, -1040, 12566, 9293,
2296 12656, 11057, 11057, 10049, -1040, -27, 826, -1040, -1040, 11057,
2297 -27, -1040, 836, -27, 842, -1040, 133, -1040, -1040, -1040,
2298 -1040, -1040, 8625, -1040, 11057, 834, 847, 12566, 12656, 11057,
2299 1065, 236, -27, -1040, -1040, 8040, 846, -27, -1040, -1040,
2300 10175, -1040, -1040, 10301, -1040, -1040, -1040, 671, 731, -1040,
2301 -1040, 850, 11923, 12746, 9293, 12836, -1040, -1040, -1040, -1040,
2302 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, 931, 59,
2303 960, 340, 11057, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2304 -1040, -1040, 851, -1040, -1040, -1040, 990, -1040, 990, 11057,
2305 -1040, 855, 857, 963, -1040, -27, 11923, 858, -1040, -1040,
2306 -1040, 966, 887, 3887, -1040, -1040, -1040, 737, 663, -1040,
2307 759, 4622, 4622, 4622, 4622, 4769, 4475, 4622, 4622, 4328,
2308 4328, 849, 849, 3200, 1162, 1162, 886, 436, 436, 759,
2309 759, 759, 1842, 1842, 5232, 4203, 5526, 4350, -1040, 708,
2310 -1040, -27, 866, 588, -1040, 666, -1040, -1040, 4938, 990,
2311 1010, -1040, 5975, 1012, 6428, 990, 54, 990, 1003, 1018,
2312 144, 12926, 9293, 13016, -1040, 374, -1040, 731, -1040, -1040,
2313 -1040, 13106, 9293, 13196, 5824, 11309, -1040, -1040, -1040, -1040,
2314 -1040, -1040, 3529, -1040, 4034, -1040, -1040, -1040, 8625, 11057,
2315 -1040, 11057, 679, -1040, 655, 3369, 4497, -27, 688, 722,
2316 -1040, -1040, -1040, -1040, 9797, -1040, 10049, -1040, -1040, 11309,
2317 4181, -1040, -1040, 708, 708, -1040, -1040, 345, -1040, -1040,
2318 38, 11923, 850, 37, 470, -27, 271, 349, -1040, -1040,
2319 1007, -1040, 487, -1040, 877, -1040, -1040, 491, 884, -1040,
2320 759, -1040, -1040, 893, -1040, -1040, -1040, -1040, 895, 10553,
2321 9419, -1040, 850, 11923, 9419, 11183, 11057, 13286, 9293, 13376,
2322 12319, 918, 11183, 11183, -1040, 824, 889, 727, 9671, 11183,
2323 11183, -1040, -1040, 824, -1040, -1040, -1040, 10679, 738, -1040,
2324 574, -1040, 1033, -1040, -1040, -1040, -1040, -1040, -1040, 1018,
2325 990, -1040, 10805, 990, 72, 235, -27, 156, 312, 7284,
2326 799, 11309, 5824, 897, 470, -1040, -27, 990, 133, 921,
2327 8770, 95, 549, -1040, -1040, -1040, -1040, 11057, 11057, 733,
2328 11057, 11057, -27, 920, 133, -1040, -1040, 350, -1040, -1040,
2329 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2330 939, -1040, 939, 11057, 927, -1040, 850, -1040, 4181, 5379,
2331 5673, -27, 753, 786, -1040, -1040, 2945, 2945, 881, -1040,
2332 356, 631, -1040, 1024, 978, -1040, 952, -1040, -1040, 742,
2333 -1040, -1040, 341, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2334 -1040, -1040, 11057, -1040, -1040, -1040, -1040, -1040, -1040, 11183,
2335 -1040, -1040, -1040, -1040, -1040, 855, -1040, 989, -1040, -1040,
2336 -1040, 7284, -1040, -1040, -1040, -1040, 7284, 11309, 990, -1040,
2337 -1040, 990, -1040, -1040, 990, -1040, 11057, -1040, 26, -1040,
2338 332, 990, 5824, 799, 990, -1040, -1040, -1040, 2196, 5824,
2339 2402, -1040, -1040, -1040, 11057, -1040, 10049, -1040, 1834, -1040,
2340 1556, 7133, -1040, -1040, 5824, 944, 787, -1040, -1040, -1040,
2341 -1040, 12319, 12200, -1040, 577, 949, -1040, -1040, -1040, 1043,
2342 -1040, 12319, 2945, 2945, 881, 356, 790, 3608, 3608, 4181,
2343 -1040, -1040, 12045, 106, -1040, -1040, 6554, -1040, 106, -1040,
2344 -1040, -1040, -1040, -1040, 10931, 6126, -1040, 990, -1040, -1040,
2345 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, 1151, -1040,
2346 -1040, -1040, -1040, -1040, -1040, -27, -27, -1040, -1040, 973,
2347 -1040, 954, 11057, -1040, 956, 546, 965, 965, -1040, 967,
2348 1049, 968, 1066, -1040, 990, 799, 974, 921, 2402, -1040,
2349 -1040, -1040, -1040, -27, 991, 995, 979, 12167, -1040, 981,
2350 965, 965, -1040, 982, 992, -1040, 999, -1040, -1040, 3,
2351 264, 355, -27, 12286, -1040, 1001, -1040, -1040, -27, 1011,
2352 -1040, 12319, -1040, -1040, 744, -1040, -1040, -1040, -1040, -1040,
2353 -1040, -1040, -1040, -1040, -1040, -27, -27, -27, -27, 1068,
2354 -1040, 743, 198, 203, 213, 5824, 1133, 5975, 3608, 11057,
2355 -1040, 955, -1040, 1151, 1079, -1040, 1022, -27, 1025, -1040,
2356 -1040, -1040, 11057, 2196, -1040, -1040, 714, -1040, -1040, -1040,
2357 -1040, 243, -1040, -1040, 2402, -1040, -1040, 1417, -1040, -1040,
2358 -1040, -1040, 2402, 5824, -27, 291, 7410, 1027, -1040, 12167,
2359 2402, -1040, 1108, 748, 714, -1040, -1040, -1040, 2402, -1040,
2360 1417, -1040, 1089, -1040, 1028, 12319, -1040, 307, 978, 1031,
2361 -1040, 652, -1040, 577, 978, -1040, -1040, 800, -1040, -1040,
2362 -1040, -1040, 248, 13466, 9293, 13556, 1010, -1040, 574, 106,
2363 801, 377, -1040, -1040, -1040, -1040, -1040, -1040, -27, -1040,
2364 1151, -1040, 1097, -1040, -1040, -27, -1040, 1032, 1037, -1040,
2365 1121, 965, -1040, 1040, -1040, 1041, -1040, 1040, 990, 1046,
2366 5824, 7133, -1040, 1069, -1040, 748, -1040, 1051, 1053, -1040,
2367 13646, -1040, 965, 1054, -1040, 1067, 1054, -1040, 542, -1040,
2368 -1040, 12319, 1071, -1040, 1072, 12319, -1040, -1040, -1040, -1040,
2369 -1040, 61, 202, -27, 286, 313, -1040, -1040, -1040, 11309,
2370 11309, 12200, -1040, -1040, 1073, 1074, -1040, 2402, -1040, 1417,
2371 -1040, -1040, 1417, -1040, 1417, -1040, -1040, -1040, -1040, 990,
2372 1048, -1040, 2402, -1040, 1417, -1040, 1075, 1076, -1040, 1417,
2373 -1040, 1417, -1040, -1040, 1089, -1040, 1071, 12319, 12319, 1071,
2374 321, -1040, -1040, -1040, -1040, 1097, 1097, 1040, 1080, 1040,
2375 1040, -1040, -1040, 1054, 1087, 1054, 1054, -1040, -1040, 1071,
2376 -1040, 1074, -1040, 1417, -1040, -1040, -1040, -1040, 1417, -1040,
2377 -1040, -1040, 6277, 1040, 1054, 576, -1040, -1040, -1040, -1040,
2378 -1040
2379};
2380
2381/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2382 Performed when YYTABLE does not specify something else to do. Zero
2383 means the default is an error. */
2384static const yytype_int16 yydefact[] =
2385{
2386 2, 0, 0, 1, 0, 362, 363, 364, 0, 355,
2387 356, 357, 360, 358, 359, 361, 350, 351, 352, 353,
2388 373, 279, 279, 637, 636, 638, 639, 749, 0, 749,
2389 0, 0, 641, 640, 642, 731, 733, 633, 632, 732,
2390 635, 627, 628, 629, 630, 578, 647, 648, 0, 0,
2391 0, 0, 0, 0, 306, 761, 761, 95, 326, 598,
2392 598, 600, 602, 0, 0, 0, 0, 0, 0, 0,
2393 3, 747, 6, 9, 35, 40, 52, 67, 279, 66,
2394 0, 83, 0, 87, 97, 0, 61, 235, 250, 0,
2395 304, 0, 0, 63, 63, 747, 0, 0, 0, 0,
2396 315, 68, 324, 293, 294, 577, 579, 295, 296, 297,
2397 299, 298, 300, 576, 617, 618, 575, 625, 643, 644,
2398 301, 0, 302, 71, 5, 8, 176, 187, 177, 200,
2399 173, 193, 183, 182, 203, 204, 198, 181, 180, 175,
2400 201, 205, 206, 185, 174, 188, 192, 194, 186, 179,
2401 195, 202, 197, 196, 189, 199, 184, 172, 191, 190,
2402 171, 178, 169, 170, 166, 167, 168, 126, 128, 127,
2403 161, 162, 157, 139, 140, 141, 148, 145, 147, 142,
2404 143, 163, 164, 149, 150, 154, 158, 144, 146, 136,
2405 137, 138, 151, 152, 153, 155, 156, 159, 160, 165,
2406 131, 133, 28, 129, 130, 132, 0, 0, 0, 0,
2407 0, 0, 0, 598, 0, 274, 0, 257, 284, 81,
2408 278, 761, 0, 643, 644, 0, 302, 761, 725, 82,
2409 749, 79, 0, 761, 449, 78, 749, 750, 0, 0,
2410 23, 247, 0, 10, 0, 350, 351, 318, 450, 0,
2411 229, 0, 315, 230, 220, 221, 312, 0, 21, 0,
2412 0, 747, 17, 20, 749, 85, 16, 308, 749, 0,
2413 754, 754, 258, 0, 0, 754, 723, 749, 0, 0,
2414 0, 93, 354, 0, 103, 104, 111, 428, 622, 621,
2415 623, 620, 0, 619, 0, 0, 0, 585, 594, 590,
2416 596, 626, 56, 241, 242, 757, 758, 4, 759, 748,
2417 0, 0, 0, 0, 0, 0, 0, 365, 454, 443,
2418 72, 458, 323, 366, 458, 439, 0, 99, 0, 91,
2419 88, 0, 57, 0, 0, 0, 0, 0, 253, 254,
2420 0, 0, 0, 0, 218, 219, 0, 0, 0, 251,
2421 252, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2422 0, 743, 744, 0, 761, 0, 0, 62, 0, 0,
2423 0, 0, 0, 747, 334, 748, 0, 384, 383, 0,
2424 0, 643, 644, 302, 121, 122, 0, 0, 124, 651,
2425 0, 643, 644, 302, 342, 196, 189, 199, 184, 166,
2426 167, 168, 126, 127, 721, 344, 720, 0, 80, 746,
2427 745, 0, 325, 580, 0, 0, 134, 728, 312, 285,
2428 730, 281, 0, 0, 0, 0, 275, 283, 0, 761,
2429 0, 0, 0, 0, 276, 749, 0, 317, 280, 679,
2430 749, 270, 761, 749, 761, 269, 749, 322, 55, 25,
2431 27, 26, 0, 319, 0, 0, 0, 0, 0, 0,
2432 19, 0, 749, 310, 15, 748, 84, 749, 307, 313,
2433 756, 755, 259, 756, 261, 314, 724, 0, 110, 626,
2434 101, 96, 0, 0, 761, 0, 327, 429, 604, 624,
2435 607, 605, 599, 581, 582, 601, 583, 603, 0, 0,
2436 0, 0, 0, 760, 7, 29, 30, 31, 32, 33,
2437 53, 54, 0, 455, 454, 73, 0, 459, 0, 0,
2438 36, 289, 0, 39, 288, 749, 0, 89, 100, 51,
2439 41, 49, 0, 262, 284, 207, 37, 0, 302, 58,
2440 227, 234, 236, 237, 238, 245, 246, 239, 240, 216,
2441 217, 243, 244, 749, 231, 232, 233, 222, 223, 224,
2442 225, 226, 255, 256, 734, 736, 735, 737, 448, 279,
2443 446, 749, 761, 734, 736, 735, 737, 447, 279, 0,
2444 761, 375, 0, 374, 0, 0, 0, 0, 332, 0,
2445 312, 0, 761, 0, 63, 340, 121, 122, 123, 649,
2446 338, 0, 761, 0, 0, 0, 345, 741, 742, 347,
2447 734, 735, 279, 42, 262, 208, 48, 215, 0, 0,
2448 727, 0, 286, 282, 761, 734, 735, 749, 734, 735,
2449 726, 316, 751, 264, 271, 266, 273, 321, 24, 0,
2450 248, 11, 34, 0, 761, 214, 22, 86, 18, 309,
2451 754, 0, 94, 738, 109, 749, 734, 735, 430, 608,
2452 0, 584, 0, 587, 0, 592, 589, 0, 0, 593,
2453 228, 452, 456, 0, 372, 453, 460, 438, 292, 0,
2454 0, 98, 92, 0, 0, 0, 0, 0, 761, 0,
2455 0, 0, 0, 0, 445, 76, 0, 451, 271, 0,
2456 0, 268, 444, 74, 267, 305, 367, 761, 761, 567,
2457 761, 376, 761, 330, 378, 64, 377, 331, 469, 0,
2458 0, 369, 0, 0, 738, 311, 749, 734, 735, 0,
2459 0, 0, 0, 121, 122, 125, 749, 0, 749, 655,
2460 0, 440, 69, 135, 729, 287, 277, 0, 0, 451,
2461 0, 0, 749, 761, 749, 260, 102, 451, 431, 609,
2462 613, 614, 615, 606, 616, 586, 588, 595, 591, 597,
2463 761, 70, 761, 0, 290, 38, 90, 50, 263, 734,
2464 735, 749, 734, 735, 561, 565, 0, 0, 0, 506,
2465 500, 503, 559, 0, 59, 486, 488, 490, 493, 540,
2466 545, 546, 547, 550, 551, 552, 553, 554, 556, 555,
2467 557, 558, 0, 47, 212, 46, 213, 77, 752, 0,
2468 44, 210, 45, 211, 75, 568, 569, 761, 570, 368,
2469 370, 0, 12, 14, 574, 371, 0, 0, 0, 379,
2470 381, 0, 65, 470, 0, 336, 0, 462, 0, 335,
2471 451, 0, 0, 0, 0, 451, 343, 722, 678, 0,
2472 678, 348, 441, 442, 0, 265, 272, 320, 678, 610,
2473 749, 0, 419, 418, 0, 291, 451, 548, 549, 122,
2474 563, 0, 0, 502, 0, 0, 505, 428, 562, 0,
2475 60, 0, 543, 544, 0, 492, 491, 0, 0, 249,
2476 43, 209, 0, 0, 572, 573, 0, 382, 0, 328,
2477 329, 471, 333, 463, 0, 0, 337, 0, 650, 339,
2478 685, 682, 681, 680, 683, 691, 700, 679, 0, 712,
2479 701, 716, 715, 711, 677, 749, 749, 684, 686, 687,
2480 689, 663, 693, 698, 761, 704, 761, 761, 709, 663,
2481 714, 663, 0, 661, 0, 0, 663, 655, 678, 432,
2482 435, 611, 417, 749, 0, 687, 402, 695, 696, 761,
2483 761, 761, 707, 402, 402, 400, 422, 457, 461, 749,
2484 520, 508, 749, 509, 515, 0, 535, 598, 749, 526,
2485 531, 534, 528, 530, 538, 753, 560, 487, 489, 541,
2486 542, 564, 499, 496, 598, 749, 749, 749, 749, 0,
2487 571, 0, 643, 644, 302, 0, 761, 0, 0, 0,
2488 464, 761, 341, 0, 395, 387, 389, 749, 392, 385,
2489 652, 654, 0, 0, 670, 692, 0, 658, 719, 702,
2490 703, 0, 660, 659, 0, 673, 713, 0, 675, 717,
2491 346, 656, 0, 0, 749, 0, 0, 0, 420, 0,
2492 408, 410, 0, 694, 0, 397, 399, 398, 0, 413,
2493 0, 415, 0, 507, 518, 0, 501, 513, 524, 510,
2494 516, 0, 504, 527, 533, 539, 537, 0, 494, 495,
2495 497, 498, 312, 0, 761, 0, 761, 13, 761, 0,
2496 478, 481, 484, 485, 465, 467, 468, 466, 749, 394,
2497 0, 688, 0, 705, 662, 749, 690, 663, 663, 699,
2498 704, 761, 718, 663, 710, 663, 687, 663, 0, 0,
2499 0, 0, 433, 0, 421, 706, 401, 402, 402, 312,
2500 0, 697, 761, 402, 708, 402, 402, 426, 749, 424,
2501 427, 0, 521, 522, 511, 0, 517, 536, 532, 525,
2502 529, 738, 311, 749, 734, 735, 566, 380, 472, 0,
2503 0, 482, 386, 388, 390, 393, 653, 0, 666, 0,
2504 668, 657, 0, 674, 0, 671, 676, 349, 434, 0,
2505 0, 612, 0, 405, 0, 407, 738, 311, 396, 0,
2506 414, 0, 411, 416, 0, 423, 519, 0, 0, 514,
2507 451, 473, 479, 480, 483, 0, 0, 663, 663, 663,
2508 663, 437, 436, 402, 402, 402, 402, 425, 523, 512,
2509 474, 391, 667, 0, 664, 669, 672, 406, 0, 403,
2510 409, 412, 0, 663, 402, 761, 665, 404, 476, 477,
2511 475
2512};
2513
2514/* YYPGOTO[NTERM-NUM]. */
2515static const yytype_int16 yypgoto[] =
2516{
2517 -1040, -1040, -1040, 972, -1040, 19, 754, -545, -1040, -51,
2518 -1040, 756, -1040, 68, -1040, -264, -308, -83, -1040, -1040,
2519 -1040, -66, -75, -1040, -1040, -25, -1040, -323, 645, 4,
2520 1126, -154, 7, -26, -1040, -391, 11, 2057, -345, 1127,
2521 -58, -11, -1040, -1040, 2, -1040, 2889, -1040, 1147, -1040,
2522 1411, -1040, 110, 60, 630, -350, 100, -15, -1040, -381,
2523 -205, 39, -1040, -307, -32, -1040, -1040, -1040, -1040, -1040,
2524 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, 32,
2525 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040,
2526 -1040, -1040, -1040, -1040, -1040, 538, -1040, 331, 1177, -364,
2527 -1040, 146, -694, -1040, -1027, -1039, 230, 152, 393, 308,
2528 -1040, 501, -1040, -886, -1040, 74, 389, -1040, -1040, -1040,
2529 -1040, -1040, -1040, -1040, 537, -1040, -1040, -96, 766, -1040,
2530 -1040, -1040, 962, -1040, -1040, -1040, -1040, -688, -1040, 42,
2531 -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -1040, -603,
2532 -1040, -1040, -1040, -1040, 399, -1040, -1040, -1040, -860, -1040,
2533 274, -991, -605, -822, -1040, 206, -1040, 210, 218, -1040,
2534 -643, -1040, 414, -1040, -1040, 208, -1040, -1040, 289, 373,
2535 675, -1040, 1197, 1459, 1483, 1523, -1040, 806, 1936, -1040,
2536 1965, 2010, -1040, -1040, -56, -1040, -1040, -200, -1040, -1040,
2537 -1040, -1040, -1040, -1040, -1040, 5, -1040, -1040, -1040, -1040,
2538 -21, 1967, 1113, 1209, 1908, 1709, -1040, -1040, 352, -1040,
2539 -770, 412, -776, -607, -1001, -829, 207, -915, -287, -62,
2540 275, 249, -1040, -1040, -489, -327, 168, -975, -957, 256,
2541 -879, -1040, -729, -1040, 120, -748, -1040, -1040, -1040, 92,
2542 -393, -1040, -318, -1040, -1040, -86, -1040, -37, 253, 848,
2543 -577, 329, -243, -60, -55, -2
2544};
2545
2546/* YYDEFGOTO[NTERM-NUM]. */
2547static const yytype_int16 yydefgoto[] =
2548{
2549 0, 1, 2, 70, 71, 72, 243, 579, 906, 580,
2550 261, 262, 461, 263, 452, 74, 530, 75, 539, 690,
2551 890, 368, 370, 371, 842, 76, 77, 515, 249, 79,
2552 80, 264, 81, 82, 83, 481, 84, 216, 388, 389,
2553 200, 201, 202, 618, 567, 204, 86, 454, 359, 87,
2554 218, 269, 535, 568, 702, 440, 441, 231, 232, 220,
2555 426, 572, 523, 524, 88, 366, 268, 467, 639, 287,
2556 719, 589, 732, 730, 604, 606, 739, 740, 957, 251,
2557 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
2558 321, 324, 707, 831, 722, 836, 837, 675, 252, 582,
2559 715, 838, 839, 380, 1025, 1026, 1027, 1028, 1136, 1061,
2560 963, 871, 872, 964, 1148, 1149, 486, 487, 658, 758,
2561 868, 1055, 959, 1132, 325, 101, 102, 322, 512, 513,
2562 672, 770, 516, 517, 676, 772, 848, 723, 1107, 720,
2563 843, 911, 1018, 1211, 1230, 1242, 1250, 1099, 1100, 1078,
2564 795, 796, 897, 898, 797, 882, 884, 881, 982, 983,
2565 984, 1152, 985, 988, 989, 990, 991, 992, 993, 798,
2566 799, 887, 800, 801, 802, 708, 827, 903, 833, 103,
2567 104, 105, 106, 107, 108, 109, 498, 662, 110, 500,
2568 111, 112, 499, 501, 292, 295, 296, 492, 660, 659,
2569 759, 869, 961, 1056, 763, 113, 114, 293, 115, 116,
2570 117, 223, 224, 120, 225, 226, 600, 731, 859, 860,
2571 1114, 1034, 935, 443, 937, 938, 1126, 940, 956, 942,
2572 943, 968, 969, 944, 945, 946, 947, 948, 972, 973,
2573 949, 950, 951, 952, 953, 1037, 407, 605, 274, 444,
2574 228, 123, 643, 570, 609, 603, 411, 307, 436, 437,
2575 697, 886, 472, 583, 375, 266
2576};
2577
2578/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2579 positive, shift that token. If negative, reduce the rule whose
2580 number is the opposite. If YYTABLE_NINF, syntax error. */
2581static const yytype_int16 yytable[] =
2582{
2583 124, 291, 260, 365, 294, 584, 412, 235, 367, 367,
2584 203, 308, 367, 205, 571, 410, 309, 240, 841, 372,
2585 215, 215, 434, 125, 536, 282, 369, 752, 474, 373,
2586 203, 844, 476, 205, 89, 308, 89, 1005, 1007, 581,
2587 630, 405, 598, 302, 623, 569, 301, 578, 222, 222,
2588 749, 282, 623, 272, 276, 221, 221, 330, 374, 737,
2589 265, 203, -107, 320, 282, 282, 282, 529, 281, 1124,
2590 73, 1150, 73, 1175, -116, 1006, 1008, 1057, 757, 627,
2591 630, 714, 234, 1173, 955, 89, 89, 794, 934, 283,
2592 934, 652, 960, 612, 270, 495, 497, -116, 934, 1029,
2593 222, 203, -637, 889, 215, 462, 613, 616, 227, 227,
2594 569, 1144, 578, 470, 3, 283, 219, 229, 1116, 581,
2595 471, 317, 267, 222, 222, 664, 237, 222, 379, 390,
2596 390, -637, 222, -354, 655, 682, 430, 1116, 319, 221,
2597 644, 974, -112, 877, 878, 1116, -636, 271, 275, 850,
2598 529, 529, -113, 446, 1117, 448, 237, 422, 260, 855,
2599 1206, -354, -354, -107, 1209, 458, -120, 644, 1129, -119,
2600 315, 316, 914, 1117, 525, -636, 1231, 305, 665, 306,
2601 256, -115, 1054, -107, 473, -734, -107, 854, 934, 1173,
2602 -107, 471, 227, 456, 1029, 1109, 1103, 485, 1042, 1043,
2603 408, 308, 1124, 1150, 876, 305, 465, 306, 260, -734,
2604 -354, -112, -116, 883, -116, -118, -113, 1229, -107, 427,
2605 -734, 1065, 1066, 1067, 464, 427, -120, 367, 367, 367,
2606 367, 445, 510, 511, 215, 1144, 215, 215, 318, 434,
2607 124, 89, 726, 630, 505, 506, 507, 508, 282, 999,
2608 1000, 936, 736, 623, 480, 623, 735, 305, 479, 306,
2609 -118, -119, 222, -103, 222, 222, 265, 1116, 222, 221,
2610 222, 221, 442, -104, 89, 644, 89, 260, 979, 981,
2611 238, 1029, 241, 1029, 1116, 644, 237, -111, 367, 89,
2612 -110, 89, 776, 593, 981, 981, -106, 282, 663, -115,
2613 663, 520, -106, 595, 1118, 586, 531, 917, 234, 319,
2614 73, 1214, 283, 308, 954, 1125, 1074, 623, 1002, 585,
2615 1130, 587, 227, 1118, 227, 460, -117, 1105, 504, 978,
2616 435, 1138, 438, 1106, -114, 265, 588, -117, 781, 1145,
2617 527, 89, 222, 222, 222, 222, 89, 222, 222, -112,
2618 -735, -112, 931, -118, -113, -118, -113, -114, 222, 1154,
2619 89, 283, 445, 537, -120, 522, -120, 576, 215, 569,
2620 522, 578, 817, 1181, -108, -105, 932, 73, 1079, 242,
2621 824, -109, 509, -735, 813, 815, 1029, 1029, 1084, 531,
2622 531, 820, 822, 317, 1198, 994, 222, -106, 89, -119,
2623 826, -119, 89, 222, 89, 1076, 668, 755, 994, 994,
2624 1075, 315, 316, 576, 1131, 1101, 361, -106, 222, 746,
2625 -106, 529, -645, 244, -106, 577, 1115, 445, 529, 529,
2626 1090, 1091, 576, 215, 297, 529, 529, -115, 894, -115,
2627 427, 638, 427, 880, 362, 363, 537, 537, 1218, -112,
2628 282, 689, -645, 1155, 203, 889, 480, 205, -108, 669,
2629 576, 222, 766, 1224, -117, -731, -117, 766, 298, -103,
2630 1153, -84, -114, 630, -114, -108, -105, 889, -105, -112,
2631 338, 339, 445, -638, 915, 623, 895, 576, 215, 896,
2632 577, -98, 361, 364, 282, -108, -105, 89, -108, -105,
2633 480, -524, -108, -105, 488, 496, -749, -631, 1128, 237,
2634 318, 900, -638, 333, 283, 233, 222, 624, 577, 729,
2635 362, 409, 738, 1171, 615, 617, 716, 349, 350, 994,
2636 477, 710, 236, 712, -646, -631, -631, 237, -311, 1015,
2637 299, 615, 617, 970, 1017, 577, 1153, 1120, 746, 1001,
2638 1153, 1248, -646, 488, 695, 529, 754, 488, 283, 490,
2639 491, -113, 650, 703, 361, 300, -311, -311, 981, 645,
2640 427, 941, 356, 357, 358, 1120, 704, 323, 709, -113,
2641 1039, -104, -731, 966, -631, 1189, 1210, -731, 835, 830,
2642 445, 830, 362, 428, 994, 576, 215, 742, 1040, 361,
2643 445, 718, 1228, 1153, 361, 576, 215, 743, 490, 491,
2644 704, -639, 490, 491, 89, -311, 89, 415, -735, 282,
2645 203, 326, 427, 205, 222, 756, -641, 362, 457, 694,
2646 -643, 327, 362, 483, 222, 986, 89, 222, 701, 765,
2647 -639, 429, 704, 768, -120, 862, 331, 78, 367, 78,
2648 459, 282, 432, 577, 926, -641, 60, 480, -643, -643,
2649 531, 78, 78, 577, -111, 853, 488, 531, 531, 414,
2650 852, 222, 701, -644, 531, 531, 429, -119, 851, -120,
2651 -640, 484, 861, 283, 459, 930, 445, 699, 1204, 987,
2652 418, 576, 215, 416, -642, 237, -732, -110, 78, 78,
2653 -631, -644, -644, 694, 701, 828, 834, -643, 840, -640,
2654 840, -119, 89, 78, -115, 283, 89, 537, 488, 489,
2655 222, 490, 491, -642, 537, 537, 753, -302, 236, -631,
2656 361, 537, 537, 970, -106, 1168, 78, 78, -634, 423,
2657 78, 970, 203, 970, 1163, 78, 522, 829, 775, 577,
2658 -644, 427, 777, 830, 367, -302, -302, 1123, 362, 591,
2659 1127, 89, 415, 222, 89, 700, -634, -634, 873, 361,
2660 873, 908, 925, 490, 491, -749, 1157, 644, 1085, 424,
2661 905, 1143, 488, 1146, 237, 907, 425, 750, -634, -120,
2662 753, 926, -117, 918, 531, 431, 1086, 362, 601, -312,
2663 607, 433, 814, 816, -302, 361, 691, 592, 967, 821,
2664 823, 361, -108, -732, -115, -634, 361, -634, -732, 453,
2665 977, 751, 930, 931, 696, 904, 819, -312, -312, 608,
2666 892, 893, 864, 362, 687, 493, 333, 490, 491, 362,
2667 1093, 1169, 1170, 488, 362, 1140, 602, 932, -117, 677,
2668 230, 537, 699, -114, 78, 1016, 233, 814, 816, -114,
2669 821, 823, 463, 89, 1021, 970, 488, 970, 89, 222,
2670 282, -83, 970, -105, 970, 78, -312, 78, 78, -115,
2671 696, 78, 688, 78, 89, 700, 819, 78, 1094, 78,
2672 1217, 89, 1219, 602, 478, 1051, 493, 1220, 490, 491,
2673 469, 619, 78, 89, 78, 1223, 89, 1225, 696, 475,
2674 705, 970, -117, -114, 1226, 482, 713, 449, 717, 493,
2675 502, 490, 491, -738, 1157, 1095, 333, 450, 451, 901,
2676 514, 1081, 596, 596, 1011, 282, 597, 879, 89, -749,
2677 528, 590, 1038, 237, 1038, 1038, 1243, 89, 1087, 503,
2678 305, 1244, 306, 594, 78, 78, 78, 78, 78, 78,
2679 78, 78, 599, 333, 1096, -738, 1098, 1038, 1038, 1038,
2680 830, 78, 721, 78, 901, 632, 78, 488, 641, 696,
2681 346, 347, 634, 354, 355, 356, 357, 358, 636, 696,
2682 975, 642, -98, -738, -738, 671, 651, 488, 967, 1063,
2683 674, -284, 967, 679, 683, 1133, 967, 680, 967, 78,
2684 684, 78, 698, 685, 834, 78, 78, 78, 706, 840,
2685 354, 355, 356, 357, 358, 711, 488, 282, 718, 767,
2686 494, 78, 490, 491, 696, 721, 769, 771, 971, 818,
2687 -738, -285, -738, 696, 885, -734, 812, 89, 830, 89,
2688 661, 845, 490, 491, 849, 41, 42, 43, 44, 78,
2689 78, 760, 761, 803, 762, 939, 866, 939, 856, 858,
2690 870, 46, 47, -286, 78, 939, 888, 965, 889, 666,
2691 1190, 490, 491, 891, 447, 89, 367, 367, 89, 902,
2692 -287, 1135, 445, 995, 709, 784, 840, 576, 215, 1032,
2693 1033, 1046, 1036, 1212, 1213, 310, 311, 312, 313, 314,
2694 78, 1041, 466, 1044, 1047, 119, 468, 119, 1049, 1038,
2695 1052, 1059, 1058, 976, 1092, 1060, 222, 1064, 1068, 78,
2696 967, 920, 967, 921, 922, 923, 924, 967, 1070, 967,
2697 1038, 1147, 829, 921, 922, 923, 924, 1080, 696, 920,
2698 1072, 921, 922, 923, 924, 577, 1122, 1083, 1134, 803,
2699 803, 1122, 89, 89, 1139, 939, 119, 119, 1110, 909,
2700 285, 1112, 910, 1040, 1151, 912, 967, 1156, 1177, 100,
2701 975, 100, 916, 1179, 1122, 919, 1182, 1184, 975, 1191,
2702 975, 1245, 1222, 100, 100, 1188, 285, 1192, 1023, 1194,
2703 1199, 222, 222, 920, 1121, 921, 922, 923, 924, 382,
2704 392, 392, 392, 1201, 455, 646, 976, 1207, 1208, 1215,
2705 1216, 648, 377, -734, -735, 394, 1233, 78, 971, 78,
2706 100, 100, 1142, 1238, 360, 696, 971, 78, 971, 333,
2707 939, 885, 741, 840, 1167, 100, 832, 78, 1022, 78,
2708 78, 939, 1023, 1108, 803, 803, 346, 347, 1024, 939,
2709 696, 696, 1174, 962, 803, 803, 803, 965, 100, 100,
2710 803, 803, 100, 874, 89, 965, 996, 100, 1227, 863,
2711 673, 1069, 1071, 631, 78, 1050, 518, 1249, 633, 1158,
2712 998, 635, 1102, 1159, 637, 353, 354, 355, 356, 357,
2713 358, 1160, 413, 997, 1166, 1097, 667, 976, 406, 1053,
2714 647, 1119, 975, 1141, 975, 649, 1137, 1082, 0, 975,
2715 0, 975, 119, 0, 0, 78, 0, 0, 0, 78,
2716 78, 0, 0, 78, 0, 0, 0, 78, 78, 0,
2717 0, 0, 0, 0, 78, 78, 0, 0, 0, 0,
2718 0, 0, 0, 0, 0, 119, 803, 119, 975, 0,
2719 971, 1045, 971, 1048, 803, 804, 0, 971, 0, 971,
2720 119, 0, 119, 681, 78, 0, 78, 78, 0, 0,
2721 0, 0, 0, 0, 939, 0, 100, 0, 0, 0,
2722 0, 803, 0, 285, 0, 0, 0, 0, 0, 965,
2723 0, 1205, 0, 0, 0, 0, 971, 100, 0, 100,
2724 100, 0, 0, 100, 0, 100, 696, 0, 0, 100,
2725 0, 100, 119, 0, 0, 0, 0, 119, 0, 0,
2726 0, 0, 0, 0, 100, 0, 100, 0, 0, 0,
2727 0, 119, 285, 0, 0, 1193, 1195, 0, 803, 0,
2728 0, 1200, 0, 1202, 1203, 0, 0, 0, 0, 1187,
2729 0, 804, 804, 0, 78, 0, 0, 273, 0, 920,
2730 0, 921, 922, 923, 924, 925, 78, 0, 0, 119,
2731 0, 78, 78, 119, 0, 119, 100, 100, 100, 100,
2732 100, 100, 100, 100, 926, 0, 0, 78, 0, 0,
2733 0, 0, 0, 100, 78, 100, 0, 0, 100, 0,
2734 0, 0, 0, 0, 0, 0, 78, 0, 928, 78,
2735 1221, 0, 0, 0, 803, 930, 931, 0, 803, 1178,
2736 1180, 1237, 1239, 1240, 1241, 1183, 0, 1185, 0, 1186,
2737 0, 100, 0, 100, 803, 0, 0, 100, 100, 100,
2738 932, 78, 1247, 0, 0, 0, 804, 804, 0, 0,
2739 78, 0, 0, 100, 0, 0, 804, 804, 804, 0,
2740 0, 0, 804, 804, 0, 0, 0, 0, 119, 0,
2741 803, 803, 0, 0, 0, 0, 857, 0, 0, 0,
2742 0, 100, 100, 0, 0, 285, 0, 0, 0, 0,
2743 865, 0, 867, 0, 0, 0, 100, 0, 920, 0,
2744 921, 922, 923, 924, 925, 0, 332, 0, 417, 0,
2745 0, 419, 420, 421, 0, 0, 0, 0, 0, 1232,
2746 1234, 1235, 1236, 926, 0, 0, 0, 0, 0, 285,
2747 0, 0, 100, 0, 0, 0, 0, 0, 0, 0,
2748 0, 0, 0, 0, 0, 1246, 0, 928, 804, 0,
2749 78, 100, 78, 929, 930, 931, 804, 0, 333, 334,
2750 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2751 345, 0, 0, 0, 0, 346, 347, 0, 0, 932,
2752 0, 0, 933, 804, 0, 119, 0, 119, 78, 0,
2753 0, 78, 0, 0, 0, 0, 0, 0, 0, 237,
2754 0, 122, 0, 122, 0, 0, 0, 119, 348, 0,
2755 349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
2756 0, 0, 0, 0, 0, 0, 0, 521, 0, 78,
2757 0, 0, 534, 0, 1003, 0, 0, 0, 0, 0,
2758 804, 0, 0, 0, 0, 0, 0, 0, 0, 100,
2759 0, 100, 122, 122, 285, 0, 286, 0, 0, 100,
2760 0, 0, 0, 0, 0, 78, 78, 0, 0, 100,
2761 0, 100, 100, 1030, 1031, 0, 0, 0, 0, 0,
2762 0, 0, 286, 119, 0, 0, 285, 119, 0, 0,
2763 0, 0, 0, 811, 0, 383, 393, 393, 0, 0,
2764 0, 0, 0, 0, 78, 78, 100, 0, 0, 0,
2765 0, 0, 0, 0, 0, 0, 804, 1073, 0, 0,
2766 804, 0, 0, 0, 0, 620, 622, 0, 0, 0,
2767 0, 0, 119, 0, 273, 119, 804, 0, 0, 0,
2768 0, 0, 0, 1088, 1089, 0, 0, 100, 0, 0,
2769 0, 100, 100, 0, 0, 100, 0, 0, 0, 100,
2770 100, 0, 0, 0, 0, 1111, 100, 100, 0, 0,
2771 0, 622, 804, 804, 273, 0, 920, 78, 921, 922,
2772 923, 924, 925, 0, 0, 0, 0, 0, 0, 811,
2773 811, 0, 0, 0, 0, 0, 100, 0, 100, 100,
2774 121, 926, 121, 0, 0, 0, 0, 0, 122, 333,
2775 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2776 678, 0, 0, 0, 0, 928, 346, 347, 0, 0,
2777 0, 929, 930, 931, 119, 0, 0, 0, 0, 119,
2778 0, 122, 0, 122, 0, 0, 1172, 0, 0, 0,
2779 0, 121, 121, 1176, 0, 119, 122, 932, 122, 118,
2780 933, 118, 119, 351, 352, 353, 354, 355, 356, 357,
2781 358, 0, 958, 0, 119, 0, 0, 119, 0, 286,
2782 0, 0, 0, 0, 811, 811, 100, 0, 0, 0,
2783 0, 0, 0, 0, 811, 811, 811, 0, 100, 0,
2784 811, 811, 0, 100, 100, 1013, 0, 0, 122, 119,
2785 118, 118, 0, 122, 284, 0, 0, 0, 119, 100,
2786 744, 0, 745, 0, 0, 0, 100, 122, 286, 0,
2787 538, 0, 0, 0, 0, 622, 0, 273, 100, 0,
2788 284, 100, 0, 0, 0, 0, 0, 0, 0, 85,
2789 0, 85, 0, 381, 391, 391, 391, 0, 0, 0,
2790 0, 0, 0, 0, 0, 122, 0, 0, 0, 122,
2791 392, 122, 0, 100, 0, 0, 0, 0, 0, 0,
2792 774, 0, 100, 0, 0, 0, 811, 0, 0, 0,
2793 0, 0, 0, 0, 811, 0, 0, 0, 0, 622,
2794 85, 85, 0, 0, 0, 0, 0, 121, 825, 0,
2795 0, 0, 0, 538, 538, 0, 0, 0, 119, 0,
2796 119, 811, 0, 847, 0, 0, 0, 0, 0, 0,
2797 0, 0, 0, 0, 0, 0, 0, 0, 0, 805,
2798 121, 0, 121, 378, 0, 0, 0, 0, 0, 0,
2799 0, 0, 0, 0, 0, 121, 119, 121, 0, 119,
2800 0, 0, 392, 806, 122, 0, 118, 0, 0, 0,
2801 0, 0, 0, 0, 875, 0, 0, 0, 811, 0,
2802 0, 286, 100, 0, 100, 0, 0, 0, 0, 0,
2803 0, 0, 0, 0, 0, 0, 0, 0, 0, 118,
2804 0, 118, 0, 807, 0, 0, 0, 121, 0, 0,
2805 0, 0, 121, 0, 118, 0, 118, 0, 0, 0,
2806 100, 0, 0, 100, 0, 286, 121, 0, 0, 121,
2807 0, 0, 0, 119, 119, 805, 805, 284, 920, 0,
2808 921, 922, 923, 924, 925, 0, 0, 913, 0, 0,
2809 0, 0, 0, 0, 811, 0, 85, 0, 811, 806,
2810 806, 100, 0, 926, 121, 0, 118, 273, 121, 0,
2811 121, 118, 0, 0, 811, 0, 0, 927, 0, 0,
2812 0, 122, 0, 122, 0, 118, 284, 928, 0, 85,
2813 0, 85, 0, 929, 930, 931, 0, 100, 100, 807,
2814 807, 0, 0, 122, 85, 0, 85, 0, 0, 0,
2815 811, 811, 121, 121, 0, 1020, 0, 0, 0, 932,
2816 0, 0, 933, 118, 0, 0, 0, 118, 0, 118,
2817 805, 805, 0, 0, 0, 0, 100, 100, 0, 0,
2818 805, 805, 805, 1035, 0, 119, 805, 805, 0, 0,
2819 286, 0, 0, 0, 806, 806, 85, 0, 0, 764,
2820 0, 85, 0, 121, 806, 806, 806, 0, 0, 0,
2821 806, 806, 0, 0, 0, 85, 0, 0, 532, 122,
2822 0, 0, 286, 122, 538, 0, 0, 0, 0, 0,
2823 0, 538, 538, 0, 807, 807, 0, 0, 538, 538,
2824 0, 0, 0, 0, 807, 807, 807, 0, 0, 100,
2825 807, 807, 0, 85, 0, 0, 0, 85, 0, 85,
2826 1104, 0, 118, 0, 0, 0, 0, 0, 122, 0,
2827 0, 122, 805, 1113, 0, 0, 0, 0, 0, 284,
2828 805, 0, 0, 0, 920, 0, 921, 922, 923, 924,
2829 925, 0, 0, 0, 0, 0, 806, 0, 0, 0,
2830 0, 532, 532, 0, 806, 0, 0, 805, 0, 926,
2831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2832 121, 0, 121, 284, 0, 0, 0, 0, 0, 0,
2833 0, 806, 0, 928, 0, 0, 807, 0, 0, 929,
2834 930, 931, 121, 0, 807, 0, 0, 0, 0, 0,
2835 0, 0, 85, 0, 0, 0, 0, 0, 538, 0,
2836 0, 0, 0, 0, 805, 932, 0, 0, 933, 0,
2837 122, 807, 0, 0, 0, 122, 0, 0, 0, 118,
2838 0, 118, 0, 0, 0, 0, 0, 0, 806, 0,
2839 0, 122, 0, 0, 0, 0, 0, 0, 122, 0,
2840 0, 118, 0, 0, 0, 0, 0, 0, 0, 0,
2841 122, 0, 0, 122, 0, 0, 0, 0, 121, 0,
2842 0, 0, 121, 121, 0, 0, 0, 0, 807, 0,
2843 121, 121, 0, 0, 0, 0, 0, 121, 121, 0,
2844 805, 1014, 0, 0, 805, 122, 0, 0, 284, 0,
2845 0, 0, 0, 0, 122, 0, 808, 0, 0, 0,
2846 805, 0, 0, 0, 806, 0, 0, 121, 806, 85,
2847 121, 85, 0, 0, 0, 0, 0, 118, 0, 0,
2848 284, 118, 0, 0, 806, 809, 0, 0, 0, 0,
2849 0, 85, 0, 0, 0, 0, 805, 805, 0, 0,
2850 0, 0, 0, 0, 807, 0, 393, 0, 807, 0,
2851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2852 806, 806, 0, 0, 807, 0, 118, 0, 0, 118,
2853 810, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2855 0, 0, 808, 808, 122, 0, 122, 121, 0, 0,
2856 807, 807, 0, 0, 0, 0, 0, 85, 0, 121,
2857 0, 85, 532, 0, 121, 0, 0, 0, 0, 532,
2858 532, 809, 809, 0, 0, 0, 532, 532, 0, 0,
2859 121, 0, 122, 0, 0, 122, 0, 121, 393, 0,
2860 0, 0, 0, 0, 0, 0, 0, 0, 0, 121,
2861 0, 0, 121, 0, 0, 0, 85, 0, 0, 85,
2862 0, 0, 0, 0, 0, 0, 810, 810, 118, 0,
2863 0, 0, 0, 118, 0, 0, 0, 0, 0, 0,
2864 0, 0, 0, 0, 121, 0, 0, 808, 808, 118,
2865 0, 0, 0, 121, 0, 0, 118, 808, 808, 808,
2866 0, 0, 0, 808, 808, 0, 0, 0, 118, 122,
2867 122, 118, 0, 0, 0, 0, 809, 809, 0, 0,
2868 0, 0, 0, 0, 0, 0, 809, 809, 809, 0,
2869 0, 0, 809, 809, 0, 0, 0, 0, 0, 1012,
2870 0, 0, 0, 118, 0, 0, 532, 0, 0, 0,
2871 0, 0, 118, 0, 0, 0, 0, 0, 85, 0,
2872 0, 810, 810, 85, 0, 0, 0, 0, 0, 0,
2873 0, 810, 810, 810, 0, 217, 217, 810, 810, 85,
2874 0, 0, 0, 0, 0, 0, 85, 0, 0, 808,
2875 0, 0, 0, 121, 0, 121, 0, 808, 85, 0,
2876 0, 85, 0, 0, 391, 0, 0, 250, 253, 254,
2877 255, 0, 0, 0, 217, 217, 0, 0, 809, 0,
2878 0, 122, 0, 0, 808, 0, 809, 303, 304, 1010,
2879 0, 121, 0, 85, 121, 0, 0, 0, 0, 0,
2880 0, 0, 85, 0, 0, 0, 0, 0, 23, 24,
2881 25, 26, 118, 809, 118, 0, 0, 0, 0, 217,
2882 0, 0, 0, 810, 32, 33, 34, 0, 0, 0,
2883 0, 810, 0, 0, 41, 42, 43, 44, 45, 0,
2884 0, 808, 0, 0, 0, 0, 0, 0, 0, 0,
2885 118, 0, 0, 118, 0, 0, 391, 0, 810, 0,
2886 0, 0, 0, 0, 0, 0, 0, 0, 121, 121,
2887 809, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2888 0, 0, 0, 0, 0, 792, 59, 60, 61, 62,
2889 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
2890 0, 0, 85, 0, 85, 0, 0, 0, 0, 0,
2891 0, 0, 0, 0, 279, 810, 0, 808, 0, 0,
2892 0, 808, 0, 0, 0, 0, 217, 118, 118, 217,
2893 217, 217, 0, 303, 0, 0, 0, 808, 0, 0,
2894 85, 0, 0, 85, 0, 0, 809, 0, 0, 217,
2895 809, 217, 217, 0, 0, 0, 0, 0, 0, 0,
2896 0, 0, 0, 0, 0, 0, 809, 0, 0, 0,
2897 0, 0, 0, 808, 808, 0, 0, 0, 0, 0,
2898 121, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2899 0, 810, 0, 0, 0, 810, 0, 0, 0, 0,
2900 0, 0, 809, 809, 0, 0, 0, 0, 0, 0,
2901 0, 810, 0, 0, 0, 0, 0, 85, 85, 0,
2902 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2903 0, 0, 0, 0, 0, 0, 0, 0, 0, 118,
2904 0, 0, 0, 0, 0, 217, 0, 810, 810, 0,
2905 533, 0, 540, 541, 542, 543, 544, 0, 0, 545,
2906 546, 547, 548, 549, 550, 551, 552, 553, 0, 0,
2907 554, 555, 556, 557, 558, 559, 560, 561, 562, 563,
2908 0, 0, 0, 217, 0, 0, 0, 0, 0, 0,
2909 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2910 0, 0, 0, 0, 0, 0, 0, 333, 334, 335,
2911 336, 337, 338, 339, 340, 341, 342, 343, 344, 345,
2912 0, 0, 0, 0, 346, 347, 0, 0, 0, 85,
2913 0, 0, 0, 614, 614, 0, 0, 0, 0, 0,
2914 0, 0, 614, 217, 217, 0, 0, 0, 217, 0,
2915 614, 614, 217, 0, 0, 0, 0, 348, 255, 349,
2916 350, 351, 352, 353, 354, 355, 356, 357, 358, 0,
2917 0, 0, 0, 640, 0, 0, 0, 0, 614, 0,
2918 0, 0, 0, 237, 0, 0, 0, 0, 0, 217,
2919 0, 0, 217, 0, 0, 0, 0, 0, 0, -738,
2920 0, 0, 0, 217, 0, 0, 0, -738, -738, -738,
2921 0, 0, -738, -738, -738, 0, -738, 0, 0, 0,
2922 0, 670, 0, 0, -738, -738, -738, -738, -738, 0,
2923 0, 0, 0, 0, 0, 0, -738, -738, 217, -738,
2924 -738, -738, -738, -738, 0, 0, 0, 0, 0, 0,
2925 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2926 0, 0, 0, 0, 0, 0, 0, -738, 0, 0,
2927 0, 0, 0, 0, 0, 0, -738, -738, -738, -738,
2928 -738, -738, -738, -738, -738, -738, -738, -738, -738, 0,
2929 0, 0, 0, -738, -738, -738, -738, 0, 747, -738,
2930 0, 0, 0, 0, 0, -738, 0, 0, 0, 0,
2931 0, 217, 0, 0, 0, 0, 0, 0, 0, -738,
2932 0, 217, -738, 0, 0, -116, -738, -738, -738, -738,
2933 -738, -738, -738, -738, -738, -738, -738, -738, 217, 0,
2934 217, 0, -738, -738, -738, -738, 0, 0, -738, -738,
2935 -738, 0, -738, 217, 0, 217, 0, 0, 0, -761,
2936 0, 0, 0, 0, 0, 0, 0, -761, -761, -761,
2937 0, 0, -761, -761, -761, 0, -761, 0, 0, 0,
2938 0, 0, 0, 0, -761, -761, -761, 0, 0, 0,
2939 0, 0, 0, 0, 0, 0, -761, -761, 217, -761,
2940 -761, -761, -761, -761, 614, 778, 0, 217, 0, 0,
2941 0, 614, 614, 0, 0, 0, 0, 217, 614, 614,
2942 0, 0, 0, 0, 0, 0, 217, -761, 0, 0,
2943 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2944 0, 217, 0, 0, 0, 0, 0, 0, 0, 0,
2945 0, 0, 0, 0, 0, -761, -761, 0, 0, 0,
2946 0, 0, 0, 0, 0, 0, 614, 614, 0, 614,
2947 614, 23, 24, 25, 26, 0, 0, 0, 0, -761,
2948 0, 0, 0, 0, 0, 0, 0, 32, 33, 34,
2949 784, 0, 217, 0, 785, 0, 986, 41, 42, 43,
2950 44, 45, -761, -761, 0, 0, 0, 233, -761, 0,
2951 -761, 0, -761, 0, 0, 926, 0, 0, 0, 0,
2952 0, 0, 0, 0, 0, 0, 0, 0, 786, 787,
2953 0, 899, 0, 0, 0, 0, 788, 0, 614, 789,
2954 0, 0, 790, 791, 0, 980, 930, 0, 792, 59,
2955 1004, 61, 62, 63, 64, 65, 66, 0, 0, 0,
2956 0, 0, 0, 0, 0, 217, 0, 0, 0, 0,
2957 793, 0, 0, 0, 0, -761, 4, 279, 5, 6,
2958 7, 8, 9, 614, 0, 217, 10, 11, 0, 0,
2959 0, 12, 0, 13, 14, 15, 16, 17, 18, 19,
2960 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
2961 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
2962 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
2963 38, 39, 40, 217, 41, 42, 43, 44, 45, 46,
2964 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2965 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
2966 0, 217, 0, 0, 0, 50, 51, 0, 0, 0,
2967 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
2968 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
2969 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
2970 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2971 0, 0, 0, 0, 67, 68, 69, 0, 0, 0,
2972 0, 0, 0, 0, 0, 0, -761, 0, -761, 0,
2973 0, 0, 0, 0, 0, 0, 0, 0, 217, -631,
2974 0, 0, 0, 0, 0, 0, 0, -631, -631, -631,
2975 0, 217, -631, -631, -631, 0, -631, 0, 0, 0,
2976 0, 686, 0, 0, -631, 0, -631, -631, -631, 0,
2977 0, 0, 0, 0, 0, 0, -631, -631, 0, -631,
2978 -631, -631, -631, -631, 0, 0, 0, 0, 0, 0,
2979 0, 0, 0, 0, 333, 334, 335, 336, 337, 338,
2980 339, 340, 341, 342, 343, 344, 345, -631, 0, 0,
2981 0, 346, 347, 217, 0, 0, -631, -631, -631, -631,
2982 -631, -631, -631, -631, -631, -631, -631, -631, -631, 0,
2983 0, 0, 0, -631, -631, -631, -631, 0, -631, -631,
2984 0, 0, 0, 0, 348, -631, 349, 350, 351, 352,
2985 353, 354, 355, 356, 357, 358, 0, 0, 0, -631,
2986 0, 0, -631, -257, 0, -631, -631, -631, -631, -631,
2987 -631, -631, -631, -631, -631, -631, -631, -631, 0, 0,
2988 0, 0, 0, -631, -631, -631, -634, 0, -631, -631,
2989 -631, 0, -631, 0, -634, -634, -634, 0, 0, -634,
2990 -634, -634, 0, -634, 0, 0, 0, 0, 686, 0,
2991 0, -634, 0, -634, -634, -634, 0, 0, 0, 0,
2992 0, 0, 0, -634, -634, 0, -634, -634, -634, -634,
2993 -634, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2994 0, 333, 334, 335, 336, 337, 338, 339, 340, 341,
2995 342, 343, 344, 345, -634, 0, 0, 0, 346, 347,
2996 0, 0, 0, -634, -634, -634, -634, -634, -634, -634,
2997 -634, -634, -634, -634, -634, -634, 0, 0, 0, 0,
2998 -634, -634, -634, -634, 0, -634, -634, 0, 0, 0,
2999 0, 348, -634, 349, 350, 351, 352, 353, 354, 355,
3000 356, 357, 358, 0, 0, 0, -634, 0, 0, -634,
3001 0, 0, -634, -634, -634, -634, -634, -634, -634, -634,
3002 -634, -634, -634, -634, -634, 0, 0, 0, 0, 0,
3003 -634, -634, -634, -739, 0, -634, -634, -634, 0, -634,
3004 0, -739, -739, -739, 0, 0, -739, -739, -739, 0,
3005 -739, 0, 0, 0, 0, 0, 0, 0, -739, -739,
3006 -739, -739, -739, 0, 0, 0, 0, 0, 0, 0,
3007 -739, -739, 0, -739, -739, -739, -739, -739, 0, 0,
3008 0, 0, 0, 0, 0, 0, 0, 0, 333, 334,
3009 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
3010 345, -739, 0, 0, 0, 346, 347, 0, 0, 0,
3011 -739, -739, -739, -739, -739, -739, -739, -739, -739, -739,
3012 -739, -739, -739, 0, 0, 0, 0, -739, -739, -739,
3013 -739, 0, 0, -739, 0, 0, 0, 0, 348, -739,
3014 349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
3015 0, 0, 0, -739, 0, 0, -739, 0, 0, 0,
3016 -739, -739, -739, -739, -739, -739, -739, -739, -739, -739,
3017 -739, -739, 0, 0, 0, 0, -739, -739, -739, -739,
3018 -740, 0, -739, -739, -739, 0, -739, 0, -740, -740,
3019 -740, 0, 0, -740, -740, -740, 0, -740, 0, 0,
3020 0, 0, 0, 0, 0, -740, -740, -740, -740, -740,
3021 0, 0, 0, 0, 0, 0, 0, -740, -740, 0,
3022 -740, -740, -740, -740, -740, 0, 0, 0, 0, 0,
3023 0, 0, 0, 0, 0, 333, 334, 335, 336, 337,
3024 338, 339, 340, 341, 342, 343, -762, -762, -740, 0,
3025 0, 0, 346, 347, 0, 0, 0, -740, -740, -740,
3026 -740, -740, -740, -740, -740, -740, -740, -740, -740, -740,
3027 0, 0, 0, 0, -740, -740, -740, -740, 0, 0,
3028 -740, 0, 0, 0, 0, 0, -740, 349, 350, 351,
3029 352, 353, 354, 355, 356, 357, 358, 0, 0, 0,
3030 -740, 0, 0, -740, 0, 0, 0, -740, -740, -740,
3031 -740, -740, -740, -740, -740, -740, -740, -740, -740, 0,
3032 0, 0, 0, -740, -740, -740, -740, -311, 0, -740,
3033 -740, -740, 0, -740, 0, -311, -311, -311, 0, 0,
3034 -311, -311, -311, 0, -311, 0, 0, 0, 0, 0,
3035 0, 0, -311, 0, -311, -311, -311, 0, 0, 0,
3036 0, 0, 0, 0, -311, -311, 0, -311, -311, -311,
3037 -311, -311, 0, 0, 0, 0, 0, 0, 0, 0,
3038 0, 0, 333, 334, 335, 336, 337, 338, 339, 340,
3039 0, 342, 343, 0, 0, -311, 0, 0, 0, 346,
3040 347, 0, 0, 0, -311, -311, -311, -311, -311, -311,
3041 -311, -311, -311, -311, -311, -311, -311, 0, 0, 0,
3042 0, -311, -311, -311, -311, 0, 748, -311, 0, 0,
3043 0, 0, 0, -311, 349, 350, 351, 352, 353, 354,
3044 355, 356, 357, 358, 0, 0, 0, -311, 0, 0,
3045 -311, 0, 0, -118, -311, -311, -311, -311, -311, -311,
3046 -311, -311, -311, -311, -311, -311, 0, 0, 0, 0,
3047 0, -311, -311, -311, -450, 0, -311, -311, -311, 0,
3048 -311, 0, -450, -450, -450, 0, 0, -450, -450, -450,
3049 0, -450, 0, 0, 0, 0, 0, 0, 0, -450,
3050 -450, -450, -450, 0, 0, 0, 0, 0, 0, 0,
3051 0, -450, -450, 0, -450, -450, -450, -450, -450, 0,
3052 0, 0, 0, 0, 0, 0, 0, 0, 0, 333,
3053 -762, -762, -762, -762, 338, 339, 0, 0, -762, -762,
3054 0, 0, -450, 0, 0, 0, 346, 347, 0, 0,
3055 0, -450, -450, -450, -450, -450, -450, -450, -450, -450,
3056 -450, -450, -450, -450, 0, 0, 0, 0, -450, -450,
3057 -450, -450, 0, 0, -450, 0, 0, 0, 0, 0,
3058 -450, 349, 350, 351, 352, 353, 354, 355, 356, 357,
3059 358, 0, 0, 0, -450, 0, 0, 0, 0, 0,
3060 0, -450, 0, -450, -450, -450, -450, -450, -450, -450,
3061 -450, -450, -450, 0, 0, 0, 0, -450, -450, -450,
3062 -450, -303, 233, -450, -450, -450, 0, -450, 0, -303,
3063 -303, -303, 0, 0, -303, -303, -303, 0, -303, 0,
3064 0, 0, 0, 0, 0, 0, -303, 0, -303, -303,
3065 -303, 0, 0, 0, 0, 0, 0, 0, -303, -303,
3066 0, -303, -303, -303, -303, -303, 0, 0, 0, 0,
3067 0, 0, 0, 0, 0, 0, 333, 334, 335, 336,
3068 337, 338, 339, 0, 0, 342, 343, 0, 0, -303,
3069 0, 0, 0, 346, 347, 0, 0, 0, -303, -303,
3070 -303, -303, -303, -303, -303, -303, -303, -303, -303, -303,
3071 -303, 0, 0, 0, 0, -303, -303, -303, -303, 0,
3072 0, -303, 0, 0, 0, 0, 0, -303, 349, 350,
3073 351, 352, 353, 354, 355, 356, 357, 358, 0, 0,
3074 0, -303, 0, 0, -303, 0, 0, 0, -303, -303,
3075 -303, -303, -303, -303, -303, -303, -303, -303, -303, -303,
3076 0, 0, 0, 0, 0, -303, -303, -303, -761, 0,
3077 -303, -303, -303, 0, -303, 0, -761, -761, -761, 0,
3078 0, -761, -761, -761, 0, -761, 0, 0, 0, 0,
3079 0, 0, 0, -761, -761, -761, -761, 0, 0, 0,
3080 0, 0, 0, 0, 0, -761, -761, 0, -761, -761,
3081 -761, -761, -761, 0, 0, 0, 0, 0, 0, 0,
3082 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3083 0, 0, 0, 0, 0, 0, -761, 0, 0, 0,
3084 0, 0, 0, 0, 0, -761, -761, -761, -761, -761,
3085 -761, -761, -761, -761, -761, -761, -761, -761, 0, 0,
3086 0, 0, -761, -761, -761, -761, 0, 0, -761, 0,
3087 0, 0, 0, 0, -761, 0, 0, 0, 0, 0,
3088 0, 0, 0, 0, 0, 0, 0, 0, -761, 0,
3089 0, 0, 0, 0, 0, -761, 0, -761, -761, -761,
3090 -761, -761, -761, -761, -761, -761, -761, 0, 0, 0,
3091 0, -761, -761, -761, -761, -318, 233, -761, -761, -761,
3092 0, -761, 0, -318, -318, -318, 0, 0, -318, -318,
3093 -318, 0, -318, 0, 0, 0, 0, 0, 0, 0,
3094 -318, 0, -318, -318, 0, 0, 0, 0, 0, 0,
3095 0, 0, -318, -318, 0, -318, -318, -318, -318, -318,
3096 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3097 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3098 0, 0, 0, -318, 0, 0, 0, 0, 0, 0,
3099 0, 0, -318, -318, -318, -318, -318, -318, -318, -318,
3100 -318, -318, -318, -318, -318, 0, 0, 0, 0, -318,
3101 -318, -318, -318, 0, 0, -318, 0, 0, 0, 0,
3102 0, -318, 0, 0, 0, 0, 0, 0, 0, 0,
3103 0, 0, 0, 0, 0, -318, 0, 0, 0, 0,
3104 0, 0, -318, 0, -318, -318, -318, -318, -318, -318,
3105 -318, -318, -318, -318, 0, 0, 0, 0, 0, -318,
3106 -318, -318, -738, 230, -318, -318, -318, 0, -318, 0,
3107 -738, -738, -738, 0, 0, 0, -738, -738, 0, -738,
3108 0, 0, 0, 0, 0, 0, 0, -738, -738, 0,
3109 0, 0, 0, 0, 0, 0, 0, 0, 0, -738,
3110 -738, 0, -738, -738, -738, -738, -738, 0, 0, 0,
3111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3113 -738, 0, 0, 0, 0, 0, 0, 0, 0, -738,
3114 -738, -738, -738, -738, -738, -738, -738, -738, -738, -738,
3115 -738, -738, 0, 0, 0, 0, -738, -738, -738, -738,
3116 0, 692, 0, 0, 0, 0, 0, 0, 0, 0,
3117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3118 0, 0, -738, 0, 0, 0, 0, 0, -116, -738,
3119 0, -738, -738, -738, -738, -738, -738, -738, -738, -738,
3120 -738, 0, 0, 0, 0, -738, -738, -738, -107, -738,
3121 0, -738, 0, -738, 0, -738, 0, -738, -738, -738,
3122 0, 0, 0, -738, -738, 0, -738, 0, 0, 0,
3123 0, 0, 0, 0, -738, -738, 0, 0, 0, 0,
3124 0, 0, 0, 0, 0, 0, -738, -738, 0, -738,
3125 -738, -738, -738, -738, 0, 0, 0, 0, 0, 0,
3126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3127 0, 0, 0, 0, 0, 0, 0, -738, 0, 0,
3128 0, 0, 0, 0, 0, 0, -738, -738, -738, -738,
3129 -738, -738, -738, -738, -738, -738, -738, -738, -738, 0,
3130 0, 0, 0, -738, -738, -738, -738, 0, 692, 0,
3131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3132 0, 0, 0, 0, 0, 0, 0, 0, 0, -738,
3133 0, 0, 0, 0, 0, -116, -738, 0, -738, -738,
3134 -738, -738, -738, -738, -738, -738, -738, -738, 0, 0,
3135 0, 0, -738, -738, -738, -738, -311, 0, -738, 0,
3136 -738, 0, -738, 0, -311, -311, -311, 0, 0, 0,
3137 -311, -311, 0, -311, 0, 0, 0, 0, 0, 0,
3138 0, -311, 0, 0, 0, 0, 0, 0, 0, 0,
3139 0, 0, 0, -311, -311, 0, -311, -311, -311, -311,
3140 -311, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3142 0, 0, 0, 0, -311, 0, 0, 0, 0, 0,
3143 0, 0, 0, -311, -311, -311, -311, -311, -311, -311,
3144 -311, -311, -311, -311, -311, -311, 0, 0, 0, 0,
3145 -311, -311, -311, -311, 0, 693, 0, 0, 0, 0,
3146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3147 0, 0, 0, 0, 0, 0, -311, 0, 0, 0,
3148 0, 0, -118, -311, 0, -311, -311, -311, -311, -311,
3149 -311, -311, -311, -311, -311, 0, 0, 0, 0, 0,
3150 -311, -311, -109, -311, 0, -311, 0, -311, 0, -311,
3151 0, -311, -311, -311, 0, 0, 0, -311, -311, 0,
3152 -311, 0, 0, 0, 0, 0, 0, 0, -311, 0,
3153 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3154 -311, -311, 0, -311, -311, -311, -311, -311, 0, 0,
3155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3156 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3157 0, -311, 0, 0, 0, 0, 0, 0, 0, 0,
3158 -311, -311, -311, -311, -311, -311, -311, -311, -311, -311,
3159 -311, -311, -311, 0, 0, 0, 0, -311, -311, -311,
3160 -311, 0, 693, 0, 0, 0, 0, 0, 0, 0,
3161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3162 0, 0, 0, -311, 0, 0, 0, 0, 0, -118,
3163 -311, 0, -311, -311, -311, -311, -311, -311, -311, -311,
3164 -311, -311, 0, 0, 0, 0, 0, -311, -311, -311,
3165 0, 0, -311, 0, -311, 257, -311, 5, 6, 7,
3166 8, 9, -761, -761, -761, 10, 11, 0, 0, -761,
3167 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3168 0, 0, 0, 0, 20, 21, 22, 23, 24, 25,
3169 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3170 29, 258, 31, 32, 33, 34, 35, 36, 37, 38,
3171 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3172 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3173 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3174 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3175 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
3176 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
3177 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3179 0, 0, 0, 67, 68, 69, 0, 0, 0, 0,
3180 0, 0, 0, 0, 0, -761, 257, -761, 5, 6,
3181 7, 8, 9, 0, 0, -761, 10, 11, 0, -761,
3182 -761, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3183 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3184 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
3185 28, 29, 258, 31, 32, 33, 34, 35, 36, 37,
3186 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3187 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3188 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3189 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3190 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3191 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3192 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3193 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3194 0, 0, 0, 0, 67, 68, 69, 0, 0, 0,
3195 0, 0, 0, 0, 0, 0, -761, 257, -761, 5,
3196 6, 7, 8, 9, 0, 0, -761, 10, 11, 0,
3197 0, -761, 12, -761, 13, 14, 15, 16, 17, 18,
3198 19, 0, 0, 0, 0, 0, 20, 21, 22, 23,
3199 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3200 0, 28, 29, 258, 31, 32, 33, 34, 35, 36,
3201 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3202 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3203 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3204 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3205 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3206 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3207 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3208 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3209 0, 0, 0, 0, 0, 67, 68, 69, 0, 0,
3210 0, 0, 0, 0, 0, 0, 0, -761, 257, -761,
3211 5, 6, 7, 8, 9, 0, 0, -761, 10, 11,
3212 0, 0, -761, 12, 0, 13, 14, 15, 16, 17,
3213 18, 19, -761, 0, 0, 0, 0, 20, 21, 22,
3214 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
3215 0, 0, 28, 29, 258, 31, 32, 33, 34, 35,
3216 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3217 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3218 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3219 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3220 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
3221 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3222 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3224 0, 0, 0, 0, 0, 0, 67, 68, 69, 0,
3225 0, 0, 0, 0, 0, 0, 0, 0, -761, 257,
3226 -761, 5, 6, 7, 8, 9, 0, 0, -761, 10,
3227 11, 0, 0, -761, 12, 0, 13, 14, 15, 16,
3228 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
3229 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3230 0, 0, 0, 28, 29, 258, 31, 32, 33, 34,
3231 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3232 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3233 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3234 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3235 0, 0, 0, 0, 0, 0, 52, 0, 0, 53,
3236 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3237 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3238 0, 0, 0, 0, 0, 257, 0, 5, 6, 7,
3239 8, 9, 0, -761, -761, 10, 11, 67, 68, 69,
3240 12, 0, 13, 14, 15, 16, 17, 18, 19, -761,
3241 0, -761, 0, 0, 20, 21, 22, 23, 24, 25,
3242 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3243 29, 258, 31, 32, 33, 34, 35, 36, 37, 38,
3244 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3245 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3246 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3247 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3248 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
3249 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
3250 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3251 0, 257, 0, 5, 6, 7, 8, 9, 0, 0,
3252 0, 10, 11, 67, 68, 69, 12, 0, 13, 14,
3253 15, 16, 17, 18, 19, -761, 0, -761, 0, 0,
3254 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3255 0, 0, 0, 0, 0, 28, 29, 258, 31, 32,
3256 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3257 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3258 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3260 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
3261 0, 259, 54, 0, 55, 56, 0, 57, 0, 0,
3262 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3263 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3264 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,
3265 68, 69, 0, 0, 0, 0, 0, 0, 0, -761,
3266 0, -761, 257, -761, 5, 6, 7, 8, 9, 0,
3267 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
3268 14, 15, 16, 17, 18, 19, 0, 0, 0, 0,
3269 0, 20, 21, 22, 23, 24, 25, 26, 0, 0,
3270 27, 0, 0, 0, 0, 0, 28, 29, 258, 31,
3271 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3272 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3273 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3274 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3275 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3276 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3277 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3279 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3280 67, 68, 69, 0, 0, 0, 0, 0, 0, 0,
3281 -761, 0, -761, 4, -761, 5, 6, 7, 8, 9,
3282 0, 0, 0, 10, 11, 0, 0, 0, 12, 0,
3283 13, 14, 15, 16, 17, 18, 19, 0, 0, 0,
3284 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3285 0, 27, 0, 0, 0, 0, 0, 28, 29, 30,
3286 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3287 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3288 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3290 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3291 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3292 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3293 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3294 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3295 0, 67, 68, 69, 0, 0, -761, 0, 0, 0,
3296 0, 0, 0, -761, 257, -761, 5, 6, 7, 8,
3297 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
3298 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3299 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3300 0, 0, 27, 0, 0, 0, 0, 0, 28, 29,
3301 258, 31, 32, 33, 34, 35, 36, 37, 38, 39,
3302 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3303 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3304 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3305 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3306 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3307 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3308 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3309 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3310 0, 0, 67, 68, 69, 0, 0, -761, 0, 0,
3311 0, 0, 0, 0, -761, 257, -761, 5, 6, 7,
3312 8, 9, 0, 0, -761, 10, 11, 0, 0, 0,
3313 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3314 0, 0, 0, 0, 20, 21, 22, 23, 24, 25,
3315 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3316 29, 258, 31, 32, 33, 34, 35, 36, 37, 38,
3317 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3318 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3319 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3320 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3321 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
3322 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
3323 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3324 0, 257, 0, 5, 6, 7, 8, 9, 0, 0,
3325 0, 10, 11, 67, 68, 69, 12, 0, 13, 14,
3326 15, 16, 17, 18, 19, -761, 0, -761, 0, 0,
3327 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3328 0, 0, 0, 0, 0, 28, 29, 258, 31, 32,
3329 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3330 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3331 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3333 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
3334 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
3335 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3336 -761, 0, 0, 0, 0, 0, 0, 0, 0, 5,
3337 6, 7, 0, 9, 0, 0, 0, 10, 11, 67,
3338 68, 69, 12, 0, 13, 14, 15, 16, 17, 18,
3339 19, -761, 0, -761, 0, 0, 20, 21, 22, 23,
3340 24, 25, 26, 0, 0, 206, 0, 0, 0, 0,
3341 0, 0, 29, 0, 0, 32, 33, 34, 35, 36,
3342 37, 38, 39, 40, 207, 41, 42, 43, 44, 45,
3343 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3344 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3345 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3346 0, 0, 0, 0, 208, 0, 0, 209, 54, 0,
3347 55, 56, 0, 210, 211, 212, 58, 59, 213, 61,
3348 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3349 0, 0, 0, 0, 0, 5, 6, 7, 0, 9,
3350 0, 0, 0, 10, 11, 67, 214, 69, 12, 0,
3351 13, 14, 15, 16, 17, 18, 19, 0, 0, 237,
3352 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3353 0, 27, 0, 0, 0, 0, 0, 0, 29, 0,
3354 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3355 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3356 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3358 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3359 208, 0, 0, 209, 54, 0, 55, 56, 0, 0,
3360 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3361 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3362 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
3363 11, 67, 68, 69, 12, 0, 13, 14, 15, 16,
3364 17, 18, 19, 305, 0, 306, 0, 0, 20, 21,
3365 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3366 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
3367 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3368 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3369 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3370 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3371 0, 0, 0, 0, 0, 0, 208, 0, 0, 209,
3372 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
3373 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3374 0, 0, 0, 0, 0, 0, 0, 5, 6, 7,
3375 8, 9, 0, 0, 0, 10, 11, 67, 68, 69,
3376 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3377 0, 237, 0, 0, 20, 21, 22, 23, 24, 25,
3378 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3379 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
3380 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3381 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3382 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3383 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3384 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
3385 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
3386 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3387 0, 0, 0, 5, 6, 7, 8, 9, 0, 0,
3388 0, 10, 11, 67, 68, 69, 12, 0, 13, 14,
3389 15, 16, 17, 18, 19, 503, 0, 0, 0, 0,
3390 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3391 0, 0, 0, 0, 0, 28, 29, 258, 31, 32,
3392 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3393 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3394 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3396 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
3397 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
3398 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3400 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,
3401 68, 69, 0, 0, 0, 0, 0, 0, 0, 0,
3402 0, 503, 126, 127, 128, 129, 130, 131, 132, 133,
3403 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
3404 144, 145, 146, 147, 148, 149, 0, 0, 0, 150,
3405 151, 152, 395, 396, 397, 398, 157, 158, 159, 0,
3406 0, 0, 0, 0, 160, 161, 162, 163, 399, 400,
3407 401, 402, 168, 37, 38, 403, 40, 0, 0, 0,
3408 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3409 0, 0, 0, 0, 170, 171, 172, 173, 174, 175,
3410 176, 177, 178, 0, 0, 179, 180, 0, 0, 0,
3411 0, 181, 182, 183, 184, 0, 0, 0, 0, 0,
3412 0, 0, 0, 0, 0, 0, 185, 186, 0, 0,
3413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3414 0, 0, 0, 0, 0, 0, 0, 0, 187, 188,
3415 189, 190, 191, 192, 193, 194, 195, 196, 0, 197,
3416 198, 0, 0, 0, 0, 0, 199, 404, 126, 127,
3417 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
3418 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
3419 148, 149, 0, 0, 0, 150, 151, 152, 153, 154,
3420 155, 156, 157, 158, 159, 0, 0, 0, 0, 0,
3421 160, 161, 162, 163, 164, 165, 166, 167, 168, 288,
3422 289, 169, 290, 0, 0, 0, 0, 0, 0, 0,
3423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3424 170, 171, 172, 173, 174, 175, 176, 177, 178, 0,
3425 0, 179, 180, 0, 0, 0, 0, 181, 182, 183,
3426 184, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3427 0, 0, 185, 186, 0, 0, 0, 0, 0, 0,
3428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3429 0, 0, 0, 0, 187, 188, 189, 190, 191, 192,
3430 193, 194, 195, 196, 0, 197, 198, 0, 0, 0,
3431 0, 0, 199, 126, 127, 128, 129, 130, 131, 132,
3432 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
3433 143, 144, 145, 146, 147, 148, 149, 0, 0, 0,
3434 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
3435 0, 0, 0, 0, 0, 160, 161, 162, 163, 164,
3436 165, 166, 167, 168, 239, 0, 169, 0, 0, 0,
3437 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3438 0, 0, 0, 0, 0, 170, 171, 172, 173, 174,
3439 175, 176, 177, 178, 0, 0, 179, 180, 0, 0,
3440 0, 0, 181, 182, 183, 184, 0, 0, 0, 0,
3441 0, 0, 0, 0, 0, 0, 0, 185, 186, 0,
3442 0, 59, 0, 0, 0, 0, 0, 0, 0, 0,
3443 0, 0, 0, 0, 0, 0, 0, 0, 0, 187,
3444 188, 189, 190, 191, 192, 193, 194, 195, 196, 0,
3445 197, 198, 0, 0, 0, 0, 0, 199, 126, 127,
3446 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
3447 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
3448 148, 149, 0, 0, 0, 150, 151, 152, 153, 154,
3449 155, 156, 157, 158, 159, 0, 0, 0, 0, 0,
3450 160, 161, 162, 163, 164, 165, 166, 167, 168, 0,
3451 0, 169, 0, 0, 0, 0, 0, 0, 0, 0,
3452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3453 170, 171, 172, 173, 174, 175, 176, 177, 178, 0,
3454 0, 179, 180, 0, 0, 0, 0, 181, 182, 183,
3455 184, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3456 0, 0, 185, 186, 0, 0, 59, 0, 0, 0,
3457 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3458 0, 0, 0, 0, 187, 188, 189, 190, 191, 192,
3459 193, 194, 195, 196, 0, 197, 198, 0, 0, 0,
3460 0, 0, 199, 126, 127, 128, 129, 130, 131, 132,
3461 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
3462 143, 144, 145, 146, 147, 148, 149, 0, 0, 0,
3463 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
3464 0, 0, 0, 0, 0, 160, 161, 162, 163, 164,
3465 165, 166, 167, 168, 0, 0, 169, 0, 0, 0,
3466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3467 0, 0, 0, 0, 0, 170, 171, 172, 173, 174,
3468 175, 176, 177, 178, 0, 0, 179, 180, 0, 0,
3469 0, 0, 181, 182, 183, 184, 0, 0, 0, 0,
3470 0, 0, 0, 0, 0, 0, 0, 185, 186, 0,
3471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3472 0, 0, 0, 0, 0, 0, 0, 0, 0, 187,
3473 188, 189, 190, 191, 192, 193, 194, 195, 196, 0,
3474 197, 198, 5, 6, 7, 0, 9, 199, 0, 0,
3475 10, 11, 0, 0, 0, 12, 0, 13, 14, 15,
3476 245, 246, 18, 19, 0, 0, 0, 0, 0, 20,
3477 247, 248, 23, 24, 25, 26, 0, 0, 206, 0,
3478 0, 0, 0, 0, 0, 277, 0, 0, 32, 33,
3479 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3480 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3482 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3483 0, 0, 0, 0, 0, 0, 0, 278, 0, 0,
3484 209, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3485 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3486 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3487 0, 5, 6, 7, 0, 9, 0, 0, 279, 10,
3488 11, 0, 0, 0, 12, 280, 13, 14, 15, 245,
3489 246, 18, 19, 0, 0, 0, 0, 0, 20, 247,
3490 248, 23, 24, 25, 26, 0, 0, 206, 0, 0,
3491 0, 0, 0, 0, 277, 0, 0, 32, 33, 34,
3492 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3493 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3496 0, 0, 0, 0, 0, 0, 278, 0, 0, 209,
3497 54, 0, 55, 56, 0, 0, 0, 0, 58, 59,
3498 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3500 5, 6, 7, 8, 9, 0, 0, 279, 10, 11,
3501 0, 0, 0, 12, 526, 13, 14, 15, 16, 17,
3502 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3503 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
3504 0, 0, 28, 29, 30, 31, 32, 33, 34, 35,
3505 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3506 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3507 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3508 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3509 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
3510 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3511 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3512 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3513 9, 0, 0, 0, 10, 11, 67, 68, 69, 12,
3514 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3515 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3516 0, 0, 206, 0, 0, 0, 0, 0, 0, 29,
3517 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3518 40, 207, 41, 42, 43, 44, 45, 46, 47, 0,
3519 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3520 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3521 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3522 0, 208, 0, 0, 209, 54, 0, 55, 56, 0,
3523 210, 211, 212, 58, 59, 213, 61, 62, 63, 64,
3524 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3525 0, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3526 10, 11, 67, 214, 69, 12, 0, 13, 14, 15,
3527 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
3528 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
3529 0, 0, 0, 0, 28, 29, 0, 31, 32, 33,
3530 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3531 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3532 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3533 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3534 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3535 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3536 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3537 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3538 7, 0, 9, 0, 0, 0, 10, 11, 67, 68,
3539 69, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3540 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3541 25, 26, 0, 0, 206, 0, 0, 0, 0, 0,
3542 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3543 38, 39, 40, 207, 41, 42, 43, 44, 45, 46,
3544 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3545 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3546 0, 0, 0, 0, 0, 50, 439, 0, 0, 0,
3547 0, 0, 0, 208, 0, 0, 209, 54, 0, 55,
3548 56, 0, 210, 211, 212, 58, 59, 213, 61, 62,
3549 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3550 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3551 0, 0, 10, 11, 67, 214, 69, 12, 0, 13,
3552 14, 15, 245, 246, 18, 19, 0, 0, 0, 0,
3553 0, 20, 247, 248, 23, 24, 25, 26, 0, 0,
3554 206, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3555 32, 33, 34, 35, 36, 37, 38, 39, 40, 207,
3556 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3557 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3558 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3559 0, 50, 51, 0, 0, 0, 0, 0, 0, 208,
3560 0, 0, 209, 54, 0, 55, 56, 0, 621, 211,
3561 212, 58, 59, 213, 61, 62, 63, 64, 65, 66,
3562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3563 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3564 67, 214, 69, 12, 0, 13, 14, 15, 245, 246,
3565 18, 19, 0, 0, 0, 0, 0, 20, 247, 248,
3566 23, 24, 25, 26, 0, 0, 206, 0, 0, 0,
3567 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3568 36, 37, 38, 39, 40, 207, 41, 42, 43, 44,
3569 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3570 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3571 0, 0, 0, 0, 0, 0, 0, 50, 439, 0,
3572 0, 0, 0, 0, 0, 208, 0, 0, 209, 54,
3573 0, 55, 56, 0, 621, 211, 212, 58, 59, 213,
3574 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3575 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3576 9, 0, 0, 0, 10, 11, 67, 214, 69, 12,
3577 0, 13, 14, 15, 245, 246, 18, 19, 0, 0,
3578 0, 0, 0, 20, 247, 248, 23, 24, 25, 26,
3579 0, 0, 206, 0, 0, 0, 0, 0, 0, 29,
3580 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3581 40, 207, 41, 42, 43, 44, 45, 46, 47, 0,
3582 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3584 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3585 0, 208, 0, 0, 209, 54, 0, 55, 56, 0,
3586 210, 211, 0, 58, 59, 213, 61, 62, 63, 64,
3587 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3588 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3589 10, 11, 67, 214, 69, 12, 0, 13, 14, 15,
3590 245, 246, 18, 19, 0, 0, 0, 0, 0, 20,
3591 247, 248, 23, 24, 25, 26, 0, 0, 206, 0,
3592 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3593 34, 35, 36, 37, 38, 39, 40, 207, 41, 42,
3594 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3595 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3596 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3597 51, 0, 0, 0, 0, 0, 0, 208, 0, 0,
3598 209, 54, 0, 55, 56, 0, 0, 211, 212, 58,
3599 59, 213, 61, 62, 63, 64, 65, 66, 0, 0,
3600 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3601 7, 0, 9, 0, 0, 0, 10, 11, 67, 214,
3602 69, 12, 0, 13, 14, 15, 245, 246, 18, 19,
3603 0, 0, 0, 0, 0, 20, 247, 248, 23, 24,
3604 25, 26, 0, 0, 206, 0, 0, 0, 0, 0,
3605 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3606 38, 39, 40, 207, 41, 42, 43, 44, 45, 46,
3607 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3608 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3609 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3610 0, 0, 0, 208, 0, 0, 209, 54, 0, 55,
3611 56, 0, 621, 211, 0, 58, 59, 213, 61, 62,
3612 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3613 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3614 0, 0, 10, 11, 67, 214, 69, 12, 0, 13,
3615 14, 15, 245, 246, 18, 19, 0, 0, 0, 0,
3616 0, 20, 247, 248, 23, 24, 25, 26, 0, 0,
3617 206, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3618 32, 33, 34, 35, 36, 37, 38, 39, 40, 207,
3619 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3620 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3621 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3622 0, 50, 51, 0, 0, 0, 0, 0, 0, 208,
3623 0, 0, 209, 54, 0, 55, 56, 0, 0, 211,
3624 0, 58, 59, 213, 61, 62, 63, 64, 65, 66,
3625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3626 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3627 67, 214, 69, 12, 0, 13, 14, 15, 16, 17,
3628 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3629 23, 24, 25, 26, 0, 0, 206, 0, 0, 0,
3630 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3631 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3632 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3633 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3634 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3635 0, 0, 0, 0, 0, 208, 0, 0, 209, 54,
3636 0, 55, 56, 0, 519, 0, 0, 58, 59, 60,
3637 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3638 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3639 9, 0, 0, 0, 10, 11, 67, 214, 69, 12,
3640 0, 13, 14, 15, 245, 246, 18, 19, 0, 0,
3641 0, 0, 0, 20, 247, 248, 23, 24, 25, 26,
3642 0, 0, 206, 0, 0, 0, 0, 0, 0, 29,
3643 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3644 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3645 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3646 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3647 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3648 0, 208, 0, 0, 209, 54, 0, 55, 56, 0,
3649 773, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3650 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3651 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3652 10, 11, 67, 214, 69, 12, 0, 13, 14, 15,
3653 245, 246, 18, 19, 0, 0, 0, 0, 0, 20,
3654 247, 248, 23, 24, 25, 26, 0, 0, 206, 0,
3655 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3656 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3657 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3658 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3659 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3660 51, 0, 0, 0, 0, 0, 0, 208, 0, 0,
3661 209, 54, 0, 55, 56, 0, 519, 0, 0, 58,
3662 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3663 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3664 7, 0, 9, 0, 0, 0, 10, 11, 67, 214,
3665 69, 12, 0, 13, 14, 15, 245, 246, 18, 19,
3666 0, 0, 0, 0, 0, 20, 247, 248, 23, 24,
3667 25, 26, 0, 0, 206, 0, 0, 0, 0, 0,
3668 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3669 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3670 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3671 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3672 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3673 0, 0, 0, 208, 0, 0, 209, 54, 0, 55,
3674 56, 0, 846, 0, 0, 58, 59, 60, 61, 62,
3675 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3676 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3677 0, 0, 10, 11, 67, 214, 69, 12, 0, 13,
3678 14, 15, 245, 246, 18, 19, 0, 0, 0, 0,
3679 0, 20, 247, 248, 23, 24, 25, 26, 0, 0,
3680 206, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3681 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3682 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3683 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3684 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3685 0, 50, 51, 0, 0, 0, 0, 0, 0, 208,
3686 0, 0, 209, 54, 0, 55, 56, 0, 1019, 0,
3687 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3688 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3689 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3690 67, 214, 69, 12, 0, 13, 14, 15, 245, 246,
3691 18, 19, 0, 0, 0, 0, 0, 20, 247, 248,
3692 23, 24, 25, 26, 0, 0, 206, 0, 0, 0,
3693 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3694 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3695 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3696 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3697 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3698 0, 0, 0, 0, 0, 208, 0, 0, 209, 54,
3699 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
3700 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3701 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3702 9, 0, 0, 0, 10, 11, 67, 214, 69, 12,
3703 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3704 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3705 0, 0, 206, 0, 0, 0, 0, 0, 0, 29,
3706 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3707 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3708 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3709 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3710 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3711 0, 208, 0, 0, 209, 54, 0, 55, 56, 0,
3712 0, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3713 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3714 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3715 10, 11, 67, 214, 69, 12, 0, 13, 14, 15,
3716 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
3717 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
3718 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3719 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3720 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3721 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3722 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3723 51, 0, 0, 0, 0, 0, 0, 208, 0, 0,
3724 209, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3725 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3726 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3727 7, 0, 9, 0, 0, 0, 10, 11, 67, 68,
3728 69, 12, 0, 13, 14, 15, 245, 246, 18, 19,
3729 0, 0, 0, 0, 0, 20, 247, 248, 23, 24,
3730 25, 26, 0, 0, 206, 0, 0, 0, 0, 0,
3731 0, 277, 0, 0, 32, 33, 34, 35, 36, 37,
3732 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3733 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3734 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3736 0, 0, 0, 278, 0, 0, 328, 54, 0, 55,
3737 56, 0, 329, 0, 0, 58, 59, 60, 61, 62,
3738 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3739 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3740 0, 0, 0, 12, 279, 13, 14, 15, 245, 246,
3741 18, 19, 0, 0, 0, 0, 0, 20, 247, 248,
3742 23, 24, 25, 26, 0, 0, 206, 0, 0, 0,
3743 0, 0, 0, 277, 0, 0, 32, 33, 34, 35,
3744 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3745 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3747 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3748 0, 0, 0, 0, 0, 376, 0, 0, 53, 54,
3749 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3750 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3751 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3752 10, 11, 0, 0, 0, 12, 279, 13, 14, 15,
3753 245, 246, 18, 19, 0, 0, 0, 0, 0, 20,
3754 247, 248, 23, 24, 25, 26, 0, 0, 206, 0,
3755 0, 0, 0, 0, 0, 277, 0, 0, 32, 33,
3756 34, 384, 36, 37, 38, 385, 40, 0, 41, 42,
3757 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3758 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3759 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3760 0, 0, 0, 386, 0, 0, 0, 387, 0, 0,
3761 209, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3762 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3763 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3764 0, 0, 10, 11, 0, 0, 0, 12, 279, 13,
3765 14, 15, 245, 246, 18, 19, 0, 0, 0, 0,
3766 0, 20, 247, 248, 23, 24, 25, 26, 0, 0,
3767 206, 0, 0, 0, 0, 0, 0, 277, 0, 0,
3768 32, 33, 34, 384, 36, 37, 38, 385, 40, 0,
3769 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3770 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3771 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3772 0, 0, 0, 0, 0, 0, 0, 0, 0, 387,
3773 0, 0, 209, 54, 0, 55, 56, 0, 0, 0,
3774 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3775 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3776 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
3777 279, 13, 14, 15, 245, 246, 18, 19, 0, 0,
3778 0, 0, 0, 20, 247, 248, 23, 24, 25, 26,
3779 0, 0, 206, 0, 0, 0, 0, 0, 0, 277,
3780 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3781 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3782 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3783 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3784 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3785 0, 278, 0, 0, 328, 54, 0, 55, 56, 0,
3786 0, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3787 65, 66, 0, 0, 0, 0, 0, 0, 5, 6,
3788 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
3789 0, 12, 279, 13, 14, 15, 245, 246, 18, 19,
3790 0, 0, 0, 0, 0, 20, 247, 248, 23, 24,
3791 25, 26, 0, 0, 206, 0, 0, 0, 0, 0,
3792 0, 277, 0, 0, 32, 33, 34, 35, 36, 37,
3793 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3794 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3795 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3796 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3797 0, 0, 0, 1009, 0, 0, 209, 54, 0, 55,
3798 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
3799 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3800 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3801 0, 0, 0, 12, 279, 13, 14, 15, 245, 246,
3802 18, 19, 0, 0, 0, 0, 0, 20, 247, 248,
3803 23, 24, 25, 26, 0, 0, 206, 0, 0, 0,
3804 0, 0, 0, 277, 0, 0, 32, 33, 34, 35,
3805 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3806 45, 46, 47, 23, 24, 25, 26, 0, 0, 0,
3807 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,
3808 33, 34, 784, 0, 0, 0, 785, 0, 0, 41,
3809 42, 43, 44, 45, 0, 1062, 0, 0, 209, 54,
3810 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
3811 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3812 786, 787, 0, 0, 0, 0, 0, 0, 788, 0,
3813 0, 789, 0, 0, 790, 791, 279, 980, 0, 0,
3814 792, 59, 60, 61, 62, 63, 64, 65, 66, 23,
3815 24, 25, 26, 0, 0, 0, 0, 0, 0, 0,
3816 0, 0, 793, 0, 0, 32, 33, 34, 784, 279,
3817 0, 0, 785, 0, 0, 41, 42, 43, 44, 45,
3818 0, 0, 23, 24, 25, 26, 0, 0, 0, 0,
3819 0, 0, 0, 0, 0, 0, 0, 0, 32, 33,
3820 34, 784, 0, 0, 0, 785, 786, 787, 41, 42,
3821 43, 44, 45, 0, 788, 0, 0, 789, 0, 0,
3822 790, 791, 0, 1077, 0, 0, 792, 59, 60, 61,
3823 62, 63, 64, 65, 66, 0, 0, 0, 0, 786,
3824 787, 0, 0, 0, 0, 0, 0, 788, 793, 0,
3825 789, 0, 0, 790, 791, 279, 0, 0, 0, 792,
3826 59, 60, 61, 62, 63, 64, 65, 66, 564, 565,
3827 0, 0, 566, 0, 0, 0, 0, 0, 0, 0,
3828 0, 793, 0, 0, 0, 0, 0, 0, 279, 0,
3829 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3830 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3831 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3832 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3833 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3834 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3835 192, 193, 194, 195, 196, 0, 197, 198, 573, 574,
3836 0, 0, 575, 199, 233, 0, 0, 0, 0, 0,
3837 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3838 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3839 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3840 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3841 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3843 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3844 192, 193, 194, 195, 196, 0, 197, 198, 625, 565,
3845 0, 0, 626, 199, 233, 0, 0, 0, 0, 0,
3846 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3847 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3848 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3849 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3850 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3852 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3853 192, 193, 194, 195, 196, 0, 197, 198, 628, 574,
3854 0, 0, 629, 199, 233, 0, 0, 0, 0, 0,
3855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3856 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3857 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3858 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3859 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3860 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3861 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3862 192, 193, 194, 195, 196, 0, 197, 198, 653, 565,
3863 0, 0, 654, 199, 233, 0, 0, 0, 0, 0,
3864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3865 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3866 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3867 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3868 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3869 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3870 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3871 192, 193, 194, 195, 196, 0, 197, 198, 656, 574,
3872 0, 0, 657, 199, 233, 0, 0, 0, 0, 0,
3873 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3874 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3875 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3876 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3877 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3878 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3879 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3880 192, 193, 194, 195, 196, 0, 197, 198, 724, 565,
3881 0, 0, 725, 199, 233, 0, 0, 0, 0, 0,
3882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3883 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3884 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3885 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3886 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3887 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3888 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3889 192, 193, 194, 195, 196, 0, 197, 198, 727, 574,
3890 0, 0, 728, 199, 233, 0, 0, 0, 0, 0,
3891 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3892 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3893 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3894 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3895 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3896 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3897 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3898 192, 193, 194, 195, 196, 0, 197, 198, 733, 565,
3899 0, 0, 734, 199, 233, 0, 0, 0, 0, 0,
3900 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3901 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3902 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3903 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3904 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3905 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3906 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3907 192, 193, 194, 195, 196, 0, 197, 198, 610, 574,
3908 0, 0, 611, 199, 233, 0, 0, 0, 0, 0,
3909 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3910 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3911 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3912 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3913 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3914 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3915 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3916 192, 193, 194, 195, 196, 0, 197, 198, 779, 565,
3917 0, 0, 780, 199, 233, 0, 0, 0, 0, 0,
3918 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3919 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3920 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3921 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3922 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3924 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3925 192, 193, 194, 195, 196, 0, 197, 198, 782, 574,
3926 0, 0, 783, 199, 233, 0, 0, 0, 0, 0,
3927 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3928 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3929 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3930 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3931 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3933 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3934 192, 193, 194, 195, 196, 0, 197, 198, 1161, 565,
3935 0, 0, 1162, 199, 233, 0, 0, 0, 0, 0,
3936 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3937 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3938 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3939 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3940 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3941 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3942 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3943 192, 193, 194, 195, 196, 0, 197, 198, 1164, 574,
3944 0, 0, 1165, 199, 233, 0, 0, 0, 0, 0,
3945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3946 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3947 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3948 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3949 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3950 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3951 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3952 192, 193, 194, 195, 196, 0, 197, 198, 1196, 565,
3953 0, 0, 1197, 199, 233, 0, 0, 0, 0, 0,
3954 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3955 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3956 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3957 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3958 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3959 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3960 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3961 192, 193, 194, 195, 196, 0, 197, 198, 610, 574,
3962 0, 0, 611, 199, 233, 0, 0, 0, 0, 0,
3963 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3964 0, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3965 0, 0, 179, 180, 0, 0, 0, 0, 181, 182,
3966 183, 184, 0, 0, 0, 0, 0, 0, 0, 0,
3967 0, 0, 0, 185, 186, 0, 0, 0, 0, 0,
3968 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3969 0, 0, 0, 0, 0, 187, 188, 189, 190, 191,
3970 192, 193, 194, 195, 196, 0, 197, 198, 0, 0,
3971 0, 0, 0, 199
3972};
3973
3974static const yytype_int16 yycheck[] =
3975{
3976 2, 59, 53, 89, 60, 369, 102, 22, 91, 92,
3977 8, 71, 95, 8, 364, 101, 71, 28, 712, 94,
3978 16, 17, 227, 4, 331, 57, 92, 634, 271, 95,
3979 28, 719, 275, 28, 2, 95, 4, 897, 898, 13,
3980 433, 99, 387, 68, 425, 363, 67, 365, 16, 17,
3981 627, 83, 433, 55, 56, 16, 17, 83, 95, 604,
3982 53, 59, 25, 78, 96, 97, 98, 331, 57, 1044,
3983 2, 1072, 4, 1112, 13, 897, 898, 963, 655, 429,
3984 473, 27, 22, 1110, 860, 53, 54, 690, 858, 57,
3985 860, 482, 868, 411, 55, 295, 296, 25, 868, 928,
3986 68, 99, 68, 100, 100, 259, 414, 415, 16, 17,
3987 428, 1068, 430, 146, 0, 83, 16, 17, 1033, 13,
3988 153, 26, 54, 91, 92, 66, 153, 95, 96, 97,
3989 98, 97, 100, 68, 484, 526, 222, 1052, 78, 100,
3990 458, 870, 25, 786, 787, 1060, 68, 55, 56, 726,
3991 414, 415, 25, 236, 1033, 238, 153, 213, 209, 736,
3992 1151, 96, 97, 126, 1155, 251, 25, 485, 1054, 25,
3993 37, 38, 146, 1052, 328, 97, 1215, 151, 119, 153,
3994 56, 25, 958, 146, 146, 148, 149, 732, 958, 1216,
3995 153, 153, 100, 244, 1023, 1024, 1018, 283, 946, 947,
3996 100, 261, 1177, 1204, 781, 151, 261, 153, 259, 148,
3997 145, 13, 151, 790, 153, 13, 13, 1208, 146, 221,
3998 148, 969, 970, 971, 261, 227, 13, 310, 311, 312,
3999 313, 233, 315, 316, 230, 1192, 232, 233, 143, 444,
4000 242, 209, 592, 636, 310, 311, 312, 313, 280, 892,
4001 893, 858, 602, 634, 280, 636, 601, 151, 279, 153,
4002 25, 13, 230, 146, 232, 233, 259, 1182, 236, 230,
4003 238, 232, 233, 146, 242, 593, 244, 328, 881, 882,
4004 27, 1110, 29, 1112, 1199, 603, 153, 146, 371, 257,
4005 146, 259, 683, 379, 897, 898, 25, 329, 498, 13,
4006 500, 326, 146, 386, 1033, 371, 331, 852, 248, 249,
4007 242, 1171, 280, 373, 859, 1044, 52, 698, 895, 370,
4008 29, 372, 230, 1052, 232, 257, 13, 1021, 309, 874,
4009 230, 1060, 232, 1021, 13, 328, 373, 25, 688, 1068,
4010 329, 309, 310, 311, 312, 313, 314, 315, 316, 151,
4011 148, 153, 109, 151, 151, 153, 153, 25, 326, 52,
4012 328, 329, 364, 331, 151, 326, 153, 365, 364, 687,
4013 331, 689, 695, 1121, 25, 25, 133, 309, 983, 143,
4014 703, 146, 314, 148, 692, 693, 1215, 1216, 991, 414,
4015 415, 699, 700, 26, 1142, 884, 364, 126, 366, 151,
4016 707, 153, 370, 371, 372, 982, 66, 650, 897, 898,
4017 146, 37, 38, 411, 123, 1018, 68, 146, 386, 624,
4018 149, 685, 99, 143, 153, 365, 1033, 429, 692, 693,
4019 1007, 1008, 430, 429, 152, 699, 700, 151, 97, 153,
4020 442, 452, 444, 788, 96, 97, 414, 415, 1177, 126,
4021 482, 537, 99, 146, 452, 100, 482, 452, 146, 119,
4022 458, 429, 662, 1192, 151, 26, 153, 667, 152, 146,
4023 1075, 126, 151, 866, 153, 126, 126, 100, 146, 126,
4024 82, 83, 484, 68, 848, 866, 145, 485, 484, 148,
4025 430, 146, 68, 145, 526, 146, 146, 465, 149, 149,
4026 526, 146, 153, 153, 66, 67, 150, 68, 1053, 153,
4027 143, 819, 97, 77, 482, 148, 484, 425, 458, 594,
4028 96, 97, 605, 146, 414, 415, 586, 129, 130, 1018,
4029 277, 582, 148, 584, 99, 96, 97, 153, 68, 903,
4030 152, 431, 432, 870, 908, 485, 1151, 1036, 753, 894,
4031 1155, 1245, 99, 66, 569, 819, 639, 66, 526, 121,
4032 122, 126, 470, 578, 68, 152, 96, 97, 1171, 459,
4033 572, 858, 136, 137, 138, 1064, 578, 28, 580, 126,
4034 34, 146, 143, 870, 145, 1130, 1163, 148, 14, 15,
4035 592, 15, 96, 97, 1083, 593, 592, 612, 52, 68,
4036 602, 25, 1207, 1208, 68, 603, 602, 618, 121, 122,
4037 612, 68, 121, 122, 582, 145, 584, 99, 148, 651,
4038 618, 126, 624, 618, 592, 651, 68, 96, 97, 569,
4039 68, 146, 96, 97, 602, 58, 604, 605, 578, 152,
4040 97, 145, 644, 152, 126, 741, 126, 2, 731, 4,
4041 99, 683, 99, 593, 77, 97, 112, 683, 96, 97,
4042 685, 16, 17, 603, 146, 731, 66, 692, 693, 99,
4043 730, 639, 612, 68, 699, 700, 145, 126, 729, 126,
4044 68, 145, 740, 651, 99, 108, 688, 99, 146, 112,
4045 56, 689, 688, 146, 68, 153, 26, 146, 53, 54,
4046 68, 96, 97, 643, 644, 707, 708, 145, 710, 97,
4047 712, 126, 680, 68, 126, 683, 684, 685, 66, 119,
4048 688, 121, 122, 97, 692, 693, 634, 68, 148, 97,
4049 68, 699, 700, 1060, 146, 1099, 91, 92, 68, 126,
4050 95, 1068, 740, 1070, 1094, 100, 707, 9, 680, 689,
4051 145, 753, 684, 15, 837, 96, 97, 1044, 96, 97,
4052 1047, 729, 99, 731, 732, 99, 96, 97, 770, 68,
4053 772, 837, 58, 121, 122, 144, 124, 1095, 34, 100,
4054 831, 1068, 66, 1070, 153, 836, 146, 99, 68, 126,
4055 698, 77, 126, 853, 819, 99, 52, 96, 97, 68,
4056 68, 146, 692, 693, 145, 68, 553, 145, 870, 699,
4057 700, 68, 146, 143, 126, 145, 68, 97, 148, 148,
4058 871, 99, 108, 109, 571, 827, 99, 96, 97, 97,
4059 88, 89, 99, 96, 97, 119, 77, 121, 122, 96,
4060 97, 40, 41, 66, 96, 97, 145, 133, 126, 518,
4061 148, 819, 99, 126, 209, 906, 148, 747, 748, 126,
4062 750, 751, 149, 831, 915, 1192, 66, 1194, 836, 837,
4063 902, 126, 1199, 146, 1201, 230, 145, 232, 233, 126,
4064 627, 236, 145, 238, 852, 99, 99, 242, 145, 244,
4065 1177, 859, 1179, 145, 56, 955, 119, 1184, 121, 122,
4066 150, 124, 257, 871, 259, 1192, 874, 1194, 655, 144,
4067 579, 1238, 126, 126, 1201, 146, 585, 54, 587, 119,
4068 77, 121, 122, 26, 124, 1011, 77, 64, 65, 819,
4069 106, 987, 52, 52, 902, 967, 56, 56, 906, 149,
4070 146, 56, 944, 153, 946, 947, 1233, 915, 1004, 151,
4071 151, 1238, 153, 25, 309, 310, 311, 312, 313, 314,
4072 315, 316, 130, 77, 1015, 68, 1017, 969, 970, 971,
4073 15, 326, 17, 328, 864, 149, 331, 66, 144, 726,
4074 94, 95, 146, 134, 135, 136, 137, 138, 146, 736,
4075 870, 144, 146, 96, 97, 144, 146, 66, 1060, 967,
4076 10, 146, 1064, 146, 146, 1056, 1068, 44, 1070, 364,
4077 44, 366, 146, 126, 1016, 370, 371, 372, 8, 1021,
4078 134, 135, 136, 137, 138, 13, 66, 1059, 25, 152,
4079 119, 386, 121, 122, 781, 17, 152, 144, 870, 150,
4080 143, 146, 145, 790, 791, 148, 128, 1015, 15, 1017,
4081 119, 720, 121, 122, 723, 59, 60, 61, 62, 414,
4082 415, 54, 55, 690, 57, 858, 146, 860, 737, 148,
4083 131, 64, 65, 146, 429, 868, 52, 870, 100, 119,
4084 1131, 121, 122, 131, 236, 1053, 1169, 1170, 1056, 100,
4085 146, 1059, 1094, 144, 1096, 52, 1098, 1095, 1094, 126,
4086 146, 52, 146, 1169, 1170, 40, 41, 42, 43, 44,
4087 465, 146, 264, 146, 146, 2, 268, 4, 52, 1121,
4088 146, 126, 131, 870, 56, 146, 1094, 146, 146, 484,
4089 1192, 52, 1194, 54, 55, 56, 57, 1199, 146, 1201,
4090 1142, 52, 9, 54, 55, 56, 57, 146, 895, 52,
4091 151, 54, 55, 56, 57, 1095, 1036, 146, 131, 786,
4092 787, 1041, 1130, 1131, 56, 958, 53, 54, 146, 838,
4093 57, 146, 841, 52, 146, 844, 1238, 146, 146, 2,
4094 1060, 4, 851, 146, 1064, 854, 146, 146, 1068, 120,
4095 1070, 1242, 144, 16, 17, 149, 83, 146, 101, 146,
4096 146, 1169, 1170, 52, 1036, 54, 55, 56, 57, 96,
4097 97, 98, 99, 146, 242, 461, 963, 146, 146, 146,
4098 146, 465, 96, 148, 148, 98, 146, 582, 1060, 584,
4099 53, 54, 1064, 146, 87, 982, 1068, 592, 1070, 77,
4100 1033, 988, 612, 1245, 1098, 68, 708, 602, 917, 604,
4101 605, 1044, 101, 1023, 881, 882, 94, 95, 107, 1052,
4102 1007, 1008, 1110, 870, 891, 892, 893, 1060, 91, 92,
4103 897, 898, 95, 772, 1242, 1068, 887, 100, 1204, 742,
4104 514, 973, 974, 435, 639, 954, 324, 1245, 440, 1083,
4105 891, 443, 1018, 1083, 446, 133, 134, 135, 136, 137,
4106 138, 1083, 105, 889, 1096, 1016, 500, 1054, 99, 957,
4107 462, 1036, 1192, 1064, 1194, 467, 1060, 988, -1, 1199,
4108 -1, 1201, 209, -1, -1, 680, -1, -1, -1, 684,
4109 685, -1, -1, 688, -1, -1, -1, 692, 693, -1,
4110 -1, -1, -1, -1, 699, 700, -1, -1, -1, -1,
4111 -1, -1, -1, -1, -1, 242, 983, 244, 1238, -1,
4112 1192, 949, 1194, 951, 991, 690, -1, 1199, -1, 1201,
4113 257, -1, 259, 525, 729, -1, 731, 732, -1, -1,
4114 -1, -1, -1, -1, 1177, -1, 209, -1, -1, -1,
4115 -1, 1018, -1, 280, -1, -1, -1, -1, -1, 1192,
4116 -1, 1148, -1, -1, -1, -1, 1238, 230, -1, 232,
4117 233, -1, -1, 236, -1, 238, 1163, -1, -1, 242,
4118 -1, 244, 309, -1, -1, -1, -1, 314, -1, -1,
4119 -1, -1, -1, -1, 257, -1, 259, -1, -1, -1,
4120 -1, 328, 329, -1, -1, 1137, 1138, -1, 1075, -1,
4121 -1, 1143, -1, 1145, 1146, -1, -1, -1, -1, 1128,
4122 -1, 786, 787, -1, 819, -1, -1, 56, -1, 52,
4123 -1, 54, 55, 56, 57, 58, 831, -1, -1, 366,
4124 -1, 836, 837, 370, -1, 372, 309, 310, 311, 312,
4125 313, 314, 315, 316, 77, -1, -1, 852, -1, -1,
4126 -1, -1, -1, 326, 859, 328, -1, -1, 331, -1,
4127 -1, -1, -1, -1, -1, -1, 871, -1, 101, 874,
4128 1189, -1, -1, -1, 1151, 108, 109, -1, 1155, 1117,
4129 1118, 1223, 1224, 1225, 1226, 1123, -1, 1125, -1, 1127,
4130 -1, 364, -1, 366, 1171, -1, -1, 370, 371, 372,
4131 133, 906, 1244, -1, -1, -1, 881, 882, -1, -1,
4132 915, -1, -1, 386, -1, -1, 891, 892, 893, -1,
4133 -1, -1, 897, 898, -1, -1, -1, -1, 465, -1,
4134 1207, 1208, -1, -1, -1, -1, 738, -1, -1, -1,
4135 -1, 414, 415, -1, -1, 482, -1, -1, -1, -1,
4136 752, -1, 754, -1, -1, -1, 429, -1, 52, -1,
4137 54, 55, 56, 57, 58, -1, 25, -1, 207, -1,
4138 -1, 210, 211, 212, -1, -1, -1, -1, -1, 1217,
4139 1218, 1219, 1220, 77, -1, -1, -1, -1, -1, 526,
4140 -1, -1, 465, -1, -1, -1, -1, -1, -1, -1,
4141 -1, -1, -1, -1, -1, 1243, -1, 101, 983, -1,
4142 1015, 484, 1017, 107, 108, 109, 991, -1, 77, 78,
4143 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4144 89, -1, -1, -1, -1, 94, 95, -1, -1, 133,
4145 -1, -1, 136, 1018, -1, 582, -1, 584, 1053, -1,
4146 -1, 1056, -1, -1, -1, -1, -1, -1, -1, 153,
4147 -1, 2, -1, 4, -1, -1, -1, 604, 127, -1,
4148 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4149 -1, -1, -1, -1, -1, -1, -1, 326, -1, 1094,
4150 -1, -1, 331, -1, 896, -1, -1, -1, -1, -1,
4151 1075, -1, -1, -1, -1, -1, -1, -1, -1, 582,
4152 -1, 584, 53, 54, 651, -1, 57, -1, -1, 592,
4153 -1, -1, -1, -1, -1, 1130, 1131, -1, -1, 602,
4154 -1, 604, 605, 935, 936, -1, -1, -1, -1, -1,
4155 -1, -1, 83, 680, -1, -1, 683, 684, -1, -1,
4156 -1, -1, -1, 690, -1, 96, 97, 98, -1, -1,
4157 -1, -1, -1, -1, 1169, 1170, 639, -1, -1, -1,
4158 -1, -1, -1, -1, -1, -1, 1151, 979, -1, -1,
4159 1155, -1, -1, -1, -1, 424, 425, -1, -1, -1,
4160 -1, -1, 729, -1, 433, 732, 1171, -1, -1, -1,
4161 -1, -1, -1, 1005, 1006, -1, -1, 680, -1, -1,
4162 -1, 684, 685, -1, -1, 688, -1, -1, -1, 692,
4163 693, -1, -1, -1, -1, 1027, 699, 700, -1, -1,
4164 -1, 470, 1207, 1208, 473, -1, 52, 1242, 54, 55,
4165 56, 57, 58, -1, -1, -1, -1, -1, -1, 786,
4166 787, -1, -1, -1, -1, -1, 729, -1, 731, 732,
4167 2, 77, 4, -1, -1, -1, -1, -1, 209, 77,
4168 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4169 519, -1, -1, -1, -1, 101, 94, 95, -1, -1,
4170 -1, 107, 108, 109, 831, -1, -1, -1, -1, 836,
4171 -1, 242, -1, 244, -1, -1, 1108, -1, -1, -1,
4172 -1, 53, 54, 1115, -1, 852, 257, 133, 259, 2,
4173 136, 4, 859, 131, 132, 133, 134, 135, 136, 137,
4174 138, -1, 148, -1, 871, -1, -1, 874, -1, 280,
4175 -1, -1, -1, -1, 881, 882, 819, -1, -1, -1,
4176 -1, -1, -1, -1, 891, 892, 893, -1, 831, -1,
4177 897, 898, -1, 836, 837, 902, -1, -1, 309, 906,
4178 53, 54, -1, 314, 57, -1, -1, -1, 915, 852,
4179 619, -1, 621, -1, -1, -1, 859, 328, 329, -1,
4180 331, -1, -1, -1, -1, 634, -1, 636, 871, -1,
4181 83, 874, -1, -1, -1, -1, -1, -1, -1, 2,
4182 -1, 4, -1, 96, 97, 98, 99, -1, -1, -1,
4183 -1, -1, -1, -1, -1, 366, -1, -1, -1, 370,
4184 967, 372, -1, 906, -1, -1, -1, -1, -1, -1,
4185 679, -1, 915, -1, -1, -1, 983, -1, -1, -1,
4186 -1, -1, -1, -1, 991, -1, -1, -1, -1, 698,
4187 53, 54, -1, -1, -1, -1, -1, 209, 707, -1,
4188 -1, -1, -1, 414, 415, -1, -1, -1, 1015, -1,
4189 1017, 1018, -1, 722, -1, -1, -1, -1, -1, -1,
4190 -1, -1, -1, -1, -1, -1, -1, -1, -1, 690,
4191 242, -1, 244, 96, -1, -1, -1, -1, -1, -1,
4192 -1, -1, -1, -1, -1, 257, 1053, 259, -1, 1056,
4193 -1, -1, 1059, 690, 465, -1, 209, -1, -1, -1,
4194 -1, -1, -1, -1, 773, -1, -1, -1, 1075, -1,
4195 -1, 482, 1015, -1, 1017, -1, -1, -1, -1, -1,
4196 -1, -1, -1, -1, -1, -1, -1, -1, -1, 242,
4197 -1, 244, -1, 690, -1, -1, -1, 309, -1, -1,
4198 -1, -1, 314, -1, 257, -1, 259, -1, -1, -1,
4199 1053, -1, -1, 1056, -1, 526, 328, -1, -1, 331,
4200 -1, -1, -1, 1130, 1131, 786, 787, 280, 52, -1,
4201 54, 55, 56, 57, 58, -1, -1, 846, -1, -1,
4202 -1, -1, -1, -1, 1151, -1, 209, -1, 1155, 786,
4203 787, 1094, -1, 77, 366, -1, 309, 866, 370, -1,
4204 372, 314, -1, -1, 1171, -1, -1, 91, -1, -1,
4205 -1, 582, -1, 584, -1, 328, 329, 101, -1, 242,
4206 -1, 244, -1, 107, 108, 109, -1, 1130, 1131, 786,
4207 787, -1, -1, 604, 257, -1, 259, -1, -1, -1,
4208 1207, 1208, 414, 415, -1, 914, -1, -1, -1, 133,
4209 -1, -1, 136, 366, -1, -1, -1, 370, -1, 372,
4210 881, 882, -1, -1, -1, -1, 1169, 1170, -1, -1,
4211 891, 892, 893, 942, -1, 1242, 897, 898, -1, -1,
4212 651, -1, -1, -1, 881, 882, 309, -1, -1, 660,
4213 -1, 314, -1, 465, 891, 892, 893, -1, -1, -1,
4214 897, 898, -1, -1, -1, 328, -1, -1, 331, 680,
4215 -1, -1, 683, 684, 685, -1, -1, -1, -1, -1,
4216 -1, 692, 693, -1, 881, 882, -1, -1, 699, 700,
4217 -1, -1, -1, -1, 891, 892, 893, -1, -1, 1242,
4218 897, 898, -1, 366, -1, -1, -1, 370, -1, 372,
4219 1019, -1, 465, -1, -1, -1, -1, -1, 729, -1,
4220 -1, 732, 983, 1032, -1, -1, -1, -1, -1, 482,
4221 991, -1, -1, -1, 52, -1, 54, 55, 56, 57,
4222 58, -1, -1, -1, -1, -1, 983, -1, -1, -1,
4223 -1, 414, 415, -1, 991, -1, -1, 1018, -1, 77,
4224 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4225 582, -1, 584, 526, -1, -1, -1, -1, -1, -1,
4226 -1, 1018, -1, 101, -1, -1, 983, -1, -1, 107,
4227 108, 109, 604, -1, 991, -1, -1, -1, -1, -1,
4228 -1, -1, 465, -1, -1, -1, -1, -1, 819, -1,
4229 -1, -1, -1, -1, 1075, 133, -1, -1, 136, -1,
4230 831, 1018, -1, -1, -1, 836, -1, -1, -1, 582,
4231 -1, 584, -1, -1, -1, -1, -1, -1, 1075, -1,
4232 -1, 852, -1, -1, -1, -1, -1, -1, 859, -1,
4233 -1, 604, -1, -1, -1, -1, -1, -1, -1, -1,
4234 871, -1, -1, 874, -1, -1, -1, -1, 680, -1,
4235 -1, -1, 684, 685, -1, -1, -1, -1, 1075, -1,
4236 692, 693, -1, -1, -1, -1, -1, 699, 700, -1,
4237 1151, 902, -1, -1, 1155, 906, -1, -1, 651, -1,
4238 -1, -1, -1, -1, 915, -1, 690, -1, -1, -1,
4239 1171, -1, -1, -1, 1151, -1, -1, 729, 1155, 582,
4240 732, 584, -1, -1, -1, -1, -1, 680, -1, -1,
4241 683, 684, -1, -1, 1171, 690, -1, -1, -1, -1,
4242 -1, 604, -1, -1, -1, -1, 1207, 1208, -1, -1,
4243 -1, -1, -1, -1, 1151, -1, 967, -1, 1155, -1,
4244 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4245 1207, 1208, -1, -1, 1171, -1, 729, -1, -1, 732,
4246 690, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4247 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4248 -1, -1, 786, 787, 1015, -1, 1017, 819, -1, -1,
4249 1207, 1208, -1, -1, -1, -1, -1, 680, -1, 831,
4250 -1, 684, 685, -1, 836, -1, -1, -1, -1, 692,
4251 693, 786, 787, -1, -1, -1, 699, 700, -1, -1,
4252 852, -1, 1053, -1, -1, 1056, -1, 859, 1059, -1,
4253 -1, -1, -1, -1, -1, -1, -1, -1, -1, 871,
4254 -1, -1, 874, -1, -1, -1, 729, -1, -1, 732,
4255 -1, -1, -1, -1, -1, -1, 786, 787, 831, -1,
4256 -1, -1, -1, 836, -1, -1, -1, -1, -1, -1,
4257 -1, -1, -1, -1, 906, -1, -1, 881, 882, 852,
4258 -1, -1, -1, 915, -1, -1, 859, 891, 892, 893,
4259 -1, -1, -1, 897, 898, -1, -1, -1, 871, 1130,
4260 1131, 874, -1, -1, -1, -1, 881, 882, -1, -1,
4261 -1, -1, -1, -1, -1, -1, 891, 892, 893, -1,
4262 -1, -1, 897, 898, -1, -1, -1, -1, -1, 902,
4263 -1, -1, -1, 906, -1, -1, 819, -1, -1, -1,
4264 -1, -1, 915, -1, -1, -1, -1, -1, 831, -1,
4265 -1, 881, 882, 836, -1, -1, -1, -1, -1, -1,
4266 -1, 891, 892, 893, -1, 16, 17, 897, 898, 852,
4267 -1, -1, -1, -1, -1, -1, 859, -1, -1, 983,
4268 -1, -1, -1, 1015, -1, 1017, -1, 991, 871, -1,
4269 -1, 874, -1, -1, 967, -1, -1, 48, 49, 50,
4270 51, -1, -1, -1, 55, 56, -1, -1, 983, -1,
4271 -1, 1242, -1, -1, 1018, -1, 991, 68, 69, 902,
4272 -1, 1053, -1, 906, 1056, -1, -1, -1, -1, -1,
4273 -1, -1, 915, -1, -1, -1, -1, -1, 33, 34,
4274 35, 36, 1015, 1018, 1017, -1, -1, -1, -1, 100,
4275 -1, -1, -1, 983, 49, 50, 51, -1, -1, -1,
4276 -1, 991, -1, -1, 59, 60, 61, 62, 63, -1,
4277 -1, 1075, -1, -1, -1, -1, -1, -1, -1, -1,
4278 1053, -1, -1, 1056, -1, -1, 1059, -1, 1018, -1,
4279 -1, -1, -1, -1, -1, -1, -1, -1, 1130, 1131,
4280 1075, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4281 -1, -1, -1, -1, -1, 110, 111, 112, 113, 114,
4282 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
4283 -1, -1, 1015, -1, 1017, -1, -1, -1, -1, -1,
4284 -1, -1, -1, -1, 139, 1075, -1, 1151, -1, -1,
4285 -1, 1155, -1, -1, -1, -1, 207, 1130, 1131, 210,
4286 211, 212, -1, 214, -1, -1, -1, 1171, -1, -1,
4287 1053, -1, -1, 1056, -1, -1, 1151, -1, -1, 230,
4288 1155, 232, 233, -1, -1, -1, -1, -1, -1, -1,
4289 -1, -1, -1, -1, -1, -1, 1171, -1, -1, -1,
4290 -1, -1, -1, 1207, 1208, -1, -1, -1, -1, -1,
4291 1242, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4292 -1, 1151, -1, -1, -1, 1155, -1, -1, -1, -1,
4293 -1, -1, 1207, 1208, -1, -1, -1, -1, -1, -1,
4294 -1, 1171, -1, -1, -1, -1, -1, 1130, 1131, -1,
4295 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4296 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1242,
4297 -1, -1, -1, -1, -1, 326, -1, 1207, 1208, -1,
4298 331, -1, 333, 334, 335, 336, 337, -1, -1, 340,
4299 341, 342, 343, 344, 345, 346, 347, 348, -1, -1,
4300 351, 352, 353, 354, 355, 356, 357, 358, 359, 360,
4301 -1, -1, -1, 364, -1, -1, -1, -1, -1, -1,
4302 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4303 -1, -1, -1, -1, -1, -1, -1, 77, 78, 79,
4304 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4305 -1, -1, -1, -1, 94, 95, -1, -1, -1, 1242,
4306 -1, -1, -1, 414, 415, -1, -1, -1, -1, -1,
4307 -1, -1, 423, 424, 425, -1, -1, -1, 429, -1,
4308 431, 432, 433, -1, -1, -1, -1, 127, 439, 129,
4309 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4310 -1, -1, -1, 454, -1, -1, -1, -1, 459, -1,
4311 -1, -1, -1, 153, -1, -1, -1, -1, -1, 470,
4312 -1, -1, 473, -1, -1, -1, -1, -1, -1, 0,
4313 -1, -1, -1, 484, -1, -1, -1, 8, 9, 10,
4314 -1, -1, 13, 14, 15, -1, 17, -1, -1, -1,
4315 -1, 502, -1, -1, 25, 26, 27, 28, 29, -1,
4316 -1, -1, -1, -1, -1, -1, 37, 38, 519, 40,
4317 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4319 -1, -1, -1, -1, -1, -1, -1, 68, -1, -1,
4320 -1, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4321 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4322 -1, -1, -1, 94, 95, 96, 97, -1, 99, 100,
4323 -1, -1, -1, -1, -1, 106, -1, -1, -1, -1,
4324 -1, 592, -1, -1, -1, -1, -1, -1, -1, 120,
4325 -1, 602, 123, -1, -1, 126, 127, 128, 129, 130,
4326 131, 132, 133, 134, 135, 136, 137, 138, 619, -1,
4327 621, -1, 143, 144, 145, 146, -1, -1, 149, 150,
4328 151, -1, 153, 634, -1, 636, -1, -1, -1, 0,
4329 -1, -1, -1, -1, -1, -1, -1, 8, 9, 10,
4330 -1, -1, 13, 14, 15, -1, 17, -1, -1, -1,
4331 -1, -1, -1, -1, 25, 26, 27, -1, -1, -1,
4332 -1, -1, -1, -1, -1, -1, 37, 38, 679, 40,
4333 41, 42, 43, 44, 685, 686, -1, 688, -1, -1,
4334 -1, 692, 693, -1, -1, -1, -1, 698, 699, 700,
4335 -1, -1, -1, -1, -1, -1, 707, 68, -1, -1,
4336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4337 -1, 722, -1, -1, -1, -1, -1, -1, -1, -1,
4338 -1, -1, -1, -1, -1, 96, 97, -1, -1, -1,
4339 -1, -1, -1, -1, -1, -1, 747, 748, -1, 750,
4340 751, 33, 34, 35, 36, -1, -1, -1, -1, 120,
4341 -1, -1, -1, -1, -1, -1, -1, 49, 50, 51,
4342 52, -1, 773, -1, 56, -1, 58, 59, 60, 61,
4343 62, 63, 143, 144, -1, -1, -1, 148, 149, -1,
4344 151, -1, 153, -1, -1, 77, -1, -1, -1, -1,
4345 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
4346 -1, 812, -1, -1, -1, -1, 98, -1, 819, 101,
4347 -1, -1, 104, 105, -1, 107, 108, -1, 110, 111,
4348 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
4349 -1, -1, -1, -1, -1, 846, -1, -1, -1, -1,
4350 132, -1, -1, -1, -1, 0, 1, 139, 3, 4,
4351 5, 6, 7, 864, -1, 866, 11, 12, -1, -1,
4352 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4353 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
4354 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
4355 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
4356 55, 56, 57, 914, 59, 60, 61, 62, 63, 64,
4357 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4358 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
4359 -1, 942, -1, -1, -1, 90, 91, -1, -1, -1,
4360 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
4361 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
4362 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
4363 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4364 -1, -1, -1, -1, 139, 140, 141, -1, -1, -1,
4365 -1, -1, -1, -1, -1, -1, 151, -1, 153, -1,
4366 -1, -1, -1, -1, -1, -1, -1, -1, 1019, 0,
4367 -1, -1, -1, -1, -1, -1, -1, 8, 9, 10,
4368 -1, 1032, 13, 14, 15, -1, 17, -1, -1, -1,
4369 -1, 44, -1, -1, 25, -1, 27, 28, 29, -1,
4370 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
4371 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4372 -1, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4373 83, 84, 85, 86, 87, 88, 89, 68, -1, -1,
4374 -1, 94, 95, 1094, -1, -1, 77, 78, 79, 80,
4375 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4376 -1, -1, -1, 94, 95, 96, 97, -1, 99, 100,
4377 -1, -1, -1, -1, 127, 106, 129, 130, 131, 132,
4378 133, 134, 135, 136, 137, 138, -1, -1, -1, 120,
4379 -1, -1, 123, 146, -1, 126, 127, 128, 129, 130,
4380 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4381 -1, -1, -1, 144, 145, 146, 0, -1, 149, 150,
4382 151, -1, 153, -1, 8, 9, 10, -1, -1, 13,
4383 14, 15, -1, 17, -1, -1, -1, -1, 44, -1,
4384 -1, 25, -1, 27, 28, 29, -1, -1, -1, -1,
4385 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
4386 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4387 -1, 77, 78, 79, 80, 81, 82, 83, 84, 85,
4388 86, 87, 88, 89, 68, -1, -1, -1, 94, 95,
4389 -1, -1, -1, 77, 78, 79, 80, 81, 82, 83,
4390 84, 85, 86, 87, 88, 89, -1, -1, -1, -1,
4391 94, 95, 96, 97, -1, 99, 100, -1, -1, -1,
4392 -1, 127, 106, 129, 130, 131, 132, 133, 134, 135,
4393 136, 137, 138, -1, -1, -1, 120, -1, -1, 123,
4394 -1, -1, 126, 127, 128, 129, 130, 131, 132, 133,
4395 134, 135, 136, 137, 138, -1, -1, -1, -1, -1,
4396 144, 145, 146, 0, -1, 149, 150, 151, -1, 153,
4397 -1, 8, 9, 10, -1, -1, 13, 14, 15, -1,
4398 17, -1, -1, -1, -1, -1, -1, -1, 25, 26,
4399 27, 28, 29, -1, -1, -1, -1, -1, -1, -1,
4400 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
4401 -1, -1, -1, -1, -1, -1, -1, -1, 77, 78,
4402 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4403 89, 68, -1, -1, -1, 94, 95, -1, -1, -1,
4404 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
4405 87, 88, 89, -1, -1, -1, -1, 94, 95, 96,
4406 97, -1, -1, 100, -1, -1, -1, -1, 127, 106,
4407 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4408 -1, -1, -1, 120, -1, -1, 123, -1, -1, -1,
4409 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
4410 137, 138, -1, -1, -1, -1, 143, 144, 145, 146,
4411 0, -1, 149, 150, 151, -1, 153, -1, 8, 9,
4412 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
4413 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
4414 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
4415 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
4416 -1, -1, -1, -1, -1, 77, 78, 79, 80, 81,
4417 82, 83, 84, 85, 86, 87, 88, 89, 68, -1,
4418 -1, -1, 94, 95, -1, -1, -1, 77, 78, 79,
4419 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4420 -1, -1, -1, -1, 94, 95, 96, 97, -1, -1,
4421 100, -1, -1, -1, -1, -1, 106, 129, 130, 131,
4422 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4423 120, -1, -1, 123, -1, -1, -1, 127, 128, 129,
4424 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4425 -1, -1, -1, 143, 144, 145, 146, 0, -1, 149,
4426 150, 151, -1, 153, -1, 8, 9, 10, -1, -1,
4427 13, 14, 15, -1, 17, -1, -1, -1, -1, -1,
4428 -1, -1, 25, -1, 27, 28, 29, -1, -1, -1,
4429 -1, -1, -1, -1, 37, 38, -1, 40, 41, 42,
4430 43, 44, -1, -1, -1, -1, -1, -1, -1, -1,
4431 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4432 -1, 86, 87, -1, -1, 68, -1, -1, -1, 94,
4433 95, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4434 83, 84, 85, 86, 87, 88, 89, -1, -1, -1,
4435 -1, 94, 95, 96, 97, -1, 99, 100, -1, -1,
4436 -1, -1, -1, 106, 129, 130, 131, 132, 133, 134,
4437 135, 136, 137, 138, -1, -1, -1, 120, -1, -1,
4438 123, -1, -1, 126, 127, 128, 129, 130, 131, 132,
4439 133, 134, 135, 136, 137, 138, -1, -1, -1, -1,
4440 -1, 144, 145, 146, 0, -1, 149, 150, 151, -1,
4441 153, -1, 8, 9, 10, -1, -1, 13, 14, 15,
4442 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
4443 26, 27, 28, -1, -1, -1, -1, -1, -1, -1,
4444 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
4445 -1, -1, -1, -1, -1, -1, -1, -1, -1, 77,
4446 78, 79, 80, 81, 82, 83, -1, -1, 86, 87,
4447 -1, -1, 68, -1, -1, -1, 94, 95, -1, -1,
4448 -1, 77, 78, 79, 80, 81, 82, 83, 84, 85,
4449 86, 87, 88, 89, -1, -1, -1, -1, 94, 95,
4450 96, 97, -1, -1, 100, -1, -1, -1, -1, -1,
4451 106, 129, 130, 131, 132, 133, 134, 135, 136, 137,
4452 138, -1, -1, -1, 120, -1, -1, -1, -1, -1,
4453 -1, 127, -1, 129, 130, 131, 132, 133, 134, 135,
4454 136, 137, 138, -1, -1, -1, -1, 143, 144, 145,
4455 146, 0, 148, 149, 150, 151, -1, 153, -1, 8,
4456 9, 10, -1, -1, 13, 14, 15, -1, 17, -1,
4457 -1, -1, -1, -1, -1, -1, 25, -1, 27, 28,
4458 29, -1, -1, -1, -1, -1, -1, -1, 37, 38,
4459 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
4460 -1, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4461 81, 82, 83, -1, -1, 86, 87, -1, -1, 68,
4462 -1, -1, -1, 94, 95, -1, -1, -1, 77, 78,
4463 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4464 89, -1, -1, -1, -1, 94, 95, 96, 97, -1,
4465 -1, 100, -1, -1, -1, -1, -1, 106, 129, 130,
4466 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4467 -1, 120, -1, -1, 123, -1, -1, -1, 127, 128,
4468 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4469 -1, -1, -1, -1, -1, 144, 145, 146, 0, -1,
4470 149, 150, 151, -1, 153, -1, 8, 9, 10, -1,
4471 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
4472 -1, -1, -1, 25, 26, 27, 28, -1, -1, -1,
4473 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
4474 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
4475 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4476 -1, -1, -1, -1, -1, -1, 68, -1, -1, -1,
4477 -1, -1, -1, -1, -1, 77, 78, 79, 80, 81,
4478 82, 83, 84, 85, 86, 87, 88, 89, -1, -1,
4479 -1, -1, 94, 95, 96, 97, -1, -1, 100, -1,
4480 -1, -1, -1, -1, 106, -1, -1, -1, -1, -1,
4481 -1, -1, -1, -1, -1, -1, -1, -1, 120, -1,
4482 -1, -1, -1, -1, -1, 127, -1, 129, 130, 131,
4483 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4484 -1, 143, 144, 145, 146, 0, 148, 149, 150, 151,
4485 -1, 153, -1, 8, 9, 10, -1, -1, 13, 14,
4486 15, -1, 17, -1, -1, -1, -1, -1, -1, -1,
4487 25, -1, 27, 28, -1, -1, -1, -1, -1, -1,
4488 -1, -1, 37, 38, -1, 40, 41, 42, 43, 44,
4489 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4490 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4491 -1, -1, -1, 68, -1, -1, -1, -1, -1, -1,
4492 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4493 85, 86, 87, 88, 89, -1, -1, -1, -1, 94,
4494 95, 96, 97, -1, -1, 100, -1, -1, -1, -1,
4495 -1, 106, -1, -1, -1, -1, -1, -1, -1, -1,
4496 -1, -1, -1, -1, -1, 120, -1, -1, -1, -1,
4497 -1, -1, 127, -1, 129, 130, 131, 132, 133, 134,
4498 135, 136, 137, 138, -1, -1, -1, -1, -1, 144,
4499 145, 146, 0, 148, 149, 150, 151, -1, 153, -1,
4500 8, 9, 10, -1, -1, -1, 14, 15, -1, 17,
4501 -1, -1, -1, -1, -1, -1, -1, 25, 26, -1,
4502 -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
4503 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
4504 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4505 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4506 68, -1, -1, -1, -1, -1, -1, -1, -1, 77,
4507 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
4508 88, 89, -1, -1, -1, -1, 94, 95, 96, 97,
4509 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
4510 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4511 -1, -1, 120, -1, -1, -1, -1, -1, 126, 127,
4512 -1, 129, 130, 131, 132, 133, 134, 135, 136, 137,
4513 138, -1, -1, -1, -1, 143, 144, 145, 146, 0,
4514 -1, 149, -1, 151, -1, 153, -1, 8, 9, 10,
4515 -1, -1, -1, 14, 15, -1, 17, -1, -1, -1,
4516 -1, -1, -1, -1, 25, 26, -1, -1, -1, -1,
4517 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
4518 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4519 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4520 -1, -1, -1, -1, -1, -1, -1, 68, -1, -1,
4521 -1, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4522 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4523 -1, -1, -1, 94, 95, 96, 97, -1, 99, -1,
4524 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4525 -1, -1, -1, -1, -1, -1, -1, -1, -1, 120,
4526 -1, -1, -1, -1, -1, 126, 127, -1, 129, 130,
4527 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4528 -1, -1, 143, 144, 145, 146, 0, -1, 149, -1,
4529 151, -1, 153, -1, 8, 9, 10, -1, -1, -1,
4530 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
4531 -1, 25, -1, -1, -1, -1, -1, -1, -1, -1,
4532 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
4533 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4534 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4535 -1, -1, -1, -1, 68, -1, -1, -1, -1, -1,
4536 -1, -1, -1, 77, 78, 79, 80, 81, 82, 83,
4537 84, 85, 86, 87, 88, 89, -1, -1, -1, -1,
4538 94, 95, 96, 97, -1, 99, -1, -1, -1, -1,
4539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4540 -1, -1, -1, -1, -1, -1, 120, -1, -1, -1,
4541 -1, -1, 126, 127, -1, 129, 130, 131, 132, 133,
4542 134, 135, 136, 137, 138, -1, -1, -1, -1, -1,
4543 144, 145, 146, 0, -1, 149, -1, 151, -1, 153,
4544 -1, 8, 9, 10, -1, -1, -1, 14, 15, -1,
4545 17, -1, -1, -1, -1, -1, -1, -1, 25, -1,
4546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4547 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
4548 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4550 -1, 68, -1, -1, -1, -1, -1, -1, -1, -1,
4551 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
4552 87, 88, 89, -1, -1, -1, -1, 94, 95, 96,
4553 97, -1, 99, -1, -1, -1, -1, -1, -1, -1,
4554 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4555 -1, -1, -1, 120, -1, -1, -1, -1, -1, 126,
4556 127, -1, 129, 130, 131, 132, 133, 134, 135, 136,
4557 137, 138, -1, -1, -1, -1, -1, 144, 145, 146,
4558 -1, -1, 149, -1, 151, 1, 153, 3, 4, 5,
4559 6, 7, 8, 9, 10, 11, 12, -1, -1, 15,
4560 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
4561 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
4562 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
4563 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
4564 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4565 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4566 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4567 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4568 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4569 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
4570 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
4571 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4572 -1, -1, -1, 139, 140, 141, -1, -1, -1, -1,
4573 -1, -1, -1, -1, -1, 151, 1, 153, 3, 4,
4574 5, 6, 7, -1, -1, 10, 11, 12, -1, 14,
4575 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4576 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
4577 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
4578 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
4579 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
4580 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4581 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
4582 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
4583 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
4584 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
4585 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
4586 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4587 -1, -1, -1, -1, 139, 140, 141, -1, -1, -1,
4588 -1, -1, -1, -1, -1, -1, 151, 1, 153, 3,
4589 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
4590 -1, 15, 16, 17, 18, 19, 20, 21, 22, 23,
4591 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
4592 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
4593 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
4594 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
4595 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
4596 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
4597 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
4598 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
4599 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
4600 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
4601 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4602 -1, -1, -1, -1, -1, 139, 140, 141, -1, -1,
4603 -1, -1, -1, -1, -1, -1, -1, 151, 1, 153,
4604 3, 4, 5, 6, 7, -1, -1, 10, 11, 12,
4605 -1, -1, 15, 16, -1, 18, 19, 20, 21, 22,
4606 23, 24, 25, -1, -1, -1, -1, 30, 31, 32,
4607 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
4608 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
4609 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
4610 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
4611 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
4612 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
4613 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
4614 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
4615 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
4616 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4617 -1, -1, -1, -1, -1, -1, 139, 140, 141, -1,
4618 -1, -1, -1, -1, -1, -1, -1, -1, 151, 1,
4619 153, 3, 4, 5, 6, 7, -1, -1, 10, 11,
4620 12, -1, -1, 15, 16, -1, 18, 19, 20, 21,
4621 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
4622 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
4623 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
4624 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
4625 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
4626 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
4627 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
4628 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
4629 102, -1, 104, 105, -1, 107, -1, -1, 110, 111,
4630 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
4631 -1, -1, -1, -1, -1, 1, -1, 3, 4, 5,
4632 6, 7, -1, 9, 10, 11, 12, 139, 140, 141,
4633 16, -1, 18, 19, 20, 21, 22, 23, 24, 151,
4634 -1, 153, -1, -1, 30, 31, 32, 33, 34, 35,
4635 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
4636 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
4637 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4638 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4639 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4640 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4641 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4642 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
4643 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
4644 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
4645 -1, 11, 12, 139, 140, 141, 16, -1, 18, 19,
4646 20, 21, 22, 23, 24, 151, -1, 153, -1, -1,
4647 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
4648 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
4649 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
4650 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
4651 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
4652 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4653 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
4654 -1, 101, 102, -1, 104, 105, -1, 107, -1, -1,
4655 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4656 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4657 -1, -1, -1, -1, -1, -1, -1, -1, -1, 139,
4658 140, 141, -1, -1, -1, -1, -1, -1, -1, 149,
4659 -1, 151, 1, 153, 3, 4, 5, 6, 7, -1,
4660 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
4661 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
4662 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
4663 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
4664 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
4665 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
4666 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
4667 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4668 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
4669 -1, -1, 101, 102, -1, 104, 105, -1, 107, -1,
4670 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
4671 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4672 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4673 139, 140, 141, -1, -1, -1, -1, -1, -1, -1,
4674 149, -1, 151, 1, 153, 3, 4, 5, 6, 7,
4675 -1, -1, -1, 11, 12, -1, -1, -1, 16, -1,
4676 18, 19, 20, 21, 22, 23, 24, -1, -1, -1,
4677 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
4678 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
4679 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
4680 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
4681 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
4682 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4683 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
4684 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
4685 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
4686 118, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4687 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4688 -1, 139, 140, 141, -1, -1, 144, -1, -1, -1,
4689 -1, -1, -1, 151, 1, 153, 3, 4, 5, 6,
4690 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
4691 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
4692 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
4693 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
4694 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
4695 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
4696 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
4697 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4698 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
4699 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
4700 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
4701 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
4702 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4703 -1, -1, 139, 140, 141, -1, -1, 144, -1, -1,
4704 -1, -1, -1, -1, 151, 1, 153, 3, 4, 5,
4705 6, 7, -1, -1, 10, 11, 12, -1, -1, -1,
4706 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
4707 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
4708 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
4709 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
4710 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4711 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4712 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4713 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4714 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4715 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
4716 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
4717 -1, 1, -1, 3, 4, 5, 6, 7, -1, -1,
4718 -1, 11, 12, 139, 140, 141, 16, -1, 18, 19,
4719 20, 21, 22, 23, 24, 151, -1, 153, -1, -1,
4720 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
4721 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
4722 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
4723 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
4724 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
4725 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4726 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
4727 -1, 101, 102, -1, 104, 105, -1, 107, -1, -1,
4728 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4729 120, -1, -1, -1, -1, -1, -1, -1, -1, 3,
4730 4, 5, -1, 7, -1, -1, -1, 11, 12, 139,
4731 140, 141, 16, -1, 18, 19, 20, 21, 22, 23,
4732 24, 151, -1, 153, -1, -1, 30, 31, 32, 33,
4733 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
4734 -1, -1, 46, -1, -1, 49, 50, 51, 52, 53,
4735 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
4736 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
4737 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
4738 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
4739 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
4740 104, 105, -1, 107, 108, 109, 110, 111, 112, 113,
4741 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
4742 -1, -1, -1, -1, -1, 3, 4, 5, -1, 7,
4743 -1, -1, -1, 11, 12, 139, 140, 141, 16, -1,
4744 18, 19, 20, 21, 22, 23, 24, -1, -1, 153,
4745 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
4746 -1, 39, -1, -1, -1, -1, -1, -1, 46, -1,
4747 -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
4748 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
4749 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
4750 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4751 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
4752 98, -1, -1, 101, 102, -1, 104, 105, -1, -1,
4753 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
4754 118, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4755 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
4756 12, 139, 140, 141, 16, -1, 18, 19, 20, 21,
4757 22, 23, 24, 151, -1, 153, -1, -1, 30, 31,
4758 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
4759 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
4760 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
4761 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
4762 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
4763 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
4764 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
4765 102, -1, 104, 105, -1, -1, -1, -1, 110, 111,
4766 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
4767 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
4768 6, 7, -1, -1, -1, 11, 12, 139, 140, 141,
4769 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
4770 -1, 153, -1, -1, 30, 31, 32, 33, 34, 35,
4771 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
4772 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
4773 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4774 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4775 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4776 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4777 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4778 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
4779 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
4780 -1, -1, -1, 3, 4, 5, 6, 7, -1, -1,
4781 -1, 11, 12, 139, 140, 141, 16, -1, 18, 19,
4782 20, 21, 22, 23, 24, 151, -1, -1, -1, -1,
4783 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
4784 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
4785 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
4786 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
4787 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
4788 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4789 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
4790 -1, 101, 102, -1, 104, 105, -1, 107, -1, -1,
4791 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4792 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4793 -1, -1, -1, -1, -1, -1, -1, -1, -1, 139,
4794 140, 141, -1, -1, -1, -1, -1, -1, -1, -1,
4795 -1, 151, 3, 4, 5, 6, 7, 8, 9, 10,
4796 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
4797 21, 22, 23, 24, 25, 26, -1, -1, -1, 30,
4798 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
4799 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
4800 51, 52, 53, 54, 55, 56, 57, -1, -1, -1,
4801 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4802 -1, -1, -1, -1, 75, 76, 77, 78, 79, 80,
4803 81, 82, 83, -1, -1, 86, 87, -1, -1, -1,
4804 -1, 92, 93, 94, 95, -1, -1, -1, -1, -1,
4805 -1, -1, -1, -1, -1, -1, 107, 108, -1, -1,
4806 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4807 -1, -1, -1, -1, -1, -1, -1, -1, 129, 130,
4808 131, 132, 133, 134, 135, 136, 137, 138, -1, 140,
4809 141, -1, -1, -1, -1, -1, 147, 148, 3, 4,
4810 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
4811 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
4812 25, 26, -1, -1, -1, 30, 31, 32, 33, 34,
4813 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
4814 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
4815 55, 56, 57, -1, -1, -1, -1, -1, -1, -1,
4816 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4817 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
4818 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
4819 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4820 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
4821 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4822 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
4823 135, 136, 137, 138, -1, 140, 141, -1, -1, -1,
4824 -1, -1, 147, 3, 4, 5, 6, 7, 8, 9,
4825 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
4826 20, 21, 22, 23, 24, 25, 26, -1, -1, -1,
4827 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4828 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
4829 50, 51, 52, 53, 54, -1, 56, -1, -1, -1,
4830 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4831 -1, -1, -1, -1, -1, 75, 76, 77, 78, 79,
4832 80, 81, 82, 83, -1, -1, 86, 87, -1, -1,
4833 -1, -1, 92, 93, 94, 95, -1, -1, -1, -1,
4834 -1, -1, -1, -1, -1, -1, -1, 107, 108, -1,
4835 -1, 111, -1, -1, -1, -1, -1, -1, -1, -1,
4836 -1, -1, -1, -1, -1, -1, -1, -1, -1, 129,
4837 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4838 140, 141, -1, -1, -1, -1, -1, 147, 3, 4,
4839 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
4840 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
4841 25, 26, -1, -1, -1, 30, 31, 32, 33, 34,
4842 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
4843 45, 46, 47, 48, 49, 50, 51, 52, 53, -1,
4844 -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
4845 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4846 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
4847 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
4848 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4849 -1, -1, 107, 108, -1, -1, 111, -1, -1, -1,
4850 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4851 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
4852 135, 136, 137, 138, -1, 140, 141, -1, -1, -1,
4853 -1, -1, 147, 3, 4, 5, 6, 7, 8, 9,
4854 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
4855 20, 21, 22, 23, 24, 25, 26, -1, -1, -1,
4856 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
4857 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
4858 50, 51, 52, 53, -1, -1, 56, -1, -1, -1,
4859 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4860 -1, -1, -1, -1, -1, 75, 76, 77, 78, 79,
4861 80, 81, 82, 83, -1, -1, 86, 87, -1, -1,
4862 -1, -1, 92, 93, 94, 95, -1, -1, -1, -1,
4863 -1, -1, -1, -1, -1, -1, -1, 107, 108, -1,
4864 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4865 -1, -1, -1, -1, -1, -1, -1, -1, -1, 129,
4866 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4867 140, 141, 3, 4, 5, -1, 7, 147, -1, -1,
4868 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
4869 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
4870 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
4871 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
4872 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
4873 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
4874 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4875 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4876 -1, -1, -1, -1, -1, -1, -1, 98, -1, -1,
4877 101, 102, -1, 104, 105, -1, -1, -1, -1, 110,
4878 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
4879 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4880 -1, 3, 4, 5, -1, 7, -1, -1, 139, 11,
4881 12, -1, -1, -1, 16, 146, 18, 19, 20, 21,
4882 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
4883 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
4884 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
4885 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
4886 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
4887 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4888 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4889 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
4890 102, -1, 104, 105, -1, -1, -1, -1, 110, 111,
4891 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
4892 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4893 3, 4, 5, 6, 7, -1, -1, 139, 11, 12,
4894 -1, -1, -1, 16, 146, 18, 19, 20, 21, 22,
4895 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
4896 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
4897 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
4898 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
4899 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
4900 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
4901 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
4902 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
4903 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
4904 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
4905 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
4906 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
4907 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
4908 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
4909 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
4910 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
4911 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
4912 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
4913 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4914 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
4915 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
4916 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
4917 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
4918 -1, -1, 3, 4, 5, 6, 7, -1, -1, -1,
4919 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
4920 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
4921 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
4922 -1, -1, -1, -1, 45, 46, -1, 48, 49, 50,
4923 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
4924 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
4925 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
4926 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
4927 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
4928 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
4929 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
4930 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
4931 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
4932 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4933 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
4934 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
4935 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
4936 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
4937 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4938 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
4939 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
4940 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
4941 105, -1, 107, 108, 109, 110, 111, 112, 113, 114,
4942 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
4943 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
4944 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
4945 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
4946 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
4947 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
4948 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
4949 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
4950 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
4951 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4952 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
4953 -1, -1, 101, 102, -1, 104, 105, -1, 107, 108,
4954 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
4955 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4956 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
4957 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
4958 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
4959 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
4960 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
4961 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
4962 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
4963 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
4964 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
4965 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
4966 -1, 104, 105, -1, 107, 108, 109, 110, 111, 112,
4967 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
4968 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
4969 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
4970 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
4971 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
4972 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
4973 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
4974 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
4975 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
4976 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4977 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
4978 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
4979 107, 108, -1, 110, 111, 112, 113, 114, 115, 116,
4980 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
4981 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
4982 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
4983 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
4984 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
4985 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
4986 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
4987 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
4988 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
4989 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
4990 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
4991 101, 102, -1, 104, 105, -1, -1, 108, 109, 110,
4992 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
4993 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
4994 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
4995 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4996 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
4997 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
4998 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
4999 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
5000 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5001 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5002 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5003 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5004 105, -1, 107, 108, -1, 110, 111, 112, 113, 114,
5005 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5006 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5007 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5008 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5009 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5010 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5011 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
5012 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5013 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5014 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5015 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5016 -1, -1, 101, 102, -1, 104, 105, -1, -1, 108,
5017 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5018 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5019 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5020 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5021 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5022 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5023 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5024 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5025 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5026 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5027 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5028 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5029 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
5030 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5031 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5032 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5033 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5034 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5035 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5036 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5037 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5038 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5039 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5040 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5041 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5042 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5043 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5044 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5045 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5046 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5047 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5048 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5049 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5050 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5051 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5052 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5053 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5054 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
5055 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5056 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5057 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5058 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5059 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5060 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5061 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5062 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5063 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5064 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5065 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5066 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5067 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5068 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5069 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5070 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5071 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5072 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5073 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5074 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5075 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5076 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5077 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5078 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5079 -1, -1, 101, 102, -1, 104, 105, -1, 107, -1,
5080 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5081 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5082 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5083 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5084 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5085 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5086 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5087 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5088 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5089 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5090 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5091 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5092 -1, 104, 105, -1, -1, -1, -1, 110, 111, 112,
5093 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5094 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5095 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5096 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5097 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5098 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5099 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5100 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5101 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5102 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5103 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5104 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5105 -1, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5106 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5107 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5108 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5109 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5110 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5111 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5112 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5113 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5114 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5115 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5116 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5117 101, 102, -1, 104, 105, -1, -1, -1, -1, 110,
5118 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5119 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5120 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5121 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5122 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5123 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5124 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5125 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5126 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5127 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5128 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5129 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5130 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5131 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5132 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5133 -1, -1, -1, 16, 139, 18, 19, 20, 21, 22,
5134 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5135 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5136 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5137 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5138 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5139 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5140 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5141 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5142 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
5143 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5144 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5145 11, 12, -1, -1, -1, 16, 139, 18, 19, 20,
5146 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5147 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5148 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5149 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5150 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5151 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5152 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5153 -1, -1, -1, 94, -1, -1, -1, 98, -1, -1,
5154 101, 102, -1, 104, 105, -1, -1, -1, -1, 110,
5155 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5156 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5157 -1, -1, 11, 12, -1, -1, -1, 16, 139, 18,
5158 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5159 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5160 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5161 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5162 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5163 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5164 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5165 -1, -1, -1, -1, -1, -1, -1, -1, -1, 98,
5166 -1, -1, 101, 102, -1, 104, 105, -1, -1, -1,
5167 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5168 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5169 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5170 139, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5171 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5172 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5173 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5174 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5175 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5176 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5177 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5178 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5179 -1, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5180 117, 118, -1, -1, -1, -1, -1, -1, 3, 4,
5181 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5182 -1, 16, 139, 18, 19, 20, 21, 22, 23, 24,
5183 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5184 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5185 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5186 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5187 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5188 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5189 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5190 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5191 105, -1, -1, -1, -1, 110, 111, 112, 113, 114,
5192 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5193 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5194 -1, -1, -1, 16, 139, 18, 19, 20, 21, 22,
5195 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5196 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5197 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5198 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5199 63, 64, 65, 33, 34, 35, 36, -1, -1, -1,
5200 -1, -1, -1, -1, -1, -1, -1, -1, -1, 49,
5201 50, 51, 52, -1, -1, -1, 56, -1, -1, 59,
5202 60, 61, 62, 63, -1, 98, -1, -1, 101, 102,
5203 -1, 104, 105, -1, -1, -1, -1, 110, 111, 112,
5204 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5205 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
5206 -1, 101, -1, -1, 104, 105, 139, 107, -1, -1,
5207 110, 111, 112, 113, 114, 115, 116, 117, 118, 33,
5208 34, 35, 36, -1, -1, -1, -1, -1, -1, -1,
5209 -1, -1, 132, -1, -1, 49, 50, 51, 52, 139,
5210 -1, -1, 56, -1, -1, 59, 60, 61, 62, 63,
5211 -1, -1, 33, 34, 35, 36, -1, -1, -1, -1,
5212 -1, -1, -1, -1, -1, -1, -1, -1, 49, 50,
5213 51, 52, -1, -1, -1, 56, 90, 91, 59, 60,
5214 61, 62, 63, -1, 98, -1, -1, 101, -1, -1,
5215 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
5216 114, 115, 116, 117, 118, -1, -1, -1, -1, 90,
5217 91, -1, -1, -1, -1, -1, -1, 98, 132, -1,
5218 101, -1, -1, 104, 105, 139, -1, -1, -1, 110,
5219 111, 112, 113, 114, 115, 116, 117, 118, 52, 53,
5220 -1, -1, 56, -1, -1, -1, -1, -1, -1, -1,
5221 -1, 132, -1, -1, -1, -1, -1, -1, 139, -1,
5222 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5223 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5224 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5225 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5226 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5227 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5228 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5229 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5230 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5231 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5232 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5233 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5234 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5235 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5236 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5237 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5238 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5239 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5240 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5241 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5242 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5243 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5244 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5245 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5246 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5247 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5248 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5249 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5250 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5251 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5252 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5253 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5254 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5255 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5256 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5257 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5258 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5259 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5260 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5261 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5262 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5263 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5264 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5265 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5266 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5267 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5268 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5269 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5270 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5272 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5273 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5274 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5276 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5277 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5278 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5279 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5281 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5282 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5283 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5284 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5285 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5286 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5287 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5288 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5289 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5290 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5291 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5292 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5293 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5294 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5295 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5296 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5297 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5298 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5299 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5300 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5301 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5302 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5303 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5304 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5305 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5306 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5308 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5309 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5310 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5311 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5312 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5313 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5314 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5315 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5317 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5318 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5319 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5320 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5321 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5322 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5323 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5324 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5326 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5327 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5328 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5330 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5331 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5332 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5333 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5335 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5336 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5337 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5338 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5339 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5340 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5341 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5342 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5343 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5344 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5345 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5346 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5347 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5348 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5349 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5350 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5351 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5353 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5354 134, 135, 136, 137, 138, -1, 140, 141, 52, 53,
5355 -1, -1, 56, 147, 148, -1, -1, -1, -1, -1,
5356 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5357 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
5358 -1, -1, 86, 87, -1, -1, -1, -1, 92, 93,
5359 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
5360 -1, -1, -1, 107, 108, -1, -1, -1, -1, -1,
5361 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5362 -1, -1, -1, -1, -1, 129, 130, 131, 132, 133,
5363 134, 135, 136, 137, 138, -1, 140, 141, -1, -1,
5364 -1, -1, -1, 147
5365};
5366
5367/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
5368 state STATE-NUM. */
5369static const yytype_int16 yystos[] =
5370{
5371 0, 155, 156, 0, 1, 3, 4, 5, 6, 7,
5372 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
5373 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
5374 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
5375 57, 59, 60, 61, 62, 63, 64, 65, 75, 76,
5376 90, 91, 98, 101, 102, 104, 105, 107, 110, 111,
5377 112, 113, 114, 115, 116, 117, 118, 139, 140, 141,
5378 157, 158, 159, 167, 169, 171, 179, 180, 182, 183,
5379 184, 186, 187, 188, 190, 191, 200, 203, 218, 233,
5380 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,
5381 252, 279, 280, 333, 334, 335, 336, 337, 338, 339,
5382 342, 344, 345, 359, 360, 362, 363, 364, 365, 366,
5383 367, 368, 369, 405, 419, 159, 3, 4, 5, 6,
5384 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
5385 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
5386 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
5387 45, 46, 47, 48, 49, 50, 51, 52, 53, 56,
5388 75, 76, 77, 78, 79, 80, 81, 82, 83, 86,
5389 87, 92, 93, 94, 95, 107, 108, 129, 130, 131,
5390 132, 133, 134, 135, 136, 137, 138, 140, 141, 147,
5391 194, 195, 196, 198, 199, 359, 39, 58, 98, 101,
5392 107, 108, 109, 112, 140, 183, 191, 200, 204, 210,
5393 213, 215, 233, 365, 366, 368, 369, 403, 404, 210,
5394 148, 211, 212, 148, 207, 211, 148, 153, 412, 54,
5395 195, 412, 143, 160, 143, 21, 22, 31, 32, 182,
5396 200, 233, 252, 200, 200, 200, 56, 1, 47, 101,
5397 163, 164, 165, 167, 185, 186, 419, 167, 220, 205,
5398 215, 403, 419, 204, 402, 403, 419, 46, 98, 139,
5399 146, 190, 218, 233, 365, 366, 369, 223, 54, 55,
5400 57, 194, 348, 361, 348, 349, 350, 152, 152, 152,
5401 152, 364, 179, 200, 200, 151, 153, 411, 417, 418,
5402 40, 41, 42, 43, 44, 37, 38, 26, 143, 207,
5403 211, 244, 281, 28, 245, 278, 126, 146, 101, 107,
5404 187, 126, 25, 77, 78, 79, 80, 81, 82, 83,
5405 84, 85, 86, 87, 88, 89, 94, 95, 127, 129,
5406 130, 131, 132, 133, 134, 135, 136, 137, 138, 202,
5407 202, 68, 96, 97, 145, 409, 219, 171, 175, 175,
5408 176, 177, 176, 175, 411, 418, 98, 184, 191, 233,
5409 257, 365, 366, 369, 52, 56, 94, 98, 192, 193,
5410 233, 365, 366, 369, 193, 33, 34, 35, 36, 49,
5411 50, 51, 52, 56, 148, 194, 367, 400, 210, 97,
5412 409, 410, 281, 336, 99, 99, 146, 204, 56, 204,
5413 204, 204, 348, 126, 100, 146, 214, 419, 97, 145,
5414 409, 99, 99, 146, 214, 210, 412, 413, 210, 91,
5415 209, 210, 215, 377, 403, 419, 171, 413, 171, 54,
5416 64, 65, 168, 148, 201, 157, 163, 97, 409, 99,
5417 167, 166, 185, 149, 411, 418, 413, 221, 413, 150,
5418 146, 153, 416, 146, 416, 144, 416, 412, 56, 364,
5419 187, 189, 146, 97, 145, 409, 270, 271, 66, 119,
5420 121, 122, 351, 119, 119, 351, 67, 351, 340, 346,
5421 343, 347, 77, 151, 159, 175, 175, 175, 175, 167,
5422 171, 171, 282, 283, 106, 181, 286, 287, 286, 107,
5423 179, 204, 215, 216, 217, 185, 146, 190, 146, 169,
5424 170, 179, 191, 200, 204, 206, 217, 233, 369, 172,
5425 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
5426 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
5427 200, 200, 200, 200, 52, 53, 56, 198, 207, 406,
5428 407, 209, 215, 52, 53, 56, 198, 207, 406, 161,
5429 163, 13, 253, 417, 253, 163, 175, 163, 411, 225,
5430 56, 97, 145, 409, 25, 171, 52, 56, 192, 130,
5431 370, 97, 145, 409, 228, 401, 229, 68, 97, 408,
5432 52, 56, 406, 170, 200, 206, 170, 206, 197, 124,
5433 204, 107, 204, 213, 403, 52, 56, 209, 52, 56,
5434 404, 413, 149, 413, 146, 413, 146, 413, 195, 222,
5435 200, 144, 144, 406, 406, 206, 160, 413, 165, 413,
5436 403, 146, 189, 52, 56, 209, 52, 56, 272, 353,
5437 352, 119, 341, 351, 66, 119, 119, 341, 66, 119,
5438 200, 144, 284, 282, 10, 251, 288, 251, 204, 146,
5439 44, 413, 189, 146, 44, 126, 44, 97, 145, 409,
5440 173, 412, 99, 99, 207, 211, 412, 414, 146, 99,
5441 99, 207, 208, 211, 419, 251, 8, 246, 329, 419,
5442 163, 13, 163, 251, 27, 254, 417, 251, 25, 224,
5443 293, 17, 248, 291, 52, 56, 209, 52, 56, 176,
5444 227, 371, 226, 52, 56, 192, 209, 161, 171, 230,
5445 231, 208, 211, 195, 204, 204, 214, 99, 99, 414,
5446 99, 99, 377, 403, 171, 416, 187, 414, 273, 354,
5447 54, 55, 57, 358, 369, 152, 351, 152, 152, 152,
5448 285, 144, 289, 107, 204, 167, 189, 167, 200, 52,
5449 56, 209, 52, 56, 52, 56, 90, 91, 98, 101,
5450 104, 105, 110, 132, 303, 304, 305, 308, 323, 324,
5451 326, 327, 328, 333, 334, 337, 338, 339, 342, 344,
5452 345, 366, 128, 170, 206, 170, 206, 181, 150, 99,
5453 170, 206, 170, 206, 181, 204, 217, 330, 419, 9,
5454 15, 247, 249, 332, 419, 14, 249, 250, 255, 256,
5455 419, 256, 178, 294, 291, 251, 107, 204, 290, 251,
5456 414, 163, 417, 175, 161, 414, 251, 413, 148, 372,
5457 373, 194, 281, 278, 99, 413, 146, 413, 274, 355,
5458 131, 265, 266, 419, 265, 204, 414, 324, 324, 56,
5459 192, 311, 309, 414, 310, 412, 415, 325, 52, 100,
5460 174, 131, 88, 89, 97, 145, 148, 306, 307, 200,
5461 170, 206, 100, 331, 419, 163, 162, 163, 175, 251,
5462 251, 295, 251, 204, 146, 253, 251, 161, 417, 251,
5463 52, 54, 55, 56, 57, 58, 77, 91, 101, 107,
5464 108, 109, 133, 136, 374, 376, 377, 378, 379, 380,
5465 381, 382, 383, 384, 387, 388, 389, 390, 391, 394,
5466 395, 396, 397, 398, 161, 376, 382, 232, 148, 276,
5467 376, 356, 262, 264, 267, 380, 382, 383, 385, 386,
5468 389, 390, 392, 393, 396, 398, 412, 163, 161, 303,
5469 107, 303, 312, 313, 314, 316, 58, 112, 317, 318,
5470 319, 320, 321, 322, 388, 144, 270, 326, 308, 324,
5471 324, 192, 414, 413, 112, 312, 317, 312, 317, 98,
5472 191, 233, 365, 366, 369, 253, 163, 253, 296, 107,
5473 204, 163, 251, 101, 107, 258, 259, 260, 261, 379,
5474 413, 413, 126, 146, 375, 204, 146, 399, 419, 34,
5475 52, 146, 399, 399, 146, 375, 52, 146, 375, 52,
5476 251, 417, 146, 372, 376, 275, 357, 267, 131, 126,
5477 146, 263, 98, 233, 146, 399, 399, 399, 146, 263,
5478 146, 263, 151, 413, 52, 146, 414, 107, 303, 316,
5479 146, 348, 415, 146, 303, 34, 52, 348, 413, 413,
5480 414, 414, 56, 97, 145, 409, 163, 332, 163, 301,
5481 302, 303, 314, 317, 204, 256, 291, 292, 260, 379,
5482 146, 413, 146, 204, 374, 377, 381, 394, 396, 384,
5483 388, 390, 398, 382, 391, 396, 380, 382, 161, 267,
5484 29, 123, 277, 163, 131, 233, 262, 393, 396, 56,
5485 97, 385, 390, 382, 392, 396, 382, 52, 268, 269,
5486 378, 146, 315, 316, 52, 146, 146, 124, 319, 321,
5487 322, 52, 56, 209, 52, 56, 329, 255, 253, 40,
5488 41, 146, 413, 258, 261, 259, 413, 146, 375, 146,
5489 375, 399, 146, 375, 146, 375, 375, 251, 149, 161,
5490 163, 120, 146, 263, 146, 263, 52, 56, 399, 146,
5491 263, 146, 263, 263, 146, 412, 315, 146, 146, 315,
5492 414, 297, 175, 175, 312, 146, 146, 382, 396, 382,
5493 382, 251, 144, 382, 396, 382, 382, 269, 316, 315,
5494 298, 259, 375, 146, 375, 375, 375, 263, 146, 263,
5495 263, 263, 299, 382, 382, 163, 375, 263, 256, 293,
5496 300
5497};
5498
5499/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
5500static const yytype_int16 yyr1[] =
5501{
5502 0, 154, 156, 155, 157, 158, 158, 158, 158, 159,
5503 159, 160, 162, 161, 161, 163, 164, 164, 164, 164,
5504 165, 166, 165, 168, 167, 167, 167, 167, 167, 167,
5505 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
5506 167, 169, 169, 169, 169, 169, 169, 169, 169, 170,
5507 170, 170, 171, 171, 171, 171, 171, 172, 173, 174,
5508 171, 171, 175, 177, 178, 176, 179, 179, 180, 180,
5509 181, 182, 183, 183, 183, 183, 183, 183, 183, 183,
5510 183, 183, 183, 184, 184, 185, 185, 186, 186, 186,
5511 186, 186, 186, 186, 186, 186, 186, 187, 187, 188,
5512 188, 189, 189, 190, 190, 190, 190, 190, 190, 190,
5513 190, 190, 191, 191, 191, 191, 191, 191, 191, 191,
5514 191, 192, 192, 193, 193, 193, 194, 194, 194, 194,
5515 194, 195, 195, 196, 197, 196, 198, 198, 198, 198,
5516 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
5517 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
5518 198, 198, 198, 198, 198, 198, 199, 199, 199, 199,
5519 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
5520 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
5521 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
5522 199, 199, 199, 199, 199, 199, 199, 200, 200, 200,
5523 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
5524 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
5525 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
5526 200, 200, 200, 200, 200, 200, 200, 201, 200, 200,
5527 200, 202, 202, 202, 202, 203, 203, 204, 205, 205,
5528 205, 205, 206, 206, 207, 207, 207, 208, 208, 209,
5529 209, 209, 209, 209, 210, 210, 210, 210, 210, 212,
5530 211, 213, 214, 214, 215, 215, 215, 215, 216, 216,
5531 217, 217, 217, 218, 218, 218, 218, 218, 218, 218,
5532 218, 218, 218, 218, 219, 218, 220, 218, 221, 218,
5533 218, 218, 218, 218, 218, 218, 218, 218, 218, 222,
5534 218, 218, 218, 218, 218, 218, 223, 218, 218, 218,
5535 218, 218, 224, 218, 225, 218, 218, 218, 226, 218,
5536 227, 218, 228, 218, 229, 230, 218, 231, 232, 218,
5537 218, 218, 218, 218, 233, 234, 235, 236, 237, 238,
5538 239, 240, 241, 242, 243, 244, 245, 246, 247, 248,
5539 249, 250, 251, 252, 253, 253, 253, 254, 254, 255,
5540 255, 256, 256, 257, 257, 258, 258, 259, 259, 260,
5541 260, 260, 260, 260, 261, 261, 262, 262, 262, 262,
5542 262, 263, 263, 264, 264, 264, 264, 264, 264, 264,
5543 264, 264, 264, 264, 264, 264, 264, 264, 265, 265,
5544 266, 266, 267, 267, 268, 268, 269, 269, 271, 272,
5545 273, 274, 275, 270, 276, 276, 277, 277, 278, 279,
5546 279, 279, 279, 280, 280, 280, 280, 280, 280, 280,
5547 280, 280, 281, 281, 283, 284, 285, 282, 287, 288,
5548 289, 286, 290, 290, 290, 290, 291, 292, 292, 294,
5549 295, 296, 297, 298, 299, 293, 300, 300, 301, 301,
5550 301, 302, 302, 302, 302, 302, 303, 304, 304, 305,
5551 305, 306, 307, 308, 308, 308, 308, 308, 308, 308,
5552 309, 308, 308, 310, 308, 308, 311, 308, 312, 312,
5553 312, 312, 312, 312, 312, 312, 313, 313, 314, 314,
5554 314, 314, 315, 315, 316, 317, 317, 317, 317, 317,
5555 317, 318, 318, 319, 319, 320, 320, 321, 321, 322,
5556 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
5557 324, 324, 324, 324, 324, 324, 324, 324, 324, 325,
5558 324, 326, 327, 328, 328, 328, 329, 329, 330, 330,
5559 330, 331, 331, 332, 332, 333, 333, 334, 335, 335,
5560 335, 336, 337, 338, 339, 340, 340, 341, 341, 342,
5561 343, 343, 344, 345, 346, 346, 347, 347, 348, 348,
5562 349, 349, 350, 350, 351, 352, 351, 353, 354, 355,
5563 356, 357, 351, 358, 358, 358, 358, 359, 359, 360,
5564 361, 361, 361, 361, 362, 363, 363, 364, 364, 364,
5565 364, 365, 365, 365, 365, 365, 366, 366, 366, 366,
5566 366, 366, 366, 367, 367, 368, 368, 369, 369, 371,
5567 370, 370, 372, 372, 372, 373, 372, 374, 374, 374,
5568 374, 374, 375, 375, 376, 376, 376, 376, 376, 376,
5569 376, 376, 376, 376, 376, 376, 376, 376, 376, 377,
5570 378, 378, 378, 378, 379, 379, 380, 381, 381, 382,
5571 382, 383, 384, 384, 385, 385, 386, 386, 387, 387,
5572 388, 388, 389, 390, 390, 391, 392, 393, 393, 394,
5573 394, 395, 395, 396, 396, 397, 397, 398, 399, 399,
5574 400, 401, 400, 402, 402, 403, 403, 404, 404, 404,
5575 404, 405, 405, 405, 406, 406, 406, 406, 407, 407,
5576 407, 408, 408, 409, 409, 410, 410, 411, 411, 412,
5577 412, 413, 414, 415, 416, 416, 416, 417, 417, 418,
5578 418, 419
5579};
5580
5581/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
5582static const yytype_int8 yyr2[] =
5583{
5584 0, 2, 0, 2, 2, 1, 1, 3, 2, 1,
5585 2, 3, 0, 6, 3, 2, 1, 1, 3, 2,
5586 1, 0, 3, 0, 4, 3, 3, 3, 2, 3,
5587 3, 3, 3, 3, 4, 1, 3, 3, 5, 3,
5588 1, 3, 3, 6, 5, 5, 5, 5, 3, 1,
5589 3, 1, 1, 3, 3, 3, 2, 0, 0, 0,
5590 6, 1, 1, 0, 0, 4, 1, 1, 1, 4,
5591 3, 1, 2, 3, 4, 5, 4, 5, 2, 2,
5592 2, 2, 2, 1, 3, 1, 3, 1, 2, 3,
5593 5, 2, 4, 2, 4, 1, 3, 1, 3, 2,
5594 3, 1, 3, 1, 1, 4, 3, 3, 3, 3,
5595 2, 1, 1, 1, 4, 3, 3, 3, 3, 2,
5596 1, 1, 1, 2, 1, 3, 1, 1, 1, 1,
5597 1, 1, 1, 1, 0, 4, 1, 1, 1, 1,
5598 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5599 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5600 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5601 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5602 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5603 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5604 1, 1, 1, 1, 1, 1, 1, 3, 3, 6,
5605 5, 5, 5, 5, 4, 3, 3, 3, 2, 2,
5606 2, 2, 3, 3, 3, 3, 3, 3, 4, 2,
5607 2, 3, 3, 3, 3, 1, 3, 3, 3, 3,
5608 3, 2, 2, 3, 3, 3, 3, 0, 4, 6,
5609 1, 1, 1, 1, 1, 3, 3, 1, 1, 2,
5610 4, 2, 1, 3, 3, 5, 3, 1, 1, 1,
5611 1, 2, 4, 2, 1, 2, 2, 4, 1, 0,
5612 2, 2, 2, 1, 1, 2, 3, 4, 1, 1,
5613 3, 4, 2, 1, 1, 1, 1, 1, 1, 1,
5614 1, 1, 1, 1, 0, 4, 0, 3, 0, 4,
5615 3, 3, 2, 3, 3, 1, 4, 3, 1, 0,
5616 6, 4, 3, 2, 1, 2, 0, 3, 6, 6,
5617 4, 4, 0, 6, 0, 5, 5, 6, 0, 6,
5618 0, 7, 0, 5, 0, 0, 7, 0, 0, 9,
5619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5621 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
5622 5, 1, 2, 1, 1, 1, 3, 1, 3, 1,
5623 3, 5, 1, 3, 2, 1, 4, 2, 2, 2,
5624 1, 2, 0, 6, 8, 4, 6, 4, 2, 6,
5625 2, 4, 6, 2, 4, 2, 4, 1, 1, 1,
5626 3, 4, 1, 4, 1, 3, 1, 1, 0, 0,
5627 0, 0, 0, 7, 4, 1, 3, 3, 3, 2,
5628 4, 5, 5, 2, 4, 4, 3, 3, 3, 2,
5629 1, 4, 3, 3, 0, 0, 0, 5, 0, 0,
5630 0, 5, 1, 2, 3, 4, 5, 1, 1, 0,
5631 0, 0, 0, 0, 0, 11, 1, 1, 1, 3,
5632 3, 1, 2, 3, 1, 1, 1, 3, 1, 3,
5633 1, 1, 1, 1, 4, 4, 3, 4, 4, 3,
5634 0, 4, 2, 0, 4, 2, 0, 4, 1, 1,
5635 2, 3, 5, 2, 4, 1, 2, 3, 2, 4,
5636 1, 3, 1, 3, 1, 3, 1, 2, 1, 3,
5637 1, 1, 3, 2, 1, 1, 3, 2, 1, 2,
5638 1, 3, 3, 2, 2, 1, 1, 1, 2, 2,
5639 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
5640 3, 1, 2, 2, 3, 1, 6, 1, 1, 1,
5641 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
5642 2, 3, 3, 3, 4, 0, 3, 1, 2, 4,
5643 0, 3, 4, 4, 0, 3, 0, 3, 0, 2,
5644 0, 2, 0, 2, 1, 0, 3, 0, 0, 0,
5645 0, 0, 8, 1, 1, 1, 1, 1, 1, 2,
5646 1, 1, 1, 1, 3, 1, 2, 1, 1, 1,
5647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5648 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
5649 4, 0, 3, 5, 3, 0, 3, 4, 2, 2,
5650 2, 1, 2, 0, 6, 8, 4, 6, 4, 6,
5651 2, 4, 6, 2, 4, 2, 4, 1, 0, 1,
5652 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
5653 3, 1, 2, 1, 2, 1, 1, 3, 1, 3,
5654 1, 1, 2, 2, 1, 3, 3, 1, 3, 1,
5655 3, 1, 1, 2, 1, 1, 1, 2, 2, 1,
5656 1, 0, 4, 1, 2, 1, 3, 3, 2, 4,
5657 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5658 1, 1, 1, 1, 1, 1, 1, 0, 1, 0,
5659 1, 2, 2, 2, 0, 1, 1, 1, 1, 1,
5660 2, 0
5661};
5662
5663
5664enum { YYENOMEM = -2 };
5665
5666#define yyerrok (yyerrstatus = 0)
5667#define yyclearin (yychar = YYEMPTY)
5668
5669#define YYACCEPT goto yyacceptlab
5670#define YYABORT goto yyabortlab
5671#define YYERROR goto yyerrorlab
5672#define YYNOMEM goto yyexhaustedlab
5673
5674
5675#define YYRECOVERING() (!!yyerrstatus)
5676
5677#define YYBACKUP(Token, Value) \
5678 do \
5679 if (yychar == YYEMPTY) \
5680 { \
5681 yychar = (Token); \
5682 yylval = (Value); \
5683 YYPOPSTACK (yylen); \
5684 yystate = *yyssp; \
5685 goto yybackup; \
5686 } \
5687 else \
5688 { \
5689 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
5690 YYERROR; \
5691 } \
5692 while (0)
5693
5694/* Backward compatibility with an undocumented macro.
5695 Use YYerror or YYUNDEF. */
5696#define YYERRCODE YYUNDEF
5697
5698/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
5699 If N is 0, then set CURRENT to the empty location which ends
5700 the previous symbol: RHS[0] (always defined). */
5701
5702#ifndef YYLLOC_DEFAULT
5703# define YYLLOC_DEFAULT(Current, Rhs, N) \
5704 do \
5705 if (N) \
5706 { \
5707 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
5708 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
5709 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
5710 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
5711 } \
5712 else \
5713 { \
5714 (Current).first_line = (Current).last_line = \
5715 YYRHSLOC (Rhs, 0).last_line; \
5716 (Current).first_column = (Current).last_column = \
5717 YYRHSLOC (Rhs, 0).last_column; \
5718 } \
5719 while (0)
5720#endif
5721
5722#define YYRHSLOC(Rhs, K) ((Rhs)[K])
5723
5724
5725/* Enable debugging if requested. */
5726#if YYDEBUG
5727
5728# ifndef YYFPRINTF
5729# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
5730# define YYFPRINTF fprintf
5731# endif
5732
5733# define YYDPRINTF(Args) \
5734do { \
5735 if (yydebug) \
5736 YYFPRINTF Args; \
5737} while (0)
5738
5739
5740/* YYLOCATION_PRINT -- Print the location on the stream.
5741 This macro was not mandated originally: define only if we know
5742 we won't break user code: when these are the locations we know. */
5743
5744# ifndef YYLOCATION_PRINT
5745
5746# if defined YY_LOCATION_PRINT
5747
5748 /* Temporary convenience wrapper in case some people defined the
5749 undocumented and private YY_LOCATION_PRINT macros. */
5750# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
5751
5752# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
5753
5754/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
5755
5757static int
5758yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
5759{
5760 int res = 0;
5761 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
5762 if (0 <= yylocp->first_line)
5763 {
5764 res += YYFPRINTF (p, "%d", yylocp->first_line);
5765 if (0 <= yylocp->first_column)
5766 res += YYFPRINTF (p, ".%d", yylocp->first_column);
5767 }
5768 if (0 <= yylocp->last_line)
5769 {
5770 if (yylocp->first_line < yylocp->last_line)
5771 {
5772 res += YYFPRINTF (p, "-%d", yylocp->last_line);
5773 if (0 <= end_col)
5774 res += YYFPRINTF (p, ".%d", end_col);
5775 }
5776 else if (0 <= end_col && yylocp->first_column < end_col)
5777 res += YYFPRINTF (p, "-%d", end_col);
5778 }
5779 return res;
5780}
5781
5782# define YYLOCATION_PRINT yy_location_print_
5783
5784 /* Temporary convenience wrapper in case some people defined the
5785 undocumented and private YY_LOCATION_PRINT macros. */
5786# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
5787
5788# else
5789
5790# define YYLOCATION_PRINT(File, Loc) ((void) 0)
5791 /* Temporary convenience wrapper in case some people defined the
5792 undocumented and private YY_LOCATION_PRINT macros. */
5793# define YY_LOCATION_PRINT YYLOCATION_PRINT
5794
5795# endif
5796# endif /* !defined YYLOCATION_PRINT */
5797
5798
5799# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
5800do { \
5801 if (yydebug) \
5802 { \
5803 YYFPRINTF (p, "%s ", Title); \
5804 yy_symbol_print (stderr, \
5805 Kind, Value, Location, p); \
5806 YYFPRINTF (p, "\n"); \
5807 } \
5808} while (0)
5809
5810
5811/*-----------------------------------.
5812| Print this symbol's value on YYO. |
5813`-----------------------------------*/
5814
5815static void
5816yy_symbol_value_print (FILE *yyo,
5817 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
5818{
5819 FILE *yyoutput = yyo;
5820 YY_USE (yyoutput);
5821 YY_USE (yylocationp);
5822 YY_USE (p);
5823 if (!yyvaluep)
5824 return;
5826 switch (yykind)
5827 {
5828 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
5829#line 970 "parse.y"
5830 {
5831#ifndef RIPPER
5832 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5833#else
5834 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5835#endif
5836}
5837#line 5836 "parse.c"
5838 break;
5839
5840 case YYSYMBOL_tFID: /* "method" */
5841#line 970 "parse.y"
5842 {
5843#ifndef RIPPER
5844 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5845#else
5846 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5847#endif
5848}
5849#line 5848 "parse.c"
5850 break;
5851
5852 case YYSYMBOL_tGVAR: /* "global variable" */
5853#line 970 "parse.y"
5854 {
5855#ifndef RIPPER
5856 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5857#else
5858 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5859#endif
5860}
5861#line 5860 "parse.c"
5862 break;
5863
5864 case YYSYMBOL_tIVAR: /* "instance variable" */
5865#line 970 "parse.y"
5866 {
5867#ifndef RIPPER
5868 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5869#else
5870 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5871#endif
5872}
5873#line 5872 "parse.c"
5874 break;
5875
5876 case YYSYMBOL_tCONSTANT: /* "constant" */
5877#line 970 "parse.y"
5878 {
5879#ifndef RIPPER
5880 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5881#else
5882 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5883#endif
5884}
5885#line 5884 "parse.c"
5886 break;
5887
5888 case YYSYMBOL_tCVAR: /* "class variable" */
5889#line 970 "parse.y"
5890 {
5891#ifndef RIPPER
5892 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5893#else
5894 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5895#endif
5896}
5897#line 5896 "parse.c"
5898 break;
5899
5900 case YYSYMBOL_tLABEL: /* tLABEL */
5901#line 970 "parse.y"
5902 {
5903#ifndef RIPPER
5904 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
5905#else
5906 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
5907#endif
5908}
5909#line 5908 "parse.c"
5910 break;
5911
5912 case YYSYMBOL_tINTEGER: /* "integer literal" */
5913#line 977 "parse.y"
5914 {
5915#ifndef RIPPER
5916 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
5917#else
5918 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
5919#endif
5920}
5921#line 5920 "parse.c"
5922 break;
5923
5924 case YYSYMBOL_tFLOAT: /* "float literal" */
5925#line 977 "parse.y"
5926 {
5927#ifndef RIPPER
5928 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
5929#else
5930 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
5931#endif
5932}
5933#line 5932 "parse.c"
5934 break;
5935
5936 case YYSYMBOL_tRATIONAL: /* "rational literal" */
5937#line 977 "parse.y"
5938 {
5939#ifndef RIPPER
5940 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
5941#else
5942 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
5943#endif
5944}
5945#line 5944 "parse.c"
5946 break;
5947
5948 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
5949#line 977 "parse.y"
5950 {
5951#ifndef RIPPER
5952 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
5953#else
5954 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
5955#endif
5956}
5957#line 5956 "parse.c"
5958 break;
5959
5960 case YYSYMBOL_tCHAR: /* "char literal" */
5961#line 977 "parse.y"
5962 {
5963#ifndef RIPPER
5964 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
5965#else
5966 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
5967#endif
5968}
5969#line 5968 "parse.c"
5970 break;
5971
5972 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
5973#line 984 "parse.y"
5974 {
5975#ifndef RIPPER
5976 rb_parser_printf(p, "$%ld", ((*yyvaluep).node)->nd_nth);
5977#else
5978 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
5979#endif
5980}
5981#line 5980 "parse.c"
5982 break;
5983
5984 case YYSYMBOL_tBACK_REF: /* "back reference" */
5985#line 991 "parse.y"
5986 {
5987#ifndef RIPPER
5988 rb_parser_printf(p, "$%c", (int)((*yyvaluep).node)->nd_nth);
5989#else
5990 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
5991#endif
5992}
5993#line 5992 "parse.c"
5994 break;
5995
5996 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
5997#line 977 "parse.y"
5998 {
5999#ifndef RIPPER
6000 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6001#else
6002 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6003#endif
6004}
6005#line 6004 "parse.c"
6006 break;
6007
6008 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
6009#line 970 "parse.y"
6010 {
6011#ifndef RIPPER
6012 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6013#else
6014 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6015#endif
6016}
6017#line 6016 "parse.c"
6018 break;
6019
6020 default:
6021 break;
6022 }
6024}
6025
6026
6027/*---------------------------.
6028| Print this symbol on YYO. |
6029`---------------------------*/
6030
6031static void
6032yy_symbol_print (FILE *yyo,
6033 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6034{
6035 YYFPRINTF (p, "%s %s (",
6036 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
6037
6038 YYLOCATION_PRINT (yyo, yylocationp);
6039 YYFPRINTF (p, ": ");
6040 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
6041 YYFPRINTF (p, ")");
6042}
6043
6044/*------------------------------------------------------------------.
6045| yy_stack_print -- Print the state stack from its BOTTOM up to its |
6046| TOP (included). |
6047`------------------------------------------------------------------*/
6048
6049static void
6050ruby_parser_yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
6051#define yy_stack_print(b, t) ruby_parser_yy_stack_print(b, t, p)
6052{
6053 YYFPRINTF (p, "Stack now");
6054 for (; yybottom <= yytop; yybottom++)
6055 {
6056 int yybot = *yybottom;
6057 YYFPRINTF (p, " %d", yybot);
6058 }
6059 YYFPRINTF (p, "\n");
6060}
6061
6062# define YY_STACK_PRINT(Bottom, Top) \
6063do { \
6064 if (yydebug) \
6065 yy_stack_print ((Bottom), (Top)); \
6066} while (0)
6067
6068
6069/*------------------------------------------------.
6070| Report that the YYRULE is going to be reduced. |
6071`------------------------------------------------*/
6072
6073static void
6074yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
6075 int yyrule, struct parser_params *p)
6076{
6077 int yylno = yyrline[yyrule];
6078 int yynrhs = yyr2[yyrule];
6079 int yyi;
6080 YYFPRINTF (p, "Reducing stack by rule %d (line %d):\n",
6081 yyrule - 1, yylno);
6082 /* The symbols being reduced. */
6083 for (yyi = 0; yyi < yynrhs; yyi++)
6084 {
6085 YYFPRINTF (p, " $%d = ", yyi + 1);
6086 yy_symbol_print (stderr,
6087 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
6088 &yyvsp[(yyi + 1) - (yynrhs)],
6089 &(yylsp[(yyi + 1) - (yynrhs)]), p);
6090 YYFPRINTF (p, "\n");
6091 }
6092}
6093
6094# define YY_REDUCE_PRINT(Rule) \
6095do { \
6096 if (yydebug) \
6097 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
6098} while (0)
6099
6100/* Nonzero means print parse trace. It is left uninitialized so that
6101 multiple parsers can coexist. */
6102#ifndef yydebug
6103int yydebug;
6104#endif
6105#else /* !YYDEBUG */
6106# define YYDPRINTF(Args) ((void) 0)
6107# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
6108# define YY_STACK_PRINT(Bottom, Top)
6109# define YY_REDUCE_PRINT(Rule)
6110#endif /* !YYDEBUG */
6111
6112
6113/* YYINITDEPTH -- initial size of the parser's stacks. */
6114#ifndef YYINITDEPTH
6115# define YYINITDEPTH 200
6116#endif
6117
6118/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
6119 if the built-in stack extension method is used).
6120
6121 Do not make this value too large; the results are undefined if
6122 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
6123 evaluated with infinite-precision integer arithmetic. */
6124
6125#ifndef YYMAXDEPTH
6126# define YYMAXDEPTH 10000
6127#endif
6128
6129
6130/* Context of a parse error. */
6131typedef struct
6132{
6133 yy_state_t *yyssp;
6134 yysymbol_kind_t yytoken;
6135 YYLTYPE *yylloc;
6136} yypcontext_t;
6137
6138/* Put in YYARG at most YYARGN of the expected tokens given the
6139 current YYCTX, and return the number of tokens stored in YYARG. If
6140 YYARG is null, return the number of expected tokens (guaranteed to
6141 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
6142 Return 0 if there are more than YYARGN expected tokens, yet fill
6143 YYARG up to YYARGN. */
6144static int
6145yypcontext_expected_tokens (const yypcontext_t *yyctx,
6146 yysymbol_kind_t yyarg[], int yyargn)
6147{
6148 /* Actual size of YYARG. */
6149 int yycount = 0;
6150 int yyn = yypact[+*yyctx->yyssp];
6151 if (!yypact_value_is_default (yyn))
6152 {
6153 /* Start YYX at -YYN if negative to avoid negative indexes in
6154 YYCHECK. In other words, skip the first -YYN actions for
6155 this state because they are default actions. */
6156 int yyxbegin = yyn < 0 ? -yyn : 0;
6157 /* Stay within bounds of both yycheck and yytname. */
6158 int yychecklim = YYLAST - yyn + 1;
6159 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6160 int yyx;
6161 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6162 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
6163 && !yytable_value_is_error (yytable[yyx + yyn]))
6164 {
6165 if (!yyarg)
6166 ++yycount;
6167 else if (yycount == yyargn)
6168 return 0;
6169 else
6170 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
6171 }
6172 }
6173 if (yyarg && yycount == 0 && 0 < yyargn)
6174 yyarg[0] = YYSYMBOL_YYEMPTY;
6175 return yycount;
6176}
6177
6178
6179
6180
6181#ifndef yystrlen
6182# if defined __GLIBC__ && defined _STRING_H
6183# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
6184# else
6185/* Return the length of YYSTR. */
6186static YYPTRDIFF_T
6187yystrlen (const char *yystr)
6188{
6189 YYPTRDIFF_T yylen;
6190 for (yylen = 0; yystr[yylen]; yylen++)
6191 continue;
6192 return yylen;
6193}
6194# endif
6195#endif
6196
6197#ifndef yystpcpy
6198# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
6199# define yystpcpy stpcpy
6200# else
6201/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
6202 YYDEST. */
6203static char *
6204yystpcpy (char *yydest, const char *yysrc)
6205{
6206 char *yyd = yydest;
6207 const char *yys = yysrc;
6208
6209 while ((*yyd++ = *yys++) != '\0')
6210 continue;
6211
6212 return yyd - 1;
6213}
6214# endif
6215#endif
6216
6217#ifndef yytnamerr
6218/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
6219 quotes and backslashes, so that it's suitable for yyerror. The
6220 heuristic is that double-quoting is unnecessary unless the string
6221 contains an apostrophe, a comma, or backslash (other than
6222 backslash-backslash). YYSTR is taken from yytname. If YYRES is
6223 null, do not copy; instead, return the length of what the result
6224 would have been. */
6225static YYPTRDIFF_T
6226yytnamerr (char *yyres, const char *yystr)
6227{
6228 if (*yystr == '"')
6229 {
6230 YYPTRDIFF_T yyn = 0;
6231 char const *yyp = yystr;
6232 for (;;)
6233 switch (*++yyp)
6234 {
6235 case '\'':
6236 case ',':
6237 goto do_not_strip_quotes;
6238
6239 case '\\':
6240 if (*++yyp != '\\')
6241 goto do_not_strip_quotes;
6242 else
6243 goto append;
6244
6245 append:
6246 default:
6247 if (yyres)
6248 yyres[yyn] = *yyp;
6249 yyn++;
6250 break;
6251
6252 case '"':
6253 if (yyres)
6254 yyres[yyn] = '\0';
6255 return yyn;
6256 }
6257 do_not_strip_quotes: ;
6258 }
6259
6260 if (yyres)
6261 return yystpcpy (yyres, yystr) - yyres;
6262 else
6263 return yystrlen (yystr);
6264}
6265#endif
6266
6267
6268static int
6269yy_syntax_error_arguments (const yypcontext_t *yyctx,
6270 yysymbol_kind_t yyarg[], int yyargn)
6271{
6272 /* Actual size of YYARG. */
6273 int yycount = 0;
6274 /* There are many possibilities here to consider:
6275 - If this state is a consistent state with a default action, then
6276 the only way this function was invoked is if the default action
6277 is an error action. In that case, don't check for expected
6278 tokens because there are none.
6279 - The only way there can be no lookahead present (in yychar) is if
6280 this state is a consistent state with a default action. Thus,
6281 detecting the absence of a lookahead is sufficient to determine
6282 that there is no unexpected or expected token to report. In that
6283 case, just report a simple "syntax error".
6284 - Don't assume there isn't a lookahead just because this state is a
6285 consistent state with a default action. There might have been a
6286 previous inconsistent state, consistent state with a non-default
6287 action, or user semantic action that manipulated yychar.
6288 - Of course, the expected token list depends on states to have
6289 correct lookahead information, and it depends on the parser not
6290 to perform extra reductions after fetching a lookahead from the
6291 scanner and before detecting a syntax error. Thus, state merging
6292 (from LALR or IELR) and default reductions corrupt the expected
6293 token list. However, the list is correct for canonical LR with
6294 one exception: it will still contain any token that will not be
6295 accepted due to an error action in a later state.
6296 */
6297 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
6298 {
6299 int yyn;
6300 if (yyarg)
6301 yyarg[yycount] = yyctx->yytoken;
6302 ++yycount;
6303 yyn = yypcontext_expected_tokens (yyctx,
6304 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
6305 if (yyn == YYENOMEM)
6306 return YYENOMEM;
6307 else
6308 yycount += yyn;
6309 }
6310 return yycount;
6311}
6312
6313/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
6314 about the unexpected token YYTOKEN for the state stack whose top is
6315 YYSSP.
6316
6317 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
6318 not large enough to hold the message. In that case, also set
6319 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
6320 required number of bytes is too large to store. */
6321static int
6322yysyntax_error (struct parser_params *p, YYPTRDIFF_T *yymsg_alloc, char **yymsg,
6323 const yypcontext_t *yyctx)
6324{
6325 enum { YYARGS_MAX = 5 };
6326 /* Internationalized format string. */
6327 const char *yyformat = YY_NULLPTR;
6328 /* Arguments of yyformat: reported tokens (one for the "unexpected",
6329 one per "expected"). */
6330 yysymbol_kind_t yyarg[YYARGS_MAX];
6331 /* Cumulated lengths of YYARG. */
6332 YYPTRDIFF_T yysize = 0;
6333
6334 /* Actual size of YYARG. */
6335 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
6336 if (yycount == YYENOMEM)
6337 return YYENOMEM;
6338
6339 switch (yycount)
6340 {
6341#define YYCASE_(N, S) \
6342 case N: \
6343 yyformat = S; \
6344 break
6345 default: /* Avoid compiler warnings. */
6346 YYCASE_(0, YY_("syntax error"));
6347 YYCASE_(1, YY_("syntax error, unexpected %s"));
6348 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
6349 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
6350 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
6351 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
6352#undef YYCASE_
6353 }
6354
6355 /* Compute error message size. Don't count the "%s"s, but reserve
6356 room for the terminator. */
6357 yysize = yystrlen (yyformat) - 2 * yycount + 1;
6358 {
6359 int yyi;
6360 for (yyi = 0; yyi < yycount; ++yyi)
6361 {
6362 YYPTRDIFF_T yysize1
6363 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
6364 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
6365 yysize = yysize1;
6366 else
6367 return YYENOMEM;
6368 }
6369 }
6370
6371 if (*yymsg_alloc < yysize)
6372 {
6373 *yymsg_alloc = 2 * yysize;
6374 if (! (yysize <= *yymsg_alloc
6375 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
6376 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
6377 return -1;
6378 }
6379
6380 /* Avoid sprintf, as that infringes on the user's name space.
6381 Don't have undefined behavior even if the translation
6382 produced a string with the wrong number of "%s"s. */
6383 {
6384 char *yyp = *yymsg;
6385 int yyi = 0;
6386 while ((*yyp = *yyformat) != '\0')
6387 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
6388 {
6389 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
6390 yyformat += 2;
6391 }
6392 else
6393 {
6394 ++yyp;
6395 ++yyformat;
6396 }
6397 }
6398 return 0;
6399}
6400
6401
6402/*-----------------------------------------------.
6403| Release the memory associated to this symbol. |
6404`-----------------------------------------------*/
6405
6406static void
6407yydestruct (const char *yymsg,
6408 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
6409{
6410 YY_USE (yyvaluep);
6411 YY_USE (yylocationp);
6412 YY_USE (p);
6413 if (!yymsg)
6414 yymsg = "Deleting";
6415 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
6416
6418 YY_USE (yykind);
6420}
6421
6422
6423
6424
6425
6426
6427/*----------.
6428| yyparse. |
6429`----------*/
6430
6431int
6433{
6434/* Lookahead token kind. */
6435int yychar;
6436
6437
6438/* The semantic value of the lookahead symbol. */
6439/* Default value used for initialization, for pacifying older GCCs
6440 or non-GCC compilers. */
6441YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
6442YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
6443
6444/* Location data for the lookahead symbol. */
6445static YYLTYPE yyloc_default
6446# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6447 = { 1, 1, 1, 1 }
6448# endif
6449;
6450YYLTYPE yylloc = yyloc_default;
6451
6452 /* Number of syntax errors so far. */
6453 int yynerrs = 0;
6454
6455 yy_state_fast_t yystate = 0;
6456 /* Number of tokens to shift before error messages enabled. */
6457 int yyerrstatus = 0;
6458
6459 /* Refer to the stacks through separate pointers, to allow yyoverflow
6460 to reallocate them elsewhere. */
6461
6462 /* Their size. */
6463 YYPTRDIFF_T yystacksize = YYINITDEPTH;
6464
6465 /* The state stack: array, bottom, top. */
6466 yy_state_t yyssa[YYINITDEPTH];
6467 yy_state_t *yyss = yyssa;
6468 yy_state_t *yyssp = yyss;
6469
6470 /* The semantic value stack: array, bottom, top. */
6471 YYSTYPE yyvsa[YYINITDEPTH];
6472 YYSTYPE *yyvs = yyvsa;
6473 YYSTYPE *yyvsp = yyvs;
6474
6475 /* The location stack: array, bottom, top. */
6476 YYLTYPE yylsa[YYINITDEPTH];
6477 YYLTYPE *yyls = yylsa;
6478 YYLTYPE *yylsp = yyls;
6479
6480 int yyn;
6481 /* The return value of yyparse. */
6482 int yyresult;
6483 /* Lookahead symbol kind. */
6485 /* The variables used to return semantic value and location from the
6486 action routines. */
6487 YYSTYPE yyval;
6488 YYLTYPE yyloc;
6489
6490 /* The locations where the error started and ended. */
6491 YYLTYPE yyerror_range[3];
6492
6493 /* Buffer for error messages, and its allocated size. */
6494 char yymsgbuf[128];
6495 char *yymsg = yymsgbuf;
6496 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
6497
6498#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
6499
6500 /* The number of symbols on the RHS of the reduced rule.
6501 Keep to zero when no symbol should be popped. */
6502 int yylen = 0;
6503
6504 YYDPRINTF ((p, "Starting parse\n"));
6505
6506 yychar = YYEMPTY; /* Cause a token to be read. */
6507
6508
6509/* User initialization code. */
6510#line 1002 "parse.y"
6511{
6513}
6514
6515#line 6511 "parse.c"
6516
6517 yylsp[0] = yylloc;
6518 goto yysetstate;
6519
6520
6521/*------------------------------------------------------------.
6522| yynewstate -- push a new state, which is found in yystate. |
6523`------------------------------------------------------------*/
6524yynewstate:
6525 /* In all cases, when you get here, the value and location stacks
6526 have just been pushed. So pushing a state here evens the stacks. */
6527 yyssp++;
6528
6529
6530/*--------------------------------------------------------------------.
6531| yysetstate -- set current state (the top of the stack) to yystate. |
6532`--------------------------------------------------------------------*/
6533yysetstate:
6534 YYDPRINTF ((p, "Entering state %d\n", yystate));
6535 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
6537 *yyssp = YY_CAST (yy_state_t, yystate);
6539 YY_STACK_PRINT (yyss, yyssp);
6540
6541 if (yyss + yystacksize - 1 <= yyssp)
6542#if !defined yyoverflow && !defined YYSTACK_RELOCATE
6543 YYNOMEM;
6544#else
6545 {
6546 /* Get the current used size of the three stacks, in elements. */
6547 YYPTRDIFF_T yysize = yyssp - yyss + 1;
6548
6549# if defined yyoverflow
6550 {
6551 /* Give user a chance to reallocate the stack. Use copies of
6552 these so that the &'s don't force the real ones into
6553 memory. */
6554 yy_state_t *yyss1 = yyss;
6555 YYSTYPE *yyvs1 = yyvs;
6556 YYLTYPE *yyls1 = yyls;
6557
6558 /* Each stack pointer address is followed by the size of the
6559 data in use in that stack, in bytes. This used to be a
6560 conditional around just the two extra args, but that might
6561 be undefined if yyoverflow is a macro. */
6562 yyoverflow (YY_("memory exhausted"),
6563 &yyss1, yysize * YYSIZEOF (*yyssp),
6564 &yyvs1, yysize * YYSIZEOF (*yyvsp),
6565 &yyls1, yysize * YYSIZEOF (*yylsp),
6566 &yystacksize);
6567 yyss = yyss1;
6568 yyvs = yyvs1;
6569 yyls = yyls1;
6570 }
6571# else /* defined YYSTACK_RELOCATE */
6572 /* Extend the stack our own way. */
6573 if (YYMAXDEPTH <= yystacksize)
6574 YYNOMEM;
6575 yystacksize *= 2;
6576 if (YYMAXDEPTH < yystacksize)
6577 yystacksize = YYMAXDEPTH;
6578
6579 {
6580 yy_state_t *yyss1 = yyss;
6581 union yyalloc *yyptr =
6582 YY_CAST (union yyalloc *,
6583 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
6584 if (! yyptr)
6585 YYNOMEM;
6589# undef YYSTACK_RELOCATE
6590 if (yyss1 != yyssa)
6591 YYSTACK_FREE (yyss1);
6592 }
6593# endif
6594
6595 yyssp = yyss + yysize - 1;
6596 yyvsp = yyvs + yysize - 1;
6597 yylsp = yyls + yysize - 1;
6598
6600 YYDPRINTF ((p, "Stack size increased to %ld\n",
6601 YY_CAST (long, yystacksize)));
6603
6604 if (yyss + yystacksize - 1 <= yyssp)
6605 YYABORT;
6606 }
6607#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
6608
6609
6610 if (yystate == YYFINAL)
6611 YYACCEPT;
6612
6613 goto yybackup;
6614
6615
6616/*-----------.
6617| yybackup. |
6618`-----------*/
6619yybackup:
6620 /* Do appropriate processing given the current state. Read a
6621 lookahead token if we need one and don't already have one. */
6622
6623 /* First try to decide what to do without reference to lookahead token. */
6624 yyn = yypact[yystate];
6625 if (yypact_value_is_default (yyn))
6626 goto yydefault;
6627
6628 /* Not known => get a lookahead token if don't already have one. */
6629
6630 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
6631 if (yychar == YYEMPTY)
6632 {
6633 YYDPRINTF ((p, "Reading a token\n"));
6634 yychar = yylex (&yylval, &yylloc, p);
6635 }
6636
6637 if (yychar <= END_OF_INPUT)
6638 {
6639 yychar = END_OF_INPUT;
6640 yytoken = YYSYMBOL_YYEOF;
6641 YYDPRINTF ((p, "Now at end of input.\n"));
6642 }
6643 else if (yychar == YYerror)
6644 {
6645 /* The scanner already issued an error message, process directly
6646 to error recovery. But do not keep the error token as
6647 lookahead, it is too special and may lead us to an endless
6648 loop in error recovery. */
6649 yychar = YYUNDEF;
6650 yytoken = YYSYMBOL_YYerror;
6651 yyerror_range[1] = yylloc;
6652 goto yyerrlab1;
6653 }
6654 else
6655 {
6656 yytoken = YYTRANSLATE (yychar);
6657 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
6658 }
6659
6660 /* If the proper action on seeing token YYTOKEN is to reduce or to
6661 detect an error, take that action. */
6662 yyn += yytoken;
6663 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
6664 goto yydefault;
6665 yyn = yytable[yyn];
6666 if (yyn <= 0)
6667 {
6668 if (yytable_value_is_error (yyn))
6669 goto yyerrlab;
6670 yyn = -yyn;
6671 goto yyreduce;
6672 }
6673
6674 /* Count tokens shifted since error; after three, turn off error
6675 status. */
6676 if (yyerrstatus)
6677 yyerrstatus--;
6678
6679 /* Shift the lookahead token. */
6680 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
6681 yystate = yyn;
6683 *++yyvsp = yylval;
6685 *++yylsp = yylloc;
6686
6687 /* Discard the shifted token. */
6688 yychar = YYEMPTY;
6689 goto yynewstate;
6690
6691
6692/*-----------------------------------------------------------.
6693| yydefault -- do the default action for the current state. |
6694`-----------------------------------------------------------*/
6695yydefault:
6696 yyn = yydefact[yystate];
6697 if (yyn == 0)
6698 goto yyerrlab;
6699 goto yyreduce;
6700
6701
6702/*-----------------------------.
6703| yyreduce -- do a reduction. |
6704`-----------------------------*/
6705yyreduce:
6706 /* yyn is the number of a rule to reduce with. */
6707 yylen = yyr2[yyn];
6708
6709 /* If YYLEN is nonzero, implement the default value of the action:
6710 '$$ = $1'.
6711
6712 Otherwise, the following line sets YYVAL to garbage.
6713 This behavior is undocumented and Bison
6714 users should not rely upon it. Assigning to YYVAL
6715 unconditionally makes the parser a bit smaller, and it avoids a
6716 GCC warning that YYVAL may be used uninitialized. */
6717 yyval = yyvsp[1-yylen];
6718
6719 /* Default location. */
6720 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
6721 yyerror_range[1] = yyloc;
6722 YY_REDUCE_PRINT (yyn);
6723 switch (yyn)
6724 {
6725 case 2: /* $@1: %empty */
6726#line 1204 "parse.y"
6727 {
6728 SET_LEX_STATE(EXPR_BEG);
6729 local_push(p, ifndef_ripper(1)+0);
6730 }
6731#line 6727 "parse.c"
6732 break;
6733
6734 case 3: /* program: $@1 top_compstmt */
6735#line 1209 "parse.y"
6736 {
6737 /*%%%*/
6738 if ((yyvsp[0].node) && !compile_for_eval) {
6739 NODE *node = (yyvsp[0].node);
6740 /* last expression should not be void */
6741 if (nd_type(node) == NODE_BLOCK) {
6742 while (node->nd_next) {
6743 node = node->nd_next;
6744 }
6745 node = node->nd_head;
6746 }
6747 node = remove_begin(node);
6748 void_expr(p, node);
6749 }
6750 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
6751 /*% %*/
6752 /*% ripper[final]: program!($2) %*/
6753 local_pop(p);
6754 }
6755#line 6751 "parse.c"
6756 break;
6757
6758 case 4: /* top_compstmt: top_stmts opt_terms */
6759#line 1231 "parse.y"
6760 {
6761 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
6762 }
6763#line 6759 "parse.c"
6764 break;
6765
6766 case 5: /* top_stmts: none */
6767#line 1237 "parse.y"
6768 {
6769 /*%%%*/
6770 (yyval.node) = NEW_BEGIN(0, &(yyloc));
6771 /*% %*/
6772 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
6773 }
6774#line 6770 "parse.c"
6775 break;
6776
6777 case 6: /* top_stmts: top_stmt */
6778#line 1244 "parse.y"
6779 {
6780 /*%%%*/
6781 (yyval.node) = newline_node((yyvsp[0].node));
6782 /*% %*/
6783 /*% ripper: stmts_add!(stmts_new!, $1) %*/
6784 }
6785#line 6781 "parse.c"
6786 break;
6787
6788 case 7: /* top_stmts: top_stmts terms top_stmt */
6789#line 1251 "parse.y"
6790 {
6791 /*%%%*/
6792 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
6793 /*% %*/
6794 /*% ripper: stmts_add!($1, $3) %*/
6795 }
6796#line 6792 "parse.c"
6797 break;
6798
6799 case 8: /* top_stmts: error top_stmt */
6800#line 1258 "parse.y"
6801 {
6802 (yyval.node) = remove_begin((yyvsp[0].node));
6803 }
6804#line 6800 "parse.c"
6805 break;
6806
6807 case 10: /* top_stmt: "`BEGIN'" begin_block */
6808#line 1265 "parse.y"
6809 {
6810 (yyval.node) = (yyvsp[0].node);
6811 }
6812#line 6808 "parse.c"
6813 break;
6814
6815 case 11: /* begin_block: '{' top_compstmt '}' */
6816#line 1271 "parse.y"
6817 {
6818 /*%%%*/
6819 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
6820 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
6821 (yyval.node) = NEW_BEGIN(0, &(yyloc));
6822 /*% %*/
6823 /*% ripper: BEGIN!($2) %*/
6824 }
6825#line 6821 "parse.c"
6826 break;
6827
6828 case 12: /* $@2: %empty */
6829#line 1283 "parse.y"
6830 {if (!(yyvsp[-1].node)) {yyerror1(&(yylsp[0]), "else without rescue is useless");}}
6831#line 6827 "parse.c"
6832 break;
6833
6834 case 13: /* bodystmt: compstmt opt_rescue k_else $@2 compstmt opt_ensure */
6835#line 1286 "parse.y"
6836 {
6837 /*%%%*/
6838 (yyval.node) = new_bodystmt(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
6839 /*% %*/
6840 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/
6841 }
6842#line 6838 "parse.c"
6843 break;
6844
6845 case 14: /* bodystmt: compstmt opt_rescue opt_ensure */
6846#line 1295 "parse.y"
6847 {
6848 /*%%%*/
6849 (yyval.node) = new_bodystmt(p, (yyvsp[-2].node), (yyvsp[-1].node), 0, (yyvsp[0].node), &(yyloc));
6850 /*% %*/
6851 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/
6852 }
6853#line 6849 "parse.c"
6854 break;
6855
6856 case 15: /* compstmt: stmts opt_terms */
6857#line 1304 "parse.y"
6858 {
6859 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
6860 }
6861#line 6857 "parse.c"
6862 break;
6863
6864 case 16: /* stmts: none */
6865#line 1310 "parse.y"
6866 {
6867 /*%%%*/
6868 (yyval.node) = NEW_BEGIN(0, &(yyloc));
6869 /*% %*/
6870 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
6871 }
6872#line 6868 "parse.c"
6873 break;
6874
6875 case 17: /* stmts: stmt_or_begin */
6876#line 1317 "parse.y"
6877 {
6878 /*%%%*/
6879 (yyval.node) = newline_node((yyvsp[0].node));
6880 /*% %*/
6881 /*% ripper: stmts_add!(stmts_new!, $1) %*/
6882 }
6883#line 6879 "parse.c"
6884 break;
6885
6886 case 18: /* stmts: stmts terms stmt_or_begin */
6887#line 1324 "parse.y"
6888 {
6889 /*%%%*/
6890 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
6891 /*% %*/
6892 /*% ripper: stmts_add!($1, $3) %*/
6893 }
6894#line 6890 "parse.c"
6895 break;
6896
6897 case 19: /* stmts: error stmt */
6898#line 1331 "parse.y"
6899 {
6900 (yyval.node) = remove_begin((yyvsp[0].node));
6901 }
6902#line 6898 "parse.c"
6903 break;
6904
6905 case 20: /* stmt_or_begin: stmt */
6906#line 1337 "parse.y"
6907 {
6908 (yyval.node) = (yyvsp[0].node);
6909 }
6910#line 6906 "parse.c"
6911 break;
6912
6913 case 21: /* $@3: %empty */
6914#line 1341 "parse.y"
6915 {
6916 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
6917 }
6918#line 6914 "parse.c"
6919 break;
6920
6921 case 22: /* stmt_or_begin: "`BEGIN'" $@3 begin_block */
6922#line 1345 "parse.y"
6923 {
6924 (yyval.node) = (yyvsp[0].node);
6925 }
6926#line 6922 "parse.c"
6927 break;
6928
6929 case 23: /* $@4: %empty */
6930#line 1350 "parse.y"
6931 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
6932#line 6928 "parse.c"
6933 break;
6934
6935 case 24: /* stmt: "`alias'" fitem $@4 fitem */
6936#line 1351 "parse.y"
6937 {
6938 /*%%%*/
6939 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
6940 /*% %*/
6941 /*% ripper: alias!($2, $4) %*/
6942 }
6943#line 6939 "parse.c"
6944 break;
6945
6946 case 25: /* stmt: "`alias'" "global variable" "global variable" */
6947#line 1358 "parse.y"
6948 {
6949 /*%%%*/
6950 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
6951 /*% %*/
6952 /*% ripper: var_alias!($2, $3) %*/
6953 }
6954#line 6950 "parse.c"
6955 break;
6956
6957 case 26: /* stmt: "`alias'" "global variable" "back reference" */
6958#line 1365 "parse.y"
6959 {
6960 /*%%%*/
6961 char buf[2];
6962 buf[0] = '$';
6963 buf[1] = (char)(yyvsp[0].node)->nd_nth;
6964 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
6965 /*% %*/
6966 /*% ripper: var_alias!($2, $3) %*/
6967 }
6968#line 6964 "parse.c"
6969 break;
6970
6971 case 27: /* stmt: "`alias'" "global variable" "numbered reference" */
6972#line 1375 "parse.y"
6973 {
6974 /*%%%*/
6975 yyerror1(&(yylsp[0]), "can't make alias for the number variables");
6976 (yyval.node) = NEW_BEGIN(0, &(yyloc));
6977 /*% %*/
6978 /*% ripper[error]: alias_error!(var_alias!($2, $3)) %*/
6979 }
6980#line 6976 "parse.c"
6981 break;
6982
6983 case 28: /* stmt: "`undef'" undef_list */
6984#line 1383 "parse.y"
6985 {
6986 /*%%%*/
6987 (yyval.node) = (yyvsp[0].node);
6988 /*% %*/
6989 /*% ripper: undef!($2) %*/
6990 }
6991#line 6987 "parse.c"
6992 break;
6993
6994 case 29: /* stmt: stmt "`if' modifier" expr_value */
6995#line 1390 "parse.y"
6996 {
6997 /*%%%*/
6998 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
6999 fixpos((yyval.node), (yyvsp[0].node));
7000 /*% %*/
7001 /*% ripper: if_mod!($3, $1) %*/
7002 }
7003#line 6999 "parse.c"
7004 break;
7005
7006 case 30: /* stmt: stmt "`unless' modifier" expr_value */
7007#line 1398 "parse.y"
7008 {
7009 /*%%%*/
7010 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
7011 fixpos((yyval.node), (yyvsp[0].node));
7012 /*% %*/
7013 /*% ripper: unless_mod!($3, $1) %*/
7014 }
7015#line 7011 "parse.c"
7016 break;
7017
7018 case 31: /* stmt: stmt "`while' modifier" expr_value */
7019#line 1406 "parse.y"
7020 {
7021 /*%%%*/
7022 if ((yyvsp[-2].node) && nd_type((yyvsp[-2].node)) == NODE_BEGIN) {
7023 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
7024 }
7025 else {
7026 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
7027 }
7028 /*% %*/
7029 /*% ripper: while_mod!($3, $1) %*/
7030 }
7031#line 7027 "parse.c"
7032 break;
7033
7034 case 32: /* stmt: stmt "`until' modifier" expr_value */
7035#line 1418 "parse.y"
7036 {
7037 /*%%%*/
7038 if ((yyvsp[-2].node) && nd_type((yyvsp[-2].node)) == NODE_BEGIN) {
7039 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
7040 }
7041 else {
7042 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
7043 }
7044 /*% %*/
7045 /*% ripper: until_mod!($3, $1) %*/
7046 }
7047#line 7043 "parse.c"
7048 break;
7049
7050 case 33: /* stmt: stmt "`rescue' modifier" stmt */
7051#line 1430 "parse.y"
7052 {
7053 /*%%%*/
7054 NODE *resq;
7055 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7056 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
7057 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-2].node)), resq, 0, &(yyloc));
7058 /*% %*/
7059 /*% ripper: rescue_mod!($1, $3) %*/
7060 }
7061#line 7057 "parse.c"
7062 break;
7063
7064 case 34: /* stmt: "`END'" '{' compstmt '}' */
7065#line 1440 "parse.y"
7066 {
7067 if (p->in_def) {
7068 rb_warn0("END in method; use at_exit");
7069 }
7070 /*%%%*/
7071 {
7072 NODE *scope = NEW_NODE(
7073 NODE_SCOPE, 0 /* tbl */, (yyvsp[-1].node) /* body */, 0 /* args */, &(yyloc));
7074 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
7075 }
7076 /*% %*/
7077 /*% ripper: END!($3) %*/
7078 }
7079#line 7075 "parse.c"
7080 break;
7081
7082 case 36: /* stmt: mlhs '=' command_call */
7083#line 1455 "parse.y"
7084 {
7085 /*%%%*/
7086 value_expr((yyvsp[0].node));
7087 (yyval.node) = node_assign(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7088 /*% %*/
7089 /*% ripper: massign!($1, $3) %*/
7090 }
7091#line 7087 "parse.c"
7092 break;
7093
7094 case 37: /* stmt: lhs '=' mrhs */
7095#line 1463 "parse.y"
7096 {
7097 /*%%%*/
7098 value_expr((yyvsp[0].node));
7099 (yyval.node) = node_assign(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7100 /*% %*/
7101 /*% ripper: assign!($1, $3) %*/
7102 }
7103#line 7099 "parse.c"
7104 break;
7105
7106 case 38: /* stmt: mlhs '=' mrhs_arg "`rescue' modifier" stmt */
7107#line 1471 "parse.y"
7108 {
7109 /*%%%*/
7110 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7111 value_expr((yyvsp[-2].node));
7112 (yyval.node) = node_assign(p, (yyvsp[-4].node), NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc)), &(yyloc));
7113 /*% %*/
7114 /*% ripper: massign!($1, rescue_mod!($3, $5)) %*/
7115 }
7116#line 7112 "parse.c"
7117 break;
7118
7119 case 39: /* stmt: mlhs '=' mrhs_arg */
7120#line 1480 "parse.y"
7121 {
7122 /*%%%*/
7123 (yyval.node) = node_assign(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7124 /*% %*/
7125 /*% ripper: massign!($1, $3) %*/
7126 }
7127#line 7123 "parse.c"
7128 break;
7129
7130 case 41: /* command_asgn: lhs '=' command_rhs */
7131#line 1490 "parse.y"
7132 {
7133 /*%%%*/
7134 (yyval.node) = node_assign(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7135 /*% %*/
7136 /*% ripper: assign!($1, $3) %*/
7137 }
7138#line 7134 "parse.c"
7139 break;
7140
7141 case 42: /* command_asgn: var_lhs "operator-assignment" command_rhs */
7142#line 1497 "parse.y"
7143 {
7144 /*%%%*/
7145 (yyval.node) = new_op_assign(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
7146 /*% %*/
7147 /*% ripper: opassign!($1, $2, $3) %*/
7148 }
7149#line 7145 "parse.c"
7150 break;
7151
7152 case 43: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" command_rhs */
7153#line 1504 "parse.y"
7154 {
7155 /*%%%*/
7156 (yyval.node) = new_ary_op_assign(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-3]), &(yyloc));
7157 /*% %*/
7158 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $6) %*/
7159
7160 }
7161#line 7157 "parse.c"
7162 break;
7163
7164 case 44: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" command_rhs */
7165#line 1512 "parse.y"
7166 {
7167 /*%%%*/
7168 (yyval.node) = new_attr_op_assign(p, (yyvsp[-4].node), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
7169 /*% %*/
7170 /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/
7171 }
7172#line 7168 "parse.c"
7173 break;
7174
7175 case 45: /* command_asgn: primary_value call_op "constant" "operator-assignment" command_rhs */
7176#line 1519 "parse.y"
7177 {
7178 /*%%%*/
7179 (yyval.node) = new_attr_op_assign(p, (yyvsp[-4].node), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
7180 /*% %*/
7181 /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/
7182 }
7183#line 7179 "parse.c"
7184 break;
7185
7186 case 46: /* command_asgn: primary_value "::" "constant" "operator-assignment" command_rhs */
7187#line 1526 "parse.y"
7188 {
7189 /*%%%*/
7190 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-2]));
7191 (yyval.node) = new_const_op_assign(p, NEW_COLON2((yyvsp[-4].node), (yyvsp[-2].id), &loc), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
7192 /*% %*/
7193 /*% ripper: opassign!(const_path_field!($1, $3), $4, $5) %*/
7194 }
7195#line 7191 "parse.c"
7196 break;
7197
7198 case 47: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" command_rhs */
7199#line 1534 "parse.y"
7200 {
7201 /*%%%*/
7202 (yyval.node) = new_attr_op_assign(p, (yyvsp[-4].node), ID2VAL(idCOLON2), (yyvsp[-2].id), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
7203 /*% %*/
7204 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $5) %*/
7205 }
7206#line 7202 "parse.c"
7207 break;
7208
7209 case 48: /* command_asgn: backref "operator-assignment" command_rhs */
7210#line 1541 "parse.y"
7211 {
7212 /*%%%*/
7213 rb_backref_error(p, (yyvsp[-2].node));
7214 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7215 /*% %*/
7216 /*% ripper[error]: assign_error!(assign!(var_field(p, $1), $3)) %*/
7217 }
7218#line 7214 "parse.c"
7219 break;
7220
7221 case 49: /* command_rhs: command_call */
7222#line 1551 "parse.y"
7223 {
7224 value_expr((yyvsp[0].node));
7225 (yyval.node) = (yyvsp[0].node);
7226 }
7227#line 7223 "parse.c"
7228 break;
7229
7230 case 50: /* command_rhs: command_call "`rescue' modifier" stmt */
7231#line 1556 "parse.y"
7232 {
7233 /*%%%*/
7234 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7235 value_expr((yyvsp[-2].node));
7236 (yyval.node) = NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
7237 /*% %*/
7238 /*% ripper: rescue_mod!($1, $3) %*/
7239 }
7240#line 7236 "parse.c"
7241 break;
7242
7243 case 53: /* expr: expr "`and'" expr */
7244#line 1569 "parse.y"
7245 {
7246 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7247 }
7248#line 7244 "parse.c"
7249 break;
7250
7251 case 54: /* expr: expr "`or'" expr */
7252#line 1573 "parse.y"
7253 {
7254 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7255 }
7256#line 7252 "parse.c"
7257 break;
7258
7259 case 55: /* expr: "`not'" opt_nl expr */
7260#line 1577 "parse.y"
7261 {
7262 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
7263 }
7264#line 7260 "parse.c"
7265 break;
7266
7267 case 56: /* expr: '!' command_call */
7268#line 1581 "parse.y"
7269 {
7270 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
7271 }
7272#line 7268 "parse.c"
7273 break;
7274
7275 case 57: /* @5: %empty */
7276#line 1585 "parse.y"
7277 {
7278 value_expr((yyvsp[-1].node));
7279 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
7280 p->command_start = FALSE;
7281 (yyval.num) = p->in_kwarg;
7282 p->in_kwarg = 1;
7283 }
7284#line 7280 "parse.c"
7285 break;
7286
7287 case 58: /* @6: %empty */
7288#line 1592 "parse.y"
7289 {(yyval.tbl) = push_pvtbl(p);}
7290#line 7286 "parse.c"
7291 break;
7292
7293 case 59: /* $@7: %empty */
7294#line 1594 "parse.y"
7295 {pop_pvtbl(p, (yyvsp[-1].tbl));}
7296#line 7292 "parse.c"
7297 break;
7298
7299 case 60: /* expr: arg "`in'" @5 @6 p_expr $@7 */
7300#line 1595 "parse.y"
7301 {
7302 p->in_kwarg = !!(yyvsp[-3].num);
7303 /*%%%*/
7304 (yyval.node) = new_case3(p, (yyvsp[-5].node), NEW_IN((yyvsp[-1].node), 0, 0, &(yylsp[-1])), &(yyloc));
7305 /*% %*/
7306 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
7307 }
7308#line 7304 "parse.c"
7309 break;
7310
7311 case 62: /* expr_value: expr */
7312#line 1606 "parse.y"
7313 {
7314 value_expr((yyvsp[0].node));
7315 (yyval.node) = (yyvsp[0].node);
7316 }
7317#line 7313 "parse.c"
7318 break;
7319
7320 case 63: /* $@8: %empty */
7321#line 1612 "parse.y"
7322 {COND_PUSH(1);}
7323#line 7319 "parse.c"
7324 break;
7325
7326 case 64: /* $@9: %empty */
7327#line 1612 "parse.y"
7328 {COND_POP();}
7329#line 7325 "parse.c"
7330 break;
7331
7332 case 65: /* expr_value_do: $@8 expr_value do $@9 */
7333#line 1613 "parse.y"
7334 {
7335 (yyval.node) = (yyvsp[-2].node);
7336 }
7337#line 7333 "parse.c"
7338 break;
7339
7340 case 69: /* block_command: block_call call_op2 operation2 command_args */
7341#line 1624 "parse.y"
7342 {
7343 /*%%%*/
7344 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7345 /*% %*/
7346 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
7347 }
7348#line 7344 "parse.c"
7349 break;
7350
7351 case 70: /* cmd_brace_block: "{ arg" brace_body '}' */
7352#line 1633 "parse.y"
7353 {
7354 (yyval.node) = (yyvsp[-1].node);
7355 /*%%%*/
7356 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
7357 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
7358 /*% %*/
7359 }
7360#line 7356 "parse.c"
7361 break;
7362
7363 case 71: /* fcall: operation */
7364#line 1643 "parse.y"
7365 {
7366 /*%%%*/
7367 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
7368 nd_set_line((yyval.node), p->tokline);
7369 /*% %*/
7370 /*% ripper: $1 %*/
7371 }
7372#line 7368 "parse.c"
7373 break;
7374
7375 case 72: /* command: fcall command_args */
7376#line 1653 "parse.y"
7377 {
7378 /*%%%*/
7379 (yyvsp[-1].node)->nd_args = (yyvsp[0].node);
7380 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
7381 (yyval.node) = (yyvsp[-1].node);
7382 /*% %*/
7383 /*% ripper: command!($1, $2) %*/
7384 }
7385#line 7381 "parse.c"
7386 break;
7387
7388 case 73: /* command: fcall command_args cmd_brace_block */
7389#line 1662 "parse.y"
7390 {
7391 /*%%%*/
7392 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
7393 (yyvsp[-2].node)->nd_args = (yyvsp[-1].node);
7394 (yyval.node) = method_add_block(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7395 fixpos((yyval.node), (yyvsp[-2].node));
7396 nd_set_last_loc((yyvsp[-2].node), (yylsp[-1]).end_pos);
7397 /*% %*/
7398 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
7399 }
7400#line 7396 "parse.c"
7401 break;
7402
7403 case 74: /* command: primary_value call_op operation2 command_args */
7404#line 1673 "parse.y"
7405 {
7406 /*%%%*/
7407 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
7408 /*% %*/
7409 /*% ripper: command_call!($1, $2, $3, $4) %*/
7410 }
7411#line 7407 "parse.c"
7412 break;
7413
7414 case 75: /* command: primary_value call_op operation2 command_args cmd_brace_block */
7415#line 1680 "parse.y"
7416 {
7417 /*%%%*/
7418 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
7419 /*% %*/
7420 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
7421 }
7422#line 7418 "parse.c"
7423 break;
7424
7425 case 76: /* command: primary_value "::" operation2 command_args */
7426#line 1687 "parse.y"
7427 {
7428 /*%%%*/
7429 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
7430 /*% %*/
7431 /*% ripper: command_call!($1, ID2VAL(idCOLON2), $3, $4) %*/
7432 }
7433#line 7429 "parse.c"
7434 break;
7435
7436 case 77: /* command: primary_value "::" operation2 command_args cmd_brace_block */
7437#line 1694 "parse.y"
7438 {
7439 /*%%%*/
7440 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
7441 /*% %*/
7442 /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/
7443 }
7444#line 7440 "parse.c"
7445 break;
7446
7447 case 78: /* command: "`super'" command_args */
7448#line 1701 "parse.y"
7449 {
7450 /*%%%*/
7451 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
7452 fixpos((yyval.node), (yyvsp[0].node));
7453 /*% %*/
7454 /*% ripper: super!($2) %*/
7455 }
7456#line 7452 "parse.c"
7457 break;
7458
7459 case 79: /* command: "`yield'" command_args */
7460#line 1709 "parse.y"
7461 {
7462 /*%%%*/
7463 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
7464 fixpos((yyval.node), (yyvsp[0].node));
7465 /*% %*/
7466 /*% ripper: yield!($2) %*/
7467 }
7468#line 7464 "parse.c"
7469 break;
7470
7471 case 80: /* command: k_return call_args */
7472#line 1717 "parse.y"
7473 {
7474 /*%%%*/
7475 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
7476 /*% %*/
7477 /*% ripper: return!($2) %*/
7478 }
7479#line 7475 "parse.c"
7480 break;
7481
7482 case 81: /* command: "`break'" call_args */
7483#line 1724 "parse.y"
7484 {
7485 /*%%%*/
7486 (yyval.node) = NEW_BREAK(ret_args(p, (yyvsp[0].node)), &(yyloc));
7487 /*% %*/
7488 /*% ripper: break!($2) %*/
7489 }
7490#line 7486 "parse.c"
7491 break;
7492
7493 case 82: /* command: "`next'" call_args */
7494#line 1731 "parse.y"
7495 {
7496 /*%%%*/
7497 (yyval.node) = NEW_NEXT(ret_args(p, (yyvsp[0].node)), &(yyloc));
7498 /*% %*/
7499 /*% ripper: next!($2) %*/
7500 }
7501#line 7497 "parse.c"
7502 break;
7503
7504 case 84: /* mlhs: "(" mlhs_inner rparen */
7505#line 1741 "parse.y"
7506 {
7507 /*%%%*/
7508 (yyval.node) = (yyvsp[-1].node);
7509 /*% %*/
7510 /*% ripper: mlhs_paren!($2) %*/
7511 }
7512#line 7508 "parse.c"
7513 break;
7514
7515 case 86: /* mlhs_inner: "(" mlhs_inner rparen */
7516#line 1751 "parse.y"
7517 {
7518 /*%%%*/
7519 (yyval.node) = NEW_MASGN(NEW_LIST((yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
7520 /*% %*/
7521 /*% ripper: mlhs_paren!($2) %*/
7522 }
7523#line 7519 "parse.c"
7524 break;
7525
7526 case 87: /* mlhs_basic: mlhs_head */
7527#line 1760 "parse.y"
7528 {
7529 /*%%%*/
7530 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
7531 /*% %*/
7532 /*% ripper: $1 %*/
7533 }
7534#line 7530 "parse.c"
7535 break;
7536
7537 case 88: /* mlhs_basic: mlhs_head mlhs_item */
7538#line 1767 "parse.y"
7539 {
7540 /*%%%*/
7541 (yyval.node) = NEW_MASGN(list_append(p, (yyvsp[-1].node),(yyvsp[0].node)), 0, &(yyloc));
7542 /*% %*/
7543 /*% ripper: mlhs_add!($1, $2) %*/
7544 }
7545#line 7541 "parse.c"
7546 break;
7547
7548 case 89: /* mlhs_basic: mlhs_head "*" mlhs_node */
7549#line 1774 "parse.y"
7550 {
7551 /*%%%*/
7552 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7553 /*% %*/
7554 /*% ripper: mlhs_add_star!($1, $3) %*/
7555 }
7556#line 7552 "parse.c"
7557 break;
7558
7559 case 90: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
7560#line 1781 "parse.y"
7561 {
7562 /*%%%*/
7563 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
7564 /*% %*/
7565 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
7566 }
7567#line 7563 "parse.c"
7568 break;
7569
7570 case 91: /* mlhs_basic: mlhs_head "*" */
7571#line 1788 "parse.y"
7572 {
7573 /*%%%*/
7574 (yyval.node) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
7575 /*% %*/
7576 /*% ripper: mlhs_add_star!($1, Qnil) %*/
7577 }
7578#line 7574 "parse.c"
7579 break;
7580
7581 case 92: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
7582#line 1795 "parse.y"
7583 {
7584 /*%%%*/
7585 (yyval.node) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
7586 /*% %*/
7587 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
7588 }
7589#line 7585 "parse.c"
7590 break;
7591
7592 case 93: /* mlhs_basic: "*" mlhs_node */
7593#line 1802 "parse.y"
7594 {
7595 /*%%%*/
7596 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
7597 /*% %*/
7598 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
7599 }
7600#line 7596 "parse.c"
7601 break;
7602
7603 case 94: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
7604#line 1809 "parse.y"
7605 {
7606 /*%%%*/
7607 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
7608 /*% %*/
7609 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
7610 }
7611#line 7607 "parse.c"
7612 break;
7613
7614 case 95: /* mlhs_basic: "*" */
7615#line 1816 "parse.y"
7616 {
7617 /*%%%*/
7618 (yyval.node) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
7619 /*% %*/
7620 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
7621 }
7622#line 7618 "parse.c"
7623 break;
7624
7625 case 96: /* mlhs_basic: "*" ',' mlhs_post */
7626#line 1823 "parse.y"
7627 {
7628 /*%%%*/
7629 (yyval.node) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
7630 /*% %*/
7631 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
7632 }
7633#line 7629 "parse.c"
7634 break;
7635
7636 case 98: /* mlhs_item: "(" mlhs_inner rparen */
7637#line 1833 "parse.y"
7638 {
7639 /*%%%*/
7640 (yyval.node) = (yyvsp[-1].node);
7641 /*% %*/
7642 /*% ripper: mlhs_paren!($2) %*/
7643 }
7644#line 7640 "parse.c"
7645 break;
7646
7647 case 99: /* mlhs_head: mlhs_item ',' */
7648#line 1842 "parse.y"
7649 {
7650 /*%%%*/
7651 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
7652 /*% %*/
7653 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
7654 }
7655#line 7651 "parse.c"
7656 break;
7657
7658 case 100: /* mlhs_head: mlhs_head mlhs_item ',' */
7659#line 1849 "parse.y"
7660 {
7661 /*%%%*/
7662 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
7663 /*% %*/
7664 /*% ripper: mlhs_add!($1, $2) %*/
7665 }
7666#line 7662 "parse.c"
7667 break;
7668
7669 case 101: /* mlhs_post: mlhs_item */
7670#line 1858 "parse.y"
7671 {
7672 /*%%%*/
7673 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
7674 /*% %*/
7675 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
7676 }
7677#line 7673 "parse.c"
7678 break;
7679
7680 case 102: /* mlhs_post: mlhs_post ',' mlhs_item */
7681#line 1865 "parse.y"
7682 {
7683 /*%%%*/
7684 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
7685 /*% %*/
7686 /*% ripper: mlhs_add!($1, $3) %*/
7687 }
7688#line 7684 "parse.c"
7689 break;
7690
7691 case 103: /* mlhs_node: user_variable */
7692#line 1874 "parse.y"
7693 {
7694 /*%%%*/
7695 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
7696 /*% %*/
7697 /*% ripper: assignable(p, var_field(p, $1)) %*/
7698 }
7699#line 7695 "parse.c"
7700 break;
7701
7702 case 104: /* mlhs_node: keyword_variable */
7703#line 1881 "parse.y"
7704 {
7705 /*%%%*/
7706 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
7707 /*% %*/
7708 /*% ripper: assignable(p, var_field(p, $1)) %*/
7709 }
7710#line 7706 "parse.c"
7711 break;
7712
7713 case 105: /* mlhs_node: primary_value '[' opt_call_args rbracket */
7714#line 1888 "parse.y"
7715 {
7716 /*%%%*/
7717 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
7718 /*% %*/
7719 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
7720 }
7721#line 7717 "parse.c"
7722 break;
7723
7724 case 106: /* mlhs_node: primary_value call_op "local variable or method" */
7725#line 1895 "parse.y"
7726 {
7727 if ((yyvsp[-1].id) == tANDDOT) {
7728 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
7729 }
7730 /*%%%*/
7731 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
7732 /*% %*/
7733 /*% ripper: field!($1, $2, $3) %*/
7734 }
7735#line 7731 "parse.c"
7736 break;
7737
7738 case 107: /* mlhs_node: primary_value "::" "local variable or method" */
7739#line 1905 "parse.y"
7740 {
7741 /*%%%*/
7742 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
7743 /*% %*/
7744 /*% ripper: const_path_field!($1, $3) %*/
7745 }
7746#line 7742 "parse.c"
7747 break;
7748
7749 case 108: /* mlhs_node: primary_value call_op "constant" */
7750#line 1912 "parse.y"
7751 {
7752 if ((yyvsp[-1].id) == tANDDOT) {
7753 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
7754 }
7755 /*%%%*/
7756 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
7757 /*% %*/
7758 /*% ripper: field!($1, $2, $3) %*/
7759 }
7760#line 7756 "parse.c"
7761 break;
7762
7763 case 109: /* mlhs_node: primary_value "::" "constant" */
7764#line 1922 "parse.y"
7765 {
7766 /*%%%*/
7767 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
7768 /*% %*/
7769 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
7770 }
7771#line 7767 "parse.c"
7772 break;
7773
7774 case 110: /* mlhs_node: ":: at EXPR_BEG" "constant" */
7775#line 1929 "parse.y"
7776 {
7777 /*%%%*/
7778 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
7779 /*% %*/
7780 /*% ripper: const_decl(p, top_const_field!($2)) %*/
7781 }
7782#line 7778 "parse.c"
7783 break;
7784
7785 case 111: /* mlhs_node: backref */
7786#line 1936 "parse.y"
7787 {
7788 /*%%%*/
7789 rb_backref_error(p, (yyvsp[0].node));
7790 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7791 /*% %*/
7792 /*% ripper[error]: assign_error!(var_field(p, $1)) %*/
7793 }
7794#line 7790 "parse.c"
7795 break;
7796
7797 case 112: /* lhs: user_variable */
7798#line 1946 "parse.y"
7799 {
7800 /*%%%*/
7801 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
7802 /*% %*/
7803 /*% ripper: assignable(p, var_field(p, $1)) %*/
7804 }
7805#line 7801 "parse.c"
7806 break;
7807
7808 case 113: /* lhs: keyword_variable */
7809#line 1953 "parse.y"
7810 {
7811 /*%%%*/
7812 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
7813 /*% %*/
7814 /*% ripper: assignable(p, var_field(p, $1)) %*/
7815 }
7816#line 7812 "parse.c"
7817 break;
7818
7819 case 114: /* lhs: primary_value '[' opt_call_args rbracket */
7820#line 1960 "parse.y"
7821 {
7822 /*%%%*/
7823 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
7824 /*% %*/
7825 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
7826 }
7827#line 7823 "parse.c"
7828 break;
7829
7830 case 115: /* lhs: primary_value call_op "local variable or method" */
7831#line 1967 "parse.y"
7832 {
7833 /*%%%*/
7834 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
7835 /*% %*/
7836 /*% ripper: field!($1, $2, $3) %*/
7837 }
7838#line 7834 "parse.c"
7839 break;
7840
7841 case 116: /* lhs: primary_value "::" "local variable or method" */
7842#line 1974 "parse.y"
7843 {
7844 /*%%%*/
7845 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
7846 /*% %*/
7847 /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/
7848 }
7849#line 7845 "parse.c"
7850 break;
7851
7852 case 117: /* lhs: primary_value call_op "constant" */
7853#line 1981 "parse.y"
7854 {
7855 /*%%%*/
7856 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
7857 /*% %*/
7858 /*% ripper: field!($1, $2, $3) %*/
7859 }
7860#line 7856 "parse.c"
7861 break;
7862
7863 case 118: /* lhs: primary_value "::" "constant" */
7864#line 1988 "parse.y"
7865 {
7866 /*%%%*/
7867 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
7868 /*% %*/
7869 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
7870 }
7871#line 7867 "parse.c"
7872 break;
7873
7874 case 119: /* lhs: ":: at EXPR_BEG" "constant" */
7875#line 1995 "parse.y"
7876 {
7877 /*%%%*/
7878 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
7879 /*% %*/
7880 /*% ripper: const_decl(p, top_const_field!($2)) %*/
7881 }
7882#line 7878 "parse.c"
7883 break;
7884
7885 case 120: /* lhs: backref */
7886#line 2002 "parse.y"
7887 {
7888 /*%%%*/
7889 rb_backref_error(p, (yyvsp[0].node));
7890 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7891 /*% %*/
7892 /*% ripper[error]: assign_error!(var_field(p, $1)) %*/
7893 }
7894#line 7890 "parse.c"
7895 break;
7896
7897 case 121: /* cname: "local variable or method" */
7898#line 2012 "parse.y"
7899 {
7900 /*%%%*/
7901 yyerror1(&(yylsp[0]), "class/module name must be CONSTANT");
7902 /*% %*/
7903 /*% ripper[error]: class_name_error!($1) %*/
7904 }
7905#line 7901 "parse.c"
7906 break;
7907
7908 case 123: /* cpath: ":: at EXPR_BEG" cname */
7909#line 2022 "parse.y"
7910 {
7911 /*%%%*/
7912 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
7913 /*% %*/
7914 /*% ripper: top_const_ref!($2) %*/
7915 }
7916#line 7912 "parse.c"
7917 break;
7918
7919 case 124: /* cpath: cname */
7920#line 2029 "parse.y"
7921 {
7922 /*%%%*/
7923 (yyval.node) = NEW_COLON2(0, (yyval.node), &(yyloc));
7924 /*% %*/
7925 /*% ripper: const_ref!($1) %*/
7926 }
7927#line 7923 "parse.c"
7928 break;
7929
7930 case 125: /* cpath: primary_value "::" cname */
7931#line 2036 "parse.y"
7932 {
7933 /*%%%*/
7934 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
7935 /*% %*/
7936 /*% ripper: const_path_ref!($1, $3) %*/
7937 }
7938#line 7934 "parse.c"
7939 break;
7940
7941 case 129: /* fname: op */
7942#line 2048 "parse.y"
7943 {
7944 SET_LEX_STATE(EXPR_ENDFN);
7945 (yyval.id) = (yyvsp[0].id);
7946 }
7947#line 7943 "parse.c"
7948 break;
7949
7950 case 131: /* fitem: fname */
7951#line 2056 "parse.y"
7952 {
7953 /*%%%*/
7954 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
7955 /*% %*/
7956 /*% ripper: symbol_literal!($1) %*/
7957 }
7958#line 7954 "parse.c"
7959 break;
7960
7961 case 133: /* undef_list: fitem */
7962#line 2066 "parse.y"
7963 {
7964 /*%%%*/
7965 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
7966 /*% %*/
7967 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
7968 }
7969#line 7965 "parse.c"
7970 break;
7971
7972 case 134: /* $@10: %empty */
7973#line 2072 "parse.y"
7974 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
7975#line 7971 "parse.c"
7976 break;
7977
7978 case 135: /* undef_list: undef_list ',' $@10 fitem */
7979#line 2073 "parse.y"
7980 {
7981 /*%%%*/
7982 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
7983 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
7984 /*% %*/
7985 /*% ripper: rb_ary_push($1, get_value($4)) %*/
7986 }
7987#line 7983 "parse.c"
7988 break;
7989
7990 case 136: /* op: '|' */
7991#line 2082 "parse.y"
7992 { ifndef_ripper((yyval.id) = '|'); }
7993#line 7989 "parse.c"
7994 break;
7995
7996 case 137: /* op: '^' */
7997#line 2083 "parse.y"
7998 { ifndef_ripper((yyval.id) = '^'); }
7999#line 7995 "parse.c"
8000 break;
8001
8002 case 138: /* op: '&' */
8003#line 2084 "parse.y"
8004 { ifndef_ripper((yyval.id) = '&'); }
8005#line 8001 "parse.c"
8006 break;
8007
8008 case 139: /* op: "<=>" */
8009#line 2085 "parse.y"
8010 { ifndef_ripper((yyval.id) = tCMP); }
8011#line 8007 "parse.c"
8012 break;
8013
8014 case 140: /* op: "==" */
8015#line 2086 "parse.y"
8016 { ifndef_ripper((yyval.id) = tEQ); }
8017#line 8013 "parse.c"
8018 break;
8019
8020 case 141: /* op: "===" */
8021#line 2087 "parse.y"
8022 { ifndef_ripper((yyval.id) = tEQQ); }
8023#line 8019 "parse.c"
8024 break;
8025
8026 case 142: /* op: "=~" */
8027#line 2088 "parse.y"
8028 { ifndef_ripper((yyval.id) = tMATCH); }
8029#line 8025 "parse.c"
8030 break;
8031
8032 case 143: /* op: "!~" */
8033#line 2089 "parse.y"
8034 { ifndef_ripper((yyval.id) = tNMATCH); }
8035#line 8031 "parse.c"
8036 break;
8037
8038 case 144: /* op: '>' */
8039#line 2090 "parse.y"
8040 { ifndef_ripper((yyval.id) = '>'); }
8041#line 8037 "parse.c"
8042 break;
8043
8044 case 145: /* op: ">=" */
8045#line 2091 "parse.y"
8046 { ifndef_ripper((yyval.id) = tGEQ); }
8047#line 8043 "parse.c"
8048 break;
8049
8050 case 146: /* op: '<' */
8051#line 2092 "parse.y"
8052 { ifndef_ripper((yyval.id) = '<'); }
8053#line 8049 "parse.c"
8054 break;
8055
8056 case 147: /* op: "<=" */
8057#line 2093 "parse.y"
8058 { ifndef_ripper((yyval.id) = tLEQ); }
8059#line 8055 "parse.c"
8060 break;
8061
8062 case 148: /* op: "!=" */
8063#line 2094 "parse.y"
8064 { ifndef_ripper((yyval.id) = tNEQ); }
8065#line 8061 "parse.c"
8066 break;
8067
8068 case 149: /* op: "<<" */
8069#line 2095 "parse.y"
8070 { ifndef_ripper((yyval.id) = tLSHFT); }
8071#line 8067 "parse.c"
8072 break;
8073
8074 case 150: /* op: ">>" */
8075#line 2096 "parse.y"
8076 { ifndef_ripper((yyval.id) = tRSHFT); }
8077#line 8073 "parse.c"
8078 break;
8079
8080 case 151: /* op: '+' */
8081#line 2097 "parse.y"
8082 { ifndef_ripper((yyval.id) = '+'); }
8083#line 8079 "parse.c"
8084 break;
8085
8086 case 152: /* op: '-' */
8087#line 2098 "parse.y"
8088 { ifndef_ripper((yyval.id) = '-'); }
8089#line 8085 "parse.c"
8090 break;
8091
8092 case 153: /* op: '*' */
8093#line 2099 "parse.y"
8094 { ifndef_ripper((yyval.id) = '*'); }
8095#line 8091 "parse.c"
8096 break;
8097
8098 case 154: /* op: "*" */
8099#line 2100 "parse.y"
8100 { ifndef_ripper((yyval.id) = '*'); }
8101#line 8097 "parse.c"
8102 break;
8103
8104 case 155: /* op: '/' */
8105#line 2101 "parse.y"
8106 { ifndef_ripper((yyval.id) = '/'); }
8107#line 8103 "parse.c"
8108 break;
8109
8110 case 156: /* op: '%' */
8111#line 2102 "parse.y"
8112 { ifndef_ripper((yyval.id) = '%'); }
8113#line 8109 "parse.c"
8114 break;
8115
8116 case 157: /* op: "**" */
8117#line 2103 "parse.y"
8118 { ifndef_ripper((yyval.id) = tPOW); }
8119#line 8115 "parse.c"
8120 break;
8121
8122 case 158: /* op: "**arg" */
8123#line 2104 "parse.y"
8124 { ifndef_ripper((yyval.id) = tDSTAR); }
8125#line 8121 "parse.c"
8126 break;
8127
8128 case 159: /* op: '!' */
8129#line 2105 "parse.y"
8130 { ifndef_ripper((yyval.id) = '!'); }
8131#line 8127 "parse.c"
8132 break;
8133
8134 case 160: /* op: '~' */
8135#line 2106 "parse.y"
8136 { ifndef_ripper((yyval.id) = '~'); }
8137#line 8133 "parse.c"
8138 break;
8139
8140 case 161: /* op: "unary+" */
8141#line 2107 "parse.y"
8142 { ifndef_ripper((yyval.id) = tUPLUS); }
8143#line 8139 "parse.c"
8144 break;
8145
8146 case 162: /* op: "unary-" */
8147#line 2108 "parse.y"
8148 { ifndef_ripper((yyval.id) = tUMINUS); }
8149#line 8145 "parse.c"
8150 break;
8151
8152 case 163: /* op: "[]" */
8153#line 2109 "parse.y"
8154 { ifndef_ripper((yyval.id) = tAREF); }
8155#line 8151 "parse.c"
8156 break;
8157
8158 case 164: /* op: "[]=" */
8159#line 2110 "parse.y"
8160 { ifndef_ripper((yyval.id) = tASET); }
8161#line 8157 "parse.c"
8162 break;
8163
8164 case 165: /* op: '`' */
8165#line 2111 "parse.y"
8166 { ifndef_ripper((yyval.id) = '`'); }
8167#line 8163 "parse.c"
8168 break;
8169
8170 case 207: /* arg: lhs '=' arg_rhs */
8171#line 2129 "parse.y"
8172 {
8173 /*%%%*/
8174 (yyval.node) = node_assign(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8175 /*% %*/
8176 /*% ripper: assign!($1, $3) %*/
8177 }
8178#line 8174 "parse.c"
8179 break;
8180
8181 case 208: /* arg: var_lhs "operator-assignment" arg_rhs */
8182#line 2136 "parse.y"
8183 {
8184 /*%%%*/
8185 (yyval.node) = new_op_assign(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
8186 /*% %*/
8187 /*% ripper: opassign!($1, $2, $3) %*/
8188 }
8189#line 8185 "parse.c"
8190 break;
8191
8192 case 209: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" arg_rhs */
8193#line 2143 "parse.y"
8194 {
8195 /*%%%*/
8196 value_expr((yyvsp[0].node));
8197 (yyval.node) = new_ary_op_assign(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-3]), &(yyloc));
8198 /*% %*/
8199 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $6) %*/
8200 }
8201#line 8197 "parse.c"
8202 break;
8203
8204 case 210: /* arg: primary_value call_op "local variable or method" "operator-assignment" arg_rhs */
8205#line 2151 "parse.y"
8206 {
8207 /*%%%*/
8208 value_expr((yyvsp[0].node));
8209 (yyval.node) = new_attr_op_assign(p, (yyvsp[-4].node), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
8210 /*% %*/
8211 /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/
8212 }
8213#line 8209 "parse.c"
8214 break;
8215
8216 case 211: /* arg: primary_value call_op "constant" "operator-assignment" arg_rhs */
8217#line 2159 "parse.y"
8218 {
8219 /*%%%*/
8220 value_expr((yyvsp[0].node));
8221 (yyval.node) = new_attr_op_assign(p, (yyvsp[-4].node), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
8222 /*% %*/
8223 /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/
8224 }
8225#line 8221 "parse.c"
8226 break;
8227
8228 case 212: /* arg: primary_value "::" "local variable or method" "operator-assignment" arg_rhs */
8229#line 2167 "parse.y"
8230 {
8231 /*%%%*/
8232 value_expr((yyvsp[0].node));
8233 (yyval.node) = new_attr_op_assign(p, (yyvsp[-4].node), ID2VAL(idCOLON2), (yyvsp[-2].id), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
8234 /*% %*/
8235 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $5) %*/
8236 }
8237#line 8233 "parse.c"
8238 break;
8239
8240 case 213: /* arg: primary_value "::" "constant" "operator-assignment" arg_rhs */
8241#line 2175 "parse.y"
8242 {
8243 /*%%%*/
8244 YYLTYPE loc = code_loc_gen(&(yylsp[-4]), &(yylsp[-2]));
8245 (yyval.node) = new_const_op_assign(p, NEW_COLON2((yyvsp[-4].node), (yyvsp[-2].id), &loc), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
8246 /*% %*/
8247 /*% ripper: opassign!(const_path_field!($1, $3), $4, $5) %*/
8248 }
8249#line 8245 "parse.c"
8250 break;
8251
8252 case 214: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" arg_rhs */
8253#line 2183 "parse.y"
8254 {
8255 /*%%%*/
8256 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-2].id), &(yyloc)), (yyvsp[-1].id), (yyvsp[0].node), &(yyloc));
8257 /*% %*/
8258 /*% ripper: opassign!(top_const_field!($2), $3, $4) %*/
8259 }
8260#line 8256 "parse.c"
8261 break;
8262
8263 case 215: /* arg: backref "operator-assignment" arg_rhs */
8264#line 2190 "parse.y"
8265 {
8266 /*%%%*/
8267 rb_backref_error(p, (yyvsp[-2].node));
8268 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8269 /*% %*/
8270 /*% ripper[error]: assign_error!(opassign!(var_field(p, $1), $2, $3)) %*/
8271 }
8272#line 8268 "parse.c"
8273 break;
8274
8275 case 216: /* arg: arg ".." arg */
8276#line 2198 "parse.y"
8277 {
8278 /*%%%*/
8279 value_expr((yyvsp[-2].node));
8280 value_expr((yyvsp[0].node));
8281 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8282 /*% %*/
8283 /*% ripper: dot2!($1, $3) %*/
8284 }
8285#line 8281 "parse.c"
8286 break;
8287
8288 case 217: /* arg: arg "..." arg */
8289#line 2207 "parse.y"
8290 {
8291 /*%%%*/
8292 value_expr((yyvsp[-2].node));
8293 value_expr((yyvsp[0].node));
8294 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8295 /*% %*/
8296 /*% ripper: dot3!($1, $3) %*/
8297 }
8298#line 8294 "parse.c"
8299 break;
8300
8301 case 218: /* arg: arg ".." */
8302#line 2216 "parse.y"
8303 {
8304 /*%%%*/
8305 YYLTYPE loc;
8306 loc.beg_pos = (yylsp[0]).end_pos;
8307 loc.end_pos = (yylsp[0]).end_pos;
8308
8309 value_expr((yyvsp[-1].node));
8310 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil(&loc), &(yyloc));
8311 /*% %*/
8312 /*% ripper: dot2!($1, Qnil) %*/
8313 }
8314#line 8310 "parse.c"
8315 break;
8316
8317 case 219: /* arg: arg "..." */
8318#line 2228 "parse.y"
8319 {
8320 /*%%%*/
8321 YYLTYPE loc;
8322 loc.beg_pos = (yylsp[0]).end_pos;
8323 loc.end_pos = (yylsp[0]).end_pos;
8324
8325 value_expr((yyvsp[-1].node));
8326 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil(&loc), &(yyloc));
8327 /*% %*/
8328 /*% ripper: dot3!($1, Qnil) %*/
8329 }
8330#line 8326 "parse.c"
8331 break;
8332
8333 case 220: /* arg: "(.." arg */
8334#line 2240 "parse.y"
8335 {
8336 /*%%%*/
8337 YYLTYPE loc;
8338 loc.beg_pos = (yylsp[-1]).beg_pos;
8339 loc.end_pos = (yylsp[-1]).beg_pos;
8340
8341 value_expr((yyvsp[0].node));
8342 (yyval.node) = NEW_DOT2(new_nil(&loc), (yyvsp[0].node), &(yyloc));
8343 /*% %*/
8344 /*% ripper: dot2!(Qnil, $2) %*/
8345 }
8346#line 8342 "parse.c"
8347 break;
8348
8349 case 221: /* arg: "(..." arg */
8350#line 2252 "parse.y"
8351 {
8352 /*%%%*/
8353 YYLTYPE loc;
8354 loc.beg_pos = (yylsp[-1]).beg_pos;
8355 loc.end_pos = (yylsp[-1]).beg_pos;
8356
8357 value_expr((yyvsp[0].node));
8358 (yyval.node) = NEW_DOT3(new_nil(&loc), (yyvsp[0].node), &(yyloc));
8359 /*% %*/
8360 /*% ripper: dot3!(Qnil, $2) %*/
8361 }
8362#line 8358 "parse.c"
8363 break;
8364
8365 case 222: /* arg: arg '+' arg */
8366#line 2264 "parse.y"
8367 {
8368 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8369 }
8370#line 8366 "parse.c"
8371 break;
8372
8373 case 223: /* arg: arg '-' arg */
8374#line 2268 "parse.y"
8375 {
8376 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8377 }
8378#line 8374 "parse.c"
8379 break;
8380
8381 case 224: /* arg: arg '*' arg */
8382#line 2272 "parse.y"
8383 {
8384 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8385 }
8386#line 8382 "parse.c"
8387 break;
8388
8389 case 225: /* arg: arg '/' arg */
8390#line 2276 "parse.y"
8391 {
8392 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8393 }
8394#line 8390 "parse.c"
8395 break;
8396
8397 case 226: /* arg: arg '%' arg */
8398#line 2280 "parse.y"
8399 {
8400 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8401 }
8402#line 8398 "parse.c"
8403 break;
8404
8405 case 227: /* arg: arg "**" arg */
8406#line 2284 "parse.y"
8407 {
8408 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8409 }
8410#line 8406 "parse.c"
8411 break;
8412
8413 case 228: /* arg: tUMINUS_NUM simple_numeric "**" arg */
8414#line 2288 "parse.y"
8415 {
8416 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
8417 }
8418#line 8414 "parse.c"
8419 break;
8420
8421 case 229: /* arg: "unary+" arg */
8422#line 2292 "parse.y"
8423 {
8424 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
8425 }
8426#line 8422 "parse.c"
8427 break;
8428
8429 case 230: /* arg: "unary-" arg */
8430#line 2296 "parse.y"
8431 {
8432 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
8433 }
8434#line 8430 "parse.c"
8435 break;
8436
8437 case 231: /* arg: arg '|' arg */
8438#line 2300 "parse.y"
8439 {
8440 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8441 }
8442#line 8438 "parse.c"
8443 break;
8444
8445 case 232: /* arg: arg '^' arg */
8446#line 2304 "parse.y"
8447 {
8448 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8449 }
8450#line 8446 "parse.c"
8451 break;
8452
8453 case 233: /* arg: arg '&' arg */
8454#line 2308 "parse.y"
8455 {
8456 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8457 }
8458#line 8454 "parse.c"
8459 break;
8460
8461 case 234: /* arg: arg "<=>" arg */
8462#line 2312 "parse.y"
8463 {
8464 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8465 }
8466#line 8462 "parse.c"
8467 break;
8468
8469 case 236: /* arg: arg "==" arg */
8470#line 2317 "parse.y"
8471 {
8472 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8473 }
8474#line 8470 "parse.c"
8475 break;
8476
8477 case 237: /* arg: arg "===" arg */
8478#line 2321 "parse.y"
8479 {
8480 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8481 }
8482#line 8478 "parse.c"
8483 break;
8484
8485 case 238: /* arg: arg "!=" arg */
8486#line 2325 "parse.y"
8487 {
8488 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8489 }
8490#line 8486 "parse.c"
8491 break;
8492
8493 case 239: /* arg: arg "=~" arg */
8494#line 2329 "parse.y"
8495 {
8496 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8497 }
8498#line 8494 "parse.c"
8499 break;
8500
8501 case 240: /* arg: arg "!~" arg */
8502#line 2333 "parse.y"
8503 {
8504 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8505 }
8506#line 8502 "parse.c"
8507 break;
8508
8509 case 241: /* arg: '!' arg */
8510#line 2337 "parse.y"
8511 {
8512 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
8513 }
8514#line 8510 "parse.c"
8515 break;
8516
8517 case 242: /* arg: '~' arg */
8518#line 2341 "parse.y"
8519 {
8520 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
8521 }
8522#line 8518 "parse.c"
8523 break;
8524
8525 case 243: /* arg: arg "<<" arg */
8526#line 2345 "parse.y"
8527 {
8528 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8529 }
8530#line 8526 "parse.c"
8531 break;
8532
8533 case 244: /* arg: arg ">>" arg */
8534#line 2349 "parse.y"
8535 {
8536 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8537 }
8538#line 8534 "parse.c"
8539 break;
8540
8541 case 245: /* arg: arg "&&" arg */
8542#line 2353 "parse.y"
8543 {
8544 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8545 }
8546#line 8542 "parse.c"
8547 break;
8548
8549 case 246: /* arg: arg "||" arg */
8550#line 2357 "parse.y"
8551 {
8552 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8553 }
8554#line 8550 "parse.c"
8555 break;
8556
8557 case 247: /* $@11: %empty */
8558#line 2360 "parse.y"
8559 {p->in_defined = 1;}
8560#line 8556 "parse.c"
8561 break;
8562
8563 case 248: /* arg: "`defined?'" opt_nl $@11 arg */
8564#line 2361 "parse.y"
8565 {
8566 p->in_defined = 0;
8567 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
8568 }
8569#line 8565 "parse.c"
8570 break;
8571
8572 case 249: /* arg: arg '?' arg opt_nl ':' arg */
8573#line 2366 "parse.y"
8574 {
8575 /*%%%*/
8576 value_expr((yyvsp[-5].node));
8577 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
8578 fixpos((yyval.node), (yyvsp[-5].node));
8579 /*% %*/
8580 /*% ripper: ifop!($1, $3, $6) %*/
8581 }
8582#line 8578 "parse.c"
8583 break;
8584
8585 case 250: /* arg: primary */
8586#line 2375 "parse.y"
8587 {
8588 (yyval.node) = (yyvsp[0].node);
8589 }
8590#line 8586 "parse.c"
8591 break;
8592
8593 case 251: /* relop: '>' */
8594#line 2380 "parse.y"
8595 {(yyval.id) = '>';}
8596#line 8592 "parse.c"
8597 break;
8598
8599 case 252: /* relop: '<' */
8600#line 2381 "parse.y"
8601 {(yyval.id) = '<';}
8602#line 8598 "parse.c"
8603 break;
8604
8605 case 253: /* relop: ">=" */
8606#line 2382 "parse.y"
8607 {(yyval.id) = idGE;}
8608#line 8604 "parse.c"
8609 break;
8610
8611 case 254: /* relop: "<=" */
8612#line 2383 "parse.y"
8613 {(yyval.id) = idLE;}
8614#line 8610 "parse.c"
8615 break;
8616
8617 case 255: /* rel_expr: arg relop arg */
8618#line 2387 "parse.y"
8619 {
8620 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8621 }
8622#line 8618 "parse.c"
8623 break;
8624
8625 case 256: /* rel_expr: rel_expr relop arg */
8626#line 2391 "parse.y"
8627 {
8628 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
8629 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8630 }
8631#line 8627 "parse.c"
8632 break;
8633
8634 case 257: /* arg_value: arg */
8635#line 2398 "parse.y"
8636 {
8637 value_expr((yyvsp[0].node));
8638 (yyval.node) = (yyvsp[0].node);
8639 }
8640#line 8636 "parse.c"
8641 break;
8642
8643 case 259: /* aref_args: args trailer */
8644#line 2406 "parse.y"
8645 {
8646 (yyval.node) = (yyvsp[-1].node);
8647 }
8648#line 8644 "parse.c"
8649 break;
8650
8651 case 260: /* aref_args: args ',' assocs trailer */
8652#line 2410 "parse.y"
8653 {
8654 /*%%%*/
8655 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
8656 /*% %*/
8657 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
8658 }
8659#line 8655 "parse.c"
8660 break;
8661
8662 case 261: /* aref_args: assocs trailer */
8663#line 2417 "parse.y"
8664 {
8665 /*%%%*/
8666 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
8667 /*% %*/
8668 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
8669 }
8670#line 8666 "parse.c"
8671 break;
8672
8673 case 262: /* arg_rhs: arg */
8674#line 2426 "parse.y"
8675 {
8676 value_expr((yyvsp[0].node));
8677 (yyval.node) = (yyvsp[0].node);
8678 }
8679#line 8675 "parse.c"
8680 break;
8681
8682 case 263: /* arg_rhs: arg "`rescue' modifier" arg */
8683#line 2431 "parse.y"
8684 {
8685 /*%%%*/
8686 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
8687 value_expr((yyvsp[-2].node));
8688 (yyval.node) = NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
8689 /*% %*/
8690 /*% ripper: rescue_mod!($1, $3) %*/
8691 }
8692#line 8688 "parse.c"
8693 break;
8694
8695 case 264: /* paren_args: '(' opt_call_args rparen */
8696#line 2442 "parse.y"
8697 {
8698 /*%%%*/
8699 (yyval.node) = (yyvsp[-1].node);
8700 /*% %*/
8701 /*% ripper: arg_paren!(escape_Qundef($2)) %*/
8702 }
8703#line 8699 "parse.c"
8704 break;
8705
8706 case 265: /* paren_args: '(' args ',' args_forward rparen */
8707#line 2449 "parse.y"
8708 {
8709 if (!local_id(p, idFWD_REST) ||
8710#if idFWD_KWREST
8711 !local_id(p, idFWD_KWREST) ||
8712#endif
8713 !local_id(p, idFWD_BLOCK)) {
8714 compile_error(p, "unexpected ...");
8715 (yyval.node) = Qnone;
8716 }
8717 else {
8718 /*%%%*/
8719 NODE *splat = NEW_SPLAT(NEW_LVAR(idFWD_REST, &(yylsp[-1])), &(yylsp[-1]));
8720#if idFWD_KWREST
8721 NODE *kwrest = list_append(p, NEW_LIST(0, &(yylsp[-1])), NEW_LVAR(idFWD_KWREST, &(yylsp[-1])));
8722#endif
8723 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[-1])), &(yylsp[-1]));
8724 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), splat, &(yyloc));
8725#if idFWD_KWREST
8726 (yyval.node) = arg_append(p, (yyval.node), new_hash(p, kwrest, &(yylsp[-1])), &(yylsp[-1]));
8727#endif
8728 (yyval.node) = arg_blk_pass((yyval.node), block);
8729 /*% %*/
8730 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
8731 }
8732 }
8733#line 8729 "parse.c"
8734 break;
8735
8736 case 266: /* paren_args: '(' args_forward rparen */
8737#line 2475 "parse.y"
8738 {
8739 if (!local_id(p, idFWD_REST) ||
8740#if idFWD_KWREST
8741 !local_id(p, idFWD_KWREST) ||
8742#endif
8743 !local_id(p, idFWD_BLOCK)) {
8744 compile_error(p, "unexpected ...");
8745 (yyval.node) = Qnone;
8746 }
8747 else {
8748 /*%%%*/
8749 NODE *splat = NEW_SPLAT(NEW_LVAR(idFWD_REST, &(yylsp[-1])), &(yylsp[-1]));
8750#if idFWD_KWREST
8751 NODE *kwrest = list_append(p, NEW_LIST(0, &(yylsp[-1])), NEW_LVAR(idFWD_KWREST, &(yylsp[-1])));
8752#endif
8753 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &(yylsp[-1])), &(yylsp[-1]));
8754#if idFWD_KWREST
8755 (yyval.node) = arg_append(p, splat, new_hash(p, kwrest, &(yylsp[-1])), &(yylsp[-1]));
8756#else
8757 (yyval.node) = splat;
8758#endif
8759 (yyval.node) = arg_blk_pass((yyval.node), block);
8760 /*% %*/
8761 /*% ripper: arg_paren!($2) %*/
8762 }
8763 }
8764#line 8760 "parse.c"
8765 break;
8766
8767 case 271: /* opt_call_args: args ',' */
8768#line 2510 "parse.y"
8769 {
8770 (yyval.node) = (yyvsp[-1].node);
8771 }
8772#line 8768 "parse.c"
8773 break;
8774
8775 case 272: /* opt_call_args: args ',' assocs ',' */
8776#line 2514 "parse.y"
8777 {
8778 /*%%%*/
8779 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
8780 /*% %*/
8781 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
8782 }
8783#line 8779 "parse.c"
8784 break;
8785
8786 case 273: /* opt_call_args: assocs ',' */
8787#line 2521 "parse.y"
8788 {
8789 /*%%%*/
8790 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
8791 /*% %*/
8792 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
8793 }
8794#line 8790 "parse.c"
8795 break;
8796
8797 case 274: /* call_args: command */
8798#line 2530 "parse.y"
8799 {
8800 /*%%%*/
8801 value_expr((yyvsp[0].node));
8802 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
8803 /*% %*/
8804 /*% ripper: args_add!(args_new!, $1) %*/
8805 }
8806#line 8802 "parse.c"
8807 break;
8808
8809 case 275: /* call_args: args opt_block_arg */
8810#line 2538 "parse.y"
8811 {
8812 /*%%%*/
8813 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node));
8814 /*% %*/
8815 /*% ripper: args_add_block!($1, $2) %*/
8816 }
8817#line 8813 "parse.c"
8818 break;
8819
8820 case 276: /* call_args: assocs opt_block_arg */
8821#line 2545 "parse.y"
8822 {
8823 /*%%%*/
8824 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
8825 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
8826 /*% %*/
8827 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
8828 }
8829#line 8825 "parse.c"
8830 break;
8831
8832 case 277: /* call_args: args ',' assocs opt_block_arg */
8833#line 2553 "parse.y"
8834 {
8835 /*%%%*/
8836 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
8837 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
8838 /*% %*/
8839 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
8840 }
8841#line 8837 "parse.c"
8842 break;
8843
8844 case 279: /* $@12: %empty */
8845#line 2564 "parse.y"
8846 {
8847 /* If call_args starts with a open paren '(' or '[',
8848 * look-ahead reading of the letters calls CMDARG_PUSH(0),
8849 * but the push must be done after CMDARG_PUSH(1).
8850 * So this code makes them consistent by first cancelling
8851 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
8852 * and finally redoing CMDARG_PUSH(0).
8853 */
8854 int lookahead = 0;
8855 switch (yychar) {
8856 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
8857 lookahead = 1;
8858 }
8859 if (lookahead) CMDARG_POP();
8860 CMDARG_PUSH(1);
8861 if (lookahead) CMDARG_PUSH(0);
8862 }
8863#line 8859 "parse.c"
8864 break;
8865
8866 case 280: /* command_args: $@12 call_args */
8867#line 2582 "parse.y"
8868 {
8869 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
8870 * but the push must be done after CMDARG_POP() in the parser.
8871 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
8872 * CMDARG_POP() to pop 1 pushed by command_args,
8873 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
8874 */
8875 int lookahead = 0;
8876 switch (yychar) {
8877 case tLBRACE_ARG:
8878 lookahead = 1;
8879 }
8880 if (lookahead) CMDARG_POP();
8881 CMDARG_POP();
8882 if (lookahead) CMDARG_PUSH(0);
8883 (yyval.node) = (yyvsp[0].node);
8884 }
8885#line 8881 "parse.c"
8886 break;
8887
8888 case 281: /* block_arg: "&" arg_value */
8889#line 2602 "parse.y"
8890 {
8891 /*%%%*/
8892 (yyval.node) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
8893 /*% %*/
8894 /*% ripper: $2 %*/
8895 }
8896#line 8892 "parse.c"
8897 break;
8898
8899 case 282: /* opt_block_arg: ',' block_arg */
8900#line 2611 "parse.y"
8901 {
8902 (yyval.node) = (yyvsp[0].node);
8903 }
8904#line 8900 "parse.c"
8905 break;
8906
8907 case 283: /* opt_block_arg: none */
8908#line 2615 "parse.y"
8909 {
8910 (yyval.node) = 0;
8911 }
8912#line 8908 "parse.c"
8913 break;
8914
8915 case 284: /* args: arg_value */
8916#line 2621 "parse.y"
8917 {
8918 /*%%%*/
8919 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
8920 /*% %*/
8921 /*% ripper: args_add!(args_new!, $1) %*/
8922 }
8923#line 8919 "parse.c"
8924 break;
8925
8926 case 285: /* args: "*" arg_value */
8927#line 2628 "parse.y"
8928 {
8929 /*%%%*/
8930 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
8931 /*% %*/
8932 /*% ripper: args_add_star!(args_new!, $2) %*/
8933 }
8934#line 8930 "parse.c"
8935 break;
8936
8937 case 286: /* args: args ',' arg_value */
8938#line 2635 "parse.y"
8939 {
8940 /*%%%*/
8941 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8942 /*% %*/
8943 /*% ripper: args_add!($1, $3) %*/
8944 }
8945#line 8941 "parse.c"
8946 break;
8947
8948 case 287: /* args: args ',' "*" arg_value */
8949#line 2642 "parse.y"
8950 {
8951 /*%%%*/
8952 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
8953 /*% %*/
8954 /*% ripper: args_add_star!($1, $4) %*/
8955 }
8956#line 8952 "parse.c"
8957 break;
8958
8959 case 290: /* mrhs: args ',' arg_value */
8960#line 2655 "parse.y"
8961 {
8962 /*%%%*/
8963 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8964 /*% %*/
8965 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
8966 }
8967#line 8963 "parse.c"
8968 break;
8969
8970 case 291: /* mrhs: args ',' "*" arg_value */
8971#line 2662 "parse.y"
8972 {
8973 /*%%%*/
8974 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
8975 /*% %*/
8976 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
8977 }
8978#line 8974 "parse.c"
8979 break;
8980
8981 case 292: /* mrhs: "*" arg_value */
8982#line 2669 "parse.y"
8983 {
8984 /*%%%*/
8985 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
8986 /*% %*/
8987 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
8988 }
8989#line 8985 "parse.c"
8990 break;
8991
8992 case 303: /* primary: "method" */
8993#line 2688 "parse.y"
8994 {
8995 /*%%%*/
8996 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
8997 /*% %*/
8998 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
8999 }
9000#line 8996 "parse.c"
9001 break;
9002
9003 case 304: /* $@13: %empty */
9004#line 2695 "parse.y"
9005 {
9006 CMDARG_PUSH(0);
9007 }
9008#line 9004 "parse.c"
9009 break;
9010
9011 case 305: /* primary: k_begin $@13 bodystmt k_end */
9012#line 2700 "parse.y"
9013 {
9014 CMDARG_POP();
9015 /*%%%*/
9016 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9017 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
9018 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9019 /*% %*/
9020 /*% ripper: begin!($3) %*/
9021 }
9022#line 9018 "parse.c"
9023 break;
9024
9025 case 306: /* $@14: %empty */
9026#line 2709 "parse.y"
9027 {SET_LEX_STATE(EXPR_ENDARG);}
9028#line 9024 "parse.c"
9029 break;
9030
9031 case 307: /* primary: "( arg" $@14 rparen */
9032#line 2710 "parse.y"
9033 {
9034 /*%%%*/
9035 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9036 /*% %*/
9037 /*% ripper: paren!(0) %*/
9038 }
9039#line 9035 "parse.c"
9040 break;
9041
9042 case 308: /* $@15: %empty */
9043#line 2716 "parse.y"
9044 {SET_LEX_STATE(EXPR_ENDARG);}
9045#line 9041 "parse.c"
9046 break;
9047
9048 case 309: /* primary: "( arg" stmt $@15 rparen */
9049#line 2717 "parse.y"
9050 {
9051 /*%%%*/
9052 if (nd_type((yyvsp[-2].node)) == NODE_SELF) (yyvsp[-2].node)->nd_state = 0;
9053 (yyval.node) = (yyvsp[-2].node);
9054 /*% %*/
9055 /*% ripper: paren!($2) %*/
9056 }
9057#line 9053 "parse.c"
9058 break;
9059
9060 case 310: /* primary: "(" compstmt ')' */
9061#line 2725 "parse.y"
9062 {
9063 /*%%%*/
9064 if (nd_type((yyvsp[-1].node)) == NODE_SELF) (yyvsp[-1].node)->nd_state = 0;
9065 (yyval.node) = (yyvsp[-1].node);
9066 /*% %*/
9067 /*% ripper: paren!($2) %*/
9068 }
9069#line 9065 "parse.c"
9070 break;
9071
9072 case 311: /* primary: primary_value "::" "constant" */
9073#line 2733 "parse.y"
9074 {
9075 /*%%%*/
9076 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
9077 /*% %*/
9078 /*% ripper: const_path_ref!($1, $3) %*/
9079 }
9080#line 9076 "parse.c"
9081 break;
9082
9083 case 312: /* primary: ":: at EXPR_BEG" "constant" */
9084#line 2740 "parse.y"
9085 {
9086 /*%%%*/
9087 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
9088 /*% %*/
9089 /*% ripper: top_const_ref!($2) %*/
9090 }
9091#line 9087 "parse.c"
9092 break;
9093
9094 case 313: /* primary: "[" aref_args ']' */
9095#line 2747 "parse.y"
9096 {
9097 /*%%%*/
9098 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
9099 /*% %*/
9100 /*% ripper: array!(escape_Qundef($2)) %*/
9101 }
9102#line 9098 "parse.c"
9103 break;
9104
9105 case 314: /* primary: "{" assoc_list '}' */
9106#line 2754 "parse.y"
9107 {
9108 /*%%%*/
9109 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
9110 (yyval.node)->nd_brace = TRUE;
9111 /*% %*/
9112 /*% ripper: hash!(escape_Qundef($2)) %*/
9113 }
9114#line 9110 "parse.c"
9115 break;
9116
9117 case 315: /* primary: k_return */
9118#line 2762 "parse.y"
9119 {
9120 /*%%%*/
9121 (yyval.node) = NEW_RETURN(0, &(yyloc));
9122 /*% %*/
9123 /*% ripper: return0! %*/
9124 }
9125#line 9121 "parse.c"
9126 break;
9127
9128 case 316: /* primary: "`yield'" '(' call_args rparen */
9129#line 2769 "parse.y"
9130 {
9131 /*%%%*/
9132 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
9133 /*% %*/
9134 /*% ripper: yield!(paren!($3)) %*/
9135 }
9136#line 9132 "parse.c"
9137 break;
9138
9139 case 317: /* primary: "`yield'" '(' rparen */
9140#line 2776 "parse.y"
9141 {
9142 /*%%%*/
9143 (yyval.node) = NEW_YIELD(0, &(yyloc));
9144 /*% %*/
9145 /*% ripper: yield!(paren!(args_new!)) %*/
9146 }
9147#line 9143 "parse.c"
9148 break;
9149
9150 case 318: /* primary: "`yield'" */
9151#line 2783 "parse.y"
9152 {
9153 /*%%%*/
9154 (yyval.node) = NEW_YIELD(0, &(yyloc));
9155 /*% %*/
9156 /*% ripper: yield0! %*/
9157 }
9158#line 9154 "parse.c"
9159 break;
9160
9161 case 319: /* $@16: %empty */
9162#line 2789 "parse.y"
9163 {p->in_defined = 1;}
9164#line 9160 "parse.c"
9165 break;
9166
9167 case 320: /* primary: "`defined?'" opt_nl '(' $@16 expr rparen */
9168#line 2790 "parse.y"
9169 {
9170 p->in_defined = 0;
9171 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
9172 }
9173#line 9169 "parse.c"
9174 break;
9175
9176 case 321: /* primary: "`not'" '(' expr rparen */
9177#line 2795 "parse.y"
9178 {
9179 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
9180 }
9181#line 9177 "parse.c"
9182 break;
9183
9184 case 322: /* primary: "`not'" '(' rparen */
9185#line 2799 "parse.y"
9186 {
9187 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
9188 }
9189#line 9185 "parse.c"
9190 break;
9191
9192 case 323: /* primary: fcall brace_block */
9193#line 2803 "parse.y"
9194 {
9195 /*%%%*/
9196 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9197 /*% %*/
9198 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
9199 }
9200#line 9196 "parse.c"
9201 break;
9202
9203 case 325: /* primary: method_call brace_block */
9204#line 2811 "parse.y"
9205 {
9206 /*%%%*/
9207 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
9208 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9209 /*% %*/
9210 /*% ripper: method_add_block!($1, $2) %*/
9211 }
9212#line 9208 "parse.c"
9213 break;
9214
9215 case 326: /* $@17: %empty */
9216#line 2819 "parse.y"
9217 {
9218 token_info_push(p, "->", &(yylsp[0]));
9219 }
9220#line 9216 "parse.c"
9221 break;
9222
9223 case 327: /* primary: "->" $@17 lambda */
9224#line 2823 "parse.y"
9225 {
9226 (yyval.node) = (yyvsp[0].node);
9227 /*%%%*/
9228 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
9229 /*% %*/
9230 }
9231#line 9227 "parse.c"
9232 break;
9233
9234 case 328: /* primary: k_if expr_value then compstmt if_tail k_end */
9235#line 2833 "parse.y"
9236 {
9237 /*%%%*/
9238 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9239 fixpos((yyval.node), (yyvsp[-4].node));
9240 /*% %*/
9241 /*% ripper: if!($2, $4, escape_Qundef($5)) %*/
9242 }
9243#line 9239 "parse.c"
9244 break;
9245
9246 case 329: /* primary: k_unless expr_value then compstmt opt_else k_end */
9247#line 2844 "parse.y"
9248 {
9249 /*%%%*/
9250 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9251 fixpos((yyval.node), (yyvsp[-4].node));
9252 /*% %*/
9253 /*% ripper: unless!($2, $4, escape_Qundef($5)) %*/
9254 }
9255#line 9251 "parse.c"
9256 break;
9257
9258 case 330: /* primary: k_while expr_value_do compstmt k_end */
9259#line 2854 "parse.y"
9260 {
9261 /*%%%*/
9262 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
9263 fixpos((yyval.node), (yyvsp[-2].node));
9264 /*% %*/
9265 /*% ripper: while!($2, $3) %*/
9266 }
9267#line 9263 "parse.c"
9268 break;
9269
9270 case 331: /* primary: k_until expr_value_do compstmt k_end */
9271#line 2864 "parse.y"
9272 {
9273 /*%%%*/
9274 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
9275 fixpos((yyval.node), (yyvsp[-2].node));
9276 /*% %*/
9277 /*% ripper: until!($2, $3) %*/
9278 }
9279#line 9275 "parse.c"
9280 break;
9281
9282 case 332: /* @18: %empty */
9283#line 2872 "parse.y"
9284 {
9285 (yyval.val) = p->case_labels;
9286 p->case_labels = Qnil;
9287 }
9288#line 9284 "parse.c"
9289 break;
9290
9291 case 333: /* primary: k_case expr_value opt_terms @18 case_body k_end */
9292#line 2878 "parse.y"
9293 {
9295 p->case_labels = (yyvsp[-2].val);
9296 /*%%%*/
9297 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
9298 fixpos((yyval.node), (yyvsp[-4].node));
9299 /*% %*/
9300 /*% ripper: case!($2, $5) %*/
9301 }
9302#line 9298 "parse.c"
9303 break;
9304
9305 case 334: /* @19: %empty */
9306#line 2888 "parse.y"
9307 {
9308 (yyval.val) = p->case_labels;
9309 p->case_labels = 0;
9310 }
9311#line 9307 "parse.c"
9312 break;
9313
9314 case 335: /* primary: k_case opt_terms @19 case_body k_end */
9315#line 2894 "parse.y"
9316 {
9318 p->case_labels = (yyvsp[-2].val);
9319 /*%%%*/
9320 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
9321 /*% %*/
9322 /*% ripper: case!(Qnil, $4) %*/
9323 }
9324#line 9320 "parse.c"
9325 break;
9326
9327 case 336: /* primary: k_case expr_value opt_terms p_case_body k_end */
9328#line 2905 "parse.y"
9329 {
9330 /*%%%*/
9331 (yyval.node) = new_case3(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
9332 /*% %*/
9333 /*% ripper: case!($2, $4) %*/
9334 }
9335#line 9331 "parse.c"
9336 break;
9337
9338 case 337: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
9339#line 2914 "parse.y"
9340 {
9341 /*%%%*/
9342 /*
9343 * for a, b, c in e
9344 * #=>
9345 * e.each{|*x| a, b, c = x}
9346 *
9347 * for a in e
9348 * #=>
9349 * e.each{|x| a, = x}
9350 */
9351 ID id = internal_id(p);
9352 NODE *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
9353 NODE *args, *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
9354 ID *tbl = ALLOC_N(ID, 3);
9355 tbl[0] = 1 /* length of local var table */; tbl[1] = id /* internal id */;
9356 rb_ast_add_local_table(p->ast, tbl);
9357
9358 switch (nd_type((yyvsp[-4].node))) {
9359 case NODE_LASGN:
9360 case NODE_DASGN:
9361 case NODE_DASGN_CURR: /* e.each {|internal_var| a = internal_var; ... } */
9362 (yyvsp[-4].node)->nd_value = internal_var;
9363 id = 0;
9364 m->nd_plen = 1;
9365 m->nd_next = (yyvsp[-4].node);
9366 break;
9367 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
9368 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), &(yylsp[-4]));
9369 break;
9370 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
9371 m->nd_next = node_assign(p, NEW_MASGN(NEW_LIST((yyvsp[-4].node), &(yylsp[-4])), 0, &(yylsp[-4])), internal_var, &(yylsp[-4]));
9372 }
9373 /* {|*internal_id| <m> = internal_id; ... } */
9374 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
9375 scope = NEW_NODE(NODE_SCOPE, tbl, (yyvsp[-1].node), args, &(yyloc));
9376 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
9377 fixpos((yyval.node), (yyvsp[-4].node));
9378 /*% %*/
9379 /*% ripper: for!($2, $4, $5) %*/
9380 }
9381#line 9377 "parse.c"
9382 break;
9383
9384 case 338: /* $@20: %empty */
9385#line 2956 "parse.y"
9386 {
9387 if (p->in_def) {
9388 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[-1]));
9389 yyerror1(&loc, "class definition in method body");
9390 }
9391 (yyvsp[-2].num) = p->in_class;
9392 p->in_class = 1;
9393 local_push(p, 0);
9394 }
9395#line 9391 "parse.c"
9396 break;
9397
9398 case 339: /* primary: k_class cpath superclass $@20 bodystmt k_end */
9399#line 2967 "parse.y"
9400 {
9401 /*%%%*/
9402 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
9403 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9404 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9405 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9406 /*% %*/
9407 /*% ripper: class!($2, $3, $5) %*/
9408 local_pop(p);
9409 p->in_class = (yyvsp[-5].num) & 1;
9410 }
9411#line 9407 "parse.c"
9412 break;
9413
9414 case 340: /* @21: %empty */
9415#line 2979 "parse.y"
9416 {
9417 (yyval.num) = (p->in_class << 1) | p->in_def;
9418 p->in_def = 0;
9419 p->in_class = 0;
9420 local_push(p, 0);
9421 }
9422#line 9418 "parse.c"
9423 break;
9424
9425 case 341: /* primary: k_class "<<" expr @21 term bodystmt k_end */
9426#line 2988 "parse.y"
9427 {
9428 /*%%%*/
9429 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
9430 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9431 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
9432 fixpos((yyval.node), (yyvsp[-4].node));
9433 /*% %*/
9434 /*% ripper: sclass!($3, $6) %*/
9435 local_pop(p);
9436 p->in_def = (yyvsp[-3].num) & 1;
9437 p->in_class = ((yyvsp[-3].num) >> 1) & 1;
9438 }
9439#line 9435 "parse.c"
9440 break;
9441
9442 case 342: /* $@22: %empty */
9443#line 3001 "parse.y"
9444 {
9445 if (p->in_def) {
9446 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9447 yyerror1(&loc, "module definition in method body");
9448 }
9449 (yyvsp[-1].num) = p->in_class;
9450 p->in_class = 1;
9451 local_push(p, 0);
9452 }
9453#line 9449 "parse.c"
9454 break;
9455
9456 case 343: /* primary: k_module cpath $@22 bodystmt k_end */
9457#line 3012 "parse.y"
9458 {
9459 /*%%%*/
9460 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
9461 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9462 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9463 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9464 /*% %*/
9465 /*% ripper: module!($2, $4) %*/
9466 local_pop(p);
9467 p->in_class = (yyvsp[-4].num) & 1;
9468 }
9469#line 9465 "parse.c"
9470 break;
9471
9472 case 344: /* @23: %empty */
9473#line 3024 "parse.y"
9474 {
9475 numparam_name(p, get_id((yyvsp[0].id)));
9476 local_push(p, 0);
9477 (yyval.id) = p->cur_arg;
9478 p->cur_arg = 0;
9479 }
9480#line 9476 "parse.c"
9481 break;
9482
9483 case 345: /* @24: %empty */
9484#line 3030 "parse.y"
9485 {
9486 (yyval.num) = p->in_def;
9487 p->in_def = 1;
9488 }
9489#line 9485 "parse.c"
9490 break;
9491
9492 case 346: /* primary: k_def fname @23 @24 f_arglist bodystmt k_end */
9493#line 3037 "parse.y"
9494 {
9495 /*%%%*/
9496 NODE *body = remove_begin((yyvsp[-1].node));
9497 reduce_nodes(p, &body);
9498 (yyval.node) = NEW_DEFN((yyvsp[-5].id), (yyvsp[-2].node), body, &(yyloc));
9499 nd_set_line((yyval.node)->nd_defn, (yylsp[0]).end_pos.lineno);
9500 set_line_body(body, (yylsp[-6]).beg_pos.lineno);
9501 /*% %*/
9502 /*% ripper: def!($2, $5, $6) %*/
9503 local_pop(p);
9504 p->in_def = (yyvsp[-3].num) & 1;
9505 p->cur_arg = (yyvsp[-4].id);
9506 }
9507#line 9503 "parse.c"
9508 break;
9509
9510 case 347: /* @25: %empty */
9511#line 3050 "parse.y"
9512 {SET_LEX_STATE(EXPR_FNAME);}
9513#line 9509 "parse.c"
9514 break;
9515
9516 case 348: /* @26: %empty */
9517#line 3051 "parse.y"
9518 {
9519 numparam_name(p, get_id((yyvsp[0].id)));
9520 (yyvsp[-1].num) = p->in_def;
9521 p->in_def = 1;
9522 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
9523 local_push(p, 0);
9524 (yyval.id) = p->cur_arg;
9525 p->cur_arg = 0;
9526 }
9527#line 9523 "parse.c"
9528 break;
9529
9530 case 349: /* primary: k_def singleton dot_or_colon @25 fname @26 f_arglist bodystmt k_end */
9531#line 3063 "parse.y"
9532 {
9533 /*%%%*/
9534 NODE *body = remove_begin((yyvsp[-1].node));
9535 reduce_nodes(p, &body);
9536 (yyval.node) = NEW_DEFS((yyvsp[-7].node), (yyvsp[-4].id), (yyvsp[-2].node), body, &(yyloc));
9537 nd_set_line((yyval.node)->nd_defn, (yylsp[0]).end_pos.lineno);
9538 set_line_body(body, (yylsp[-8]).beg_pos.lineno);
9539 /*% %*/
9540 /*% ripper: defs!($2, $3, $5, $7, $8) %*/
9541 local_pop(p);
9542 p->in_def = (yyvsp[-5].num) & 1;
9543 p->cur_arg = (yyvsp[-3].id);
9544 }
9545#line 9541 "parse.c"
9546 break;
9547
9548 case 350: /* primary: "`break'" */
9549#line 3077 "parse.y"
9550 {
9551 /*%%%*/
9552 (yyval.node) = NEW_BREAK(0, &(yyloc));
9553 /*% %*/
9554 /*% ripper: break!(args_new!) %*/
9555 }
9556#line 9552 "parse.c"
9557 break;
9558
9559 case 351: /* primary: "`next'" */
9560#line 3084 "parse.y"
9561 {
9562 /*%%%*/
9563 (yyval.node) = NEW_NEXT(0, &(yyloc));
9564 /*% %*/
9565 /*% ripper: next!(args_new!) %*/
9566 }
9567#line 9563 "parse.c"
9568 break;
9569
9570 case 352: /* primary: "`redo'" */
9571#line 3091 "parse.y"
9572 {
9573 /*%%%*/
9574 (yyval.node) = NEW_REDO(&(yyloc));
9575 /*% %*/
9576 /*% ripper: redo! %*/
9577 }
9578#line 9574 "parse.c"
9579 break;
9580
9581 case 353: /* primary: "`retry'" */
9582#line 3098 "parse.y"
9583 {
9584 /*%%%*/
9585 (yyval.node) = NEW_RETRY(&(yyloc));
9586 /*% %*/
9587 /*% ripper: retry! %*/
9588 }
9589#line 9585 "parse.c"
9590 break;
9591
9592 case 354: /* primary_value: primary */
9593#line 3107 "parse.y"
9594 {
9595 value_expr((yyvsp[0].node));
9596 (yyval.node) = (yyvsp[0].node);
9597 }
9598#line 9594 "parse.c"
9599 break;
9600
9601 case 355: /* k_begin: "`begin'" */
9602#line 3114 "parse.y"
9603 {
9604 token_info_push(p, "begin", &(yyloc));
9605 }
9606#line 9602 "parse.c"
9607 break;
9608
9609 case 356: /* k_if: "`if'" */
9610#line 3120 "parse.y"
9611 {
9612 WARN_EOL("if");
9613 token_info_push(p, "if", &(yyloc));
9614 if (p->token_info && p->token_info->nonspc &&
9615 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
9616 const char *tok = p->lex.ptok;
9617 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
9618 beg += rb_strlen_lit("else");
9619 while (beg < tok && ISSPACE(*beg)) beg++;
9620 if (beg == tok) {
9621 p->token_info->nonspc = 0;
9622 }
9623 }
9624 }
9625#line 9621 "parse.c"
9626 break;
9627
9628 case 357: /* k_unless: "`unless'" */
9629#line 3137 "parse.y"
9630 {
9631 token_info_push(p, "unless", &(yyloc));
9632 }
9633#line 9629 "parse.c"
9634 break;
9635
9636 case 358: /* k_while: "`while'" */
9637#line 3143 "parse.y"
9638 {
9639 token_info_push(p, "while", &(yyloc));
9640 }
9641#line 9637 "parse.c"
9642 break;
9643
9644 case 359: /* k_until: "`until'" */
9645#line 3149 "parse.y"
9646 {
9647 token_info_push(p, "until", &(yyloc));
9648 }
9649#line 9645 "parse.c"
9650 break;
9651
9652 case 360: /* k_case: "`case'" */
9653#line 3155 "parse.y"
9654 {
9655 token_info_push(p, "case", &(yyloc));
9656 }
9657#line 9653 "parse.c"
9658 break;
9659
9660 case 361: /* k_for: "`for'" */
9661#line 3161 "parse.y"
9662 {
9663 token_info_push(p, "for", &(yyloc));
9664 }
9665#line 9661 "parse.c"
9666 break;
9667
9668 case 362: /* k_class: "`class'" */
9669#line 3167 "parse.y"
9670 {
9671 token_info_push(p, "class", &(yyloc));
9672 }
9673#line 9669 "parse.c"
9674 break;
9675
9676 case 363: /* k_module: "`module'" */
9677#line 3173 "parse.y"
9678 {
9679 token_info_push(p, "module", &(yyloc));
9680 }
9681#line 9677 "parse.c"
9682 break;
9683
9684 case 364: /* k_def: "`def'" */
9685#line 3179 "parse.y"
9686 {
9687 token_info_push(p, "def", &(yyloc));
9688 }
9689#line 9685 "parse.c"
9690 break;
9691
9692 case 365: /* k_do: "`do'" */
9693#line 3185 "parse.y"
9694 {
9695 token_info_push(p, "do", &(yyloc));
9696 }
9697#line 9693 "parse.c"
9698 break;
9699
9700 case 366: /* k_do_block: "`do' for block" */
9701#line 3191 "parse.y"
9702 {
9703 token_info_push(p, "do", &(yyloc));
9704 }
9705#line 9701 "parse.c"
9706 break;
9707
9708 case 367: /* k_rescue: "`rescue'" */
9709#line 3197 "parse.y"
9710 {
9711 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
9712 }
9713#line 9709 "parse.c"
9714 break;
9715
9716 case 368: /* k_ensure: "`ensure'" */
9717#line 3203 "parse.y"
9718 {
9719 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
9720 }
9721#line 9717 "parse.c"
9722 break;
9723
9724 case 369: /* k_when: "`when'" */
9725#line 3209 "parse.y"
9726 {
9727 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
9728 }
9729#line 9725 "parse.c"
9730 break;
9731
9732 case 370: /* k_else: "`else'" */
9733#line 3215 "parse.y"
9734 {
9735 token_info *ptinfo_beg = p->token_info;
9736 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
9737 token_info_warn(p, "else", p->token_info, same, &(yyloc));
9738 if (same) {
9739 token_info e;
9740 e.next = ptinfo_beg->next;
9741 e.token = "else";
9742 token_info_setup(&e, p->lex.pbeg, &(yyloc));
9743 if (!e.nonspc) *ptinfo_beg = e;
9744 }
9745 }
9746#line 9742 "parse.c"
9747 break;
9748
9749 case 371: /* k_elsif: "`elsif'" */
9750#line 3230 "parse.y"
9751 {
9752 WARN_EOL("elsif");
9753 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
9754 }
9755#line 9751 "parse.c"
9756 break;
9757
9758 case 372: /* k_end: "`end'" */
9759#line 3237 "parse.y"
9760 {
9761 token_info_pop(p, "end", &(yyloc));
9762 }
9763#line 9759 "parse.c"
9764 break;
9765
9766 case 373: /* k_return: "`return'" */
9767#line 3243 "parse.y"
9768 {
9769 if (p->in_class && !p->in_def && !dyna_in_block(p))
9770 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
9771 }
9772#line 9768 "parse.c"
9773 break;
9774
9775 case 380: /* if_tail: k_elsif expr_value then compstmt if_tail */
9776#line 3262 "parse.y"
9777 {
9778 /*%%%*/
9779 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9780 fixpos((yyval.node), (yyvsp[-3].node));
9781 /*% %*/
9782 /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/
9783 }
9784#line 9780 "parse.c"
9785 break;
9786
9787 case 382: /* opt_else: k_else compstmt */
9788#line 3273 "parse.y"
9789 {
9790 /*%%%*/
9791 (yyval.node) = (yyvsp[0].node);
9792 /*% %*/
9793 /*% ripper: else!($2) %*/
9794 }
9795#line 9791 "parse.c"
9796 break;
9797
9798 case 385: /* f_marg: f_norm_arg */
9799#line 3286 "parse.y"
9800 {
9801 /*%%%*/
9802 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
9803 mark_lvar_used(p, (yyval.node));
9804 /*% %*/
9805 /*% ripper: assignable(p, $1) %*/
9806 }
9807#line 9803 "parse.c"
9808 break;
9809
9810 case 386: /* f_marg: "(" f_margs rparen */
9811#line 3294 "parse.y"
9812 {
9813 /*%%%*/
9814 (yyval.node) = (yyvsp[-1].node);
9815 /*% %*/
9816 /*% ripper: mlhs_paren!($2) %*/
9817 }
9818#line 9814 "parse.c"
9819 break;
9820
9821 case 387: /* f_marg_list: f_marg */
9822#line 3303 "parse.y"
9823 {
9824 /*%%%*/
9825 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
9826 /*% %*/
9827 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
9828 }
9829#line 9825 "parse.c"
9830 break;
9831
9832 case 388: /* f_marg_list: f_marg_list ',' f_marg */
9833#line 3310 "parse.y"
9834 {
9835 /*%%%*/
9836 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
9837 /*% %*/
9838 /*% ripper: mlhs_add!($1, $3) %*/
9839 }
9840#line 9836 "parse.c"
9841 break;
9842
9843 case 389: /* f_margs: f_marg_list */
9844#line 3319 "parse.y"
9845 {
9846 /*%%%*/
9847 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
9848 /*% %*/
9849 /*% ripper: $1 %*/
9850 }
9851#line 9847 "parse.c"
9852 break;
9853
9854 case 390: /* f_margs: f_marg_list ',' f_rest_marg */
9855#line 3326 "parse.y"
9856 {
9857 /*%%%*/
9858 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9859 /*% %*/
9860 /*% ripper: mlhs_add_star!($1, $3) %*/
9861 }
9862#line 9858 "parse.c"
9863 break;
9864
9865 case 391: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
9866#line 3333 "parse.y"
9867 {
9868 /*%%%*/
9869 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
9870 /*% %*/
9871 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
9872 }
9873#line 9869 "parse.c"
9874 break;
9875
9876 case 392: /* f_margs: f_rest_marg */
9877#line 3340 "parse.y"
9878 {
9879 /*%%%*/
9880 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
9881 /*% %*/
9882 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
9883 }
9884#line 9880 "parse.c"
9885 break;
9886
9887 case 393: /* f_margs: f_rest_marg ',' f_marg_list */
9888#line 3347 "parse.y"
9889 {
9890 /*%%%*/
9891 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
9892 /*% %*/
9893 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
9894 }
9895#line 9891 "parse.c"
9896 break;
9897
9898 case 394: /* f_rest_marg: "*" f_norm_arg */
9899#line 3356 "parse.y"
9900 {
9901 /*%%%*/
9902 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
9903 mark_lvar_used(p, (yyval.node));
9904 /*% %*/
9905 /*% ripper: assignable(p, $2) %*/
9906 }
9907#line 9903 "parse.c"
9908 break;
9909
9910 case 395: /* f_rest_marg: "*" */
9911#line 3364 "parse.y"
9912 {
9913 /*%%%*/
9915 /*% %*/
9916 /*% ripper: Qnil %*/
9917 }
9918#line 9914 "parse.c"
9919 break;
9920
9921 case 396: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
9922#line 3373 "parse.y"
9923 {
9924 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
9925 }
9926#line 9922 "parse.c"
9927 break;
9928
9929 case 397: /* block_args_tail: f_block_kwarg opt_f_block_arg */
9930#line 3377 "parse.y"
9931 {
9932 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
9933 }
9934#line 9930 "parse.c"
9935 break;
9936
9937 case 398: /* block_args_tail: f_kwrest opt_f_block_arg */
9938#line 3381 "parse.y"
9939 {
9940 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
9941 }
9942#line 9938 "parse.c"
9943 break;
9944
9945 case 399: /* block_args_tail: f_no_kwarg opt_f_block_arg */
9946#line 3385 "parse.y"
9947 {
9948 (yyval.node) = new_args_tail(p, Qnone, ID2VAL(idNil), (yyvsp[0].id), &(yylsp[-1]));
9949 }
9950#line 9946 "parse.c"
9951 break;
9952
9953 case 400: /* block_args_tail: f_block_arg */
9954#line 3389 "parse.y"
9955 {
9956 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
9957 }
9958#line 9954 "parse.c"
9959 break;
9960
9961 case 401: /* opt_block_args_tail: ',' block_args_tail */
9962#line 3395 "parse.y"
9963 {
9964 (yyval.node) = (yyvsp[0].node);
9965 }
9966#line 9962 "parse.c"
9967 break;
9968
9969 case 402: /* opt_block_args_tail: %empty */
9970#line 3399 "parse.y"
9971 {
9972 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
9973 }
9974#line 9970 "parse.c"
9975 break;
9976
9977 case 403: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
9978#line 3405 "parse.y"
9979 {
9980 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
9981 }
9982#line 9978 "parse.c"
9983 break;
9984
9985 case 404: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
9986#line 3409 "parse.y"
9987 {
9988 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9989 }
9990#line 9986 "parse.c"
9991 break;
9992
9993 case 405: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
9994#line 3413 "parse.y"
9995 {
9996 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
9997 }
9998#line 9994 "parse.c"
9999 break;
10000
10001 case 406: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
10002#line 3417 "parse.y"
10003 {
10004 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10005 }
10006#line 10002 "parse.c"
10007 break;
10008
10009 case 407: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
10010#line 3421 "parse.y"
10011 {
10012 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10013 }
10014#line 10010 "parse.c"
10015 break;
10016
10017 case 408: /* block_param: f_arg ',' */
10018#line 3425 "parse.y"
10019 {
10020 /*%%%*/
10021 /* magic number for rest_id in iseq_set_arguments() */
10022 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, NODE_SPECIAL_EXCESSIVE_COMMA, Qnone, new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[-1])), &(yyloc));
10023 /*% %*/
10024 /*% ripper: new_args(p, $1, Qnone, excessed_comma!, Qnone, new_args_tail(p, Qnone, Qnone, Qnone, NULL), NULL) %*/
10025 }
10026#line 10022 "parse.c"
10027 break;
10028
10029 case 409: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10030#line 3433 "parse.y"
10031 {
10032 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10033 }
10034#line 10030 "parse.c"
10035 break;
10036
10037 case 410: /* block_param: f_arg opt_block_args_tail */
10038#line 3437 "parse.y"
10039 {
10040 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10041 }
10042#line 10038 "parse.c"
10043 break;
10044
10045 case 411: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
10046#line 3441 "parse.y"
10047 {
10048 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10049 }
10050#line 10046 "parse.c"
10051 break;
10052
10053 case 412: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10054#line 3445 "parse.y"
10055 {
10056 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10057 }
10058#line 10054 "parse.c"
10059 break;
10060
10061 case 413: /* block_param: f_block_optarg opt_block_args_tail */
10062#line 3449 "parse.y"
10063 {
10064 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10065 }
10066#line 10062 "parse.c"
10067 break;
10068
10069 case 414: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
10070#line 3453 "parse.y"
10071 {
10072 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10073 }
10074#line 10070 "parse.c"
10075 break;
10076
10077 case 415: /* block_param: f_rest_arg opt_block_args_tail */
10078#line 3457 "parse.y"
10079 {
10080 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10081 }
10082#line 10078 "parse.c"
10083 break;
10084
10085 case 416: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
10086#line 3461 "parse.y"
10087 {
10088 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10089 }
10090#line 10086 "parse.c"
10091 break;
10092
10093 case 417: /* block_param: block_args_tail */
10094#line 3465 "parse.y"
10095 {
10096 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10097 }
10098#line 10094 "parse.c"
10099 break;
10100
10101 case 419: /* opt_block_param: block_param_def */
10102#line 3472 "parse.y"
10103 {
10104 p->command_start = TRUE;
10105 }
10106#line 10102 "parse.c"
10107 break;
10108
10109 case 420: /* block_param_def: '|' opt_bv_decl '|' */
10110#line 3478 "parse.y"
10111 {
10112 p->cur_arg = 0;
10114 /*%%%*/
10115 (yyval.node) = 0;
10116 /*% %*/
10117 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/
10118 }
10119#line 10115 "parse.c"
10120 break;
10121
10122 case 421: /* block_param_def: '|' block_param opt_bv_decl '|' */
10123#line 3487 "parse.y"
10124 {
10125 p->cur_arg = 0;
10127 /*%%%*/
10128 (yyval.node) = (yyvsp[-2].node);
10129 /*% %*/
10130 /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/
10131 }
10132#line 10128 "parse.c"
10133 break;
10134
10135 case 422: /* opt_bv_decl: opt_nl */
10136#line 3499 "parse.y"
10137 {
10138 (yyval.node) = 0;
10139 }
10140#line 10136 "parse.c"
10141 break;
10142
10143 case 423: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
10144#line 3503 "parse.y"
10145 {
10146 /*%%%*/
10147 (yyval.node) = 0;
10148 /*% %*/
10149 /*% ripper: $3 %*/
10150 }
10151#line 10147 "parse.c"
10152 break;
10153
10154 case 426: /* bvar: "local variable or method" */
10155#line 3518 "parse.y"
10156 {
10157 new_bv(p, get_id((yyvsp[0].id)));
10158 /*% ripper: get_value($1) %*/
10159 }
10160#line 10156 "parse.c"
10161 break;
10162
10163 case 427: /* bvar: f_bad_arg */
10164#line 3523 "parse.y"
10165 {
10166 (yyval.node) = 0;
10167 }
10168#line 10164 "parse.c"
10169 break;
10170
10171 case 428: /* @27: %empty */
10172#line 3528 "parse.y"
10173 {
10174 (yyval.vars) = dyna_push(p);
10175 }
10176#line 10172 "parse.c"
10177 break;
10178
10179 case 429: /* @28: %empty */
10180#line 3531 "parse.y"
10181 {
10182 (yyval.num) = p->lex.lpar_beg;
10183 p->lex.lpar_beg = p->lex.paren_nest;
10184 }
10185#line 10181 "parse.c"
10186 break;
10187
10188 case 430: /* @29: %empty */
10189#line 3535 "parse.y"
10190 {
10191 (yyval.num) = p->max_numparam;
10192 p->max_numparam = 0;
10193 }
10194#line 10190 "parse.c"
10195 break;
10196
10197 case 431: /* @30: %empty */
10198#line 3539 "parse.y"
10199 {
10200 (yyval.node) = numparam_push(p);
10201 }
10202#line 10198 "parse.c"
10203 break;
10204
10205 case 432: /* $@31: %empty */
10206#line 3543 "parse.y"
10207 {
10208 CMDARG_PUSH(0);
10209 }
10210#line 10206 "parse.c"
10211 break;
10212
10213 case 433: /* lambda: @27 @28 @29 @30 f_larglist $@31 lambda_body */
10214#line 3547 "parse.y"
10215 {
10216 int max_numparam = p->max_numparam;
10217 p->lex.lpar_beg = (yyvsp[-5].num);
10218 p->max_numparam = (yyvsp[-4].num);
10219 CMDARG_POP();
10220 (yyvsp[-2].node) = args_with_numbered(p, (yyvsp[-2].node), max_numparam);
10221 /*%%%*/
10222 {
10223 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10224 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node), (yyvsp[0].node), &loc);
10225 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
10226 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10227 }
10228 /*% %*/
10229 /*% ripper: lambda!($5, $7) %*/
10230 numparam_pop(p, (yyvsp[-3].node));
10231 dyna_pop(p, (yyvsp[-6].vars));
10232 }
10233#line 10229 "parse.c"
10234 break;
10235
10236 case 434: /* f_larglist: '(' f_args opt_bv_decl ')' */
10237#line 3568 "parse.y"
10238 {
10239 /*%%%*/
10240 (yyval.node) = (yyvsp[-2].node);
10242 /*% %*/
10243 /*% ripper: paren!($2) %*/
10244 }
10245#line 10241 "parse.c"
10246 break;
10247
10248 case 435: /* f_larglist: f_args */
10249#line 3576 "parse.y"
10250 {
10251 /*%%%*/
10252 if (!args_info_empty_p((yyvsp[0].node)->nd_ainfo))
10254 /*% %*/
10255 (yyval.node) = (yyvsp[0].node);
10256 }
10257#line 10253 "parse.c"
10258 break;
10259
10260 case 436: /* lambda_body: tLAMBEG compstmt '}' */
10261#line 3586 "parse.y"
10262 {
10263 token_info_pop(p, "}", &(yylsp[0]));
10264 (yyval.node) = (yyvsp[-1].node);
10265 }
10266#line 10262 "parse.c"
10267 break;
10268
10269 case 437: /* lambda_body: "`do' for lambda" bodystmt k_end */
10270#line 3591 "parse.y"
10271 {
10272 (yyval.node) = (yyvsp[-1].node);
10273 }
10274#line 10270 "parse.c"
10275 break;
10276
10277 case 438: /* do_block: k_do_block do_body k_end */
10278#line 3597 "parse.y"
10279 {
10280 (yyval.node) = (yyvsp[-1].node);
10281 /*%%%*/
10282 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10283 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10284 /*% %*/
10285 }
10286#line 10282 "parse.c"
10287 break;
10288
10289 case 439: /* block_call: command do_block */
10290#line 3607 "parse.y"
10291 {
10292 /*%%%*/
10293 if (nd_type((yyvsp[-1].node)) == NODE_YIELD) {
10294 compile_error(p, "block given to yield");
10295 }
10296 else {
10297 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
10298 }
10299 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10300 fixpos((yyval.node), (yyvsp[-1].node));
10301 /*% %*/
10302 /*% ripper: method_add_block!($1, $2) %*/
10303 }
10304#line 10300 "parse.c"
10305 break;
10306
10307 case 440: /* block_call: block_call call_op2 operation2 opt_paren_args */
10308#line 3621 "parse.y"
10309 {
10310 /*%%%*/
10311 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10312 /*% %*/
10313 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
10314 }
10315#line 10311 "parse.c"
10316 break;
10317
10318 case 441: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
10319#line 3628 "parse.y"
10320 {
10321 /*%%%*/
10322 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10323 /*% %*/
10324 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
10325 }
10326#line 10322 "parse.c"
10327 break;
10328
10329 case 442: /* block_call: block_call call_op2 operation2 command_args do_block */
10330#line 3635 "parse.y"
10331 {
10332 /*%%%*/
10333 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10334 /*% %*/
10335 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
10336 }
10337#line 10333 "parse.c"
10338 break;
10339
10340 case 443: /* method_call: fcall paren_args */
10341#line 3644 "parse.y"
10342 {
10343 /*%%%*/
10344 (yyval.node) = (yyvsp[-1].node);
10345 (yyval.node)->nd_args = (yyvsp[0].node);
10346 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
10347 /*% %*/
10348 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
10349 }
10350#line 10346 "parse.c"
10351 break;
10352
10353 case 444: /* method_call: primary_value call_op operation2 opt_paren_args */
10354#line 3653 "parse.y"
10355 {
10356 /*%%%*/
10357 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10358 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10359 /*% %*/
10360 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
10361 }
10362#line 10358 "parse.c"
10363 break;
10364
10365 case 445: /* method_call: primary_value "::" operation2 paren_args */
10366#line 3661 "parse.y"
10367 {
10368 /*%%%*/
10369 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10370 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10371 /*% %*/
10372 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), $3), $4) %*/
10373 }
10374#line 10370 "parse.c"
10375 break;
10376
10377 case 446: /* method_call: primary_value "::" operation3 */
10378#line 3669 "parse.y"
10379 {
10380 /*%%%*/
10381 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
10382 /*% %*/
10383 /*% ripper: call!($1, ID2VAL(idCOLON2), $3) %*/
10384 }
10385#line 10381 "parse.c"
10386 break;
10387
10388 case 447: /* method_call: primary_value call_op paren_args */
10389#line 3676 "parse.y"
10390 {
10391 /*%%%*/
10392 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10393 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10394 /*% %*/
10395 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
10396 }
10397#line 10393 "parse.c"
10398 break;
10399
10400 case 448: /* method_call: primary_value "::" paren_args */
10401#line 3684 "parse.y"
10402 {
10403 /*%%%*/
10404 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10405 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10406 /*% %*/
10407 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), ID2VAL(idCall)), $3) %*/
10408 }
10409#line 10405 "parse.c"
10410 break;
10411
10412 case 449: /* method_call: "`super'" paren_args */
10413#line 3692 "parse.y"
10414 {
10415 /*%%%*/
10416 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
10417 /*% %*/
10418 /*% ripper: super!($2) %*/
10419 }
10420#line 10416 "parse.c"
10421 break;
10422
10423 case 450: /* method_call: "`super'" */
10424#line 3699 "parse.y"
10425 {
10426 /*%%%*/
10427 (yyval.node) = NEW_ZSUPER(&(yyloc));
10428 /*% %*/
10429 /*% ripper: zsuper! %*/
10430 }
10431#line 10427 "parse.c"
10432 break;
10433
10434 case 451: /* method_call: primary_value '[' opt_call_args rbracket */
10435#line 3706 "parse.y"
10436 {
10437 /*%%%*/
10438 if ((yyvsp[-3].node) && nd_type((yyvsp[-3].node)) == NODE_SELF)
10439 (yyval.node) = NEW_FCALL(tAREF, (yyvsp[-1].node), &(yyloc));
10440 else
10441 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
10442 fixpos((yyval.node), (yyvsp[-3].node));
10443 /*% %*/
10444 /*% ripper: aref!($1, escape_Qundef($3)) %*/
10445 }
10446#line 10442 "parse.c"
10447 break;
10448
10449 case 452: /* brace_block: '{' brace_body '}' */
10450#line 3719 "parse.y"
10451 {
10452 (yyval.node) = (yyvsp[-1].node);
10453 /*%%%*/
10454 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10455 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10456 /*% %*/
10457 }
10458#line 10454 "parse.c"
10459 break;
10460
10461 case 453: /* brace_block: k_do do_body k_end */
10462#line 3727 "parse.y"
10463 {
10464 (yyval.node) = (yyvsp[-1].node);
10465 /*%%%*/
10466 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10467 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10468 /*% %*/
10469 }
10470#line 10466 "parse.c"
10471 break;
10472
10473 case 454: /* @32: %empty */
10474#line 3736 "parse.y"
10475 {(yyval.vars) = dyna_push(p);}
10476#line 10472 "parse.c"
10477 break;
10478
10479 case 455: /* @33: %empty */
10480#line 3737 "parse.y"
10481 {
10482 (yyval.num) = p->max_numparam;
10483 p->max_numparam = 0;
10484 }
10485#line 10481 "parse.c"
10486 break;
10487
10488 case 456: /* @34: %empty */
10489#line 3741 "parse.y"
10490 {
10491 (yyval.node) = numparam_push(p);
10492 }
10493#line 10489 "parse.c"
10494 break;
10495
10496 case 457: /* brace_body: @32 @33 @34 opt_block_param compstmt */
10497#line 3745 "parse.y"
10498 {
10499 int max_numparam = p->max_numparam;
10500 p->max_numparam = (yyvsp[-3].num);
10501 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
10502 /*%%%*/
10503 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10504 /*% %*/
10505 /*% ripper: brace_block!(escape_Qundef($4), $5) %*/
10506 numparam_pop(p, (yyvsp[-2].node));
10507 dyna_pop(p, (yyvsp[-4].vars));
10508 }
10509#line 10505 "parse.c"
10510 break;
10511
10512 case 458: /* @35: %empty */
10513#line 3758 "parse.y"
10514 {(yyval.vars) = dyna_push(p);}
10515#line 10511 "parse.c"
10516 break;
10517
10518 case 459: /* @36: %empty */
10519#line 3759 "parse.y"
10520 {
10521 (yyval.num) = p->max_numparam;
10522 p->max_numparam = 0;
10523 }
10524#line 10520 "parse.c"
10525 break;
10526
10527 case 460: /* @37: %empty */
10528#line 3763 "parse.y"
10529 {
10530 (yyval.node) = numparam_push(p);
10531 CMDARG_PUSH(0);
10532 }
10533#line 10529 "parse.c"
10534 break;
10535
10536 case 461: /* do_body: @35 @36 @37 opt_block_param bodystmt */
10537#line 3768 "parse.y"
10538 {
10539 int max_numparam = p->max_numparam;
10540 p->max_numparam = (yyvsp[-3].num);
10541 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
10542 /*%%%*/
10543 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10544 /*% %*/
10545 /*% ripper: do_block!(escape_Qundef($4), $5) %*/
10546 CMDARG_POP();
10547 numparam_pop(p, (yyvsp[-2].node));
10548 dyna_pop(p, (yyvsp[-4].vars));
10549 }
10550#line 10546 "parse.c"
10551 break;
10552
10553 case 462: /* case_args: arg_value */
10554#line 3783 "parse.y"
10555 {
10556 /*%%%*/
10557 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
10558 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
10559 /*% %*/
10560 /*% ripper: args_add!(args_new!, $1) %*/
10561 }
10562#line 10558 "parse.c"
10563 break;
10564
10565 case 463: /* case_args: "*" arg_value */
10566#line 3791 "parse.y"
10567 {
10568 /*%%%*/
10569 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
10570 /*% %*/
10571 /*% ripper: args_add_star!(args_new!, $2) %*/
10572 }
10573#line 10569 "parse.c"
10574 break;
10575
10576 case 464: /* case_args: case_args ',' arg_value */
10577#line 3798 "parse.y"
10578 {
10579 /*%%%*/
10580 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
10581 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10582 /*% %*/
10583 /*% ripper: args_add!($1, $3) %*/
10584 }
10585#line 10581 "parse.c"
10586 break;
10587
10588 case 465: /* case_args: case_args ',' "*" arg_value */
10589#line 3806 "parse.y"
10590 {
10591 /*%%%*/
10592 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
10593 /*% %*/
10594 /*% ripper: args_add_star!($1, $4) %*/
10595 }
10596#line 10592 "parse.c"
10597 break;
10598
10599 case 466: /* case_body: k_when case_args then compstmt cases */
10600#line 3817 "parse.y"
10601 {
10602 /*%%%*/
10603 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10604 fixpos((yyval.node), (yyvsp[-3].node));
10605 /*% %*/
10606 /*% ripper: when!($2, $4, escape_Qundef($5)) %*/
10607 }
10608#line 10604 "parse.c"
10609 break;
10610
10611 case 469: /* @38: %empty */
10612#line 3831 "parse.y"
10613 {
10614 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
10615 p->command_start = FALSE;
10616 (yyval.num) = p->in_kwarg;
10617 p->in_kwarg = 1;
10618 }
10619#line 10615 "parse.c"
10620 break;
10621
10622 case 470: /* @39: %empty */
10623#line 3837 "parse.y"
10624 {(yyval.tbl) = push_pvtbl(p);}
10625#line 10621 "parse.c"
10626 break;
10627
10628 case 471: /* @40: %empty */
10629#line 3838 "parse.y"
10630 {(yyval.tbl) = push_pktbl(p);}
10631#line 10627 "parse.c"
10632 break;
10633
10634 case 472: /* $@41: %empty */
10635#line 3840 "parse.y"
10636 {pop_pktbl(p, (yyvsp[-2].tbl));}
10637#line 10633 "parse.c"
10638 break;
10639
10640 case 473: /* $@42: %empty */
10641#line 3841 "parse.y"
10642 {pop_pvtbl(p, (yyvsp[-4].tbl));}
10643#line 10639 "parse.c"
10644 break;
10645
10646 case 474: /* $@43: %empty */
10647#line 3842 "parse.y"
10648 {
10649 p->in_kwarg = !!(yyvsp[-6].num);
10650 }
10651#line 10647 "parse.c"
10652 break;
10653
10654 case 475: /* p_case_body: "`in'" @38 @39 @40 p_top_expr then $@41 $@42 $@43 compstmt p_cases */
10655#line 3847 "parse.y"
10656 {
10657 /*%%%*/
10658 (yyval.node) = NEW_IN((yyvsp[-6].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10659 /*% %*/
10660 /*% ripper: in!($5, $10, escape_Qundef($11)) %*/
10661 }
10662#line 10658 "parse.c"
10663 break;
10664
10665 case 479: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
10666#line 3861 "parse.y"
10667 {
10668 /*%%%*/
10669 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10670 fixpos((yyval.node), (yyvsp[0].node));
10671 /*% %*/
10672 /*% ripper: if_mod!($3, $1) %*/
10673 }
10674#line 10670 "parse.c"
10675 break;
10676
10677 case 480: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
10678#line 3869 "parse.y"
10679 {
10680 /*%%%*/
10681 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10682 fixpos((yyval.node), (yyvsp[0].node));
10683 /*% %*/
10684 /*% ripper: unless_mod!($3, $1) %*/
10685 }
10686#line 10682 "parse.c"
10687 break;
10688
10689 case 482: /* p_top_expr_body: p_expr ',' */
10690#line 3880 "parse.y"
10691 {
10692 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, Qnone, &(yyloc));
10693 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
10694 }
10695#line 10691 "parse.c"
10696 break;
10697
10698 case 483: /* p_top_expr_body: p_expr ',' p_args */
10699#line 3885 "parse.y"
10700 {
10701 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
10702 /*%%%*/
10703 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
10704 /*%
10705 %*/
10706 }
10707#line 10703 "parse.c"
10708 break;
10709
10710 case 484: /* p_top_expr_body: p_args_tail */
10711#line 3893 "parse.y"
10712 {
10713 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10714 }
10715#line 10711 "parse.c"
10716 break;
10717
10718 case 485: /* p_top_expr_body: p_kwargs */
10719#line 3897 "parse.y"
10720 {
10721 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
10722 }
10723#line 10719 "parse.c"
10724 break;
10725
10726 case 487: /* p_as: p_expr "=>" p_variable */
10727#line 3906 "parse.y"
10728 {
10729 /*%%%*/
10730 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
10731 n = list_append(p, n, (yyvsp[0].node));
10732 (yyval.node) = new_hash(p, n, &(yyloc));
10733 /*% %*/
10734 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
10735 }
10736#line 10732 "parse.c"
10737 break;
10738
10739 case 489: /* p_alt: p_alt '|' p_expr_basic */
10740#line 3918 "parse.y"
10741 {
10742 /*%%%*/
10743 (yyval.node) = NEW_NODE(NODE_OR, (yyvsp[-2].node), (yyvsp[0].node), 0, &(yyloc));
10744 /*% %*/
10745 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
10746 }
10747#line 10743 "parse.c"
10748 break;
10749
10750 case 491: /* p_lparen: '(' */
10751#line 3927 "parse.y"
10752 {(yyval.tbl) = push_pktbl(p);}
10753#line 10749 "parse.c"
10754 break;
10755
10756 case 492: /* p_lbracket: '[' */
10757#line 3928 "parse.y"
10758 {(yyval.tbl) = push_pktbl(p);}
10759#line 10755 "parse.c"
10760 break;
10761
10762 case 494: /* p_expr_basic: p_const p_lparen p_args rparen */
10763#line 3932 "parse.y"
10764 {
10765 pop_pktbl(p, (yyvsp[-2].tbl));
10766 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
10767 /*%%%*/
10768 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
10769 /*%
10770 %*/
10771 }
10772#line 10768 "parse.c"
10773 break;
10774
10775 case 495: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
10776#line 3941 "parse.y"
10777 {
10778 pop_pktbl(p, (yyvsp[-2].tbl));
10779 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10780 /*%%%*/
10781 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
10782 /*%
10783 %*/
10784 }
10785#line 10781 "parse.c"
10786 break;
10787
10788 case 496: /* p_expr_basic: p_const '(' rparen */
10789#line 3950 "parse.y"
10790 {
10791 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
10792 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
10793 }
10794#line 10790 "parse.c"
10795 break;
10796
10797 case 497: /* p_expr_basic: p_const p_lbracket p_args rbracket */
10798#line 3955 "parse.y"
10799 {
10800 pop_pktbl(p, (yyvsp[-2].tbl));
10801 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
10802 /*%%%*/
10803 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
10804 /*%
10805 %*/
10806 }
10807#line 10803 "parse.c"
10808 break;
10809
10810 case 498: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
10811#line 3964 "parse.y"
10812 {
10813 pop_pktbl(p, (yyvsp[-2].tbl));
10814 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
10815 /*%%%*/
10816 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
10817 /*%
10818 %*/
10819 }
10820#line 10816 "parse.c"
10821 break;
10822
10823 case 499: /* p_expr_basic: p_const '[' rbracket */
10824#line 3973 "parse.y"
10825 {
10826 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
10827 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
10828 }
10829#line 10825 "parse.c"
10830 break;
10831
10832 case 500: /* @44: %empty */
10833#line 3977 "parse.y"
10834 {(yyval.tbl) = push_pktbl(p);}
10835#line 10831 "parse.c"
10836 break;
10837
10838 case 501: /* p_expr_basic: "[" @44 p_args rbracket */
10839#line 3978 "parse.y"
10840 {
10841 pop_pktbl(p, (yyvsp[-2].tbl));
10842 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
10843 }
10844#line 10840 "parse.c"
10845 break;
10846
10847 case 502: /* p_expr_basic: "[" rbracket */
10848#line 3983 "parse.y"
10849 {
10850 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
10851 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
10852 }
10853#line 10849 "parse.c"
10854 break;
10855
10856 case 503: /* @45: %empty */
10857#line 3988 "parse.y"
10858 {
10859 (yyval.tbl) = push_pktbl(p);
10860 (yyvsp[0].num) = p->in_kwarg;
10861 p->in_kwarg = 0;
10862 }
10863#line 10859 "parse.c"
10864 break;
10865
10866 case 504: /* p_expr_basic: "{" @45 p_kwargs rbrace */
10867#line 3994 "parse.y"
10868 {
10869 pop_pktbl(p, (yyvsp[-2].tbl));
10870 p->in_kwarg = (yyvsp[-3].num);
10871 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
10872 }
10873#line 10869 "parse.c"
10874 break;
10875
10876 case 505: /* p_expr_basic: "{" rbrace */
10877#line 4000 "parse.y"
10878 {
10879 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
10880 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
10881 }
10882#line 10878 "parse.c"
10883 break;
10884
10885 case 506: /* @46: %empty */
10886#line 4004 "parse.y"
10887 {(yyval.tbl) = push_pktbl(p);}
10888#line 10884 "parse.c"
10889 break;
10890
10891 case 507: /* p_expr_basic: "(" @46 p_expr rparen */
10892#line 4005 "parse.y"
10893 {
10894 pop_pktbl(p, (yyvsp[-2].tbl));
10895 (yyval.node) = (yyvsp[-1].node);
10896 }
10897#line 10893 "parse.c"
10898 break;
10899
10900 case 508: /* p_args: p_expr */
10901#line 4012 "parse.y"
10902 {
10903 /*%%%*/
10904 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
10905 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &(yyloc));
10906 /*%
10907 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, 0, Qnone, &@$);
10908 %*/
10909 }
10910#line 10906 "parse.c"
10911 break;
10912
10913 case 509: /* p_args: p_args_head */
10914#line 4021 "parse.y"
10915 {
10916 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, Qnone, &(yyloc));
10917 }
10918#line 10914 "parse.c"
10919 break;
10920
10921 case 510: /* p_args: p_args_head p_arg */
10922#line 4025 "parse.y"
10923 {
10924 /*%%%*/
10925 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, Qnone, &(yyloc));
10926 /*%
10927 VALUE pre_args = rb_ary_concat($1, get_value($2));
10928 $$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$);
10929 %*/
10930 }
10931#line 10927 "parse.c"
10932 break;
10933
10934 case 511: /* p_args: p_args_head "*" "local variable or method" */
10935#line 4034 "parse.y"
10936 {
10937 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-2].node), 1, (yyvsp[0].id), Qnone, &(yyloc));
10938 }
10939#line 10935 "parse.c"
10940 break;
10941
10942 case 512: /* p_args: p_args_head "*" "local variable or method" ',' p_args_post */
10943#line 4038 "parse.y"
10944 {
10945 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-4].node), 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10946 }
10947#line 10943 "parse.c"
10948 break;
10949
10950 case 513: /* p_args: p_args_head "*" */
10951#line 4042 "parse.y"
10952 {
10953 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, 0, Qnone, &(yyloc));
10954 }
10955#line 10951 "parse.c"
10956 break;
10957
10958 case 514: /* p_args: p_args_head "*" ',' p_args_post */
10959#line 4046 "parse.y"
10960 {
10961 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, 0, (yyvsp[0].node), &(yyloc));
10962 }
10963#line 10959 "parse.c"
10964 break;
10965
10966 case 516: /* p_args_head: p_arg ',' */
10967#line 4053 "parse.y"
10968 {
10969 (yyval.node) = (yyvsp[-1].node);
10970 }
10971#line 10967 "parse.c"
10972 break;
10973
10974 case 517: /* p_args_head: p_args_head p_arg ',' */
10975#line 4057 "parse.y"
10976 {
10977 /*%%%*/
10978 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
10979 /*% %*/
10980 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
10981 }
10982#line 10978 "parse.c"
10983 break;
10984
10985 case 518: /* p_args_tail: "*" "local variable or method" */
10986#line 4066 "parse.y"
10987 {
10988 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].id), Qnone, &(yyloc));
10989 }
10990#line 10986 "parse.c"
10991 break;
10992
10993 case 519: /* p_args_tail: "*" "local variable or method" ',' p_args_post */
10994#line 4070 "parse.y"
10995 {
10996 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
10997 }
10998#line 10994 "parse.c"
10999 break;
11000
11001 case 520: /* p_args_tail: "*" */
11002#line 4074 "parse.y"
11003 {
11004 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, Qnone, &(yyloc));
11005 }
11006#line 11002 "parse.c"
11007 break;
11008
11009 case 521: /* p_args_tail: "*" ',' p_args_post */
11010#line 4078 "parse.y"
11011 {
11012 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, (yyvsp[0].node), &(yyloc));
11013 }
11014#line 11010 "parse.c"
11015 break;
11016
11017 case 523: /* p_args_post: p_args_post ',' p_arg */
11018#line 4085 "parse.y"
11019 {
11020 /*%%%*/
11021 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
11022 /*% %*/
11023 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
11024 }
11025#line 11021 "parse.c"
11026 break;
11027
11028 case 524: /* p_arg: p_expr */
11029#line 4094 "parse.y"
11030 {
11031 /*%%%*/
11032 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11033 /*% %*/
11034 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
11035 }
11036#line 11032 "parse.c"
11037 break;
11038
11039 case 525: /* p_kwargs: p_kwarg ',' p_kwrest */
11040#line 4103 "parse.y"
11041 {
11042 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
11043 }
11044#line 11040 "parse.c"
11045 break;
11046
11047 case 526: /* p_kwargs: p_kwarg */
11048#line 4107 "parse.y"
11049 {
11050 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
11051 }
11052#line 11048 "parse.c"
11053 break;
11054
11055 case 527: /* p_kwargs: p_kwarg ',' */
11056#line 4111 "parse.y"
11057 {
11058 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
11059 }
11060#line 11056 "parse.c"
11061 break;
11062
11063 case 528: /* p_kwargs: p_kwrest */
11064#line 4115 "parse.y"
11065 {
11066 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
11067 }
11068#line 11064 "parse.c"
11069 break;
11070
11071 case 529: /* p_kwargs: p_kwarg ',' p_kwnorest */
11072#line 4119 "parse.y"
11073 {
11074 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), ID2VAL(idNil), &(yyloc));
11075 }
11076#line 11072 "parse.c"
11077 break;
11078
11079 case 530: /* p_kwargs: p_kwnorest */
11080#line 4123 "parse.y"
11081 {
11082 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), ID2VAL(idNil), &(yyloc));
11083 }
11084#line 11080 "parse.c"
11085 break;
11086
11087 case 532: /* p_kwarg: p_kwarg ',' p_kw */
11088#line 4131 "parse.y"
11089 {
11090 /*%%%*/
11091 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
11092 /*% %*/
11093 /*% ripper: rb_ary_push($1, $3) %*/
11094 }
11095#line 11091 "parse.c"
11096 break;
11097
11098 case 533: /* p_kw: p_kw_label p_expr */
11099#line 4140 "parse.y"
11100 {
11101 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
11102 /*%%%*/
11103 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yyloc)), &(yyloc)), (yyvsp[0].node));
11104 /*% %*/
11105 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
11106 }
11107#line 11103 "parse.c"
11108 break;
11109
11110 case 534: /* p_kw: p_kw_label */
11111#line 4148 "parse.y"
11112 {
11113 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
11114 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
11115 yyerror1(&(yylsp[0]), "key must be valid as local variables");
11116 }
11117 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
11118 /*%%%*/
11119 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
11120 /*% %*/
11121 /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/
11122 }
11123#line 11119 "parse.c"
11124 break;
11125
11126 case 536: /* p_kw_label: "string literal" string_contents tLABEL_END */
11127#line 4163 "parse.y"
11128 {
11129 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11130 /*%%%*/
11131 if (!(yyvsp[-1].node) || nd_type((yyvsp[-1].node)) == NODE_STR) {
11132 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
11133 (yyval.id) = SYM2ID(node->nd_lit);
11134 }
11135 /*%
11136 if (ripper_is_node_yylval($2) && RNODE($2)->nd_cval) {
11137 VALUE label = RNODE($2)->nd_cval;
11138 VALUE rval = RNODE($2)->nd_rval;
11139 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
11140 RNODE($$)->nd_loc = loc;
11141 }
11142 %*/
11143 else {
11144 yyerror1(&loc, "symbol literal with interpolation is not allowed");
11145 (yyval.id) = 0;
11146 }
11147 }
11148#line 11144 "parse.c"
11149 break;
11150
11151 case 537: /* p_kwrest: kwrest_mark "local variable or method" */
11152#line 4186 "parse.y"
11153 {
11154 (yyval.id) = (yyvsp[0].id);
11155 }
11156#line 11152 "parse.c"
11157 break;
11158
11159 case 538: /* p_kwrest: kwrest_mark */
11160#line 4190 "parse.y"
11161 {
11162 (yyval.id) = 0;
11163 }
11164#line 11160 "parse.c"
11165 break;
11166
11167 case 539: /* p_kwnorest: kwrest_mark "`nil'" */
11168#line 4196 "parse.y"
11169 {
11170 (yyval.id) = 0;
11171 }
11172#line 11168 "parse.c"
11173 break;
11174
11175 case 541: /* p_value: p_primitive ".." p_primitive */
11176#line 4203 "parse.y"
11177 {
11178 /*%%%*/
11179 value_expr((yyvsp[-2].node));
11180 value_expr((yyvsp[0].node));
11181 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11182 /*% %*/
11183 /*% ripper: dot2!($1, $3) %*/
11184 }
11185#line 11181 "parse.c"
11186 break;
11187
11188 case 542: /* p_value: p_primitive "..." p_primitive */
11189#line 4212 "parse.y"
11190 {
11191 /*%%%*/
11192 value_expr((yyvsp[-2].node));
11193 value_expr((yyvsp[0].node));
11194 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11195 /*% %*/
11196 /*% ripper: dot3!($1, $3) %*/
11197 }
11198#line 11194 "parse.c"
11199 break;
11200
11201 case 543: /* p_value: p_primitive ".." */
11202#line 4221 "parse.y"
11203 {
11204 /*%%%*/
11205 YYLTYPE loc;
11206 loc.beg_pos = (yylsp[0]).end_pos;
11207 loc.end_pos = (yylsp[0]).end_pos;
11208
11209 value_expr((yyvsp[-1].node));
11210 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil(&loc), &(yyloc));
11211 /*% %*/
11212 /*% ripper: dot2!($1, Qnil) %*/
11213 }
11214#line 11210 "parse.c"
11215 break;
11216
11217 case 544: /* p_value: p_primitive "..." */
11218#line 4233 "parse.y"
11219 {
11220 /*%%%*/
11221 YYLTYPE loc;
11222 loc.beg_pos = (yylsp[0]).end_pos;
11223 loc.end_pos = (yylsp[0]).end_pos;
11224
11225 value_expr((yyvsp[-1].node));
11226 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil(&loc), &(yyloc));
11227 /*% %*/
11228 /*% ripper: dot3!($1, Qnil) %*/
11229 }
11230#line 11226 "parse.c"
11231 break;
11232
11233 case 548: /* p_value: "(.." p_primitive */
11234#line 4248 "parse.y"
11235 {
11236 /*%%%*/
11237 YYLTYPE loc;
11238 loc.beg_pos = (yylsp[-1]).beg_pos;
11239 loc.end_pos = (yylsp[-1]).beg_pos;
11240
11241 value_expr((yyvsp[0].node));
11242 (yyval.node) = NEW_DOT2(new_nil(&loc), (yyvsp[0].node), &(yyloc));
11243 /*% %*/
11244 /*% ripper: dot2!(Qnil, $2) %*/
11245 }
11246#line 11242 "parse.c"
11247 break;
11248
11249 case 549: /* p_value: "(..." p_primitive */
11250#line 4260 "parse.y"
11251 {
11252 /*%%%*/
11253 YYLTYPE loc;
11254 loc.beg_pos = (yylsp[-1]).beg_pos;
11255 loc.end_pos = (yylsp[-1]).beg_pos;
11256
11257 value_expr((yyvsp[0].node));
11258 (yyval.node) = NEW_DOT3(new_nil(&loc), (yyvsp[0].node), &(yyloc));
11259 /*% %*/
11260 /*% ripper: dot3!(Qnil, $2) %*/
11261 }
11262#line 11258 "parse.c"
11263 break;
11264
11265 case 558: /* p_primitive: keyword_variable */
11266#line 4282 "parse.y"
11267 {
11268 /*%%%*/
11269 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
11270 /*% %*/
11271 /*% ripper: var_ref!($1) %*/
11272 }
11273#line 11269 "parse.c"
11274 break;
11275
11276 case 559: /* $@47: %empty */
11277#line 4289 "parse.y"
11278 {
11279 token_info_push(p, "->", &(yylsp[0]));
11280 }
11281#line 11277 "parse.c"
11282 break;
11283
11284 case 560: /* p_primitive: "->" $@47 lambda */
11285#line 4293 "parse.y"
11286 {
11287 (yyval.node) = (yyvsp[0].node);
11288 /*%%%*/
11289 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
11290 /*% %*/
11291 }
11292#line 11288 "parse.c"
11293 break;
11294
11295 case 561: /* p_variable: "local variable or method" */
11296#line 4302 "parse.y"
11297 {
11298 /*%%%*/
11299 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
11300 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11301 /*% %*/
11302 /*% ripper: assignable(p, var_field(p, $1)) %*/
11303 }
11304#line 11300 "parse.c"
11305 break;
11306
11307 case 562: /* p_var_ref: '^' "local variable or method" */
11308#line 4312 "parse.y"
11309 {
11310 /*%%%*/
11311 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
11312 if (!(nd_type(n) == NODE_LVAR || nd_type(n) == NODE_DVAR)) {
11313 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
11314 }
11315 (yyval.node) = n;
11316 /*% %*/
11317 /*% ripper: var_ref!($2) %*/
11318 }
11319#line 11315 "parse.c"
11320 break;
11321
11322 case 563: /* p_const: ":: at EXPR_BEG" cname */
11323#line 4325 "parse.y"
11324 {
11325 /*%%%*/
11326 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
11327 /*% %*/
11328 /*% ripper: top_const_ref!($2) %*/
11329 }
11330#line 11326 "parse.c"
11331 break;
11332
11333 case 564: /* p_const: p_const "::" cname */
11334#line 4332 "parse.y"
11335 {
11336 /*%%%*/
11337 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11338 /*% %*/
11339 /*% ripper: const_path_ref!($1, $3) %*/
11340 }
11341#line 11337 "parse.c"
11342 break;
11343
11344 case 565: /* p_const: "constant" */
11345#line 4339 "parse.y"
11346 {
11347 /*%%%*/
11348 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
11349 /*% %*/
11350 /*% ripper: var_ref!($1) %*/
11351 }
11352#line 11348 "parse.c"
11353 break;
11354
11355 case 566: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
11356#line 4350 "parse.y"
11357 {
11358 /*%%%*/
11359 (yyval.node) = NEW_RESBODY((yyvsp[-4].node),
11360 (yyvsp[-3].node) ? block_append(p, node_assign(p, (yyvsp[-3].node), NEW_ERRINFO(&(yylsp[-3])), &(yylsp[-3])), (yyvsp[-1].node)) : (yyvsp[-1].node),
11361 (yyvsp[0].node), &(yyloc));
11362 fixpos((yyval.node), (yyvsp[-4].node)?(yyvsp[-4].node):(yyvsp[-1].node));
11363 /*% %*/
11364 /*% ripper: rescue!(escape_Qundef($2), escape_Qundef($3), escape_Qundef($5), escape_Qundef($6)) %*/
11365 }
11366#line 11362 "parse.c"
11367 break;
11368
11369 case 568: /* exc_list: arg_value */
11370#line 4363 "parse.y"
11371 {
11372 /*%%%*/
11373 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11374 /*% %*/
11375 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
11376 }
11377#line 11373 "parse.c"
11378 break;
11379
11380 case 569: /* exc_list: mrhs */
11381#line 4370 "parse.y"
11382 {
11383 /*%%%*/
11384 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
11385 /*% %*/
11386 /*% ripper: $1 %*/
11387 }
11388#line 11384 "parse.c"
11389 break;
11390
11391 case 571: /* exc_var: "=>" lhs */
11392#line 4380 "parse.y"
11393 {
11394 (yyval.node) = (yyvsp[0].node);
11395 }
11396#line 11392 "parse.c"
11397 break;
11398
11399 case 573: /* opt_ensure: k_ensure compstmt */
11400#line 4387 "parse.y"
11401 {
11402 /*%%%*/
11403 (yyval.node) = (yyvsp[0].node);
11404 /*% %*/
11405 /*% ripper: ensure!($2) %*/
11406 }
11407#line 11403 "parse.c"
11408 break;
11409
11410 case 577: /* strings: string */
11411#line 4401 "parse.y"
11412 {
11413 /*%%%*/
11414 NODE *node = (yyvsp[0].node);
11415 if (!node) {
11416 node = NEW_STR(STR_NEW0(), &(yyloc));
11417 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
11418 }
11419 else {
11420 node = evstr2dstr(p, node);
11421 }
11422 (yyval.node) = node;
11423 /*% %*/
11424 /*% ripper: $1 %*/
11425 }
11426#line 11422 "parse.c"
11427 break;
11428
11429 case 580: /* string: string string1 */
11430#line 4420 "parse.y"
11431 {
11432 /*%%%*/
11433 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11434 /*% %*/
11435 /*% ripper: string_concat!($1, $2) %*/
11436 }
11437#line 11433 "parse.c"
11438 break;
11439
11440 case 581: /* string1: "string literal" string_contents "terminator" */
11441#line 4429 "parse.y"
11442 {
11443 /*%%%*/
11444 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
11445 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
11446 /*% %*/
11447 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
11448 }
11449#line 11445 "parse.c"
11450 break;
11451
11452 case 582: /* xstring: "backtick literal" xstring_contents "terminator" */
11453#line 4439 "parse.y"
11454 {
11455 /*%%%*/
11456 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
11457 /*% %*/
11458 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
11459 }
11460#line 11456 "parse.c"
11461 break;
11462
11463 case 583: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
11464#line 4448 "parse.y"
11465 {
11466 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
11467 }
11468#line 11464 "parse.c"
11469 break;
11470
11471 case 584: /* words: "word list" ' ' word_list "terminator" */
11472#line 4454 "parse.y"
11473 {
11474 /*%%%*/
11475 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11476 /*% %*/
11477 /*% ripper: array!($3) %*/
11478 }
11479#line 11475 "parse.c"
11480 break;
11481
11482 case 585: /* word_list: %empty */
11483#line 4463 "parse.y"
11484 {
11485 /*%%%*/
11486 (yyval.node) = 0;
11487 /*% %*/
11488 /*% ripper: words_new! %*/
11489 }
11490#line 11486 "parse.c"
11491 break;
11492
11493 case 586: /* word_list: word_list word ' ' */
11494#line 4470 "parse.y"
11495 {
11496 /*%%%*/
11497 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
11498 /*% %*/
11499 /*% ripper: words_add!($1, $2) %*/
11500 }
11501#line 11497 "parse.c"
11502 break;
11503
11504 case 588: /* word: word string_content */
11505#line 4481 "parse.y"
11506 {
11507 /*%%%*/
11508 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11509 /*% %*/
11510 /*% ripper: word_add!($1, $2) %*/
11511 }
11512#line 11508 "parse.c"
11513 break;
11514
11515 case 589: /* symbols: "symbol list" ' ' symbol_list "terminator" */
11516#line 4490 "parse.y"
11517 {
11518 /*%%%*/
11519 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11520 /*% %*/
11521 /*% ripper: array!($3) %*/
11522 }
11523#line 11519 "parse.c"
11524 break;
11525
11526 case 590: /* symbol_list: %empty */
11527#line 4499 "parse.y"
11528 {
11529 /*%%%*/
11530 (yyval.node) = 0;
11531 /*% %*/
11532 /*% ripper: symbols_new! %*/
11533 }
11534#line 11530 "parse.c"
11535 break;
11536
11537 case 591: /* symbol_list: symbol_list word ' ' */
11538#line 4506 "parse.y"
11539 {
11540 /*%%%*/
11541 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
11542 /*% %*/
11543 /*% ripper: symbols_add!($1, $2) %*/
11544 }
11545#line 11541 "parse.c"
11546 break;
11547
11548 case 592: /* qwords: "verbatim word list" ' ' qword_list "terminator" */
11549#line 4515 "parse.y"
11550 {
11551 /*%%%*/
11552 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11553 /*% %*/
11554 /*% ripper: array!($3) %*/
11555 }
11556#line 11552 "parse.c"
11557 break;
11558
11559 case 593: /* qsymbols: "verbatim symbol list" ' ' qsym_list "terminator" */
11560#line 4524 "parse.y"
11561 {
11562 /*%%%*/
11563 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11564 /*% %*/
11565 /*% ripper: array!($3) %*/
11566 }
11567#line 11563 "parse.c"
11568 break;
11569
11570 case 594: /* qword_list: %empty */
11571#line 4533 "parse.y"
11572 {
11573 /*%%%*/
11574 (yyval.node) = 0;
11575 /*% %*/
11576 /*% ripper: qwords_new! %*/
11577 }
11578#line 11574 "parse.c"
11579 break;
11580
11581 case 595: /* qword_list: qword_list "literal content" ' ' */
11582#line 4540 "parse.y"
11583 {
11584 /*%%%*/
11585 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
11586 /*% %*/
11587 /*% ripper: qwords_add!($1, $2) %*/
11588 }
11589#line 11585 "parse.c"
11590 break;
11591
11592 case 596: /* qsym_list: %empty */
11593#line 4549 "parse.y"
11594 {
11595 /*%%%*/
11596 (yyval.node) = 0;
11597 /*% %*/
11598 /*% ripper: qsymbols_new! %*/
11599 }
11600#line 11596 "parse.c"
11601 break;
11602
11603 case 597: /* qsym_list: qsym_list "literal content" ' ' */
11604#line 4556 "parse.y"
11605 {
11606 /*%%%*/
11607 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
11608 /*% %*/
11609 /*% ripper: qsymbols_add!($1, $2) %*/
11610 }
11611#line 11607 "parse.c"
11612 break;
11613
11614 case 598: /* string_contents: %empty */
11615#line 4565 "parse.y"
11616 {
11617 /*%%%*/
11618 (yyval.node) = 0;
11619 /*% %*/
11620 /*% ripper: string_content! %*/
11621 /*%%%*/
11622 /*%
11623 $$ = ripper_new_yylval(p, 0, $$, 0);
11624 %*/
11625 }
11626#line 11622 "parse.c"
11627 break;
11628
11629 case 599: /* string_contents: string_contents string_content */
11630#line 4576 "parse.y"
11631 {
11632 /*%%%*/
11633 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11634 /*% %*/
11635 /*% ripper: string_add!($1, $2) %*/
11636 /*%%%*/
11637 /*%
11638 if (ripper_is_node_yylval($1) && ripper_is_node_yylval($2) &&
11639 !RNODE($1)->nd_cval) {
11640 RNODE($1)->nd_cval = RNODE($2)->nd_cval;
11641 RNODE($1)->nd_rval = add_mark_object(p, $$);
11642 $$ = $1;
11643 }
11644 %*/
11645 }
11646#line 11642 "parse.c"
11647 break;
11648
11649 case 600: /* xstring_contents: %empty */
11650#line 4594 "parse.y"
11651 {
11652 /*%%%*/
11653 (yyval.node) = 0;
11654 /*% %*/
11655 /*% ripper: xstring_new! %*/
11656 }
11657#line 11653 "parse.c"
11658 break;
11659
11660 case 601: /* xstring_contents: xstring_contents string_content */
11661#line 4601 "parse.y"
11662 {
11663 /*%%%*/
11664 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11665 /*% %*/
11666 /*% ripper: xstring_add!($1, $2) %*/
11667 }
11668#line 11664 "parse.c"
11669 break;
11670
11671 case 602: /* regexp_contents: %empty */
11672#line 4610 "parse.y"
11673 {
11674 /*%%%*/
11675 (yyval.node) = 0;
11676 /*% %*/
11677 /*% ripper: regexp_new! %*/
11678 /*%%%*/
11679 /*%
11680 $$ = ripper_new_yylval(p, 0, $$, 0);
11681 %*/
11682 }
11683#line 11679 "parse.c"
11684 break;
11685
11686 case 603: /* regexp_contents: regexp_contents string_content */
11687#line 4621 "parse.y"
11688 {
11689 /*%%%*/
11690 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
11691 if (!head) {
11692 (yyval.node) = tail;
11693 }
11694 else if (!tail) {
11695 (yyval.node) = head;
11696 }
11697 else {
11698 switch (nd_type(head)) {
11699 case NODE_STR:
11700 nd_set_type(head, NODE_DSTR);
11701 break;
11702 case NODE_DSTR:
11703 break;
11704 default:
11705 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
11706 break;
11707 }
11708 (yyval.node) = list_append(p, head, tail);
11709 }
11710 /*%
11711 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
11712 if (ripper_is_node_yylval(n1)) {
11713 s1 = RNODE(n1)->nd_cval;
11714 n1 = RNODE(n1)->nd_rval;
11715 }
11716 if (ripper_is_node_yylval(n2)) {
11717 s2 = RNODE(n2)->nd_cval;
11718 n2 = RNODE(n2)->nd_rval;
11719 }
11720 $$ = dispatch2(regexp_add, n1, n2);
11721 if (!s1 && s2) {
11722 $$ = ripper_new_yylval(p, 0, $$, s2);
11723 }
11724 %*/
11725 }
11726#line 11722 "parse.c"
11727 break;
11728
11729 case 605: /* @48: %empty */
11730#line 4664 "parse.y"
11731 {
11732 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
11733 (yyval.strterm) = p->lex.strterm;
11734 p->lex.strterm = 0;
11735 SET_LEX_STATE(EXPR_BEG);
11736 }
11737#line 11733 "parse.c"
11738 break;
11739
11740 case 606: /* string_content: tSTRING_DVAR @48 string_dvar */
11741#line 4671 "parse.y"
11742 {
11743 p->lex.strterm = (yyvsp[-1].strterm);
11744 /*%%%*/
11745 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
11746 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
11747 /*% %*/
11748 /*% ripper: string_dvar!($3) %*/
11749 }
11750#line 11746 "parse.c"
11751 break;
11752
11753 case 607: /* $@49: %empty */
11754#line 4680 "parse.y"
11755 {
11756 CMDARG_PUSH(0);
11757 COND_PUSH(0);
11758 }
11759#line 11755 "parse.c"
11760 break;
11761
11762 case 608: /* @50: %empty */
11763#line 4684 "parse.y"
11764 {
11765 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
11766 (yyval.strterm) = p->lex.strterm;
11767 p->lex.strterm = 0;
11768 }
11769#line 11765 "parse.c"
11770 break;
11771
11772 case 609: /* @51: %empty */
11773#line 4689 "parse.y"
11774 {
11775 (yyval.num) = p->lex.state;
11776 SET_LEX_STATE(EXPR_BEG);
11777 }
11778#line 11774 "parse.c"
11779 break;
11780
11781 case 610: /* @52: %empty */
11782#line 4693 "parse.y"
11783 {
11784 (yyval.num) = p->lex.brace_nest;
11785 p->lex.brace_nest = 0;
11786 }
11787#line 11783 "parse.c"
11788 break;
11789
11790 case 611: /* @53: %empty */
11791#line 4697 "parse.y"
11792 {
11793 (yyval.num) = p->heredoc_indent;
11794 p->heredoc_indent = 0;
11795 }
11796#line 11792 "parse.c"
11797 break;
11798
11799 case 612: /* string_content: tSTRING_DBEG $@49 @50 @51 @52 @53 compstmt "'}'" */
11800#line 4702 "parse.y"
11801 {
11802 COND_POP();
11803 CMDARG_POP();
11804 p->lex.strterm = (yyvsp[-5].strterm);
11805 SET_LEX_STATE((yyvsp[-4].num));
11806 p->lex.brace_nest = (yyvsp[-3].num);
11807 p->heredoc_indent = (yyvsp[-2].num);
11808 p->heredoc_line_indent = -1;
11809 /*%%%*/
11810 if ((yyvsp[-1].node)) (yyvsp[-1].node)->flags &= ~NODE_FL_NEWLINE;
11811 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
11812 /*% %*/
11813 /*% ripper: string_embexpr!($7) %*/
11814 }
11815#line 11811 "parse.c"
11816 break;
11817
11818 case 613: /* string_dvar: "global variable" */
11819#line 4719 "parse.y"
11820 {
11821 /*%%%*/
11822 (yyval.node) = NEW_GVAR((yyvsp[0].id), &(yyloc));
11823 /*% %*/
11824 /*% ripper: var_ref!($1) %*/
11825 }
11826#line 11822 "parse.c"
11827 break;
11828
11829 case 614: /* string_dvar: "instance variable" */
11830#line 4726 "parse.y"
11831 {
11832 /*%%%*/
11833 (yyval.node) = NEW_IVAR((yyvsp[0].id), &(yyloc));
11834 /*% %*/
11835 /*% ripper: var_ref!($1) %*/
11836 }
11837#line 11833 "parse.c"
11838 break;
11839
11840 case 615: /* string_dvar: "class variable" */
11841#line 4733 "parse.y"
11842 {
11843 /*%%%*/
11844 (yyval.node) = NEW_CVAR((yyvsp[0].id), &(yyloc));
11845 /*% %*/
11846 /*% ripper: var_ref!($1) %*/
11847 }
11848#line 11844 "parse.c"
11849 break;
11850
11851 case 619: /* ssym: "symbol literal" sym */
11852#line 4747 "parse.y"
11853 {
11854 SET_LEX_STATE(EXPR_END);
11855 /*%%%*/
11856 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
11857 /*% %*/
11858 /*% ripper: symbol_literal!(symbol!($2)) %*/
11859 }
11860#line 11856 "parse.c"
11861 break;
11862
11863 case 624: /* dsym: "symbol literal" string_contents "terminator" */
11864#line 4763 "parse.y"
11865 {
11866 SET_LEX_STATE(EXPR_END);
11867 /*%%%*/
11868 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
11869 /*% %*/
11870 /*% ripper: dyna_symbol!($2) %*/
11871 }
11872#line 11868 "parse.c"
11873 break;
11874
11875 case 626: /* numeric: tUMINUS_NUM simple_numeric */
11876#line 4774 "parse.y"
11877 {
11878 /*%%%*/
11879 (yyval.node) = (yyvsp[0].node);
11880 RB_OBJ_WRITE(p->ast, &(yyval.node)->nd_lit, negate_lit(p, (yyval.node)->nd_lit));
11881 /*% %*/
11882 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
11883 }
11884#line 11880 "parse.c"
11885 break;
11886
11887 case 636: /* keyword_variable: "`nil'" */
11888#line 4796 "parse.y"
11889 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
11890#line 11886 "parse.c"
11891 break;
11892
11893 case 637: /* keyword_variable: "`self'" */
11894#line 4797 "parse.y"
11895 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
11896#line 11892 "parse.c"
11897 break;
11898
11899 case 638: /* keyword_variable: "`true'" */
11900#line 4798 "parse.y"
11901 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
11902#line 11898 "parse.c"
11903 break;
11904
11905 case 639: /* keyword_variable: "`false'" */
11906#line 4799 "parse.y"
11907 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
11908#line 11904 "parse.c"
11909 break;
11910
11911 case 640: /* keyword_variable: "`__FILE__'" */
11912#line 4800 "parse.y"
11913 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
11914#line 11910 "parse.c"
11915 break;
11916
11917 case 641: /* keyword_variable: "`__LINE__'" */
11918#line 4801 "parse.y"
11919 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
11920#line 11916 "parse.c"
11921 break;
11922
11923 case 642: /* keyword_variable: "`__ENCODING__'" */
11924#line 4802 "parse.y"
11925 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
11926#line 11922 "parse.c"
11927 break;
11928
11929 case 643: /* var_ref: user_variable */
11930#line 4806 "parse.y"
11931 {
11932 /*%%%*/
11933 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
11934 /*%
11935 if (id_is_var(p, get_id($1))) {
11936 $$ = dispatch1(var_ref, $1);
11937 }
11938 else {
11939 $$ = dispatch1(vcall, $1);
11940 }
11941 %*/
11942 }
11943#line 11939 "parse.c"
11944 break;
11945
11946 case 644: /* var_ref: keyword_variable */
11947#line 4819 "parse.y"
11948 {
11949 /*%%%*/
11950 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
11951 /*% %*/
11952 /*% ripper: var_ref!($1) %*/
11953 }
11954#line 11950 "parse.c"
11955 break;
11956
11957 case 645: /* var_lhs: user_variable */
11958#line 4828 "parse.y"
11959 {
11960 /*%%%*/
11961 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11962 /*% %*/
11963 /*% ripper: assignable(p, var_field(p, $1)) %*/
11964 }
11965#line 11961 "parse.c"
11966 break;
11967
11968 case 646: /* var_lhs: keyword_variable */
11969#line 4835 "parse.y"
11970 {
11971 /*%%%*/
11972 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11973 /*% %*/
11974 /*% ripper: assignable(p, var_field(p, $1)) %*/
11975 }
11976#line 11972 "parse.c"
11977 break;
11978
11979 case 649: /* $@54: %empty */
11980#line 4848 "parse.y"
11981 {
11982 SET_LEX_STATE(EXPR_BEG);
11983 p->command_start = TRUE;
11984 }
11985#line 11981 "parse.c"
11986 break;
11987
11988 case 650: /* superclass: '<' $@54 expr_value term */
11989#line 4853 "parse.y"
11990 {
11991 (yyval.node) = (yyvsp[-1].node);
11992 }
11993#line 11989 "parse.c"
11994 break;
11995
11996 case 651: /* superclass: %empty */
11997#line 4857 "parse.y"
11998 {
11999 /*%%%*/
12000 (yyval.node) = 0;
12001 /*% %*/
12002 /*% ripper: Qnil %*/
12003 }
12004#line 12000 "parse.c"
12005 break;
12006
12007 case 652: /* f_arglist: '(' f_args rparen */
12008#line 4866 "parse.y"
12009 {
12010 /*%%%*/
12011 (yyval.node) = (yyvsp[-1].node);
12012 /*% %*/
12013 /*% ripper: paren!($2) %*/
12014 SET_LEX_STATE(EXPR_BEG);
12015 p->command_start = TRUE;
12016 }
12017#line 12013 "parse.c"
12018 break;
12019
12020 case 653: /* f_arglist: '(' f_arg ',' args_forward rparen */
12021#line 4875 "parse.y"
12022 {
12023 arg_var(p, idFWD_REST);
12024#if idFWD_KWREST
12025 arg_var(p, idFWD_KWREST);
12026#endif
12027 arg_var(p, idFWD_BLOCK);
12028 /*%%%*/
12029 (yyval.node) = new_args_tail(p, Qnone, idFWD_KWREST, idFWD_BLOCK, &(yylsp[-1]));
12030 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, idFWD_REST, Qnone, (yyval.node), &(yylsp[-1]));
12031 /*% %*/
12032 /*% ripper: paren!(params_new($2, Qnone, $4, Qnone, Qnone, Qnone, Qnone)) %*/
12033 SET_LEX_STATE(EXPR_BEG);
12034 p->command_start = TRUE;
12035 }
12036#line 12032 "parse.c"
12037 break;
12038
12039 case 654: /* f_arglist: '(' args_forward rparen */
12040#line 4890 "parse.y"
12041 {
12042 arg_var(p, idFWD_REST);
12043#if idFWD_KWREST
12044 arg_var(p, idFWD_KWREST);
12045#endif
12046 arg_var(p, idFWD_BLOCK);
12047 /*%%%*/
12048 (yyval.node) = new_args_tail(p, Qnone, idFWD_KWREST, idFWD_BLOCK, &(yylsp[-1]));
12049 (yyval.node) = new_args(p, Qnone, Qnone, idFWD_REST, Qnone, (yyval.node), &(yylsp[-1]));
12050 /*% %*/
12051 /*% ripper: paren!(params_new(Qnone, Qnone, $2, Qnone, Qnone, Qnone, Qnone)) %*/
12052 SET_LEX_STATE(EXPR_BEG);
12053 p->command_start = TRUE;
12054 }
12055#line 12051 "parse.c"
12056 break;
12057
12058 case 655: /* @55: %empty */
12059#line 4904 "parse.y"
12060 {
12061 (yyval.num) = p->in_kwarg;
12062 p->in_kwarg = 1;
12063 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
12064 }
12065#line 12061 "parse.c"
12066 break;
12067
12068 case 656: /* f_arglist: @55 f_args term */
12069#line 4910 "parse.y"
12070 {
12071 p->in_kwarg = !!(yyvsp[-2].num);
12072 (yyval.node) = (yyvsp[-1].node);
12073 SET_LEX_STATE(EXPR_BEG);
12074 p->command_start = TRUE;
12075 }
12076#line 12072 "parse.c"
12077 break;
12078
12079 case 657: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
12080#line 4919 "parse.y"
12081 {
12082 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12083 }
12084#line 12080 "parse.c"
12085 break;
12086
12087 case 658: /* args_tail: f_kwarg opt_f_block_arg */
12088#line 4923 "parse.y"
12089 {
12090 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
12091 }
12092#line 12088 "parse.c"
12093 break;
12094
12095 case 659: /* args_tail: f_kwrest opt_f_block_arg */
12096#line 4927 "parse.y"
12097 {
12098 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12099 }
12100#line 12096 "parse.c"
12101 break;
12102
12103 case 660: /* args_tail: f_no_kwarg opt_f_block_arg */
12104#line 4931 "parse.y"
12105 {
12106 (yyval.node) = new_args_tail(p, Qnone, ID2VAL(idNil), (yyvsp[0].id), &(yylsp[-1]));
12107 }
12108#line 12104 "parse.c"
12109 break;
12110
12111 case 661: /* args_tail: f_block_arg */
12112#line 4935 "parse.y"
12113 {
12114 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
12115 }
12116#line 12112 "parse.c"
12117 break;
12118
12119 case 662: /* opt_args_tail: ',' args_tail */
12120#line 4941 "parse.y"
12121 {
12122 (yyval.node) = (yyvsp[0].node);
12123 }
12124#line 12120 "parse.c"
12125 break;
12126
12127 case 663: /* opt_args_tail: %empty */
12128#line 4945 "parse.y"
12129 {
12130 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12131 }
12132#line 12128 "parse.c"
12133 break;
12134
12135 case 664: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
12136#line 4951 "parse.y"
12137 {
12138 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12139 }
12140#line 12136 "parse.c"
12141 break;
12142
12143 case 665: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
12144#line 4955 "parse.y"
12145 {
12146 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12147 }
12148#line 12144 "parse.c"
12149 break;
12150
12151 case 666: /* f_args: f_arg ',' f_optarg opt_args_tail */
12152#line 4959 "parse.y"
12153 {
12154 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12155 }
12156#line 12152 "parse.c"
12157 break;
12158
12159 case 667: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
12160#line 4963 "parse.y"
12161 {
12162 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12163 }
12164#line 12160 "parse.c"
12165 break;
12166
12167 case 668: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
12168#line 4967 "parse.y"
12169 {
12170 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12171 }
12172#line 12168 "parse.c"
12173 break;
12174
12175 case 669: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
12176#line 4971 "parse.y"
12177 {
12178 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12179 }
12180#line 12176 "parse.c"
12181 break;
12182
12183 case 670: /* f_args: f_arg opt_args_tail */
12184#line 4975 "parse.y"
12185 {
12186 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12187 }
12188#line 12184 "parse.c"
12189 break;
12190
12191 case 671: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
12192#line 4979 "parse.y"
12193 {
12194 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12195 }
12196#line 12192 "parse.c"
12197 break;
12198
12199 case 672: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
12200#line 4983 "parse.y"
12201 {
12202 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12203 }
12204#line 12200 "parse.c"
12205 break;
12206
12207 case 673: /* f_args: f_optarg opt_args_tail */
12208#line 4987 "parse.y"
12209 {
12210 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12211 }
12212#line 12208 "parse.c"
12213 break;
12214
12215 case 674: /* f_args: f_optarg ',' f_arg opt_args_tail */
12216#line 4991 "parse.y"
12217 {
12218 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12219 }
12220#line 12216 "parse.c"
12221 break;
12222
12223 case 675: /* f_args: f_rest_arg opt_args_tail */
12224#line 4995 "parse.y"
12225 {
12226 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12227 }
12228#line 12224 "parse.c"
12229 break;
12230
12231 case 676: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
12232#line 4999 "parse.y"
12233 {
12234 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12235 }
12236#line 12232 "parse.c"
12237 break;
12238
12239 case 677: /* f_args: args_tail */
12240#line 5003 "parse.y"
12241 {
12242 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12243 }
12244#line 12240 "parse.c"
12245 break;
12246
12247 case 678: /* f_args: %empty */
12248#line 5007 "parse.y"
12249 {
12250 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12251 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[0]));
12252 }
12253#line 12249 "parse.c"
12254 break;
12255
12256 case 679: /* args_forward: "(..." */
12257#line 5014 "parse.y"
12258 {
12259 /*%%%*/
12260 (yyval.id) = idDot3;
12261 /*% %*/
12262 /*% ripper: args_forward! %*/
12263 }
12264#line 12260 "parse.c"
12265 break;
12266
12267 case 680: /* f_bad_arg: "constant" */
12268#line 5023 "parse.y"
12269 {
12270 /*%%%*/
12271 yyerror1(&(yylsp[0]), "formal argument cannot be a constant");
12272 (yyval.id) = 0;
12273 /*% %*/
12274 /*% ripper[error]: param_error!($1) %*/
12275 }
12276#line 12272 "parse.c"
12277 break;
12278
12279 case 681: /* f_bad_arg: "instance variable" */
12280#line 5031 "parse.y"
12281 {
12282 /*%%%*/
12283 yyerror1(&(yylsp[0]), "formal argument cannot be an instance variable");
12284 (yyval.id) = 0;
12285 /*% %*/
12286 /*% ripper[error]: param_error!($1) %*/
12287 }
12288#line 12284 "parse.c"
12289 break;
12290
12291 case 682: /* f_bad_arg: "global variable" */
12292#line 5039 "parse.y"
12293 {
12294 /*%%%*/
12295 yyerror1(&(yylsp[0]), "formal argument cannot be a global variable");
12296 (yyval.id) = 0;
12297 /*% %*/
12298 /*% ripper[error]: param_error!($1) %*/
12299 }
12300#line 12296 "parse.c"
12301 break;
12302
12303 case 683: /* f_bad_arg: "class variable" */
12304#line 5047 "parse.y"
12305 {
12306 /*%%%*/
12307 yyerror1(&(yylsp[0]), "formal argument cannot be a class variable");
12308 (yyval.id) = 0;
12309 /*% %*/
12310 /*% ripper[error]: param_error!($1) %*/
12311 }
12312#line 12308 "parse.c"
12313 break;
12314
12315 case 685: /* f_norm_arg: "local variable or method" */
12316#line 5058 "parse.y"
12317 {
12318 formal_argument(p, get_id((yyvsp[0].id)));
12320 (yyval.id) = (yyvsp[0].id);
12321 }
12322#line 12318 "parse.c"
12323 break;
12324
12325 case 686: /* f_arg_asgn: f_norm_arg */
12326#line 5066 "parse.y"
12327 {
12328 ID id = get_id((yyvsp[0].id));
12329 arg_var(p, id);
12330 p->cur_arg = id;
12331 (yyval.id) = (yyvsp[0].id);
12332 }
12333#line 12329 "parse.c"
12334 break;
12335
12336 case 687: /* f_arg_item: f_arg_asgn */
12337#line 5075 "parse.y"
12338 {
12339 p->cur_arg = 0;
12340 /*%%%*/
12341 (yyval.node) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
12342 /*% %*/
12343 /*% ripper: get_value($1) %*/
12344 }
12345#line 12341 "parse.c"
12346 break;
12347
12348 case 688: /* f_arg_item: "(" f_margs rparen */
12349#line 5083 "parse.y"
12350 {
12351 /*%%%*/
12352 ID tid = internal_id(p);
12353 YYLTYPE loc;
12354 loc.beg_pos = (yylsp[-1]).beg_pos;
12355 loc.end_pos = (yylsp[-1]).beg_pos;
12356 arg_var(p, tid);
12357 if (dyna_in_block(p)) {
12358 (yyvsp[-1].node)->nd_value = NEW_DVAR(tid, &loc);
12359 }
12360 else {
12361 (yyvsp[-1].node)->nd_value = NEW_LVAR(tid, &loc);
12362 }
12363 (yyval.node) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
12364 (yyval.node)->nd_next = (yyvsp[-1].node);
12365 /*% %*/
12366 /*% ripper: mlhs_paren!($2) %*/
12367 }
12368#line 12364 "parse.c"
12369 break;
12370
12371 case 690: /* f_arg: f_arg ',' f_arg_item */
12372#line 5106 "parse.y"
12373 {
12374 /*%%%*/
12375 (yyval.node) = (yyvsp[-2].node);
12376 (yyval.node)->nd_plen++;
12377 (yyval.node)->nd_next = block_append(p, (yyval.node)->nd_next, (yyvsp[0].node)->nd_next);
12378 rb_discard_node(p, (yyvsp[0].node));
12379 /*% %*/
12380 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12381 }
12382#line 12378 "parse.c"
12383 break;
12384
12385 case 691: /* f_label: tLABEL */
12386#line 5119 "parse.y"
12387 {
12388 ID id = get_id((yyvsp[0].id));
12389 arg_var(p, formal_argument(p, id));
12390 p->cur_arg = id;
12392 (yyval.id) = (yyvsp[0].id);
12393 }
12394#line 12390 "parse.c"
12395 break;
12396
12397 case 692: /* f_kw: f_label arg_value */
12398#line 5129 "parse.y"
12399 {
12400 p->cur_arg = 0;
12401 /*%%%*/
12402 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12403 /*% %*/
12404 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
12405 }
12406#line 12402 "parse.c"
12407 break;
12408
12409 case 693: /* f_kw: f_label */
12410#line 5137 "parse.y"
12411 {
12412 p->cur_arg = 0;
12413 /*%%%*/
12414 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
12415 /*% %*/
12416 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
12417 }
12418#line 12414 "parse.c"
12419 break;
12420
12421 case 694: /* f_block_kw: f_label primary_value */
12422#line 5147 "parse.y"
12423 {
12424 /*%%%*/
12425 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12426 /*% %*/
12427 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
12428 }
12429#line 12425 "parse.c"
12430 break;
12431
12432 case 695: /* f_block_kw: f_label */
12433#line 5154 "parse.y"
12434 {
12435 /*%%%*/
12436 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
12437 /*% %*/
12438 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
12439 }
12440#line 12436 "parse.c"
12441 break;
12442
12443 case 696: /* f_block_kwarg: f_block_kw */
12444#line 5163 "parse.y"
12445 {
12446 /*%%%*/
12447 (yyval.node) = (yyvsp[0].node);
12448 /*% %*/
12449 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12450 }
12451#line 12447 "parse.c"
12452 break;
12453
12454 case 697: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
12455#line 5170 "parse.y"
12456 {
12457 /*%%%*/
12458 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
12459 /*% %*/
12460 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12461 }
12462#line 12458 "parse.c"
12463 break;
12464
12465 case 698: /* f_kwarg: f_kw */
12466#line 5180 "parse.y"
12467 {
12468 /*%%%*/
12469 (yyval.node) = (yyvsp[0].node);
12470 /*% %*/
12471 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12472 }
12473#line 12469 "parse.c"
12474 break;
12475
12476 case 699: /* f_kwarg: f_kwarg ',' f_kw */
12477#line 5187 "parse.y"
12478 {
12479 /*%%%*/
12480 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
12481 /*% %*/
12482 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12483 }
12484#line 12480 "parse.c"
12485 break;
12486
12487 case 702: /* f_no_kwarg: kwrest_mark "`nil'" */
12488#line 5200 "parse.y"
12489 {
12490 /*%%%*/
12491 /*% %*/
12492 /*% ripper: nokw_param!(Qnil) %*/
12493 }
12494#line 12490 "parse.c"
12495 break;
12496
12497 case 703: /* f_kwrest: kwrest_mark "local variable or method" */
12498#line 5208 "parse.y"
12499 {
12500 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
12501 /*%%%*/
12502 (yyval.id) = (yyvsp[0].id);
12503 /*% %*/
12504 /*% ripper: kwrest_param!($2) %*/
12505 }
12506#line 12502 "parse.c"
12507 break;
12508
12509 case 704: /* f_kwrest: kwrest_mark */
12510#line 5216 "parse.y"
12511 {
12512 /*%%%*/
12513 (yyval.id) = internal_id(p);
12514 arg_var(p, (yyval.id));
12515 /*% %*/
12516 /*% ripper: kwrest_param!(Qnil) %*/
12517 }
12518#line 12514 "parse.c"
12519 break;
12520
12521 case 705: /* f_opt: f_arg_asgn '=' arg_value */
12522#line 5226 "parse.y"
12523 {
12524 p->cur_arg = 0;
12525 /*%%%*/
12526 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12527 /*% %*/
12528 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
12529 }
12530#line 12526 "parse.c"
12531 break;
12532
12533 case 706: /* f_block_opt: f_arg_asgn '=' primary_value */
12534#line 5236 "parse.y"
12535 {
12536 p->cur_arg = 0;
12537 /*%%%*/
12538 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12539 /*% %*/
12540 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
12541 }
12542#line 12538 "parse.c"
12543 break;
12544
12545 case 707: /* f_block_optarg: f_block_opt */
12546#line 5246 "parse.y"
12547 {
12548 /*%%%*/
12549 (yyval.node) = (yyvsp[0].node);
12550 /*% %*/
12551 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12552 }
12553#line 12549 "parse.c"
12554 break;
12555
12556 case 708: /* f_block_optarg: f_block_optarg ',' f_block_opt */
12557#line 5253 "parse.y"
12558 {
12559 /*%%%*/
12560 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
12561 /*% %*/
12562 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12563 }
12564#line 12560 "parse.c"
12565 break;
12566
12567 case 709: /* f_optarg: f_opt */
12568#line 5262 "parse.y"
12569 {
12570 /*%%%*/
12571 (yyval.node) = (yyvsp[0].node);
12572 /*% %*/
12573 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12574 }
12575#line 12571 "parse.c"
12576 break;
12577
12578 case 710: /* f_optarg: f_optarg ',' f_opt */
12579#line 5269 "parse.y"
12580 {
12581 /*%%%*/
12582 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
12583 /*% %*/
12584 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12585 }
12586#line 12582 "parse.c"
12587 break;
12588
12589 case 713: /* f_rest_arg: restarg_mark "local variable or method" */
12590#line 5282 "parse.y"
12591 {
12592 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
12593 /*%%%*/
12594 (yyval.id) = (yyvsp[0].id);
12595 /*% %*/
12596 /*% ripper: rest_param!($2) %*/
12597 }
12598#line 12594 "parse.c"
12599 break;
12600
12601 case 714: /* f_rest_arg: restarg_mark */
12602#line 5290 "parse.y"
12603 {
12604 /*%%%*/
12605 (yyval.id) = internal_id(p);
12606 arg_var(p, (yyval.id));
12607 /*% %*/
12608 /*% ripper: rest_param!(Qnil) %*/
12609 }
12610#line 12606 "parse.c"
12611 break;
12612
12613 case 717: /* f_block_arg: blkarg_mark "local variable or method" */
12614#line 5304 "parse.y"
12615 {
12616 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
12617 /*%%%*/
12618 (yyval.id) = (yyvsp[0].id);
12619 /*% %*/
12620 /*% ripper: blockarg!($2) %*/
12621 }
12622#line 12618 "parse.c"
12623 break;
12624
12625 case 718: /* opt_f_block_arg: ',' f_block_arg */
12626#line 5314 "parse.y"
12627 {
12628 (yyval.id) = (yyvsp[0].id);
12629 }
12630#line 12626 "parse.c"
12631 break;
12632
12633 case 719: /* opt_f_block_arg: none */
12634#line 5318 "parse.y"
12635 {
12636 (yyval.id) = Qnull;
12637 }
12638#line 12634 "parse.c"
12639 break;
12640
12641 case 720: /* singleton: var_ref */
12642#line 5324 "parse.y"
12643 {
12644 value_expr((yyvsp[0].node));
12645 (yyval.node) = (yyvsp[0].node);
12646 }
12647#line 12643 "parse.c"
12648 break;
12649
12650 case 721: /* $@56: %empty */
12651#line 5328 "parse.y"
12652 {SET_LEX_STATE(EXPR_BEG);}
12653#line 12649 "parse.c"
12654 break;
12655
12656 case 722: /* singleton: '(' $@56 expr rparen */
12657#line 5329 "parse.y"
12658 {
12659 /*%%%*/
12660 switch (nd_type((yyvsp[-1].node))) {
12661 case NODE_STR:
12662 case NODE_DSTR:
12663 case NODE_XSTR:
12664 case NODE_DXSTR:
12665 case NODE_DREGX:
12666 case NODE_LIT:
12667 case NODE_LIST:
12668 case NODE_ZLIST:
12669 yyerror1(&(yylsp[-1]), "can't define singleton method for literals");
12670 break;
12671 default:
12672 value_expr((yyvsp[-1].node));
12673 break;
12674 }
12675 (yyval.node) = (yyvsp[-1].node);
12676 /*% %*/
12677 /*% ripper: paren!($3) %*/
12678 }
12679#line 12675 "parse.c"
12680 break;
12681
12682 case 724: /* assoc_list: assocs trailer */
12683#line 5354 "parse.y"
12684 {
12685 /*%%%*/
12686 (yyval.node) = (yyvsp[-1].node);
12687 /*% %*/
12688 /*% ripper: assoclist_from_args!($1) %*/
12689 }
12690#line 12686 "parse.c"
12691 break;
12692
12693 case 726: /* assocs: assocs ',' assoc */
12694#line 5365 "parse.y"
12695 {
12696 /*%%%*/
12697 NODE *assocs = (yyvsp[-2].node);
12698 NODE *tail = (yyvsp[0].node);
12699 if (!assocs) {
12700 assocs = tail;
12701 }
12702 else if (tail) {
12703 if (assocs->nd_head &&
12704 !tail->nd_head && nd_type(tail->nd_next) == NODE_LIST &&
12705 nd_type(tail->nd_next->nd_head) == NODE_HASH) {
12706 /* DSTAR */
12707 tail = tail->nd_next->nd_head->nd_head;
12708 }
12709 assocs = list_concat(assocs, tail);
12710 }
12711 (yyval.node) = assocs;
12712 /*% %*/
12713 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12714 }
12715#line 12711 "parse.c"
12716 break;
12717
12718 case 727: /* assoc: arg_value "=>" arg_value */
12719#line 5388 "parse.y"
12720 {
12721 /*%%%*/
12722 if (nd_type((yyvsp[-2].node)) == NODE_STR) {
12723 nd_set_type((yyvsp[-2].node), NODE_LIT);
12724 RB_OBJ_WRITE(p->ast, &(yyvsp[-2].node)->nd_lit, rb_fstring((yyvsp[-2].node)->nd_lit));
12725 }
12726 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
12727 /*% %*/
12728 /*% ripper: assoc_new!($1, $3) %*/
12729 }
12730#line 12726 "parse.c"
12731 break;
12732
12733 case 728: /* assoc: tLABEL arg_value */
12734#line 5399 "parse.y"
12735 {
12736 /*%%%*/
12737 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
12738 /*% %*/
12739 /*% ripper: assoc_new!($1, $2) %*/
12740 }
12741#line 12737 "parse.c"
12742 break;
12743
12744 case 729: /* assoc: "string literal" string_contents tLABEL_END arg_value */
12745#line 5406 "parse.y"
12746 {
12747 /*%%%*/
12748 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
12749 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
12750 /*% %*/
12751 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
12752 }
12753#line 12749 "parse.c"
12754 break;
12755
12756 case 730: /* assoc: "**arg" arg_value */
12757#line 5414 "parse.y"
12758 {
12759 /*%%%*/
12760 if (nd_type((yyvsp[0].node)) == NODE_HASH &&
12761 !((yyvsp[0].node)->nd_head && (yyvsp[0].node)->nd_head->nd_alen)) {
12762 static VALUE empty_hash;
12763 if (!empty_hash) {
12764 empty_hash = rb_obj_freeze(rb_hash_new());
12765 rb_gc_register_mark_object(empty_hash);
12766 }
12767 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
12768 }
12769 else
12770 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
12771 /*% %*/
12772 /*% ripper: assoc_splat!($2) %*/
12773 }
12774#line 12770 "parse.c"
12775 break;
12776
12777 case 757: /* term: ';' */
12778#line 5482 "parse.y"
12779 {yyerrok;token_flush(p);}
12780#line 12776 "parse.c"
12781 break;
12782
12783 case 758: /* term: '\n' */
12784#line 5483 "parse.y"
12785 {token_flush(p);}
12786#line 12782 "parse.c"
12787 break;
12788
12789 case 760: /* terms: terms ';' */
12790#line 5487 "parse.y"
12791 {yyerrok;}
12792#line 12788 "parse.c"
12793 break;
12794
12795 case 761: /* none: %empty */
12796#line 5491 "parse.y"
12797 {
12798 (yyval.node) = Qnull;
12799 }
12800#line 12796 "parse.c"
12801 break;
12802
12803
12804#line 12800 "parse.c"
12805
12806 default: break;
12807 }
12808 /* User semantic actions sometimes alter yychar, and that requires
12809 that yytoken be updated with the new translation. We take the
12810 approach of translating immediately before every use of yytoken.
12811 One alternative is translating here after every semantic action,
12812 but that translation would be missed if the semantic action invokes
12813 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
12814 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
12815 incorrect destructor might then be invoked immediately. In the
12816 case of YYERROR or YYBACKUP, subsequent parser actions might lead
12817 to an incorrect destructor call or verbose syntax error message
12818 before the lookahead is translated. */
12819 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
12820
12821 YYPOPSTACK (yylen);
12822 yylen = 0;
12823
12824 *++yyvsp = yyval;
12825 *++yylsp = yyloc;
12826
12827 /* Now 'shift' the result of the reduction. Determine what state
12828 that goes to, based on the state we popped back to and the rule
12829 number reduced by. */
12830 {
12831 const int yylhs = yyr1[yyn] - YYNTOKENS;
12832 const int yyi = yypgoto[yylhs] + *yyssp;
12833 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
12834 ? yytable[yyi]
12835 : yydefgoto[yylhs]);
12836 }
12837
12838 goto yynewstate;
12839
12840
12841/*--------------------------------------.
12842| yyerrlab -- here on detecting error. |
12843`--------------------------------------*/
12844yyerrlab:
12845 /* Make sure we have latest lookahead translation. See comments at
12846 user semantic actions for why this is necessary. */
12847 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
12848 /* If not already recovering from an error, report this error. */
12849 if (!yyerrstatus)
12850 {
12851 ++yynerrs;
12852 {
12853 yypcontext_t yyctx
12854 = {yyssp, yytoken, &yylloc};
12855 char const *yymsgp = YY_("syntax error");
12856 int yysyntax_error_status;
12857 yysyntax_error_status = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
12858 if (yysyntax_error_status == 0)
12859 yymsgp = yymsg;
12860 else if (yysyntax_error_status == -1)
12861 {
12862 if (yymsg != yymsgbuf)
12863 YYSTACK_FREE (yymsg);
12864 yymsg = YY_CAST (char *,
12865 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
12866 if (yymsg)
12867 {
12868 yysyntax_error_status
12869 = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
12870 yymsgp = yymsg;
12871 }
12872 else
12873 {
12874 yymsg = yymsgbuf;
12875 yymsg_alloc = sizeof yymsgbuf;
12876 yysyntax_error_status = YYENOMEM;
12877 }
12878 }
12879 yyerror (&yylloc, p, yymsgp);
12880 if (yysyntax_error_status == YYENOMEM)
12881 YYNOMEM;
12882 }
12883 }
12884
12885 yyerror_range[1] = yylloc;
12886 if (yyerrstatus == 3)
12887 {
12888 /* If just tried and failed to reuse lookahead token after an
12889 error, discard it. */
12890
12891 if (yychar <= END_OF_INPUT)
12892 {
12893 /* Return failure if at end of input. */
12894 if (yychar == END_OF_INPUT)
12895 YYABORT;
12896 }
12897 else
12898 {
12899 yydestruct ("Error: discarding",
12900 yytoken, &yylval, &yylloc, p);
12901 yychar = YYEMPTY;
12902 }
12903 }
12904
12905 /* Else will try to reuse lookahead token after shifting the error
12906 token. */
12907 goto yyerrlab1;
12908
12909
12910/*---------------------------------------------------.
12911| yyerrorlab -- error raised explicitly by YYERROR. |
12912`---------------------------------------------------*/
12913yyerrorlab:
12914 /* Pacify compilers when the user code never invokes YYERROR and the
12915 label yyerrorlab therefore never appears in user code. */
12916 if (0)
12917 YYERROR;
12918 ++yynerrs;
12919
12920 /* Do not reclaim the symbols of the rule whose action triggered
12921 this YYERROR. */
12922 YYPOPSTACK (yylen);
12923 yylen = 0;
12924 YY_STACK_PRINT (yyss, yyssp);
12925 yystate = *yyssp;
12926 goto yyerrlab1;
12927
12928
12929/*-------------------------------------------------------------.
12930| yyerrlab1 -- common code for both syntax error and YYERROR. |
12931`-------------------------------------------------------------*/
12932yyerrlab1:
12933 yyerrstatus = 3; /* Each real token shifted decrements this. */
12934
12935 /* Pop stack until we find a state that shifts the error token. */
12936 for (;;)
12937 {
12938 yyn = yypact[yystate];
12939 if (!yypact_value_is_default (yyn))
12940 {
12941 yyn += YYSYMBOL_YYerror;
12942 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
12943 {
12944 yyn = yytable[yyn];
12945 if (0 < yyn)
12946 break;
12947 }
12948 }
12949
12950 /* Pop the current state because it cannot handle the error token. */
12951 if (yyssp == yyss)
12952 YYABORT;
12953
12954 yyerror_range[1] = *yylsp;
12955 yydestruct ("Error: popping",
12956 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
12957 YYPOPSTACK (1);
12958 yystate = *yyssp;
12959 YY_STACK_PRINT (yyss, yyssp);
12960 }
12961
12963 *++yyvsp = yylval;
12965
12966 yyerror_range[2] = yylloc;
12967 ++yylsp;
12968 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
12969
12970 /* Shift the error token. */
12971 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
12972
12973 yystate = yyn;
12974 goto yynewstate;
12975
12976
12977/*-------------------------------------.
12978| yyacceptlab -- YYACCEPT comes here. |
12979`-------------------------------------*/
12980yyacceptlab:
12981 yyresult = 0;
12982 goto yyreturnlab;
12983
12984
12985/*-----------------------------------.
12986| yyabortlab -- YYABORT comes here. |
12987`-----------------------------------*/
12988yyabortlab:
12989 yyresult = 1;
12990 goto yyreturnlab;
12991
12992
12993/*-----------------------------------------------------------.
12994| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
12995`-----------------------------------------------------------*/
12996yyexhaustedlab:
12997 yyerror (&yylloc, p, YY_("memory exhausted"));
12998 yyresult = 2;
12999 goto yyreturnlab;
13000
13001
13002/*----------------------------------------------------------.
13003| yyreturnlab -- parsing is finished, clean up and return. |
13004`----------------------------------------------------------*/
13005yyreturnlab:
13006 if (yychar != YYEMPTY)
13007 {
13008 /* Make sure we have latest lookahead translation. See comments at
13009 user semantic actions for why this is necessary. */
13010 yytoken = YYTRANSLATE (yychar);
13011 yydestruct ("Cleanup: discarding lookahead",
13012 yytoken, &yylval, &yylloc, p);
13013 }
13014 /* Do not reclaim the symbols of the rule whose action triggered
13015 this YYABORT or YYACCEPT. */
13016 YYPOPSTACK (yylen);
13017 YY_STACK_PRINT (yyss, yyssp);
13018 while (yyssp != yyss)
13019 {
13020 yydestruct ("Cleanup: popping",
13021 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
13022 YYPOPSTACK (1);
13023 }
13024#ifndef yyoverflow
13025 if (yyss != yyssa)
13026 YYSTACK_FREE (yyss);
13027#endif
13028 if (yymsg != yymsgbuf)
13029 YYSTACK_FREE (yymsg);
13030 return yyresult;
13031}
13032
13033#line 5495 "parse.y"
13034
13035# undef p
13036# undef yylex
13037# undef yylval
13038# define yylval (*p->lval)
13039
13040static int regx_options(struct parser_params*);
13041static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
13042static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
13043static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
13044static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
13045
13046#ifndef RIPPER
13047# define set_yylval_node(x) { \
13048 YYLTYPE _cur_loc; \
13049 rb_parser_set_location(p, &_cur_loc); \
13050 yylval.node = (x); \
13051}
13052# define set_yylval_str(x) \
13053do { \
13054 set_yylval_node(NEW_STR(x, &_cur_loc)); \
13055 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
13056} while(0)
13057# define set_yylval_literal(x) \
13058do { \
13059 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
13060 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
13061} while(0)
13062# define set_yylval_num(x) (yylval.num = (x))
13063# define set_yylval_id(x) (yylval.id = (x))
13064# define set_yylval_name(x) (yylval.id = (x))
13065# define yylval_id() (yylval.id)
13066#else
13067static inline VALUE
13068ripper_yylval_id(struct parser_params *p, ID x)
13069{
13070 return ripper_new_yylval(p, x, ID2SYM(x), 0);
13071}
13072# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
13073# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
13074# define set_yylval_id(x) (void)(x)
13075# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
13076# define set_yylval_literal(x) add_mark_object(p, (x))
13077# define set_yylval_node(x) (void)(x)
13078# define yylval_id() yylval.id
13079# define _cur_loc NULL_LOC /* dummy */
13080#endif
13081
13082#define set_yylval_noname() set_yylval_id(keyword_nil)
13083
13084#ifndef RIPPER
13085#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
13086#define dispatch_scan_event(p, t) ((void)0)
13087#define dispatch_delayed_token(p, t) ((void)0)
13088#define has_delayed_token(p) (0)
13089#else
13090#define literal_flush(p, ptr) ((void)(ptr))
13091
13092#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val))
13093
13094static inline VALUE
13095intern_sym(const char *name)
13096{
13097 ID id = rb_intern_const(name);
13098 return ID2SYM(id);
13099}
13100
13101static int
13102ripper_has_scan_event(struct parser_params *p)
13103{
13104 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
13105 return p->lex.pcur > p->lex.ptok;
13106}
13107
13108static VALUE
13109ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
13110{
13111 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
13112 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
13113 token_flush(p);
13114 return rval;
13115}
13116
13117static void
13118ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
13119{
13120 if (!ripper_has_scan_event(p)) return;
13121 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
13122}
13123#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
13124
13125static void
13126ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
13127{
13128 int saved_line = p->ruby_sourceline;
13129 const char *saved_tokp = p->lex.ptok;
13130
13131 if (NIL_P(p->delayed.token)) return;
13132 p->ruby_sourceline = p->delayed.line;
13133 p->lex.ptok = p->lex.pbeg + p->delayed.col;
13134 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
13135 p->delayed.token = Qnil;
13136 p->ruby_sourceline = saved_line;
13137 p->lex.ptok = saved_tokp;
13138}
13139#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
13140#define has_delayed_token(p) (!NIL_P(p->delayed.token))
13141#endif /* RIPPER */
13142
13143#include "ruby/regex.h"
13144#include "ruby/util.h"
13145
13146static inline int
13147is_identchar(const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
13148{
13149 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
13150}
13151
13152static inline int
13153parser_is_identchar(struct parser_params *p)
13154{
13155 return !(p)->eofp && is_identchar(p->lex.pcur-1, p->lex.pend, p->enc);
13156}
13157
13158static inline int
13159parser_isascii(struct parser_params *p)
13160{
13161 return ISASCII(*(p->lex.pcur-1));
13162}
13163
13164static void
13165token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
13166{
13167 int column = 1, nonspc = 0, i;
13168 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
13169 if (*ptr == '\t') {
13170 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
13171 }
13172 column++;
13173 if (*ptr != ' ' && *ptr != '\t') {
13174 nonspc = 1;
13175 }
13176 }
13177
13178 ptinfo->beg = loc->beg_pos;
13179 ptinfo->indent = column;
13180 ptinfo->nonspc = nonspc;
13181}
13182
13183static void
13184token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
13185{
13186 token_info *ptinfo;
13187
13188 if (!p->token_info_enabled) return;
13189 ptinfo = ALLOC(token_info);
13190 ptinfo->token = token;
13191 ptinfo->next = p->token_info;
13192 token_info_setup(ptinfo, p->lex.pbeg, loc);
13193
13194 p->token_info = ptinfo;
13195}
13196
13197static void
13198token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
13199{
13200 token_info *ptinfo_beg = p->token_info;
13201
13202 if (!ptinfo_beg) return;
13203 p->token_info = ptinfo_beg->next;
13204
13205 /* indentation check of matched keywords (begin..end, if..end, etc.) */
13206 token_info_warn(p, token, ptinfo_beg, 1, loc);
13207 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
13208}
13209
13210static void
13211token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
13212{
13213 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
13214 if (!p->token_info_enabled) return;
13215 if (!ptinfo_beg) return;
13216 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
13217 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
13218 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
13219 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
13220 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
13221 rb_warn3L(ptinfo_end->beg.lineno,
13222 "mismatched indentations at '%s' with '%s' at %d",
13223 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
13224}
13225
13226static int
13227parser_precise_mbclen(struct parser_params *p, const char *ptr)
13228{
13229 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
13230 if (!MBCLEN_CHARFOUND_P(len)) {
13231 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
13232 return -1;
13233 }
13234 return len;
13235}
13236
13237#ifndef RIPPER
13238static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
13239
13240static inline void
13241parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
13242{
13243 VALUE str;
13244 int lineno = p->ruby_sourceline;
13245 if (!yylloc) {
13246 return;
13247 }
13248 else if (yylloc->beg_pos.lineno == lineno) {
13249 str = p->lex.lastline;
13250 }
13251 else {
13252 return;
13253 }
13254 ruby_show_error_line(p->error_buffer, yylloc, lineno, str);
13255}
13256
13257static int
13258parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
13259{
13260 YYLTYPE current;
13261
13262 if (!yylloc) {
13263 yylloc = RUBY_SET_YYLLOC(current);
13264 }
13265 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
13266 p->ruby_sourceline != yylloc->end_pos.lineno) ||
13267 (yylloc->beg_pos.lineno == yylloc->end_pos.lineno &&
13268 yylloc->beg_pos.column == yylloc->end_pos.column)) {
13269 yylloc = 0;
13270 }
13271 compile_error(p, "%s", msg);
13272 parser_show_error_line(p, yylloc);
13273 return 0;
13274}
13275
13276static void
13277ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
13278{
13279 VALUE mesg;
13280 const int max_line_margin = 30;
13281 const char *ptr, *ptr_end, *pt, *pb;
13282 const char *pre = "", *post = "", *pend;
13283 const char *code = "", *caret = "";
13284 const char *lim;
13285 const char *const pbeg = RSTRING_PTR(str);
13286 char *buf;
13287 long len;
13288 int i;
13289
13290 if (!yylloc) return;
13291 pend = RSTRING_END(str);
13292 if (pend > pbeg && pend[-1] == '\n') {
13293 if (--pend > pbeg && pend[-1] == '\r') --pend;
13294 }
13295
13296 pt = pend;
13297 if (lineno == yylloc->end_pos.lineno &&
13298 (pend - pbeg) > yylloc->end_pos.column) {
13299 pt = pbeg + yylloc->end_pos.column;
13300 }
13301
13302 ptr = ptr_end = pt;
13303 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
13304 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
13305
13306 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
13307 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
13308
13309 len = ptr_end - ptr;
13310 if (len > 4) {
13311 if (ptr > pbeg) {
13312 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
13313 if (ptr > pbeg) pre = "...";
13314 }
13315 if (ptr_end < pend) {
13316 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
13317 if (ptr_end < pend) post = "...";
13318 }
13319 }
13320 pb = pbeg;
13321 if (lineno == yylloc->beg_pos.lineno) {
13322 pb += yylloc->beg_pos.column;
13323 if (pb > pt) pb = pt;
13324 }
13325 if (pb < ptr) pb = ptr;
13326 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
13327 return;
13328 }
13329 if (RTEST(errbuf)) {
13330 mesg = rb_attr_get(errbuf, idMesg);
13331 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
13332 rb_str_cat_cstr(mesg, "\n");
13333 }
13334 else {
13335 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
13336 }
13337 if (!errbuf && rb_stderr_tty_p()) {
13338#define CSI_BEGIN "\033["
13339#define CSI_SGR "m"
13340 rb_str_catf(mesg,
13341 CSI_BEGIN""CSI_SGR"%s" /* pre */
13342 CSI_BEGIN"1"CSI_SGR"%.*s"
13343 CSI_BEGIN"1;4"CSI_SGR"%.*s"
13344 CSI_BEGIN";1"CSI_SGR"%.*s"
13345 CSI_BEGIN""CSI_SGR"%s" /* post */
13346 "\n",
13347 pre,
13348 (int)(pb - ptr), ptr,
13349 (int)(pt - pb), pb,
13350 (int)(ptr_end - pt), pt,
13351 post);
13352 }
13353 else {
13354 char *p2;
13355
13356 len = ptr_end - ptr;
13357 lim = pt < pend ? pt : pend;
13358 i = (int)(lim - ptr);
13359 buf = ALLOCA_N(char, i+2);
13360 code = ptr;
13361 caret = p2 = buf;
13362 if (ptr <= pb) {
13363 while (ptr < pb) {
13364 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
13365 }
13366 *p2++ = '^';
13367 ptr++;
13368 }
13369 if (lim > ptr) {
13370 memset(p2, '~', (lim - ptr));
13371 p2 += (lim - ptr);
13372 }
13373 *p2 = '\0';
13374 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
13375 pre, (int)len, code, post,
13376 pre, caret);
13377 }
13378 if (!errbuf) rb_write_error_str(mesg);
13379}
13380#else
13381static int
13382parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
13383{
13384 const char *pcur = 0, *ptok = 0;
13385 if (yylloc &&
13386 p->ruby_sourceline == yylloc->beg_pos.lineno &&
13387 p->ruby_sourceline == yylloc->end_pos.lineno) {
13388 pcur = p->lex.pcur;
13389 ptok = p->lex.ptok;
13390 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
13391 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
13392 }
13393 dispatch1(parse_error, STR_NEW2(msg));
13394 ripper_error(p);
13395 if (pcur) {
13396 p->lex.ptok = ptok;
13397 p->lex.pcur = pcur;
13398 }
13399 return 0;
13400}
13401
13402static inline void
13403parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
13404{
13405}
13406#endif /* !RIPPER */
13407
13408#ifndef RIPPER
13409static int
13410vtable_size(const struct vtable *tbl)
13411{
13412 if (!DVARS_TERMINAL_P(tbl)) {
13413 return tbl->pos;
13414 }
13415 else {
13416 return 0;
13417 }
13418}
13419#endif
13420
13421static struct vtable *
13422vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
13423{
13424 struct vtable *tbl = ALLOC(struct vtable);
13425 tbl->pos = 0;
13426 tbl->capa = 8;
13427 tbl->tbl = ALLOC_N(ID, tbl->capa);
13428 tbl->prev = prev;
13429#ifndef RIPPER
13430 if (p->debug) {
13431 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
13432 }
13433#endif
13434 return tbl;
13435}
13436#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
13437
13438static void
13439vtable_free_gen(struct parser_params *p, int line, const char *name,
13440 struct vtable *tbl)
13441{
13442#ifndef RIPPER
13443 if (p->debug) {
13444 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
13445 }
13446#endif
13447 if (!DVARS_TERMINAL_P(tbl)) {
13448 if (tbl->tbl) {
13449 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
13450 }
13451 ruby_sized_xfree(tbl, sizeof(tbl));
13452 }
13453}
13454#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
13455
13456static void
13457vtable_add_gen(struct parser_params *p, int line, const char *name,
13458 struct vtable *tbl, ID id)
13459{
13460#ifndef RIPPER
13461 if (p->debug) {
13462 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
13463 line, name, (void *)tbl, rb_id2name(id));
13464 }
13465#endif
13466 if (DVARS_TERMINAL_P(tbl)) {
13467 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
13468 return;
13469 }
13470 if (tbl->pos == tbl->capa) {
13471 tbl->capa = tbl->capa * 2;
13472 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
13473 }
13474 tbl->tbl[tbl->pos++] = id;
13475}
13476#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
13477
13478#ifndef RIPPER
13479static void
13480vtable_pop_gen(struct parser_params *p, int line, const char *name,
13481 struct vtable *tbl, int n)
13482{
13483 if (p->debug) {
13484 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
13485 line, name, (void *)tbl, n);
13486 }
13487 if (tbl->pos < n) {
13488 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
13489 return;
13490 }
13491 tbl->pos -= n;
13492}
13493#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
13494#endif
13495
13496static int
13497vtable_included(const struct vtable * tbl, ID id)
13498{
13499 int i;
13500
13501 if (!DVARS_TERMINAL_P(tbl)) {
13502 for (i = 0; i < tbl->pos; i++) {
13503 if (tbl->tbl[i] == id) {
13504 return i+1;
13505 }
13506 }
13507 }
13508 return 0;
13509}
13510
13511static void parser_prepare(struct parser_params *p);
13512
13513#ifndef RIPPER
13514static NODE *parser_append_options(struct parser_params *p, NODE *node);
13515
13516static VALUE
13517debug_lines(VALUE fname)
13518{
13519 ID script_lines;
13520 CONST_ID(script_lines, "SCRIPT_LINES__");
13521 if (rb_const_defined_at(rb_cObject, script_lines)) {
13522 VALUE hash = rb_const_get_at(rb_cObject, script_lines);
13523 if (RB_TYPE_P(hash, T_HASH)) {
13524 VALUE lines = rb_ary_new();
13525 rb_hash_aset(hash, fname, lines);
13526 return lines;
13527 }
13528 }
13529 return 0;
13530}
13531
13532static int
13533e_option_supplied(struct parser_params *p)
13534{
13535 return strcmp(p->ruby_sourcefile, "-e") == 0;
13536}
13537
13538static VALUE
13539yycompile0(VALUE arg)
13540{
13541 int n;
13542 NODE *tree;
13543 struct parser_params *p = (struct parser_params *)arg;
13544 VALUE cov = Qfalse;
13545
13548 if (p->debug_lines && p->ruby_sourceline > 0) {
13549 VALUE str = STR_NEW0();
13550 n = p->ruby_sourceline;
13551 do {
13553 } while (--n);
13554 }
13555
13556 if (!e_option_supplied(p)) {
13557 cov = Qtrue;
13558 }
13559 }
13560
13561 parser_prepare(p);
13562#define RUBY_DTRACE_PARSE_HOOK(name) \
13563 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
13564 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
13565 }
13567 n = yyparse(p);
13569 p->debug_lines = 0;
13570
13571 p->lex.strterm = 0;
13572 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
13573 p->lex.prevline = p->lex.lastline = p->lex.nextline = 0;
13574 if (n || p->error_p) {
13575 VALUE mesg = p->error_buffer;
13576 if (!mesg) {
13578 }
13579 rb_set_errinfo(mesg);
13580 return FALSE;
13581 }
13582 tree = p->eval_tree;
13583 if (!tree) {
13584 tree = NEW_NIL(&NULL_LOC);
13585 }
13586 else {
13587 VALUE opt = p->compile_option;
13588 NODE *prelude;
13589 NODE *body = parser_append_options(p, tree->nd_body);
13590 if (!opt) opt = rb_obj_hide(rb_ident_hash_new());
13591 rb_hash_aset(opt, rb_sym_intern_ascii_cstr("coverage_enabled"), cov);
13592 prelude = block_append(p, p->eval_tree_begin, body);
13593 tree->nd_body = prelude;
13594 RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt);
13595 }
13596 p->ast->body.root = tree;
13597 p->ast->body.line_count = p->line_count;
13598 return TRUE;
13599}
13600
13601static rb_ast_t *
13602yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line)
13603{
13604 rb_ast_t *ast;
13605 if (NIL_P(fname)) {
13607 p->ruby_sourcefile = "(none)";
13608 }
13609 else {
13611 p->ruby_sourcefile = StringValueCStr(fname);
13612 }
13613 p->ruby_sourceline = line - 1;
13614
13615 p->ast = ast = rb_ast_new();
13616 rb_suppress_tracing(yycompile0, (VALUE)p);
13617 p->ast = 0;
13618 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
13619
13620 return ast;
13621}
13622#endif /* !RIPPER */
13623
13624static rb_encoding *
13625must_be_ascii_compatible(VALUE s)
13626{
13628 if (!rb_enc_asciicompat(enc)) {
13629 rb_raise(rb_eArgError, "invalid source encoding");
13630 }
13631 return enc;
13632}
13633
13634static VALUE
13635lex_get_str(struct parser_params *p, VALUE s)
13636{
13637 char *beg, *end, *start;
13638 long len;
13639
13640 beg = RSTRING_PTR(s);
13641 len = RSTRING_LEN(s);
13642 start = beg;
13643 if (p->lex.gets_.ptr) {
13644 if (len == p->lex.gets_.ptr) return Qnil;
13645 beg += p->lex.gets_.ptr;
13646 len -= p->lex.gets_.ptr;
13647 }
13648 end = memchr(beg, '\n', len);
13649 if (end) len = ++end - beg;
13650 p->lex.gets_.ptr += len;
13651 return rb_str_subseq(s, beg - start, len);
13652}
13653
13654static VALUE
13655lex_getline(struct parser_params *p)
13656{
13657 VALUE line = (*p->lex.gets)(p, p->lex.input);
13658 if (NIL_P(line)) return line;
13659 must_be_ascii_compatible(line);
13660#ifndef RIPPER
13661 if (p->debug_lines) {
13662 rb_enc_associate(line, p->enc);
13663 rb_ary_push(p->debug_lines, line);
13664 }
13665#endif
13666 p->line_count++;
13667 return line;
13668}
13669
13670static const rb_data_type_t parser_data_type;
13671
13672#ifndef RIPPER
13673static rb_ast_t*
13674parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
13675{
13676 struct parser_params *p;
13677
13678 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
13679
13680 p->lex.gets = lex_get_str;
13681 p->lex.gets_.ptr = 0;
13682 p->lex.input = rb_str_new_frozen(s);
13683 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
13684
13685 return yycompile(vparser, p, fname, line);
13686}
13687
13688rb_ast_t*
13689rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
13690{
13692}
13693
13694rb_ast_t*
13696{
13697 must_be_ascii_compatible(s);
13698 return parser_compile_string(vparser, f, s, line);
13699}
13700
13702
13703static VALUE
13704lex_io_gets(struct parser_params *p, VALUE io)
13705{
13706 return rb_io_gets_internal(io);
13707}
13708
13709rb_ast_t*
13710rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
13711{
13712 struct parser_params *p;
13713
13714 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
13715
13716 p->lex.gets = lex_io_gets;
13717 p->lex.input = file;
13718 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
13719
13720 return yycompile(vparser, p, fname, start);
13721}
13722
13723static VALUE
13724lex_generic_gets(struct parser_params *p, VALUE input)
13725{
13726 return (*p->lex.gets_.call)(input, p->line_count);
13727}
13728
13729rb_ast_t*
13730rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
13731{
13732 struct parser_params *p;
13733
13734 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
13735
13736 p->lex.gets = lex_generic_gets;
13737 p->lex.gets_.call = lex_gets;
13738 p->lex.input = input;
13739 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
13740
13741 return yycompile(vparser, p, fname, start);
13742}
13743#endif /* !RIPPER */
13744
13745#define STR_FUNC_ESCAPE 0x01
13746#define STR_FUNC_EXPAND 0x02
13747#define STR_FUNC_REGEXP 0x04
13748#define STR_FUNC_QWORDS 0x08
13749#define STR_FUNC_SYMBOL 0x10
13750#define STR_FUNC_INDENT 0x20
13751#define STR_FUNC_LABEL 0x40
13752#define STR_FUNC_LIST 0x4000
13753#define STR_FUNC_TERM 0x8000
13754
13766
13767static VALUE
13768parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
13769{
13770 VALUE str;
13771
13773 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
13775 }
13776 else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) {
13778 }
13779 }
13780
13781 return str;
13782}
13783
13784#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
13785#define lex_eol_p(p) ((p)->lex.pcur >= (p)->lex.pend)
13786#define lex_eol_n_p(p,n) ((p)->lex.pcur+(n) >= (p)->lex.pend)
13787#define peek(p,c) peek_n(p, (c), 0)
13788#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
13789#define peekc(p) peekc_n(p, 0)
13790#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
13791
13792#ifdef RIPPER
13793static void
13794add_delayed_token(struct parser_params *p, const char *tok, const char *end)
13795{
13796 if (tok < end) {
13797 if (!has_delayed_token(p)) {
13798 p->delayed.token = rb_str_buf_new(end - tok);
13799 rb_enc_associate(p->delayed.token, p->enc);
13800 p->delayed.line = p->ruby_sourceline;
13801 p->delayed.col = rb_long2int(tok - p->lex.pbeg);
13802 }
13803 rb_str_buf_cat(p->delayed.token, tok, end - tok);
13804 p->lex.ptok = end;
13805 }
13806}
13807#else
13808#define add_delayed_token(p, tok, end) ((void)(tok), (void)(end))
13809#endif
13810
13811static int
13812nextline(struct parser_params *p)
13813{
13814 VALUE v = p->lex.nextline;
13815 p->lex.nextline = 0;
13816 if (!v) {
13817 if (p->eofp)
13818 return -1;
13819
13820 if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
13821 goto end_of_input;
13822 }
13823
13824 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
13825 end_of_input:
13826 p->eofp = 1;
13827 lex_goto_eol(p);
13828 return -1;
13829 }
13830 p->cr_seen = FALSE;
13831 }
13832 else if (NIL_P(v)) {
13833 /* after here-document without terminator */
13834 goto end_of_input;
13835 }
13836 add_delayed_token(p, p->lex.ptok, p->lex.pend);
13837 if (p->heredoc_end > 0) {
13839 p->heredoc_end = 0;
13840 }
13841 p->ruby_sourceline++;
13842 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
13843 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
13844 token_flush(p);
13845 p->lex.prevline = p->lex.lastline;
13846 p->lex.lastline = v;
13847 return 0;
13848}
13849
13850static int
13851parser_cr(struct parser_params *p, int c)
13852{
13853 if (peek(p, '\n')) {
13854 p->lex.pcur++;
13855 c = '\n';
13856 }
13857 else if (!p->cr_seen) {
13858 p->cr_seen = TRUE;
13859 /* carried over with p->lex.nextline for nextc() */
13860 rb_warn0("encountered \\r in middle of line, treated as a mere space");
13861 }
13862 return c;
13863}
13864
13865static inline int
13866nextc(struct parser_params *p)
13867{
13868 int c;
13869
13870 if (UNLIKELY((p->lex.pcur == p->lex.pend) || p->eofp || RTEST(p->lex.nextline))) {
13871 if (nextline(p)) return -1;
13872 }
13873 c = (unsigned char)*p->lex.pcur++;
13874 if (UNLIKELY(c == '\r')) {
13875 c = parser_cr(p, c);
13876 }
13877
13878 return c;
13879}
13880
13881static void
13882pushback(struct parser_params *p, int c)
13883{
13884 if (c == -1) return;
13885 p->lex.pcur--;
13886 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
13887 p->lex.pcur--;
13888 }
13889}
13890
13891#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
13892
13893#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
13894#define tok(p) (p)->tokenbuf
13895#define toklen(p) (p)->tokidx
13896
13897static int
13898looking_at_eol_p(struct parser_params *p)
13899{
13900 const char *ptr = p->lex.pcur;
13901 while (ptr < p->lex.pend) {
13902 int c = (unsigned char)*ptr++;
13903 int eol = (c == '\n' || c == '#');
13904 if (eol || !ISSPACE(c)) {
13905 return eol;
13906 }
13907 }
13908 return TRUE;
13909}
13910
13911static char*
13912newtok(struct parser_params *p)
13913{
13914 p->tokidx = 0;
13915 p->tokline = p->ruby_sourceline;
13916 if (!p->tokenbuf) {
13917 p->toksiz = 60;
13918 p->tokenbuf = ALLOC_N(char, 60);
13919 }
13920 if (p->toksiz > 4096) {
13921 p->toksiz = 60;
13922 REALLOC_N(p->tokenbuf, char, 60);
13923 }
13924 return p->tokenbuf;
13925}
13926
13927static char *
13928tokspace(struct parser_params *p, int n)
13929{
13930 p->tokidx += n;
13931
13932 if (p->tokidx >= p->toksiz) {
13933 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
13934 REALLOC_N(p->tokenbuf, char, p->toksiz);
13935 }
13936 return &p->tokenbuf[p->tokidx-n];
13937}
13938
13939static void
13940tokadd(struct parser_params *p, int c)
13941{
13942 p->tokenbuf[p->tokidx++] = (char)c;
13943 if (p->tokidx >= p->toksiz) {
13944 p->toksiz *= 2;
13945 REALLOC_N(p->tokenbuf, char, p->toksiz);
13946 }
13947}
13948
13949static int
13950tok_hex(struct parser_params *p, size_t *numlen)
13951{
13952 int c;
13953
13954 c = scan_hex(p->lex.pcur, 2, numlen);
13955 if (!*numlen) {
13956 yyerror0("invalid hex escape");
13957 token_flush(p);
13958 return 0;
13959 }
13960 p->lex.pcur += *numlen;
13961 return c;
13962}
13963
13964#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
13965
13966static int
13967escaped_control_code(int c)
13968{
13969 int c2 = 0;
13970 switch (c) {
13971 case ' ':
13972 c2 = 's';
13973 break;
13974 case '\n':
13975 c2 = 'n';
13976 break;
13977 case '\t':
13978 c2 = 't';
13979 break;
13980 case '\v':
13981 c2 = 'v';
13982 break;
13983 case '\r':
13984 c2 = 'r';
13985 break;
13986 case '\f':
13987 c2 = 'f';
13988 break;
13989 }
13990 return c2;
13991}
13992
13993#define WARN_SPACE_CHAR(c, prefix) \
13994 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
13995
13996static int
13997tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
13998 int regexp_literal, int wide)
13999{
14000 size_t numlen;
14001 int codepoint = scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
14002 literal_flush(p, p->lex.pcur);
14003 p->lex.pcur += numlen;
14004 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
14005 yyerror0("invalid Unicode escape");
14006 return wide && numlen > 0;
14007 }
14008 if (codepoint > 0x10ffff) {
14009 yyerror0("invalid Unicode codepoint (too large)");
14010 return wide;
14011 }
14012 if ((codepoint & 0xfffff800) == 0xd800) {
14013 yyerror0("invalid Unicode codepoint");
14014 return wide;
14015 }
14016 if (regexp_literal) {
14017 tokcopy(p, (int)numlen);
14018 }
14019 else if (codepoint >= 0x80) {
14020 rb_encoding *utf8 = rb_utf8_encoding();
14021 if (*encp && utf8 != *encp) {
14022 YYLTYPE loc = RUBY_INIT_YYLLOC();
14023 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
14024 parser_show_error_line(p, &loc);
14025 return wide;
14026 }
14027 *encp = utf8;
14028 tokaddmbc(p, codepoint, *encp);
14029 }
14030 else {
14031 tokadd(p, codepoint);
14032 }
14033 return TRUE;
14034}
14035
14036/* return value is for ?\u3042 */
14037static void
14038tokadd_utf8(struct parser_params *p, rb_encoding **encp,
14039 int term, int symbol_literal, int regexp_literal)
14040{
14041 /*
14042 * If `term` is not -1, then we allow multiple codepoints in \u{}
14043 * upto `term` byte, otherwise we're parsing a character literal.
14044 * And then add the codepoints to the current token.
14045 */
14046 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
14047
14048 const int open_brace = '{', close_brace = '}';
14049
14050 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
14051
14052 if (peek(p, open_brace)) { /* handle \u{...} form */
14053 const char *second = NULL;
14054 int c, last = nextc(p);
14055 if (p->lex.pcur >= p->lex.pend) goto unterminated;
14056 while (ISSPACE(c = *p->lex.pcur) && ++p->lex.pcur < p->lex.pend);
14057 while (c != close_brace) {
14058 if (c == term) goto unterminated;
14059 if (second == multiple_codepoints)
14060 second = p->lex.pcur;
14061 if (regexp_literal) tokadd(p, last);
14062 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
14063 break;
14064 }
14065 while (ISSPACE(c = *p->lex.pcur)) {
14066 if (++p->lex.pcur >= p->lex.pend) goto unterminated;
14067 last = c;
14068 }
14069 if (term == -1 && !second)
14070 second = multiple_codepoints;
14071 }
14072
14073 if (c != close_brace) {
14074 unterminated:
14075 token_flush(p);
14076 yyerror0("unterminated Unicode escape");
14077 return;
14078 }
14079 if (second && second != multiple_codepoints) {
14080 const char *pcur = p->lex.pcur;
14081 p->lex.pcur = second;
14083 token_flush(p);
14084 p->lex.pcur = pcur;
14085 yyerror0(multiple_codepoints);
14086 token_flush(p);
14087 }
14088
14089 if (regexp_literal) tokadd(p, close_brace);
14090 nextc(p);
14091 }
14092 else { /* handle \uxxxx form */
14093 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
14094 token_flush(p);
14095 return;
14096 }
14097 }
14098}
14099
14100#define ESCAPE_CONTROL 1
14101#define ESCAPE_META 2
14102
14103static int
14104read_escape(struct parser_params *p, int flags, rb_encoding **encp)
14105{
14106 int c;
14107 size_t numlen;
14108
14109 switch (c = nextc(p)) {
14110 case '\\': /* Backslash */
14111 return c;
14112
14113 case 'n': /* newline */
14114 return '\n';
14115
14116 case 't': /* horizontal tab */
14117 return '\t';
14118
14119 case 'r': /* carriage-return */
14120 return '\r';
14121
14122 case 'f': /* form-feed */
14123 return '\f';
14124
14125 case 'v': /* vertical tab */
14126 return '\13';
14127
14128 case 'a': /* alarm(bell) */
14129 return '\007';
14130
14131 case 'e': /* escape */
14132 return 033;
14133
14134 case '0': case '1': case '2': case '3': /* octal constant */
14135 case '4': case '5': case '6': case '7':
14136 pushback(p, c);
14137 c = scan_oct(p->lex.pcur, 3, &numlen);
14138 p->lex.pcur += numlen;
14139 return c;
14140
14141 case 'x': /* hex constant */
14142 c = tok_hex(p, &numlen);
14143 if (numlen == 0) return 0;
14144 return c;
14145
14146 case 'b': /* backspace */
14147 return '\010';
14148
14149 case 's': /* space */
14150 return ' ';
14151
14152 case 'M':
14153 if (flags & ESCAPE_META) goto eof;
14154 if ((c = nextc(p)) != '-') {
14155 goto eof;
14156 }
14157 if ((c = nextc(p)) == '\\') {
14158 if (peek(p, 'u')) goto eof;
14159 return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
14160 }
14161 else if (c == -1 || !ISASCII(c)) goto eof;
14162 else {
14163 int c2 = escaped_control_code(c);
14164 if (c2) {
14165 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
14166 WARN_SPACE_CHAR(c2, "\\M-");
14167 }
14168 else {
14169 WARN_SPACE_CHAR(c2, "\\C-\\M-");
14170 }
14171 }
14172 else if (ISCNTRL(c)) goto eof;
14173 return ((c & 0xff) | 0x80);
14174 }
14175
14176 case 'C':
14177 if ((c = nextc(p)) != '-') {
14178 goto eof;
14179 }
14180 case 'c':
14181 if (flags & ESCAPE_CONTROL) goto eof;
14182 if ((c = nextc(p))== '\\') {
14183 if (peek(p, 'u')) goto eof;
14184 c = read_escape(p, flags|ESCAPE_CONTROL, encp);
14185 }
14186 else if (c == '?')
14187 return 0177;
14188 else if (c == -1 || !ISASCII(c)) goto eof;
14189 else {
14190 int c2 = escaped_control_code(c);
14191 if (c2) {
14192 if (ISCNTRL(c)) {
14193 if (flags & ESCAPE_META) {
14194 WARN_SPACE_CHAR(c2, "\\M-");
14195 }
14196 else {
14197 WARN_SPACE_CHAR(c2, "");
14198 }
14199 }
14200 else {
14201 if (flags & ESCAPE_META) {
14202 WARN_SPACE_CHAR(c2, "\\M-\\C-");
14203 }
14204 else {
14205 WARN_SPACE_CHAR(c2, "\\C-");
14206 }
14207 }
14208 }
14209 else if (ISCNTRL(c)) goto eof;
14210 }
14211 return c & 0x9f;
14212
14213 eof:
14214 case -1:
14215 yyerror0("Invalid escape character syntax");
14216 token_flush(p);
14217 return '\0';
14218
14219 default:
14220 return c;
14221 }
14222}
14223
14224static void
14225tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
14226{
14227 int len = rb_enc_codelen(c, enc);
14228 rb_enc_mbcput(c, tokspace(p, len), enc);
14229}
14230
14231static int
14232tokadd_escape(struct parser_params *p, rb_encoding **encp)
14233{
14234 int c;
14235 int flags = 0;
14236 size_t numlen;
14237
14238 first:
14239 switch (c = nextc(p)) {
14240 case '\n':
14241 return 0; /* just ignore */
14242
14243 case '0': case '1': case '2': case '3': /* octal constant */
14244 case '4': case '5': case '6': case '7':
14245 {
14246 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
14247 if (numlen == 0) goto eof;
14248 p->lex.pcur += numlen;
14249 tokcopy(p, (int)numlen + 1);
14250 }
14251 return 0;
14252
14253 case 'x': /* hex constant */
14254 {
14255 tok_hex(p, &numlen);
14256 if (numlen == 0) return -1;
14257 tokcopy(p, (int)numlen + 2);
14258 }
14259 return 0;
14260
14261 case 'M':
14262 if (flags & ESCAPE_META) goto eof;
14263 if ((c = nextc(p)) != '-') {
14264 pushback(p, c);
14265 goto eof;
14266 }
14267 tokcopy(p, 3);
14268 flags |= ESCAPE_META;
14269 goto escaped;
14270
14271 case 'C':
14272 if (flags & ESCAPE_CONTROL) goto eof;
14273 if ((c = nextc(p)) != '-') {
14274 pushback(p, c);
14275 goto eof;
14276 }
14277 tokcopy(p, 3);
14278 goto escaped;
14279
14280 case 'c':
14281 if (flags & ESCAPE_CONTROL) goto eof;
14282 tokcopy(p, 2);
14283 flags |= ESCAPE_CONTROL;
14284 escaped:
14285 if ((c = nextc(p)) == '\\') {
14286 goto first;
14287 }
14288 else if (c == -1) goto eof;
14289 tokadd(p, c);
14290 return 0;
14291
14292 eof:
14293 case -1:
14294 yyerror0("Invalid escape character syntax");
14295 token_flush(p);
14296 return -1;
14297
14298 default:
14299 tokadd(p, '\\');
14300 tokadd(p, c);
14301 }
14302 return 0;
14303}
14304
14305static int
14306regx_options(struct parser_params *p)
14307{
14308 int kcode = 0;
14309 int kopt = 0;
14310 int options = 0;
14311 int c, opt, kc;
14312
14313 newtok(p);
14314 while (c = nextc(p), ISALPHA(c)) {
14315 if (c == 'o') {
14316 options |= RE_OPTION_ONCE;
14317 }
14318 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
14319 if (kc >= 0) {
14320 if (kc != rb_ascii8bit_encindex()) kcode = c;
14321 kopt = opt;
14322 }
14323 else {
14324 options |= opt;
14325 }
14326 }
14327 else {
14328 tokadd(p, c);
14329 }
14330 }
14331 options |= kopt;
14332 pushback(p, c);
14333 if (toklen(p)) {
14334 YYLTYPE loc = RUBY_INIT_YYLLOC();
14335 tokfix(p);
14336 compile_error(p, "unknown regexp option%s - %*s",
14337 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
14338 parser_show_error_line(p, &loc);
14339 }
14340 return options | RE_OPTION_ENCODING(kcode);
14341}
14342
14343static int
14344tokadd_mbchar(struct parser_params *p, int c)
14345{
14346 int len = parser_precise_mbclen(p, p->lex.pcur-1);
14347 if (len < 0) return -1;
14348 tokadd(p, c);
14349 p->lex.pcur += --len;
14350 if (len > 0) tokcopy(p, len);
14351 return c;
14352}
14353
14354static inline int
14355simple_re_meta(int c)
14356{
14357 switch (c) {
14358 case '$': case '*': case '+': case '.':
14359 case '?': case '^': case '|':
14360 case ')': case ']': case '}': case '>':
14361 return TRUE;
14362 default:
14363 return FALSE;
14364 }
14365}
14366
14367static int
14368parser_update_heredoc_indent(struct parser_params *p, int c)
14369{
14370 if (p->heredoc_line_indent == -1) {
14371 if (c == '\n') p->heredoc_line_indent = 0;
14372 }
14373 else {
14374 if (c == ' ') {
14376 return TRUE;
14377 }
14378 else if (c == '\t') {
14379 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
14381 return TRUE;
14382 }
14383 else if (c != '\n') {
14384 if (p->heredoc_indent > p->heredoc_line_indent) {
14386 }
14387 p->heredoc_line_indent = -1;
14388 }
14389 }
14390 return FALSE;
14391}
14392
14393static void
14394parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
14395{
14396 YYLTYPE loc = RUBY_INIT_YYLLOC();
14397 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
14398 compile_error(p, "%s mixed within %s source", n1, n2);
14399 parser_show_error_line(p, &loc);
14400}
14401
14402static void
14403parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
14404{
14405 const char *pos = p->lex.pcur;
14406 p->lex.pcur = beg;
14407 parser_mixed_error(p, enc1, enc2);
14408 p->lex.pcur = pos;
14409}
14410
14411static int
14412tokadd_string(struct parser_params *p,
14413 int func, int term, int paren, long *nest,
14414 rb_encoding **encp, rb_encoding **enc)
14415{
14416 int c;
14417 bool erred = false;
14418
14419#define mixed_error(enc1, enc2) \
14420 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
14421#define mixed_escape(beg, enc1, enc2) \
14422 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
14423
14424 while ((c = nextc(p)) != -1) {
14425 if (p->heredoc_indent > 0) {
14426 parser_update_heredoc_indent(p, c);
14427 }
14428
14429 if (paren && c == paren) {
14430 ++*nest;
14431 }
14432 else if (c == term) {
14433 if (!nest || !*nest) {
14434 pushback(p, c);
14435 break;
14436 }
14437 --*nest;
14438 }
14439 else if ((func & STR_FUNC_EXPAND) && c == '#' && p->lex.pcur < p->lex.pend) {
14440 int c2 = *p->lex.pcur;
14441 if (c2 == '$' || c2 == '@' || c2 == '{') {
14442 pushback(p, c);
14443 break;
14444 }
14445 }
14446 else if (c == '\\') {
14447 literal_flush(p, p->lex.pcur - 1);
14448 c = nextc(p);
14449 switch (c) {
14450 case '\n':
14451 if (func & STR_FUNC_QWORDS) break;
14452 if (func & STR_FUNC_EXPAND) {
14453 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
14454 continue;
14455 if (c == term) {
14456 c = '\\';
14457 goto terminate;
14458 }
14459 }
14460 tokadd(p, '\\');
14461 break;
14462
14463 case '\\':
14464 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
14465 break;
14466
14467 case 'u':
14468 if ((func & STR_FUNC_EXPAND) == 0) {
14469 tokadd(p, '\\');
14470 break;
14471 }
14472 tokadd_utf8(p, enc, term,
14473 func & STR_FUNC_SYMBOL,
14474 func & STR_FUNC_REGEXP);
14475 continue;
14476
14477 default:
14478 if (c == -1) return -1;
14479 if (!ISASCII(c)) {
14480 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
14481 goto non_ascii;
14482 }
14483 if (func & STR_FUNC_REGEXP) {
14484 if (c == term && !simple_re_meta(c)) {
14485 tokadd(p, c);
14486 continue;
14487 }
14488 pushback(p, c);
14489 if ((c = tokadd_escape(p, enc)) < 0)
14490 return -1;
14491 if (*enc && *enc != *encp) {
14492 mixed_escape(p->lex.ptok+2, *enc, *encp);
14493 }
14494 continue;
14495 }
14496 else if (func & STR_FUNC_EXPAND) {
14497 pushback(p, c);
14498 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
14499 c = read_escape(p, 0, enc);
14500 }
14501 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
14502 /* ignore backslashed spaces in %w */
14503 }
14504 else if (c != term && !(paren && c == paren)) {
14505 tokadd(p, '\\');
14506 pushback(p, c);
14507 continue;
14508 }
14509 }
14510 }
14511 else if (!parser_isascii(p)) {
14512 non_ascii:
14513 if (!*enc) {
14514 *enc = *encp;
14515 }
14516 else if (*enc != *encp) {
14517 mixed_error(*enc, *encp);
14518 continue;
14519 }
14520 if (tokadd_mbchar(p, c) == -1) return -1;
14521 continue;
14522 }
14523 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
14524 pushback(p, c);
14525 break;
14526 }
14527 if (c & 0x80) {
14528 if (!*enc) {
14529 *enc = *encp;
14530 }
14531 else if (*enc != *encp) {
14532 mixed_error(*enc, *encp);
14533 continue;
14534 }
14535 }
14536 tokadd(p, c);
14537 }
14538 terminate:
14539 if (*enc) *encp = *enc;
14540 return c;
14541}
14542
14543static inline rb_strterm_t *
14544new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
14545{
14546 return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
14547}
14548
14549/* imemo_parser_strterm for literal */
14550#define NEW_STRTERM(func, term, paren) \
14551 new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
14552
14553#ifdef RIPPER
14554static void
14556{
14557 VALUE content = yylval.val;
14558 if (!ripper_is_node_yylval(content))
14559 content = ripper_new_yylval(p, 0, 0, content);
14560 if (has_delayed_token(p)) {
14561 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
14562 if (len > 0) {
14563 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
14564 }
14566 p->lex.ptok = p->lex.pcur;
14567 RNODE(content)->nd_rval = yylval.val;
14568 }
14570 if (yylval.val != content)
14571 RNODE(content)->nd_rval = yylval.val;
14572 yylval.val = content;
14573}
14574#else
14575#define flush_string_content(p, enc) ((void)(enc))
14576#endif
14577
14578RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
14579/* this can be shared with ripper, since it's independent from struct
14580 * parser_params. */
14581#ifndef RIPPER
14582#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
14583#define SPECIAL_PUNCT(idx) ( \
14584 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
14585 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
14586 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
14587 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
14588 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
14589 BIT('0', idx))
14590const unsigned int ruby_global_name_punct_bits[] = {
14591 SPECIAL_PUNCT(0),
14592 SPECIAL_PUNCT(1),
14593 SPECIAL_PUNCT(2),
14594};
14595#undef BIT
14596#undef SPECIAL_PUNCT
14597#endif
14598
14599static enum yytokentype
14600parser_peek_variable_name(struct parser_params *p)
14601{
14602 int c;
14603 const char *ptr = p->lex.pcur;
14604
14605 if (ptr + 1 >= p->lex.pend) return 0;
14606 c = *ptr++;
14607 switch (c) {
14608 case '$':
14609 if ((c = *ptr) == '-') {
14610 if (++ptr >= p->lex.pend) return 0;
14611 c = *ptr;
14612 }
14613 else if (is_global_name_punct(c) || ISDIGIT(c)) {
14614 return tSTRING_DVAR;
14615 }
14616 break;
14617 case '@':
14618 if ((c = *ptr) == '@') {
14619 if (++ptr >= p->lex.pend) return 0;
14620 c = *ptr;
14621 }
14622 break;
14623 case '{':
14624 p->lex.pcur = ptr;
14625 p->command_start = TRUE;
14626 return tSTRING_DBEG;
14627 default:
14628 return 0;
14629 }
14630 if (!ISASCII(c) || c == '_' || ISALPHA(c))
14631 return tSTRING_DVAR;
14632 return 0;
14633}
14634
14635#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
14636#define IS_END() IS_lex_state(EXPR_END_ANY)
14637#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
14638#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
14639#define IS_LABEL_POSSIBLE() (\
14640 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
14641 IS_ARG())
14642#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
14643#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
14644
14645static inline enum yytokentype
14646parser_string_term(struct parser_params *p, int func)
14647{
14648 p->lex.strterm = 0;
14649 if (func & STR_FUNC_REGEXP) {
14650 set_yylval_num(regx_options(p));
14651 dispatch_scan_event(p, tREGEXP_END);
14652 SET_LEX_STATE(EXPR_END);
14653 return tREGEXP_END;
14654 }
14655 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
14656 nextc(p);
14657 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
14658 return tLABEL_END;
14659 }
14660 SET_LEX_STATE(EXPR_END);
14661 return tSTRING_END;
14662}
14663
14664static enum yytokentype
14665parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
14666{
14667 int func = (int)quote->u1.func;
14668 int term = (int)quote->u3.term;
14669 int paren = (int)quote->u2.paren;
14670 int c, space = 0;
14671 rb_encoding *enc = p->enc;
14672 rb_encoding *base_enc = 0;
14673 VALUE lit;
14674
14675 if (func & STR_FUNC_TERM) {
14676 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
14677 SET_LEX_STATE(EXPR_END);
14678 p->lex.strterm = 0;
14679 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
14680 }
14681 c = nextc(p);
14682 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
14683 do {c = nextc(p);} while (ISSPACE(c));
14684 space = 1;
14685 }
14686 if (func & STR_FUNC_LIST) {
14687 quote->u1.func &= ~STR_FUNC_LIST;
14688 space = 1;
14689 }
14690 if (c == term && !quote->u0.nest) {
14691 if (func & STR_FUNC_QWORDS) {
14692 quote->u1.func |= STR_FUNC_TERM;
14693 pushback(p, c); /* dispatch the term at tSTRING_END */
14694 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
14695 return ' ';
14696 }
14697 return parser_string_term(p, func);
14698 }
14699 if (space) {
14700 pushback(p, c);
14701 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
14702 return ' ';
14703 }
14704 newtok(p);
14705 if ((func & STR_FUNC_EXPAND) && c == '#') {
14706 int t = parser_peek_variable_name(p);
14707 if (t) return t;
14708 tokadd(p, '#');
14709 c = nextc(p);
14710 }
14711 pushback(p, c);
14712 if (tokadd_string(p, func, term, paren, &quote->u0.nest,
14713 &enc, &base_enc) == -1) {
14714 if (p->eofp) {
14715#ifndef RIPPER
14716# define unterminated_literal(mesg) yyerror0(mesg)
14717#else
14718# define unterminated_literal(mesg) compile_error(p, mesg)
14719#endif
14720 literal_flush(p, p->lex.pcur);
14721 if (func & STR_FUNC_QWORDS) {
14722 /* no content to add, bailing out here */
14723 unterminated_literal("unterminated list meets end of file");
14724 p->lex.strterm = 0;
14725 return tSTRING_END;
14726 }
14727 if (func & STR_FUNC_REGEXP) {
14728 unterminated_literal("unterminated regexp meets end of file");
14729 }
14730 else {
14731 unterminated_literal("unterminated string meets end of file");
14732 }
14733 quote->u1.func |= STR_FUNC_TERM;
14734 }
14735 }
14736
14737 tokfix(p);
14738 lit = STR_NEW3(tok(p), toklen(p), enc, func);
14739 set_yylval_str(lit);
14740 flush_string_content(p, enc);
14741
14742 return tSTRING_CONTENT;
14743}
14744
14745static enum yytokentype
14746heredoc_identifier(struct parser_params *p)
14747{
14748 /*
14749 * term_len is length of `<<"END"` except `END`,
14750 * in this case term_len is 4 (<, <, " and ").
14751 */
14752 long len, offset = p->lex.pcur - p->lex.pbeg;
14753 int c = nextc(p), term, func = 0, quote = 0;
14754 enum yytokentype token = tSTRING_BEG;
14755 int indent = 0;
14756
14757 if (c == '-') {
14758 c = nextc(p);
14759 func = STR_FUNC_INDENT;
14760 offset++;
14761 }
14762 else if (c == '~') {
14763 c = nextc(p);
14764 func = STR_FUNC_INDENT;
14765 offset++;
14766 indent = INT_MAX;
14767 }
14768 switch (c) {
14769 case '\'':
14770 func |= str_squote; goto quoted;
14771 case '"':
14772 func |= str_dquote; goto quoted;
14773 case '`':
14775 func |= str_xquote; goto quoted;
14776
14777 quoted:
14778 quote++;
14779 offset++;
14780 term = c;
14781 len = 0;
14782 while ((c = nextc(p)) != term) {
14783 if (c == -1 || c == '\r' || c == '\n') {
14784 yyerror(NULL, p, "unterminated here document identifier");
14785 return -1;
14786 }
14787 }
14788 break;
14789
14790 default:
14791 if (!parser_is_identchar(p)) {
14792 pushback(p, c);
14793 if (func & STR_FUNC_INDENT) {
14794 pushback(p, indent > 0 ? '~' : '-');
14795 }
14796 return 0;
14797 }
14798 func |= str_dquote;
14799 do {
14800 int n = parser_precise_mbclen(p, p->lex.pcur-1);
14801 if (n < 0) return 0;
14802 p->lex.pcur += --n;
14803 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
14804 pushback(p, c);
14805 break;
14806 }
14807
14808 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
14809 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
14810 yyerror(NULL, p, "too long here document identifier");
14812 lex_goto_eol(p);
14813
14814 p->lex.strterm = new_strterm(0, 0, 0, p->lex.lastline);
14817 here->offset = offset;
14818 here->sourceline = p->ruby_sourceline;
14819 here->length = (int)len;
14820 here->quote = quote;
14821 here->func = func;
14822
14823 token_flush(p);
14824 p->heredoc_indent = indent;
14825 p->heredoc_line_indent = 0;
14826 return token;
14827}
14828
14829static void
14830heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
14831{
14832 VALUE line;
14833
14834 p->lex.strterm = 0;
14835 line = here->lastline;
14836 p->lex.lastline = line;
14837 p->lex.pbeg = RSTRING_PTR(line);
14838 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
14839 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
14840 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
14842 p->ruby_sourceline = (int)here->sourceline;
14843 if (p->eofp) p->lex.nextline = Qnil;
14844 p->eofp = 0;
14845}
14846
14847static int
14848dedent_string(VALUE string, int width)
14849{
14850 char *str;
14851 long len;
14852 int i, col = 0;
14853
14854 RSTRING_GETMEM(string, str, len);
14855 for (i = 0; i < len && col < width; i++) {
14856 if (str[i] == ' ') {
14857 col++;
14858 }
14859 else if (str[i] == '\t') {
14860 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
14861 if (n > width) break;
14862 col = n;
14863 }
14864 else {
14865 break;
14866 }
14867 }
14868 if (!i) return 0;
14869 rb_str_modify(string);
14870 str = RSTRING_PTR(string);
14871 if (RSTRING_LEN(string) != len)
14872 rb_fatal("literal string changed: %+"PRIsVALUE, string);
14873 MEMMOVE(str, str + i, char, len - i);
14874 rb_str_set_len(string, len - i);
14875 return i;
14876}
14877
14878#ifndef RIPPER
14879static NODE *
14880heredoc_dedent(struct parser_params *p, NODE *root)
14881{
14882 NODE *node, *str_node, *prev_node;
14883 int indent = p->heredoc_indent;
14884 VALUE prev_lit = 0;
14885
14886 if (indent <= 0) return root;
14887 p->heredoc_indent = 0;
14888 if (!root) return root;
14889
14890 prev_node = node = str_node = root;
14891 if (nd_type(root) == NODE_LIST) str_node = root->nd_head;
14892
14893 while (str_node) {
14894 VALUE lit = str_node->nd_lit;
14895 if (str_node->flags & NODE_FL_NEWLINE) {
14896 dedent_string(lit, indent);
14897 }
14898 if (!prev_lit) {
14899 prev_lit = lit;
14900 }
14901 else if (!literal_concat0(p, prev_lit, lit)) {
14902 return 0;
14903 }
14904 else {
14905 NODE *end = node->nd_end;
14906 node = prev_node->nd_next = node->nd_next;
14907 if (!node) {
14908 if (nd_type(prev_node) == NODE_DSTR)
14909 nd_set_type(prev_node, NODE_STR);
14910 break;
14911 }
14912 node->nd_end = end;
14913 goto next_str;
14914 }
14915
14916 str_node = 0;
14917 while ((node = (prev_node = node)->nd_next) != 0) {
14918 next_str:
14919 if (nd_type(node) != NODE_LIST) break;
14920 if ((str_node = node->nd_head) != 0) {
14921 enum node_type type = nd_type(str_node);
14922 if (type == NODE_STR || type == NODE_DSTR) break;
14923 prev_lit = 0;
14924 str_node = 0;
14925 }
14926 }
14927 }
14928 return root;
14929}
14930#else /* RIPPER */
14931static VALUE
14932heredoc_dedent(struct parser_params *p, VALUE array)
14933{
14934 int indent = p->heredoc_indent;
14935
14936 if (indent <= 0) return array;
14937 p->heredoc_indent = 0;
14938 dispatch2(heredoc_dedent, array, INT2NUM(indent));
14939 return array;
14940}
14941
14942/*
14943 * call-seq:
14944 * Ripper.dedent_string(input, width) -> Integer
14945 *
14946 * USE OF RIPPER LIBRARY ONLY.
14947 *
14948 * Strips up to +width+ leading whitespaces from +input+,
14949 * and returns the stripped column width.
14950 */
14951static VALUE
14952parser_dedent_string(VALUE self, VALUE input, VALUE width)
14953{
14954 int wid, col;
14955
14957 wid = NUM2UINT(width);
14958 col = dedent_string(input, wid);
14959 return INT2NUM(col);
14960}
14961#endif
14962
14963static int
14964whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
14965{
14966 const char *ptr = p->lex.pbeg;
14967 long n;
14968
14969 if (indent) {
14970 while (*ptr && ISSPACE(*ptr)) ptr++;
14971 }
14972 n = p->lex.pend - (ptr + len);
14973 if (n < 0) return FALSE;
14974 if (n > 0 && ptr[len] != '\n') {
14975 if (ptr[len] != '\r') return FALSE;
14976 if (n <= 1 || ptr[len+1] != '\n') return FALSE;
14977 }
14978 return strncmp(eos, ptr, len) == 0;
14979}
14980
14981static int
14982word_match_p(struct parser_params *p, const char *word, long len)
14983{
14984 if (strncmp(p->lex.pcur, word, len)) return 0;
14985 if (p->lex.pcur + len == p->lex.pend) return 1;
14986 int c = (unsigned char)p->lex.pcur[len];
14987 if (ISSPACE(c)) return 1;
14988 switch (c) {
14989 case '\0': case '\004': case '\032': return 1;
14990 }
14991 return 0;
14992}
14993
14994#define NUM_SUFFIX_R (1<<0)
14995#define NUM_SUFFIX_I (1<<1)
14996#define NUM_SUFFIX_ALL 3
14997
14998static int
14999number_literal_suffix(struct parser_params *p, int mask)
15000{
15001 int c, result = 0;
15002 const char *lastp = p->lex.pcur;
15003
15004 while ((c = nextc(p)) != -1) {
15005 if ((mask & NUM_SUFFIX_I) && c == 'i') {
15006 result |= (mask & NUM_SUFFIX_I);
15007 mask &= ~NUM_SUFFIX_I;
15008 /* r after i, rational of complex is disallowed */
15009 mask &= ~NUM_SUFFIX_R;
15010 continue;
15011 }
15012 if ((mask & NUM_SUFFIX_R) && c == 'r') {
15013 result |= (mask & NUM_SUFFIX_R);
15014 mask &= ~NUM_SUFFIX_R;
15015 continue;
15016 }
15017 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
15018 p->lex.pcur = lastp;
15019 literal_flush(p, p->lex.pcur);
15020 return 0;
15021 }
15022 pushback(p, c);
15023 break;
15024 }
15025 return result;
15026}
15027
15028static enum yytokentype
15029set_number_literal(struct parser_params *p, VALUE v,
15030 enum yytokentype type, int suffix)
15031{
15032 if (suffix & NUM_SUFFIX_I) {
15033 v = rb_complex_raw(INT2FIX(0), v);
15034 type = tIMAGINARY;
15035 }
15037 SET_LEX_STATE(EXPR_END);
15038 return type;
15039}
15040
15041static enum yytokentype
15042set_integer_literal(struct parser_params *p, VALUE v, int suffix)
15043{
15044 enum yytokentype type = tINTEGER;
15045 if (suffix & NUM_SUFFIX_R) {
15046 v = rb_rational_raw1(v);
15047 type = tRATIONAL;
15048 }
15049 return set_number_literal(p, v, type, suffix);
15050}
15051
15052#ifdef RIPPER
15053static void
15055{
15056 VALUE str;
15057 if (has_delayed_token(p))
15059 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
15060 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
15061 lex_goto_eol(p);
15062 token_flush(p);
15063}
15064
15065#else
15066#define dispatch_heredoc_end(p) ((void)0)
15067#endif
15068
15069static enum yytokentype
15070here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
15071{
15072 int c, func, indent = 0;
15073 const char *eos, *ptr, *ptr_end;
15074 long len;
15075 VALUE str = 0;
15076 rb_encoding *enc = p->enc;
15077 rb_encoding *base_enc = 0;
15078 int bol;
15079
15080 eos = RSTRING_PTR(here->lastline) + here->offset;
15081 len = here->length;
15082 indent = (func = here->func) & STR_FUNC_INDENT;
15083
15084 if ((c = nextc(p)) == -1) {
15085 error:
15086#ifdef RIPPER
15087 if (!has_delayed_token(p)) {
15089 }
15090 else {
15091 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
15092 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
15093 int cr = ENC_CODERANGE_UNKNOWN;
15095 if (cr != ENC_CODERANGE_7BIT &&
15096 p->enc == rb_usascii_encoding() &&
15097 enc != rb_utf8_encoding()) {
15099 }
15100 }
15101 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
15102 }
15104 }
15105 lex_goto_eol(p);
15106#endif
15107 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15108 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
15109 (int)len, eos);
15110 token_flush(p);
15111 p->lex.strterm = 0;
15112 SET_LEX_STATE(EXPR_END);
15113 return tSTRING_END;
15114 }
15115 bol = was_bol(p);
15116 if (!bol) {
15117 /* not beginning of line, cannot be the terminator */
15118 }
15119 else if (p->heredoc_line_indent == -1) {
15120 /* `heredoc_line_indent == -1` means
15121 * - "after an interpolation in the same line", or
15122 * - "in a continuing line"
15123 */
15124 p->heredoc_line_indent = 0;
15125 }
15126 else if (whole_match_p(p, eos, len, indent)) {
15128 restore:
15129 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15130 token_flush(p);
15131 p->lex.strterm = 0;
15132 SET_LEX_STATE(EXPR_END);
15133 return tSTRING_END;
15134 }
15135
15136 if (!(func & STR_FUNC_EXPAND)) {
15137 do {
15139 ptr_end = p->lex.pend;
15140 if (ptr_end > ptr) {
15141 switch (ptr_end[-1]) {
15142 case '\n':
15143 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
15144 ptr_end++;
15145 break;
15146 }
15147 case '\r':
15148 --ptr_end;
15149 }
15150 }
15151
15152 if (p->heredoc_indent > 0) {
15153 long i = 0;
15154 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
15155 i++;
15156 p->heredoc_line_indent = 0;
15157 }
15158
15159 if (str)
15160 rb_str_cat(str, ptr, ptr_end - ptr);
15161 else
15162 str = STR_NEW(ptr, ptr_end - ptr);
15163 if (ptr_end < p->lex.pend) rb_str_cat(str, "\n", 1);
15164 lex_goto_eol(p);
15165 if (p->heredoc_indent > 0) {
15166 goto flush_str;
15167 }
15168 if (nextc(p) == -1) {
15169 if (str) {
15170 str = 0;
15171 }
15172 goto error;
15173 }
15174 } while (!whole_match_p(p, eos, len, indent));
15175 }
15176 else {
15177 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
15178 newtok(p);
15179 if (c == '#') {
15180 int t = parser_peek_variable_name(p);
15181 if (p->heredoc_line_indent != -1) {
15182 if (p->heredoc_indent > p->heredoc_line_indent) {
15184 }
15185 p->heredoc_line_indent = -1;
15186 }
15187 if (t) return t;
15188 tokadd(p, '#');
15189 c = nextc(p);
15190 }
15191 do {
15192 pushback(p, c);
15193 enc = p->enc;
15194 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
15195 if (p->eofp) goto error;
15196 goto restore;
15197 }
15198 if (c != '\n') {
15199 if (c == '\\') p->heredoc_line_indent = -1;
15200 flush:
15201 str = STR_NEW3(tok(p), toklen(p), enc, func);
15202 flush_str:
15204#ifndef RIPPER
15205 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15206#endif
15208 return tSTRING_CONTENT;
15209 }
15210 tokadd(p, nextc(p));
15211 if (p->heredoc_indent > 0) {
15212 lex_goto_eol(p);
15213 goto flush;
15214 }
15215 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
15216 if ((c = nextc(p)) == -1) goto error;
15217 } while (!whole_match_p(p, eos, len, indent));
15218 str = STR_NEW3(tok(p), toklen(p), enc, func);
15219 }
15221#ifdef RIPPER
15222 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
15223 yylval.val, str);
15224#endif
15225 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15226 token_flush(p);
15227 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
15229#ifndef RIPPER
15230 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15231#endif
15232 return tSTRING_CONTENT;
15233}
15234
15235#include "lex.c"
15236
15237static int
15238arg_ambiguous(struct parser_params *p, char c)
15239{
15240#ifndef RIPPER
15241 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
15242#else
15243 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
15244#endif
15245 return TRUE;
15246}
15247
15248static ID
15249formal_argument(struct parser_params *p, ID lhs)
15250{
15251 switch (id_type(lhs)) {
15252 case ID_LOCAL:
15253 break;
15254#ifndef RIPPER
15255 case ID_CONST:
15256 yyerror0("formal argument cannot be a constant");
15257 return 0;
15258 case ID_INSTANCE:
15259 yyerror0("formal argument cannot be an instance variable");
15260 return 0;
15261 case ID_GLOBAL:
15262 yyerror0("formal argument cannot be a global variable");
15263 return 0;
15264 case ID_CLASS:
15265 yyerror0("formal argument cannot be a class variable");
15266 return 0;
15267 default:
15268 yyerror0("formal argument must be local variable");
15269 return 0;
15270#else
15271 default:
15272 lhs = dispatch1(param_error, lhs);
15273 ripper_error(p);
15274 return 0;
15275#endif
15276 }
15277 shadowing_lvar(p, lhs);
15278 return lhs;
15279}
15280
15281static int
15282lvar_defined(struct parser_params *p, ID id)
15283{
15284 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
15285}
15286
15287/* emacsen -*- hack */
15288static long
15289parser_encode_length(struct parser_params *p, const char *name, long len)
15290{
15291 long nlen;
15292
15293 if (len > 5 && name[nlen = len - 5] == '-') {
15294 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
15295 return nlen;
15296 }
15297 if (len > 4 && name[nlen = len - 4] == '-') {
15298 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
15299 return nlen;
15300 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
15301 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
15302 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
15303 return nlen;
15304 }
15305 return len;
15306}
15307
15308static void
15309parser_set_encode(struct parser_params *p, const char *name)
15310{
15311 int idx = rb_enc_find_index(name);
15313 VALUE excargs[3];
15314
15315 if (idx < 0) {
15316 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
15317 error:
15318 excargs[0] = rb_eArgError;
15319 excargs[2] = rb_make_backtrace();
15321 rb_exc_raise(rb_make_exception(3, excargs));
15322 }
15323 enc = rb_enc_from_index(idx);
15324 if (!rb_enc_asciicompat(enc)) {
15325 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
15326 goto error;
15327 }
15328 p->enc = enc;
15329#ifndef RIPPER
15330 if (p->debug_lines) {
15331 VALUE lines = p->debug_lines;
15332 long i, n = RARRAY_LEN(lines);
15333 for (i = 0; i < n; ++i) {
15334 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
15335 }
15336 }
15337#endif
15338}
15339
15340static int
15341comment_at_top(struct parser_params *p)
15342{
15343 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
15344 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
15345 while (ptr < ptr_end) {
15346 if (!ISSPACE(*ptr)) return 0;
15347 ptr++;
15348 }
15349 return 1;
15350}
15351
15352typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
15353typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
15354
15355static void
15356magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
15357{
15358 if (!comment_at_top(p)) {
15359 return;
15360 }
15361 parser_set_encode(p, val);
15362}
15363
15364static int
15365parser_get_bool(struct parser_params *p, const char *name, const char *val)
15366{
15367 switch (*val) {
15368 case 't': case 'T':
15369 if (strcasecmp(val, "true") == 0) {
15370 return TRUE;
15371 }
15372 break;
15373 case 'f': case 'F':
15374 if (strcasecmp(val, "false") == 0) {
15375 return FALSE;
15376 }
15377 break;
15378 }
15379 rb_compile_warning(p->ruby_sourcefile, p->ruby_sourceline, "invalid value for %s: %s", name, val);
15380 return -1;
15381}
15382
15383static void
15384parser_set_token_info(struct parser_params *p, const char *name, const char *val)
15385{
15386 int b = parser_get_bool(p, name, val);
15387 if (b >= 0) p->token_info_enabled = b;
15388}
15389
15390static void
15391parser_set_compile_option_flag(struct parser_params *p, const char *name, const char *val)
15392{
15393 int b;
15394
15395 if (p->token_seen) {
15396 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
15397 return;
15398 }
15399
15400 b = parser_get_bool(p, name, val);
15401 if (b < 0) return;
15402
15403 if (!p->compile_option)
15406 (b ? Qtrue : Qfalse));
15407}
15408
15409# if WARN_PAST_SCOPE
15410static void
15411parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
15412{
15413 int b = parser_get_bool(p, name, val);
15414 if (b >= 0) p->past_scope_enabled = b;
15415}
15416# endif
15417
15418struct magic_comment {
15419 const char *name;
15422};
15423
15424static const struct magic_comment magic_comments[] = {
15425 {"coding", magic_comment_encoding, parser_encode_length},
15426 {"encoding", magic_comment_encoding, parser_encode_length},
15427 {"frozen_string_literal", parser_set_compile_option_flag},
15428 {"warn_indent", parser_set_token_info},
15429# if WARN_PAST_SCOPE
15430 {"warn_past_scope", parser_set_past_scope},
15431# endif
15432};
15433
15434static const char *
15435magic_comment_marker(const char *str, long len)
15436{
15437 long i = 2;
15438
15439 while (i < len) {
15440 switch (str[i]) {
15441 case '-':
15442 if (str[i-1] == '*' && str[i-2] == '-') {
15443 return str + i + 1;
15444 }
15445 i += 2;
15446 break;
15447 case '*':
15448 if (i + 1 >= len) return 0;
15449 if (str[i+1] != '-') {
15450 i += 4;
15451 }
15452 else if (str[i-1] != '-') {
15453 i += 2;
15454 }
15455 else {
15456 return str + i + 2;
15457 }
15458 break;
15459 default:
15460 i += 3;
15461 break;
15462 }
15463 }
15464 return 0;
15465}
15466
15467static int
15468parser_magic_comment(struct parser_params *p, const char *str, long len)
15469{
15470 int indicator = 0;
15471 VALUE name = 0, val = 0;
15472 const char *beg, *end, *vbeg, *vend;
15473#define str_copy(_s, _p, _n) ((_s) \
15474 ? (void)(rb_str_resize((_s), (_n)), \
15475 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
15476 : (void)((_s) = STR_NEW((_p), (_n))))
15477
15478 if (len <= 7) return FALSE;
15479 if (!!(beg = magic_comment_marker(str, len))) {
15480 if (!(end = magic_comment_marker(beg, str + len - beg)))
15481 return FALSE;
15482 indicator = TRUE;
15483 str = beg;
15484 len = end - beg - 3;
15485 }
15486
15487 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
15488 while (len > 0) {
15489 const struct magic_comment *mc = magic_comments;
15490 char *s;
15491 int i;
15492 long n = 0;
15493
15494 for (; len > 0 && *str; str++, --len) {
15495 switch (*str) {
15496 case '\'': case '"': case ':': case ';':
15497 continue;
15498 }
15499 if (!ISSPACE(*str)) break;
15500 }
15501 for (beg = str; len > 0; str++, --len) {
15502 switch (*str) {
15503 case '\'': case '"': case ':': case ';':
15504 break;
15505 default:
15506 if (ISSPACE(*str)) break;
15507 continue;
15508 }
15509 break;
15510 }
15511 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
15512 if (!len) break;
15513 if (*str != ':') {
15514 if (!indicator) return FALSE;
15515 continue;
15516 }
15517
15518 do str++; while (--len > 0 && ISSPACE(*str));
15519 if (!len) break;
15520 if (*str == '"') {
15521 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
15522 if (*str == '\\') {
15523 --len;
15524 ++str;
15525 }
15526 }
15527 vend = str;
15528 if (len) {
15529 --len;
15530 ++str;
15531 }
15532 }
15533 else {
15534 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
15535 vend = str;
15536 }
15537 if (indicator) {
15538 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
15539 }
15540 else {
15541 while (len > 0 && (ISSPACE(*str))) --len, str++;
15542 if (len) return FALSE;
15543 }
15544
15545 n = end - beg;
15546 str_copy(name, beg, n);
15547 s = RSTRING_PTR(name);
15548 for (i = 0; i < n; ++i) {
15549 if (s[i] == '-') s[i] = '_';
15550 }
15551 do {
15552 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
15553 n = vend - vbeg;
15554 if (mc->length) {
15555 n = (*mc->length)(p, vbeg, n);
15556 }
15557 str_copy(val, vbeg, n);
15558 (*mc->func)(p, mc->name, RSTRING_PTR(val));
15559 break;
15560 }
15561 } while (++mc < magic_comments + numberof(magic_comments));
15562#ifdef RIPPER
15563 str_copy(val, vbeg, vend - vbeg);
15564 dispatch2(magic_comment, name, val);
15565#endif
15566 }
15567
15568 return TRUE;
15569}
15570
15571static void
15572set_file_encoding(struct parser_params *p, const char *str, const char *send)
15573{
15574 int sep = 0;
15575 const char *beg = str;
15576 VALUE s;
15577
15578 for (;;) {
15579 if (send - str <= 6) return;
15580 switch (str[6]) {
15581 case 'C': case 'c': str += 6; continue;
15582 case 'O': case 'o': str += 5; continue;
15583 case 'D': case 'd': str += 4; continue;
15584 case 'I': case 'i': str += 3; continue;
15585 case 'N': case 'n': str += 2; continue;
15586 case 'G': case 'g': str += 1; continue;
15587 case '=': case ':':
15588 sep = 1;
15589 str += 6;
15590 break;
15591 default:
15592 str += 6;
15593 if (ISSPACE(*str)) break;
15594 continue;
15595 }
15596 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
15597 }
15598 for (;;) {
15599 do {
15600 if (++str >= send) return;
15601 } while (ISSPACE(*str));
15602 if (sep) break;
15603 if (*str != '=' && *str != ':') return;
15604 sep = 1;
15605 str++;
15606 }
15607 beg = str;
15608 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
15609 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
15610 parser_set_encode(p, RSTRING_PTR(s));
15611 rb_str_resize(s, 0);
15612}
15613
15614static void
15615parser_prepare(struct parser_params *p)
15616{
15617 int c = nextc(p);
15619 switch (c) {
15620 case '#':
15621 if (peek(p, '!')) p->has_shebang = 1;
15622 break;
15623 case 0xef: /* UTF-8 BOM marker */
15624 if (p->lex.pend - p->lex.pcur >= 2 &&
15625 (unsigned char)p->lex.pcur[0] == 0xbb &&
15626 (unsigned char)p->lex.pcur[1] == 0xbf) {
15627 p->enc = rb_utf8_encoding();
15628 p->lex.pcur += 2;
15629 p->lex.pbeg = p->lex.pcur;
15630 return;
15631 }
15632 break;
15633 case EOF:
15634 return;
15635 }
15636 pushback(p, c);
15637 p->enc = rb_enc_get(p->lex.lastline);
15638}
15639
15640#ifndef RIPPER
15641#define ambiguous_operator(tok, op, syn) ( \
15642 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
15643 rb_warning0("even though it seems like "syn""))
15644#else
15645#define ambiguous_operator(tok, op, syn) \
15646 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
15647#endif
15648#define warn_balanced(tok, op, syn) ((void) \
15649 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
15650 space_seen && !ISSPACE(c) && \
15651 (ambiguous_operator(tok, op, syn), 0)), \
15652 (enum yytokentype)(tok))
15653
15654static VALUE
15655parse_rational(struct parser_params *p, char *str, int len, int seen_point)
15656{
15657 VALUE v;
15658 char *point = &str[seen_point];
15659 size_t fraclen = len-seen_point-1;
15660 memmove(point, point+1, fraclen+1);
15661 v = rb_cstr_to_inum(str, 10, FALSE);
15662 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
15663}
15664
15665static enum yytokentype
15666no_digits(struct parser_params *p)
15667{
15668 yyerror0("numeric literal without digits");
15669 if (peek(p, '_')) nextc(p);
15670 /* dummy 0, for tUMINUS_NUM at numeric */
15671 return set_integer_literal(p, INT2FIX(0), 0);
15672}
15673
15674static enum yytokentype
15675parse_numeric(struct parser_params *p, int c)
15676{
15677 int is_float, seen_point, seen_e, nondigit;
15678 int suffix;
15679
15680 is_float = seen_point = seen_e = nondigit = 0;
15681 SET_LEX_STATE(EXPR_END);
15682 newtok(p);
15683 if (c == '-' || c == '+') {
15684 tokadd(p, c);
15685 c = nextc(p);
15686 }
15687 if (c == '0') {
15688 int start = toklen(p);
15689 c = nextc(p);
15690 if (c == 'x' || c == 'X') {
15691 /* hexadecimal */
15692 c = nextc(p);
15693 if (c != -1 && ISXDIGIT(c)) {
15694 do {
15695 if (c == '_') {
15696 if (nondigit) break;
15697 nondigit = c;
15698 continue;
15699 }
15700 if (!ISXDIGIT(c)) break;
15701 nondigit = 0;
15702 tokadd(p, c);
15703 } while ((c = nextc(p)) != -1);
15704 }
15705 pushback(p, c);
15706 tokfix(p);
15707 if (toklen(p) == start) {
15708 return no_digits(p);
15709 }
15710 else if (nondigit) goto trailing_uc;
15711 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
15712 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
15713 }
15714 if (c == 'b' || c == 'B') {
15715 /* binary */
15716 c = nextc(p);
15717 if (c == '0' || c == '1') {
15718 do {
15719 if (c == '_') {
15720 if (nondigit) break;
15721 nondigit = c;
15722 continue;
15723 }
15724 if (c != '0' && c != '1') break;
15725 nondigit = 0;
15726 tokadd(p, c);
15727 } while ((c = nextc(p)) != -1);
15728 }
15729 pushback(p, c);
15730 tokfix(p);
15731 if (toklen(p) == start) {
15732 return no_digits(p);
15733 }
15734 else if (nondigit) goto trailing_uc;
15735 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
15736 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
15737 }
15738 if (c == 'd' || c == 'D') {
15739 /* decimal */
15740 c = nextc(p);
15741 if (c != -1 && ISDIGIT(c)) {
15742 do {
15743 if (c == '_') {
15744 if (nondigit) break;
15745 nondigit = c;
15746 continue;
15747 }
15748 if (!ISDIGIT(c)) break;
15749 nondigit = 0;
15750 tokadd(p, c);
15751 } while ((c = nextc(p)) != -1);
15752 }
15753 pushback(p, c);
15754 tokfix(p);
15755 if (toklen(p) == start) {
15756 return no_digits(p);
15757 }
15758 else if (nondigit) goto trailing_uc;
15759 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
15760 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
15761 }
15762 if (c == '_') {
15763 /* 0_0 */
15764 goto octal_number;
15765 }
15766 if (c == 'o' || c == 'O') {
15767 /* prefixed octal */
15768 c = nextc(p);
15769 if (c == -1 || c == '_' || !ISDIGIT(c)) {
15770 return no_digits(p);
15771 }
15772 }
15773 if (c >= '0' && c <= '7') {
15774 /* octal */
15775 octal_number:
15776 do {
15777 if (c == '_') {
15778 if (nondigit) break;
15779 nondigit = c;
15780 continue;
15781 }
15782 if (c < '0' || c > '9') break;
15783 if (c > '7') goto invalid_octal;
15784 nondigit = 0;
15785 tokadd(p, c);
15786 } while ((c = nextc(p)) != -1);
15787 if (toklen(p) > start) {
15788 pushback(p, c);
15789 tokfix(p);
15790 if (nondigit) goto trailing_uc;
15791 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
15792 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
15793 }
15794 if (nondigit) {
15795 pushback(p, c);
15796 goto trailing_uc;
15797 }
15798 }
15799 if (c > '7' && c <= '9') {
15800 invalid_octal:
15801 yyerror0("Invalid octal digit");
15802 }
15803 else if (c == '.' || c == 'e' || c == 'E') {
15804 tokadd(p, '0');
15805 }
15806 else {
15807 pushback(p, c);
15808 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
15809 return set_integer_literal(p, INT2FIX(0), suffix);
15810 }
15811 }
15812
15813 for (;;) {
15814 switch (c) {
15815 case '0': case '1': case '2': case '3': case '4':
15816 case '5': case '6': case '7': case '8': case '9':
15817 nondigit = 0;
15818 tokadd(p, c);
15819 break;
15820
15821 case '.':
15822 if (nondigit) goto trailing_uc;
15823 if (seen_point || seen_e) {
15824 goto decode_num;
15825 }
15826 else {
15827 int c0 = nextc(p);
15828 if (c0 == -1 || !ISDIGIT(c0)) {
15829 pushback(p, c0);
15830 goto decode_num;
15831 }
15832 c = c0;
15833 }
15834 seen_point = toklen(p);
15835 tokadd(p, '.');
15836 tokadd(p, c);
15837 is_float++;
15838 nondigit = 0;
15839 break;
15840
15841 case 'e':
15842 case 'E':
15843 if (nondigit) {
15844 pushback(p, c);
15845 c = nondigit;
15846 goto decode_num;
15847 }
15848 if (seen_e) {
15849 goto decode_num;
15850 }
15851 nondigit = c;
15852 c = nextc(p);
15853 if (c != '-' && c != '+' && !ISDIGIT(c)) {
15854 pushback(p, c);
15855 nondigit = 0;
15856 goto decode_num;
15857 }
15858 tokadd(p, nondigit);
15859 seen_e++;
15860 is_float++;
15861 tokadd(p, c);
15862 nondigit = (c == '-' || c == '+') ? c : 0;
15863 break;
15864
15865 case '_': /* `_' in number just ignored */
15866 if (nondigit) goto decode_num;
15867 nondigit = c;
15868 break;
15869
15870 default:
15871 goto decode_num;
15872 }
15873 c = nextc(p);
15874 }
15875
15876 decode_num:
15877 pushback(p, c);
15878 if (nondigit) {
15879 trailing_uc:
15880 literal_flush(p, p->lex.pcur - 1);
15881 YYLTYPE loc = RUBY_INIT_YYLLOC();
15882 compile_error(p, "trailing `%c' in number", nondigit);
15883 parser_show_error_line(p, &loc);
15884 }
15885 tokfix(p);
15886 if (is_float) {
15887 enum yytokentype type = tFLOAT;
15888 VALUE v;
15889
15890 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
15891 if (suffix & NUM_SUFFIX_R) {
15892 type = tRATIONAL;
15893 v = parse_rational(p, tok(p), toklen(p), seen_point);
15894 }
15895 else {
15896 double d = strtod(tok(p), 0);
15897 if (errno == ERANGE) {
15898 rb_warning1("Float %s out of range", WARN_S(tok(p)));
15899 errno = 0;
15900 }
15901 v = DBL2NUM(d);
15902 }
15903 return set_number_literal(p, v, type, suffix);
15904 }
15905 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
15906 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
15907}
15908
15909static enum yytokentype
15910parse_qmark(struct parser_params *p, int space_seen)
15911{
15912 rb_encoding *enc;
15913 register int c;
15914 VALUE lit;
15915
15916 if (IS_END()) {
15918 return '?';
15919 }
15920 c = nextc(p);
15921 if (c == -1) {
15922 compile_error(p, "incomplete character syntax");
15923 return 0;
15924 }
15925 if (rb_enc_isspace(c, p->enc)) {
15926 if (!IS_ARG()) {
15927 int c2 = escaped_control_code(c);
15928 if (c2) {
15929 WARN_SPACE_CHAR(c2, "?");
15930 }
15931 }
15932 ternary:
15933 pushback(p, c);
15935 return '?';
15936 }
15937 newtok(p);
15938 enc = p->enc;
15939 if (!parser_isascii(p)) {
15940 if (tokadd_mbchar(p, c) == -1) return 0;
15941 }
15942 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
15943 p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
15944 if (space_seen) {
15945 const char *start = p->lex.pcur - 1, *ptr = start;
15946 do {
15947 int n = parser_precise_mbclen(p, ptr);
15948 if (n < 0) return -1;
15949 ptr += n;
15950 } while (ptr < p->lex.pend && is_identchar(ptr, p->lex.pend, p->enc));
15951 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
15952 " a conditional operator, put a space after `?'",
15953 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
15954 }
15955 goto ternary;
15956 }
15957 else if (c == '\\') {
15958 if (peek(p, 'u')) {
15959 nextc(p);
15960 enc = rb_utf8_encoding();
15961 tokadd_utf8(p, &enc, -1, 0, 0);
15962 }
15963 else if (!lex_eol_p(p) && !(c = *p->lex.pcur, ISASCII(c))) {
15964 nextc(p);
15965 if (tokadd_mbchar(p, c) == -1) return 0;
15966 }
15967 else {
15968 c = read_escape(p, 0, &enc);
15969 tokadd(p, c);
15970 }
15971 }
15972 else {
15973 tokadd(p, c);
15974 }
15975 tokfix(p);
15976 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
15977 set_yylval_str(lit);
15978 SET_LEX_STATE(EXPR_END);
15979 return tCHAR;
15980}
15981
15982static enum yytokentype
15983parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
15984{
15985 register int c;
15986 const char *ptok = p->lex.pcur;
15987
15988 if (IS_BEG()) {
15989 int term;
15990 int paren;
15991
15992 c = nextc(p);
15993 quotation:
15994 if (c == -1 || !ISALNUM(c)) {
15995 term = c;
15996 c = 'Q';
15997 }
15998 else {
15999 term = nextc(p);
16000 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
16001 yyerror0("unknown type of %string");
16002 return 0;
16003 }
16004 }
16005 if (c == -1 || term == -1) {
16006 compile_error(p, "unterminated quoted string meets end of file");
16007 return 0;
16008 }
16009 paren = term;
16010 if (term == '(') term = ')';
16011 else if (term == '[') term = ']';
16012 else if (term == '{') term = '}';
16013 else if (term == '<') term = '>';
16014 else paren = 0;
16015
16016 p->lex.ptok = ptok-1;
16017 switch (c) {
16018 case 'Q':
16019 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
16020 return tSTRING_BEG;
16021
16022 case 'q':
16023 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
16024 return tSTRING_BEG;
16025
16026 case 'W':
16027 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16028 return tWORDS_BEG;
16029
16030 case 'w':
16031 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16032 return tQWORDS_BEG;
16033
16034 case 'I':
16035 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16036 return tSYMBOLS_BEG;
16037
16038 case 'i':
16039 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16040 return tQSYMBOLS_BEG;
16041
16042 case 'x':
16043 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
16044 return tXSTRING_BEG;
16045
16046 case 'r':
16047 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
16048 return tREGEXP_BEG;
16049
16050 case 's':
16051 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
16052 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
16053 return tSYMBEG;
16054
16055 default:
16056 yyerror0("unknown type of %string");
16057 return 0;
16058 }
16059 }
16060 if ((c = nextc(p)) == '=') {
16061 set_yylval_id('%');
16062 SET_LEX_STATE(EXPR_BEG);
16063 return tOP_ASGN;
16064 }
16065 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
16066 goto quotation;
16067 }
16068 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16069 pushback(p, c);
16070 return warn_balanced('%', "%%", "string literal");
16071}
16072
16073static int
16074tokadd_ident(struct parser_params *p, int c)
16075{
16076 do {
16077 if (tokadd_mbchar(p, c) == -1) return -1;
16078 c = nextc(p);
16079 } while (parser_is_identchar(p));
16080 pushback(p, c);
16081 return 0;
16082}
16083
16084static ID
16085tokenize_ident(struct parser_params *p, const enum lex_state_e last_state)
16086{
16087 ID ident = TOK_INTERN();
16088
16089 set_yylval_name(ident);
16090
16091 return ident;
16092}
16093
16094static int
16095parse_numvar(struct parser_params *p)
16096{
16097 size_t len;
16098 int overflow;
16099 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
16100 const unsigned long nth_ref_max =
16101 ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
16102 /* NTH_REF is left-shifted to be ORed with back-ref flag and
16103 * turned into a Fixnum, in compile.c */
16104
16105 if (overflow || n > nth_ref_max) {
16106 /* compile_error()? */
16107 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
16108 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
16109 }
16110 else {
16111 return (int)n;
16112 }
16113}
16114
16115static enum yytokentype
16116parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
16117{
16118 const char *ptr = p->lex.pcur;
16119 register int c;
16120
16121 SET_LEX_STATE(EXPR_END);
16122 p->lex.ptok = ptr - 1; /* from '$' */
16123 newtok(p);
16124 c = nextc(p);
16125 switch (c) {
16126 case '_': /* $_: last read line string */
16127 c = nextc(p);
16128 if (parser_is_identchar(p)) {
16129 tokadd(p, '$');
16130 tokadd(p, '_');
16131 break;
16132 }
16133 pushback(p, c);
16134 c = '_';
16135 /* fall through */
16136 case '~': /* $~: match-data */
16137 case '*': /* $*: argv */
16138 case '$': /* $$: pid */
16139 case '?': /* $?: last status */
16140 case '!': /* $!: error string */
16141 case '@': /* $@: error position */
16142 case '/': /* $/: input record separator */
16143 case '\\': /* $\: output record separator */
16144 case ';': /* $;: field separator */
16145 case ',': /* $,: output field separator */
16146 case '.': /* $.: last read line number */
16147 case '=': /* $=: ignorecase */
16148 case ':': /* $:: load path */
16149 case '<': /* $<: reading filename */
16150 case '>': /* $>: default output handle */
16151 case '\"': /* $": already loaded files */
16152 tokadd(p, '$');
16153 tokadd(p, c);
16154 goto gvar;
16155
16156 case '-':
16157 tokadd(p, '$');
16158 tokadd(p, c);
16159 c = nextc(p);
16160 if (parser_is_identchar(p)) {
16161 if (tokadd_mbchar(p, c) == -1) return 0;
16162 }
16163 else {
16164 pushback(p, c);
16165 pushback(p, '-');
16166 return '$';
16167 }
16168 gvar:
16170 return tGVAR;
16171
16172 case '&': /* $&: last match */
16173 case '`': /* $`: string before last match */
16174 case '\'': /* $': string after last match */
16175 case '+': /* $+: string matches last paren. */
16176 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
16177 tokadd(p, '$');
16178 tokadd(p, c);
16179 goto gvar;
16180 }
16181 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
16182 return tBACK_REF;
16183
16184 case '1': case '2': case '3':
16185 case '4': case '5': case '6':
16186 case '7': case '8': case '9':
16187 tokadd(p, '$');
16188 do {
16189 tokadd(p, c);
16190 c = nextc(p);
16191 } while (c != -1 && ISDIGIT(c));
16192 pushback(p, c);
16193 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
16194 tokfix(p);
16195 set_yylval_node(NEW_NTH_REF(parse_numvar(p), &_cur_loc));
16196 return tNTH_REF;
16197
16198 default:
16199 if (!parser_is_identchar(p)) {
16200 YYLTYPE loc = RUBY_INIT_YYLLOC();
16201 if (c == -1 || ISSPACE(c)) {
16202 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
16203 }
16204 else {
16205 pushback(p, c);
16206 compile_error(p, "`$%c' is not allowed as a global variable name", c);
16207 }
16208 parser_show_error_line(p, &loc);
16210 return tGVAR;
16211 }
16212 /* fall through */
16213 case '0':
16214 tokadd(p, '$');
16215 }
16216
16217 if (tokadd_ident(p, c)) return 0;
16218 SET_LEX_STATE(EXPR_END);
16219 tokenize_ident(p, last_state);
16220 return tGVAR;
16221}
16222
16223#ifndef RIPPER
16224static bool
16225parser_numbered_param(struct parser_params *p, int n)
16226{
16227 if (n < 0) return false;
16228
16230 return false;
16231 }
16232 if (p->max_numparam == ORDINAL_PARAM) {
16233 compile_error(p, "ordinary parameter is defined");
16234 return false;
16235 }
16236 struct vtable *args = p->lvtbl->args;
16237 if (p->max_numparam < n) {
16238 p->max_numparam = n;
16239 }
16240 while (n > args->pos) {
16241 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
16242 }
16243 return true;
16244}
16245#endif
16246
16247static enum yytokentype
16248parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
16249{
16250 const char *ptr = p->lex.pcur;
16251 enum yytokentype result = tIVAR;
16252 register int c = nextc(p);
16253 YYLTYPE loc;
16254
16255 p->lex.ptok = ptr - 1; /* from '@' */
16256 newtok(p);
16257 tokadd(p, '@');
16258 if (c == '@') {
16259 result = tCVAR;
16260 tokadd(p, '@');
16261 c = nextc(p);
16262 }
16263 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
16264 if (c == -1 || !parser_is_identchar(p)) {
16265 pushback(p, c);
16266 RUBY_SET_YYLLOC(loc);
16267 if (result == tIVAR) {
16268 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
16269 }
16270 else {
16271 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
16272 }
16273 parser_show_error_line(p, &loc);
16275 SET_LEX_STATE(EXPR_END);
16276 return result;
16277 }
16278 else if (ISDIGIT(c)) {
16279 pushback(p, c);
16280 RUBY_SET_YYLLOC(loc);
16281 if (result == tIVAR) {
16282 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
16283 }
16284 else {
16285 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
16286 }
16287 parser_show_error_line(p, &loc);
16289 SET_LEX_STATE(EXPR_END);
16290 return result;
16291 }
16292
16293 if (tokadd_ident(p, c)) return 0;
16294 tokenize_ident(p, last_state);
16295 return result;
16296}
16297
16298static enum yytokentype
16299parse_ident(struct parser_params *p, int c, int cmd_state)
16300{
16301 enum yytokentype result;
16302 int mb = ENC_CODERANGE_7BIT;
16303 const enum lex_state_e last_state = p->lex.state;
16304 ID ident;
16305
16306 do {
16307 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
16308 if (tokadd_mbchar(p, c) == -1) return 0;
16309 c = nextc(p);
16310 } while (parser_is_identchar(p));
16311 if ((c == '!' || c == '?') && !peek(p, '=')) {
16312 result = tFID;
16313 tokadd(p, c);
16314 }
16315 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
16316 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
16317 result = tIDENTIFIER;
16318 tokadd(p, c);
16319 }
16320 else {
16321 result = tCONSTANT; /* assume provisionally */
16322 pushback(p, c);
16323 }
16324 tokfix(p);
16325
16326 if (IS_LABEL_POSSIBLE()) {
16327 if (IS_LABEL_SUFFIX(0)) {
16328 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
16329 nextc(p);
16331 return tLABEL;
16332 }
16333 }
16334 if (mb == ENC_CODERANGE_7BIT && !IS_lex_state(EXPR_DOT)) {
16335 const struct kwtable *kw;
16336
16337 /* See if it is a reserved word. */
16338 kw = rb_reserved_word(tok(p), toklen(p));
16339 if (kw) {
16340 enum lex_state_e state = p->lex.state;
16341 if (IS_lex_state_for(state, EXPR_FNAME)) {
16342 SET_LEX_STATE(EXPR_ENDFN);
16344 return kw->id[0];
16345 }
16346 SET_LEX_STATE(kw->state);
16347 if (IS_lex_state(EXPR_BEG)) {
16348 p->command_start = TRUE;
16349 }
16350 if (kw->id[0] == keyword_do) {
16351 if (lambda_beginning_p()) {
16352 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
16353 return keyword_do_LAMBDA;
16354 }
16355 if (COND_P()) return keyword_do_cond;
16356 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
16357 return keyword_do_block;
16358 return keyword_do;
16359 }
16360 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED)))
16361 return kw->id[0];
16362 else {
16363 if (kw->id[0] != kw->id[1])
16364 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
16365 return kw->id[1];
16366 }
16367 }
16368 }
16369
16370 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
16371 if (cmd_state) {
16372 SET_LEX_STATE(EXPR_CMDARG);
16373 }
16374 else {
16375 SET_LEX_STATE(EXPR_ARG);
16376 }
16377 }
16378 else if (p->lex.state == EXPR_FNAME) {
16379 SET_LEX_STATE(EXPR_ENDFN);
16380 }
16381 else {
16382 SET_LEX_STATE(EXPR_END);
16383 }
16384
16385 ident = tokenize_ident(p, last_state);
16386 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
16387 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
16388 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
16389 lvar_defined(p, ident)) {
16390 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
16391 }
16392 return result;
16393}
16394
16395static enum yytokentype
16396parser_yylex(struct parser_params *p)
16397{
16398 register int c;
16399 int space_seen = 0;
16400 int cmd_state;
16401 int label;
16402 enum lex_state_e last_state;
16403 int fallthru = FALSE;
16404 int token_seen = p->token_seen;
16405
16406 if (p->lex.strterm) {
16407 if (p->lex.strterm->flags & STRTERM_HEREDOC) {
16408 return here_document(p, &p->lex.strterm->u.heredoc);
16409 }
16410 else {
16411 token_flush(p);
16412 return parse_string(p, &p->lex.strterm->u.literal);
16413 }
16414 }
16415 cmd_state = p->command_start;
16416 p->command_start = FALSE;
16417 p->token_seen = TRUE;
16418 retry:
16419 last_state = p->lex.state;
16420#ifndef RIPPER
16421 token_flush(p);
16422#endif
16423 switch (c = nextc(p)) {
16424 case '\0': /* NUL */
16425 case '\004': /* ^D */
16426 case '\032': /* ^Z */
16427 case -1: /* end of script. */
16428 return 0;
16429
16430 /* white spaces */
16431 case ' ': case '\t': case '\f': case '\r':
16432 case '\13': /* '\v' */
16433 space_seen = 1;
16434#ifdef RIPPER
16435 while ((c = nextc(p))) {
16436 switch (c) {
16437 case ' ': case '\t': case '\f': case '\r':
16438 case '\13': /* '\v' */
16439 break;
16440 default:
16441 goto outofloop;
16442 }
16443 }
16444 outofloop:
16445 pushback(p, c);
16447#endif
16448 goto retry;
16449
16450 case '#': /* it's a comment */
16451 p->token_seen = token_seen;
16452 /* no magic_comment in shebang line */
16453 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
16454 if (comment_at_top(p)) {
16455 set_file_encoding(p, p->lex.pcur, p->lex.pend);
16456 }
16457 }
16458 lex_goto_eol(p);
16460 fallthru = TRUE;
16461 /* fall through */
16462 case '\n':
16463 p->token_seen = token_seen;
16464 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
16465 !IS_lex_state(EXPR_LABELED));
16466 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
16467 if (!fallthru) {
16469 }
16470 fallthru = FALSE;
16471 if (!c && p->in_kwarg) {
16472 goto normal_newline;
16473 }
16474 goto retry;
16475 }
16476 while (1) {
16477 switch (c = nextc(p)) {
16478 case ' ': case '\t': case '\f': case '\r':
16479 case '\13': /* '\v' */
16480 space_seen = 1;
16481 break;
16482 case '#':
16483 pushback(p, c);
16484 if (space_seen) dispatch_scan_event(p, tSP);
16485 goto retry;
16486 case '&':
16487 case '.': {
16489 if (peek(p, '.') == (c == '&')) {
16490 pushback(p, c);
16492 goto retry;
16493 }
16494 }
16495 default:
16496 p->ruby_sourceline--;
16497 p->lex.nextline = p->lex.lastline;
16498 case -1: /* EOF no decrement*/
16499#ifndef RIPPER
16500 if (p->lex.prevline && !p->eofp) p->lex.lastline = p->lex.prevline;
16501 p->lex.pbeg = RSTRING_PTR(p->lex.lastline);
16502 p->lex.pend = p->lex.pcur = p->lex.pbeg + RSTRING_LEN(p->lex.lastline);
16503 pushback(p, 1); /* always pushback */
16504 p->lex.ptok = p->lex.pcur;
16505#else
16506 lex_goto_eol(p);
16507 if (c != -1) {
16508 p->lex.ptok = p->lex.pcur;
16509 }
16510#endif
16511 goto normal_newline;
16512 }
16513 }
16514 normal_newline:
16515 p->command_start = TRUE;
16516 SET_LEX_STATE(EXPR_BEG);
16517 return '\n';
16518
16519 case '*':
16520 if ((c = nextc(p)) == '*') {
16521 if ((c = nextc(p)) == '=') {
16523 SET_LEX_STATE(EXPR_BEG);
16524 return tOP_ASGN;
16525 }
16526 pushback(p, c);
16527 if (IS_SPCARG(c)) {
16528 rb_warning0("`**' interpreted as argument prefix");
16529 c = tDSTAR;
16530 }
16531 else if (IS_BEG()) {
16532 c = tDSTAR;
16533 }
16534 else {
16535 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
16536 }
16537 }
16538 else {
16539 if (c == '=') {
16540 set_yylval_id('*');
16541 SET_LEX_STATE(EXPR_BEG);
16542 return tOP_ASGN;
16543 }
16544 pushback(p, c);
16545 if (IS_SPCARG(c)) {
16546 rb_warning0("`*' interpreted as argument prefix");
16547 c = tSTAR;
16548 }
16549 else if (IS_BEG()) {
16550 c = tSTAR;
16551 }
16552 else {
16553 c = warn_balanced('*', "*", "argument prefix");
16554 }
16555 }
16556 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16557 return c;
16558
16559 case '!':
16560 c = nextc(p);
16561 if (IS_AFTER_OPERATOR()) {
16562 SET_LEX_STATE(EXPR_ARG);
16563 if (c == '@') {
16564 return '!';
16565 }
16566 }
16567 else {
16568 SET_LEX_STATE(EXPR_BEG);
16569 }
16570 if (c == '=') {
16571 return tNEQ;
16572 }
16573 if (c == '~') {
16574 return tNMATCH;
16575 }
16576 pushback(p, c);
16577 return '!';
16578
16579 case '=':
16580 if (was_bol(p)) {
16581 /* skip embedded rd document */
16582 if (word_match_p(p, "begin", 5)) {
16583 int first_p = TRUE;
16584
16585 lex_goto_eol(p);
16587 for (;;) {
16588 lex_goto_eol(p);
16589 if (!first_p) {
16591 }
16592 first_p = FALSE;
16593 c = nextc(p);
16594 if (c == -1) {
16595 compile_error(p, "embedded document meets end of file");
16596 return 0;
16597 }
16598 if (c == '=' && word_match_p(p, "end", 3)) {
16599 break;
16600 }
16601 pushback(p, c);
16602 }
16603 lex_goto_eol(p);
16605 goto retry;
16606 }
16607 }
16608
16609 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16610 if ((c = nextc(p)) == '=') {
16611 if ((c = nextc(p)) == '=') {
16612 return tEQQ;
16613 }
16614 pushback(p, c);
16615 return tEQ;
16616 }
16617 if (c == '~') {
16618 return tMATCH;
16619 }
16620 else if (c == '>') {
16621 return tASSOC;
16622 }
16623 pushback(p, c);
16624 return '=';
16625
16626 case '<':
16627 c = nextc(p);
16628 if (c == '<' &&
16629 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
16630 !IS_END() &&
16631 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
16632 int token = heredoc_identifier(p);
16633 if (token) return token < 0 ? 0 : token;
16634 }
16635 if (IS_AFTER_OPERATOR()) {
16636 SET_LEX_STATE(EXPR_ARG);
16637 }
16638 else {
16639 if (IS_lex_state(EXPR_CLASS))
16640 p->command_start = TRUE;
16641 SET_LEX_STATE(EXPR_BEG);
16642 }
16643 if (c == '=') {
16644 if ((c = nextc(p)) == '>') {
16645 return tCMP;
16646 }
16647 pushback(p, c);
16648 return tLEQ;
16649 }
16650 if (c == '<') {
16651 if ((c = nextc(p)) == '=') {
16653 SET_LEX_STATE(EXPR_BEG);
16654 return tOP_ASGN;
16655 }
16656 pushback(p, c);
16657 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
16658 }
16659 pushback(p, c);
16660 return '<';
16661
16662 case '>':
16663 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16664 if ((c = nextc(p)) == '=') {
16665 return tGEQ;
16666 }
16667 if (c == '>') {
16668 if ((c = nextc(p)) == '=') {
16670 SET_LEX_STATE(EXPR_BEG);
16671 return tOP_ASGN;
16672 }
16673 pushback(p, c);
16674 return tRSHFT;
16675 }
16676 pushback(p, c);
16677 return '>';
16678
16679 case '"':
16680 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
16681 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
16682 p->lex.ptok = p->lex.pcur-1;
16683 return tSTRING_BEG;
16684
16685 case '`':
16686 if (IS_lex_state(EXPR_FNAME)) {
16687 SET_LEX_STATE(EXPR_ENDFN);
16688 return c;
16689 }
16690 if (IS_lex_state(EXPR_DOT)) {
16691 if (cmd_state)
16692 SET_LEX_STATE(EXPR_CMDARG);
16693 else
16694 SET_LEX_STATE(EXPR_ARG);
16695 return c;
16696 }
16697 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
16698 return tXSTRING_BEG;
16699
16700 case '\'':
16701 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
16702 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
16703 p->lex.ptok = p->lex.pcur-1;
16704 return tSTRING_BEG;
16705
16706 case '?':
16707 return parse_qmark(p, space_seen);
16708
16709 case '&':
16710 if ((c = nextc(p)) == '&') {
16711 SET_LEX_STATE(EXPR_BEG);
16712 if ((c = nextc(p)) == '=') {
16714 SET_LEX_STATE(EXPR_BEG);
16715 return tOP_ASGN;
16716 }
16717 pushback(p, c);
16718 return tANDOP;
16719 }
16720 else if (c == '=') {
16721 set_yylval_id('&');
16722 SET_LEX_STATE(EXPR_BEG);
16723 return tOP_ASGN;
16724 }
16725 else if (c == '.') {
16727 SET_LEX_STATE(EXPR_DOT);
16728 return tANDDOT;
16729 }
16730 pushback(p, c);
16731 if (IS_SPCARG(c)) {
16732 if ((c != ':') ||
16733 (c = peekc_n(p, 1)) == -1 ||
16734 !(c == '\'' || c == '"' ||
16735 is_identchar((p->lex.pcur+1), p->lex.pend, p->enc))) {
16736 rb_warning0("`&' interpreted as argument prefix");
16737 }
16738 c = tAMPER;
16739 }
16740 else if (IS_BEG()) {
16741 c = tAMPER;
16742 }
16743 else {
16744 c = warn_balanced('&', "&", "argument prefix");
16745 }
16746 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16747 return c;
16748
16749 case '|':
16750 if ((c = nextc(p)) == '|') {
16751 SET_LEX_STATE(EXPR_BEG);
16752 if ((c = nextc(p)) == '=') {
16754 SET_LEX_STATE(EXPR_BEG);
16755 return tOP_ASGN;
16756 }
16757 pushback(p, c);
16758 if (IS_lex_state_for(last_state, EXPR_BEG)) {
16759 c = '|';
16760 pushback(p, '|');
16761 return c;
16762 }
16763 return tOROP;
16764 }
16765 if (c == '=') {
16766 set_yylval_id('|');
16767 SET_LEX_STATE(EXPR_BEG);
16768 return tOP_ASGN;
16769 }
16770 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
16771 pushback(p, c);
16772 return '|';
16773
16774 case '+':
16775 c = nextc(p);
16776 if (IS_AFTER_OPERATOR()) {
16777 SET_LEX_STATE(EXPR_ARG);
16778 if (c == '@') {
16779 return tUPLUS;
16780 }
16781 pushback(p, c);
16782 return '+';
16783 }
16784 if (c == '=') {
16785 set_yylval_id('+');
16786 SET_LEX_STATE(EXPR_BEG);
16787 return tOP_ASGN;
16788 }
16789 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
16790 SET_LEX_STATE(EXPR_BEG);
16791 pushback(p, c);
16792 if (c != -1 && ISDIGIT(c)) {
16793 return parse_numeric(p, '+');
16794 }
16795 return tUPLUS;
16796 }
16797 SET_LEX_STATE(EXPR_BEG);
16798 pushback(p, c);
16799 return warn_balanced('+', "+", "unary operator");
16800
16801 case '-':
16802 c = nextc(p);
16803 if (IS_AFTER_OPERATOR()) {
16804 SET_LEX_STATE(EXPR_ARG);
16805 if (c == '@') {
16806 return tUMINUS;
16807 }
16808 pushback(p, c);
16809 return '-';
16810 }
16811 if (c == '=') {
16812 set_yylval_id('-');
16813 SET_LEX_STATE(EXPR_BEG);
16814 return tOP_ASGN;
16815 }
16816 if (c == '>') {
16817 SET_LEX_STATE(EXPR_ENDFN);
16818 return tLAMBDA;
16819 }
16820 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
16821 SET_LEX_STATE(EXPR_BEG);
16822 pushback(p, c);
16823 if (c != -1 && ISDIGIT(c)) {
16824 return tUMINUS_NUM;
16825 }
16826 return tUMINUS;
16827 }
16828 SET_LEX_STATE(EXPR_BEG);
16829 pushback(p, c);
16830 return warn_balanced('-', "-", "unary operator");
16831
16832 case '.': {
16833 int is_beg = IS_BEG();
16834 SET_LEX_STATE(EXPR_BEG);
16835 if ((c = nextc(p)) == '.') {
16836 if ((c = nextc(p)) == '.') {
16837 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
16838 rb_warn0("... at EOL, should be parenthesized?");
16839 }
16840 return is_beg ? tBDOT3 : tDOT3;
16841 }
16842 pushback(p, c);
16843 return is_beg ? tBDOT2 : tDOT2;
16844 }
16845 pushback(p, c);
16846 if (c != -1 && ISDIGIT(c)) {
16847 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
16848 parse_numeric(p, '.');
16849 if (ISDIGIT(prev)) {
16850 yyerror0("unexpected fraction part after numeric literal");
16851 }
16852 else {
16853 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
16854 }
16855 SET_LEX_STATE(EXPR_END);
16856 p->lex.ptok = p->lex.pcur;
16857 goto retry;
16858 }
16859 set_yylval_id('.');
16860 SET_LEX_STATE(EXPR_DOT);
16861 return '.';
16862 }
16863
16864 case '0': case '1': case '2': case '3': case '4':
16865 case '5': case '6': case '7': case '8': case '9':
16866 return parse_numeric(p, c);
16867
16868 case ')':
16869 COND_POP();
16870 CMDARG_POP();
16871 SET_LEX_STATE(EXPR_ENDFN);
16872 p->lex.paren_nest--;
16873 return c;
16874
16875 case ']':
16876 COND_POP();
16877 CMDARG_POP();
16878 SET_LEX_STATE(EXPR_END);
16879 p->lex.paren_nest--;
16880 return c;
16881
16882 case '}':
16883 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
16884 if (!p->lex.brace_nest--) return tSTRING_DEND;
16885 COND_POP();
16886 CMDARG_POP();
16887 SET_LEX_STATE(EXPR_END);
16888 p->lex.paren_nest--;
16889 return c;
16890
16891 case ':':
16892 c = nextc(p);
16893 if (c == ':') {
16894 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
16895 SET_LEX_STATE(EXPR_BEG);
16896 return tCOLON3;
16897 }
16899 SET_LEX_STATE(EXPR_DOT);
16900 return tCOLON2;
16901 }
16902 if (IS_END() || ISSPACE(c) || c == '#') {
16903 pushback(p, c);
16904 c = warn_balanced(':', ":", "symbol literal");
16905 SET_LEX_STATE(EXPR_BEG);
16906 return c;
16907 }
16908 switch (c) {
16909 case '\'':
16910 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
16911 break;
16912 case '"':
16913 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
16914 break;
16915 default:
16916 pushback(p, c);
16917 break;
16918 }
16919 SET_LEX_STATE(EXPR_FNAME);
16920 return tSYMBEG;
16921
16922 case '/':
16923 if (IS_BEG()) {
16924 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
16925 return tREGEXP_BEG;
16926 }
16927 if ((c = nextc(p)) == '=') {
16928 set_yylval_id('/');
16929 SET_LEX_STATE(EXPR_BEG);
16930 return tOP_ASGN;
16931 }
16932 pushback(p, c);
16933 if (IS_SPCARG(c)) {
16934 arg_ambiguous(p, '/');
16935 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
16936 return tREGEXP_BEG;
16937 }
16938 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16939 return warn_balanced('/', "/", "regexp literal");
16940
16941 case '^':
16942 if ((c = nextc(p)) == '=') {
16943 set_yylval_id('^');
16944 SET_LEX_STATE(EXPR_BEG);
16945 return tOP_ASGN;
16946 }
16947 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16948 pushback(p, c);
16949 return '^';
16950
16951 case ';':
16952 SET_LEX_STATE(EXPR_BEG);
16953 p->command_start = TRUE;
16954 return ';';
16955
16956 case ',':
16957 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
16958 return ',';
16959
16960 case '~':
16961 if (IS_AFTER_OPERATOR()) {
16962 if ((c = nextc(p)) != '@') {
16963 pushback(p, c);
16964 }
16965 SET_LEX_STATE(EXPR_ARG);
16966 }
16967 else {
16968 SET_LEX_STATE(EXPR_BEG);
16969 }
16970 return '~';
16971
16972 case '(':
16973 if (IS_BEG()) {
16974 c = tLPAREN;
16975 }
16976 else if (!space_seen) {
16977 /* foo( ... ) => method call, no ambiguity */
16978 }
16979 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
16980 c = tLPAREN_ARG;
16981 }
16982 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
16983 rb_warning0("parentheses after method name is interpreted as "
16984 "an argument list, not a decomposed argument");
16985 }
16986 p->lex.paren_nest++;
16987 COND_PUSH(0);
16988 CMDARG_PUSH(0);
16989 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
16990 return c;
16991
16992 case '[':
16993 p->lex.paren_nest++;
16994 if (IS_AFTER_OPERATOR()) {
16995 if ((c = nextc(p)) == ']') {
16996 SET_LEX_STATE(EXPR_ARG);
16997 if ((c = nextc(p)) == '=') {
16998 return tASET;
16999 }
17000 pushback(p, c);
17001 return tAREF;
17002 }
17003 pushback(p, c);
17004 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
17005 return '[';
17006 }
17007 else if (IS_BEG()) {
17008 c = tLBRACK;
17009 }
17010 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
17011 c = tLBRACK;
17012 }
17013 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17014 COND_PUSH(0);
17015 CMDARG_PUSH(0);
17016 return c;
17017
17018 case '{':
17019 ++p->lex.brace_nest;
17020 if (lambda_beginning_p())
17021 c = tLAMBEG;
17022 else if (IS_lex_state(EXPR_LABELED))
17023 c = tLBRACE; /* hash */
17024 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
17025 c = '{'; /* block (primary) */
17026 else if (IS_lex_state(EXPR_ENDARG))
17027 c = tLBRACE_ARG; /* block (expr) */
17028 else
17029 c = tLBRACE; /* hash */
17030 if (c != tLBRACE) {
17031 p->command_start = TRUE;
17032 SET_LEX_STATE(EXPR_BEG);
17033 }
17034 else {
17035 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17036 }
17037 ++p->lex.paren_nest; /* after lambda_beginning_p() */
17038 COND_PUSH(0);
17039 CMDARG_PUSH(0);
17040 return c;
17041
17042 case '\\':
17043 c = nextc(p);
17044 if (c == '\n') {
17045 space_seen = 1;
17047 goto retry; /* skip \\n */
17048 }
17049 if (c == ' ') return tSP;
17050 if (ISSPACE(c)) return c;
17051 pushback(p, c);
17052 return '\\';
17053
17054 case '%':
17055 return parse_percent(p, space_seen, last_state);
17056
17057 case '$':
17058 return parse_gvar(p, last_state);
17059
17060 case '@':
17061 return parse_atmark(p, last_state);
17062
17063 case '_':
17064 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
17065 p->ruby__end__seen = 1;
17066 p->eofp = 1;
17067#ifndef RIPPER
17068 return -1;
17069#else
17070 lex_goto_eol(p);
17072 return 0;
17073#endif
17074 }
17075 newtok(p);
17076 break;
17077
17078 default:
17079 if (!parser_is_identchar(p)) {
17080 compile_error(p, "Invalid char `\\x%02X' in expression", c);
17081 token_flush(p);
17082 goto retry;
17083 }
17084
17085 newtok(p);
17086 break;
17087 }
17088
17089 return parse_ident(p, c, cmd_state);
17090}
17091
17092static enum yytokentype
17093yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
17094{
17095 enum yytokentype t;
17096
17097 p->lval = lval;
17098 lval->val = Qundef;
17099 t = parser_yylex(p);
17100
17101 if (p->lex.strterm && (p->lex.strterm->flags & STRTERM_HEREDOC))
17103 else
17104 RUBY_SET_YYLLOC(*yylloc);
17105
17106 if (has_delayed_token(p))
17108 else if (t != 0)
17109 dispatch_scan_event(p, t);
17110
17111 return t;
17112}
17113
17114#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
17115
17116static NODE*
17117node_newnode(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2, const rb_code_location_t *loc)
17118{
17119 NODE *n = rb_ast_newnode(p->ast, type);
17120
17121 rb_node_init(n, type, a0, a1, a2);
17122
17123 nd_set_loc(n, loc);
17124 nd_set_node_id(n, parser_get_node_id(p));
17125 return n;
17126}
17127
17128static NODE *
17129nd_set_loc(NODE *nd, const YYLTYPE *loc)
17130{
17131 nd->nd_loc = *loc;
17132 nd_set_line(nd, loc->beg_pos.lineno);
17133 return nd;
17134}
17135
17136#ifndef RIPPER
17137static enum node_type
17138nodetype(NODE *node) /* for debug */
17139{
17140 return (enum node_type)nd_type(node);
17141}
17142
17143static int
17144nodeline(NODE *node)
17145{
17146 return nd_line(node);
17147}
17148
17149static NODE*
17150newline_node(NODE *node)
17151{
17152 if (node) {
17153 node = remove_begin(node);
17154 node->flags |= NODE_FL_NEWLINE;
17155 }
17156 return node;
17157}
17158
17159static void
17160fixpos(NODE *node, NODE *orig)
17161{
17162 if (!node) return;
17163 if (!orig) return;
17164 nd_set_line(node, nd_line(orig));
17165}
17166
17167static void
17168parser_warning(struct parser_params *p, NODE *node, const char *mesg)
17169{
17170 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17171}
17172
17173static void
17174parser_warn(struct parser_params *p, NODE *node, const char *mesg)
17175{
17176 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17177}
17178
17179static NODE*
17180block_append(struct parser_params *p, NODE *head, NODE *tail)
17181{
17182 NODE *end, *h = head, *nd;
17183
17184 if (tail == 0) return head;
17185
17186 if (h == 0) return tail;
17187 switch (nd_type(h)) {
17188 case NODE_LIT:
17189 case NODE_STR:
17190 case NODE_SELF:
17191 case NODE_TRUE:
17192 case NODE_FALSE:
17193 case NODE_NIL:
17194 parser_warning(p, h, "unused literal ignored");
17195 return tail;
17196 default:
17197 h = end = NEW_BLOCK(head, &head->nd_loc);
17198 end->nd_end = end;
17199 head = end;
17200 break;
17201 case NODE_BLOCK:
17202 end = h->nd_end;
17203 break;
17204 }
17205
17206 nd = end->nd_head;
17207 switch (nd_type(nd)) {
17208 case NODE_RETURN:
17209 case NODE_BREAK:
17210 case NODE_NEXT:
17211 case NODE_REDO:
17212 case NODE_RETRY:
17213 if (RTEST(ruby_verbose)) {
17214 parser_warning(p, tail, "statement not reached");
17215 }
17216 break;
17217
17218 default:
17219 break;
17220 }
17221
17222 if (nd_type(tail) != NODE_BLOCK) {
17223 tail = NEW_BLOCK(tail, &tail->nd_loc);
17224 tail->nd_end = tail;
17225 }
17226 end->nd_next = tail;
17227 h->nd_end = tail->nd_end;
17228 nd_set_last_loc(head, nd_last_loc(tail));
17229 return head;
17230}
17231
17232/* append item to the list */
17233static NODE*
17234list_append(struct parser_params *p, NODE *list, NODE *item)
17235{
17236 NODE *last;
17237
17238 if (list == 0) return NEW_LIST(item, &item->nd_loc);
17239 if (list->nd_next) {
17240 last = list->nd_next->nd_end;
17241 }
17242 else {
17243 last = list;
17244 }
17245
17246 list->nd_alen += 1;
17247 last->nd_next = NEW_LIST(item, &item->nd_loc);
17248 list->nd_next->nd_end = last->nd_next;
17249
17251
17252 return list;
17253}
17254
17255/* concat two lists */
17256static NODE*
17257list_concat(NODE *head, NODE *tail)
17258{
17259 NODE *last;
17260
17261 if (head->nd_next) {
17262 last = head->nd_next->nd_end;
17263 }
17264 else {
17265 last = head;
17266 }
17267
17268 head->nd_alen += tail->nd_alen;
17269 last->nd_next = tail;
17270 if (tail->nd_next) {
17271 head->nd_next->nd_end = tail->nd_next->nd_end;
17272 }
17273 else {
17274 head->nd_next->nd_end = tail;
17275 }
17276
17277 nd_set_last_loc(head, nd_last_loc(tail));
17278
17279 return head;
17280}
17281
17282static int
17283literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
17284{
17285 if (NIL_P(tail)) return 1;
17286 if (!rb_enc_compatible(head, tail)) {
17287 compile_error(p, "string literal encodings differ (%s / %s)",
17288 rb_enc_name(rb_enc_get(head)),
17289 rb_enc_name(rb_enc_get(tail)));
17290 rb_str_resize(head, 0);
17291 rb_str_resize(tail, 0);
17292 return 0;
17293 }
17294 rb_str_buf_append(head, tail);
17295 return 1;
17296}
17297
17298/* concat two string literals */
17299static NODE *
17300literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
17301{
17302 enum node_type htype;
17303 NODE *headlast;
17304 VALUE lit;
17305
17306 if (!head) return tail;
17307 if (!tail) return head;
17308
17309 htype = nd_type(head);
17310 if (htype == NODE_EVSTR) {
17311 NODE *node = NEW_DSTR(STR_NEW0(), loc);
17312 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
17313 head = list_append(p, node, head);
17314 htype = NODE_DSTR;
17315 }
17316 if (p->heredoc_indent > 0) {
17317 switch (htype) {
17318 case NODE_STR:
17319 nd_set_type(head, NODE_DSTR);
17320 case NODE_DSTR:
17321 return list_append(p, head, tail);
17322 default:
17323 break;
17324 }
17325 }
17326 switch (nd_type(tail)) {
17327 case NODE_STR:
17328 if (htype == NODE_DSTR && (headlast = head->nd_next->nd_end->nd_head) &&
17329 nd_type(headlast) == NODE_STR) {
17330 htype = NODE_STR;
17331 lit = headlast->nd_lit;
17332 }
17333 else {
17334 lit = head->nd_lit;
17335 }
17336 if (htype == NODE_STR) {
17337 if (!literal_concat0(p, lit, tail->nd_lit)) {
17338 error:
17339 rb_discard_node(p, head);
17340 rb_discard_node(p, tail);
17341 return 0;
17342 }
17343 rb_discard_node(p, tail);
17344 }
17345 else {
17346 list_append(p, head, tail);
17347 }
17348 break;
17349
17350 case NODE_DSTR:
17351 if (htype == NODE_STR) {
17352 if (!literal_concat0(p, head->nd_lit, tail->nd_lit))
17353 goto error;
17354 tail->nd_lit = head->nd_lit;
17355 rb_discard_node(p, head);
17356 head = tail;
17357 }
17358 else if (NIL_P(tail->nd_lit)) {
17359 append:
17360 head->nd_alen += tail->nd_alen - 1;
17361 head->nd_next->nd_end->nd_next = tail->nd_next;
17362 head->nd_next->nd_end = tail->nd_next->nd_end;
17363 rb_discard_node(p, tail);
17364 }
17365 else if (htype == NODE_DSTR && (headlast = head->nd_next->nd_end->nd_head) &&
17366 nd_type(headlast) == NODE_STR) {
17367 lit = headlast->nd_lit;
17368 if (!literal_concat0(p, lit, tail->nd_lit))
17369 goto error;
17370 tail->nd_lit = Qnil;
17371 goto append;
17372 }
17373 else {
17374 list_concat(head, NEW_NODE(NODE_LIST, NEW_STR(tail->nd_lit, loc), tail->nd_alen, tail->nd_next, loc));
17375 }
17376 break;
17377
17378 case NODE_EVSTR:
17379 if (htype == NODE_STR) {
17380 nd_set_type(head, NODE_DSTR);
17381 head->nd_alen = 1;
17382 }
17383 list_append(p, head, tail);
17384 break;
17385 }
17386 return head;
17387}
17388
17389static NODE *
17390evstr2dstr(struct parser_params *p, NODE *node)
17391{
17392 if (nd_type(node) == NODE_EVSTR) {
17393 NODE * dstr = NEW_DSTR(STR_NEW0(), &node->nd_loc);
17394 RB_OBJ_WRITTEN(p->ast, Qnil, dstr->nd_lit);
17395 node = list_append(p, dstr, node);
17396 }
17397 return node;
17398}
17399
17400static NODE *
17401new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
17402{
17403 NODE *head = node;
17404
17405 if (node) {
17406 switch (nd_type(node)) {
17407 case NODE_STR: case NODE_DSTR: case NODE_EVSTR:
17408 return node;
17409 }
17410 }
17411 return NEW_EVSTR(head, loc);
17412}
17413
17414static NODE *
17415call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
17416 const YYLTYPE *op_loc, const YYLTYPE *loc)
17417{
17418 NODE *expr;
17419 value_expr(recv);
17420 value_expr(arg1);
17421 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
17422 nd_set_line(expr, op_loc->beg_pos.lineno);
17423 return expr;
17424}
17425
17426static NODE *
17427call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
17428{
17429 NODE *opcall;
17430 value_expr(recv);
17431 opcall = NEW_OPCALL(recv, id, 0, loc);
17432 nd_set_line(opcall, op_loc->beg_pos.lineno);
17433 return opcall;
17434}
17435
17436static NODE *
17437new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
17438{
17439 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
17440 nd_set_line(qcall, op_loc->beg_pos.lineno);
17441 return qcall;
17442}
17443
17444static NODE*
17445new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
17446{
17447 NODE *ret;
17448 if (block) block_dup_check(p, args, block);
17449 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
17450 if (block) ret = method_add_block(p, ret, block, loc);
17451 fixpos(ret, recv);
17452 return ret;
17453}
17454
17455#define nd_once_body(node) (nd_type(node) == NODE_ONCE ? (node)->nd_body : node)
17456static NODE*
17457match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
17458{
17459 NODE *n;
17460 int line = op_loc->beg_pos.lineno;
17461
17462 value_expr(node1);
17463 value_expr(node2);
17464 if (node1 && (n = nd_once_body(node1)) != 0) {
17465 switch (nd_type(n)) {
17466 case NODE_DREGX:
17467 {
17468 NODE *match = NEW_MATCH2(node1, node2, loc);
17469 nd_set_line(match, line);
17470 return match;
17471 }
17472
17473 case NODE_LIT:
17474 if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
17475 const VALUE lit = n->nd_lit;
17476 NODE *match = NEW_MATCH2(node1, node2, loc);
17477 match->nd_args = reg_named_capture_assign(p, lit, loc);
17478 nd_set_line(match, line);
17479 return match;
17480 }
17481 }
17482 }
17483
17484 if (node2 && (n = nd_once_body(node2)) != 0) {
17485 NODE *match3;
17486
17487 switch (nd_type(n)) {
17488 case NODE_LIT:
17489 if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
17490 /* fallthru */
17491 case NODE_DREGX:
17492 match3 = NEW_MATCH3(node2, node1, loc);
17493 return match3;
17494 }
17495 }
17496
17497 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
17498 nd_set_line(n, line);
17499 return n;
17500}
17501
17502# if WARN_PAST_SCOPE
17503static int
17504past_dvar_p(struct parser_params *p, ID id)
17505{
17506 struct vtable *past = p->lvtbl->past;
17507 while (past) {
17508 if (vtable_included(past, id)) return 1;
17509 past = past->prev;
17510 }
17511 return 0;
17512}
17513# endif
17514
17515/* As Ripper#warn does not have arguments for the location, so the
17516 * following messages cannot be separated */
17517#define WARN_LOCATION(type) do { \
17518 if (p->warn_location) { \
17519 int line; \
17520 VALUE file = rb_source_location(&line); \
17521 rb_warn3(type" in eval may not return location in binding;" \
17522 " use Binding#source_location instead\n" \
17523 "%"PRIsWARN":%d: warning: in `%"PRIsWARN"'", \
17524 file, WARN_I(line), rb_id2str(rb_frame_this_func())); \
17525 } \
17526} while (0)
17527
17528static int
17529numparam_nested_p(struct parser_params *p)
17530{
17531 struct local_vars *local = p->lvtbl;
17532 NODE *outer = local->numparam.outer;
17533 NODE *inner = local->numparam.inner;
17534 if (outer || inner) {
17535 NODE *used = outer ? outer : inner;
17536 compile_error(p, "numbered parameter is already used in\n"
17537 "%s:%d: %s block here",
17539 outer ? "outer" : "inner");
17540 parser_show_error_line(p, &used->nd_loc);
17541 return 1;
17542 }
17543 return 0;
17544}
17545
17546static NODE*
17547gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
17548{
17549 ID *vidp = NULL;
17550 NODE *node;
17551 switch (id) {
17552 case keyword_self:
17553 return NEW_SELF(loc);
17554 case keyword_nil:
17555 return NEW_NIL(loc);
17556 case keyword_true:
17557 return NEW_TRUE(loc);
17558 case keyword_false:
17559 return NEW_FALSE(loc);
17560 case keyword__FILE__:
17561 WARN_LOCATION("__FILE__");
17562 {
17563 VALUE file = p->ruby_sourcefile_string;
17564 if (NIL_P(file))
17565 file = rb_str_new(0, 0);
17566 else
17567 file = rb_str_dup(file);
17568 node = NEW_STR(file, loc);
17569 RB_OBJ_WRITTEN(p->ast, Qnil, file);
17570 }
17571 return node;
17572 case keyword__LINE__:
17573 WARN_LOCATION("__LINE__");
17574 return NEW_LIT(INT2FIX(p->tokline), loc);
17576 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
17577 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
17578 return node;
17579
17580 }
17581 switch (id_type(id)) {
17582 case ID_LOCAL:
17583 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
17584 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
17585 if (id == p->cur_arg) {
17586 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
17587 return 0;
17588 }
17589 if (vidp) *vidp |= LVAR_USED;
17590 node = NEW_DVAR(id, loc);
17591 return node;
17592 }
17593 if (local_id_ref(p, id, &vidp)) {
17594 if (id == p->cur_arg) {
17595 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
17596 return 0;
17597 }
17598 if (vidp) *vidp |= LVAR_USED;
17599 node = NEW_LVAR(id, loc);
17600 return node;
17601 }
17602 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
17603 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
17604 if (numparam_nested_p(p)) return 0;
17605 node = NEW_DVAR(id, loc);
17606 struct local_vars *local = p->lvtbl;
17607 if (!local->numparam.current) local->numparam.current = node;
17608 return node;
17609 }
17610# if WARN_PAST_SCOPE
17611 if (!p->in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
17612 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
17613 }
17614# endif
17615 /* method call without arguments */
17616 return NEW_VCALL(id, loc);
17617 case ID_GLOBAL:
17618 return NEW_GVAR(id, loc);
17619 case ID_INSTANCE:
17620 return NEW_IVAR(id, loc);
17621 case ID_CONST:
17622 return NEW_CONST(id, loc);
17623 case ID_CLASS:
17624 return NEW_CVAR(id, loc);
17625 }
17626 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
17627 return 0;
17628}
17629
17630static NODE *
17631opt_arg_append(NODE *opt_list, NODE *opt)
17632{
17633 NODE *opts = opt_list;
17634 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
17635
17636 while (opts->nd_next) {
17637 opts = opts->nd_next;
17638 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
17639 }
17640 opts->nd_next = opt;
17641
17642 return opt_list;
17643}
17644
17645static NODE *
17646kwd_append(NODE *kwlist, NODE *kw)
17647{
17648 if (kwlist) {
17649 NODE *kws = kwlist;
17650 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
17651 while (kws->nd_next) {
17652 kws = kws->nd_next;
17653 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
17654 }
17655 kws->nd_next = kw;
17656 }
17657 return kwlist;
17658}
17659
17660static NODE *
17661new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
17662{
17663 return NEW_DEFINED(remove_begin_all(expr), loc);
17664}
17665
17666static NODE*
17667symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
17668{
17669 if (nd_type(symbol) == NODE_DSTR) {
17670 nd_set_type(symbol, NODE_DSYM);
17671 }
17672 else {
17673 nd_set_type(symbol, NODE_LIT);
17674 RB_OBJ_WRITTEN(p->ast, Qnil, symbol->nd_lit = rb_str_intern(symbol->nd_lit));
17675 }
17676 return list_append(p, symbols, symbol);
17677}
17678
17679static NODE *
17680new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
17681{
17682 NODE *list, *prev;
17683 VALUE lit;
17684
17685 if (!node) {
17686 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
17687 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
17688 return node;
17689 }
17690 switch (nd_type(node)) {
17691 case NODE_STR:
17692 {
17693 VALUE src = node->nd_lit;
17694 nd_set_type(node, NODE_LIT);
17695 nd_set_loc(node, loc);
17696 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
17697 }
17698 break;
17699 default:
17700 lit = STR_NEW0();
17701 node = NEW_NODE(NODE_DSTR, lit, 1, NEW_LIST(node, loc), loc);
17702 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
17703 /* fall through */
17704 case NODE_DSTR:
17705 nd_set_type(node, NODE_DREGX);
17706 nd_set_loc(node, loc);
17707 node->nd_cflag = options & RE_OPTION_MASK;
17708 if (!NIL_P(node->nd_lit)) reg_fragment_check(p, node->nd_lit, options);
17709 for (list = (prev = node)->nd_next; list; list = list->nd_next) {
17710 if (nd_type(list->nd_head) == NODE_STR) {
17711 VALUE tail = list->nd_head->nd_lit;
17712 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(prev->nd_lit)) {
17713 VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
17714 if (!literal_concat0(p, lit, tail)) {
17715 return NEW_NIL(loc); /* dummy node on error */
17716 }
17717 rb_str_resize(tail, 0);
17718 prev->nd_next = list->nd_next;
17719 rb_discard_node(p, list->nd_head);
17720 rb_discard_node(p, list);
17721 list = prev;
17722 }
17723 else {
17724 prev = list;
17725 }
17726 }
17727 else {
17728 prev = 0;
17729 }
17730 }
17731 if (!node->nd_next) {
17732 VALUE src = node->nd_lit;
17733 nd_set_type(node, NODE_LIT);
17734 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
17735 }
17736 if (options & RE_OPTION_ONCE) {
17737 node = NEW_NODE(NODE_ONCE, 0, node, 0, loc);
17738 }
17739 break;
17740 }
17741 return node;
17742}
17743
17744static NODE *
17745new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
17746{
17747 if (!k) return 0;
17748 return NEW_KW_ARG(0, (k), loc);
17749}
17750
17751static NODE *
17752new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
17753{
17754 if (!node) {
17755 VALUE lit = STR_NEW0();
17756 NODE *xstr = NEW_XSTR(lit, loc);
17757 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
17758 return xstr;
17759 }
17760 switch (nd_type(node)) {
17761 case NODE_STR:
17762 nd_set_type(node, NODE_XSTR);
17763 nd_set_loc(node, loc);
17764 break;
17765 case NODE_DSTR:
17766 nd_set_type(node, NODE_DXSTR);
17767 nd_set_loc(node, loc);
17768 break;
17769 default:
17770 node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node, loc), loc);
17771 break;
17772 }
17773 return node;
17774}
17775
17776static void
17777check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
17778{
17779 VALUE lit;
17780
17781 if (!arg || !p->case_labels) return;
17782
17784 if (lit == Qundef) return;
17785 if (nd_type(arg) == NODE_STR) {
17786 RB_OBJ_WRITTEN(p->ast, Qnil, arg->nd_lit = lit);
17787 }
17788
17789 if (NIL_P(p->case_labels)) {
17791 }
17792 else {
17793 VALUE line = rb_hash_lookup(p->case_labels, lit);
17794 if (!NIL_P(line)) {
17795 rb_warning1("duplicated `when' clause with line %d is ignored",
17796 WARN_IVAL(line));
17797 return;
17798 }
17799 }
17801}
17802
17803#else /* !RIPPER */
17804static int
17805id_is_var(struct parser_params *p, ID id)
17806{
17807 if (is_notop_id(id)) {
17808 switch (id & ID_SCOPE_MASK) {
17809 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
17810 return 1;
17811 case ID_LOCAL:
17812 if (dyna_in_block(p)) {
17813 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
17814 }
17815 if (local_id(p, id)) return 1;
17816 /* method call without arguments */
17817 return 0;
17818 }
17819 }
17820 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
17821 return 0;
17822}
17823
17824static VALUE
17825new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
17826{
17827 VALUE src = 0, err;
17828 int options = 0;
17829 if (ripper_is_node_yylval(re)) {
17830 src = RNODE(re)->nd_cval;
17831 re = RNODE(re)->nd_rval;
17832 }
17833 if (ripper_is_node_yylval(opt)) {
17834 options = (int)RNODE(opt)->nd_tag;
17835 opt = RNODE(opt)->nd_rval;
17836 }
17837 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
17838 compile_error(p, "%"PRIsVALUE, err);
17839 }
17840 return dispatch2(regexp_literal, re, opt);
17841}
17842#endif /* !RIPPER */
17843
17844
17845#ifndef RIPPER
17846static const char rb_parser_lex_state_names[][8] = {
17847 "BEG", "END", "ENDARG", "ENDFN", "ARG",
17848 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
17849 "LABEL", "LABELED","FITEM",
17850};
17851
17852static VALUE
17853append_lex_state_name(enum lex_state_e state, VALUE buf)
17854{
17855 int i, sep = 0;
17856 unsigned int mask = 1;
17857 static const char none[] = "NONE";
17858
17859 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
17860 if ((unsigned)state & mask) {
17861 if (sep) {
17862 rb_str_cat(buf, "|", 1);
17863 }
17864 sep = 1;
17865 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
17866 }
17867 }
17868 if (!sep) {
17869 rb_str_cat(buf, none, sizeof(none)-1);
17870 }
17871 return buf;
17872}
17873
17874static void
17875flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
17876{
17877 VALUE mesg = p->debug_buffer;
17878
17879 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
17880 p->debug_buffer = Qnil;
17881 rb_io_puts(1, &mesg, out);
17882 }
17883 if (!NIL_P(str) && RSTRING_LEN(str)) {
17885 }
17886}
17887
17888enum lex_state_e
17890 enum lex_state_e to, int line)
17891{
17892 VALUE mesg;
17893 mesg = rb_str_new_cstr("lex_state: ");
17894 append_lex_state_name(from, mesg);
17895 rb_str_cat_cstr(mesg, " -> ");
17896 append_lex_state_name(to, mesg);
17897 rb_str_catf(mesg, " at line %d\n", line);
17898 flush_debug_buffer(p, p->debug_output, mesg);
17899 return to;
17900}
17901
17902VALUE
17904{
17905 return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
17906}
17907
17908static void
17909append_bitstack_value(stack_type stack, VALUE mesg)
17910{
17911 if (stack == 0) {
17912 rb_str_cat_cstr(mesg, "0");
17913 }
17914 else {
17915 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
17916 for (; mask && !(stack & mask); mask >>= 1) continue;
17917 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
17918 }
17919}
17920
17921void
17923 const char *name, int line)
17924{
17925 VALUE mesg = rb_sprintf("%s: ", name);
17926 append_bitstack_value(stack, mesg);
17927 rb_str_catf(mesg, " at line %d\n", line);
17928 flush_debug_buffer(p, p->debug_output, mesg);
17929}
17930
17931void
17932rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
17933{
17934 va_list ap;
17935 VALUE mesg = rb_str_new_cstr("internal parser error: ");
17936
17937 va_start(ap, fmt);
17938 rb_str_vcatf(mesg, fmt, ap);
17939 va_end(ap);
17940 parser_yyerror(p, NULL, RSTRING_PTR(mesg));
17941 RB_GC_GUARD(mesg);
17942
17943 mesg = rb_str_new(0, 0);
17944 append_lex_state_name(p->lex.state, mesg);
17945 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
17946 rb_str_resize(mesg, 0);
17947 append_bitstack_value(p->cond_stack, mesg);
17948 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
17949 rb_str_resize(mesg, 0);
17950 append_bitstack_value(p->cmdarg_stack, mesg);
17951 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
17952 if (p->debug_output == rb_stdout)
17954 p->debug = TRUE;
17955}
17956
17957YYLTYPE *
17959{
17960 int sourceline = here->sourceline;
17961 int beg_pos = (int)here->offset - here->quote
17962 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
17963 int end_pos = (int)here->offset + here->length + here->quote;
17964
17965 yylloc->beg_pos.lineno = sourceline;
17966 yylloc->beg_pos.column = beg_pos;
17967 yylloc->end_pos.lineno = sourceline;
17968 yylloc->end_pos.column = end_pos;
17969 return yylloc;
17970}
17971
17972YYLTYPE *
17974{
17975 yylloc->beg_pos.lineno = p->ruby_sourceline;
17976 yylloc->beg_pos.column = (int)(p->lex.ptok - p->lex.pbeg);
17977 yylloc->end_pos.lineno = p->ruby_sourceline;
17978 yylloc->end_pos.column = (int)(p->lex.ptok - p->lex.pbeg);
17979 return yylloc;
17980}
17981
17982YYLTYPE *
17984{
17985 yylloc->beg_pos.lineno = p->ruby_sourceline;
17986 yylloc->beg_pos.column = (int)(p->lex.ptok - p->lex.pbeg);
17987 yylloc->end_pos.lineno = p->ruby_sourceline;
17988 yylloc->end_pos.column = (int)(p->lex.pcur - p->lex.pbeg);
17989 return yylloc;
17990}
17991#endif /* !RIPPER */
17992
17993static int
17994assignable0(struct parser_params *p, ID id, const char **err)
17995{
17996 if (!id) return -1;
17997 switch (id) {
17998 case keyword_self:
17999 *err = "Can't change the value of self";
18000 return -1;
18001 case keyword_nil:
18002 *err = "Can't assign to nil";
18003 return -1;
18004 case keyword_true:
18005 *err = "Can't assign to true";
18006 return -1;
18007 case keyword_false:
18008 *err = "Can't assign to false";
18009 return -1;
18010 case keyword__FILE__:
18011 *err = "Can't assign to __FILE__";
18012 return -1;
18013 case keyword__LINE__:
18014 *err = "Can't assign to __LINE__";
18015 return -1;
18017 *err = "Can't assign to __ENCODING__";
18018 return -1;
18019 }
18020 switch (id_type(id)) {
18021 case ID_LOCAL:
18022 if (dyna_in_block(p)) {
18023 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
18024 compile_error(p, "Can't assign to numbered parameter _%d",
18025 NUMPARAM_ID_TO_IDX(id));
18026 return -1;
18027 }
18028 if (dvar_curr(p, id)) return NODE_DASGN_CURR;
18029 if (dvar_defined(p, id)) return NODE_DASGN;
18030 if (local_id(p, id)) return NODE_LASGN;
18031 dyna_var(p, id);
18032 return NODE_DASGN_CURR;
18033 }
18034 else {
18035 if (!local_id(p, id)) local_var(p, id);
18036 return NODE_LASGN;
18037 }
18038 break;
18039 case ID_GLOBAL: return NODE_GASGN;
18040 case ID_INSTANCE: return NODE_IASGN;
18041 case ID_CONST:
18042 if (!p->in_def) return NODE_CDECL;
18043 *err = "dynamic constant assignment";
18044 return -1;
18045 case ID_CLASS: return NODE_CVASGN;
18046 default:
18047 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
18048 }
18049 return -1;
18050}
18051
18052#ifndef RIPPER
18053static NODE*
18054assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
18055{
18056 const char *err = 0;
18057 int node_type = assignable0(p, id, &err);
18058 switch (node_type) {
18059 case NODE_DASGN_CURR: return NEW_DASGN_CURR(id, val, loc);
18060 case NODE_DASGN: return NEW_DASGN(id, val, loc);
18061 case NODE_LASGN: return NEW_LASGN(id, val, loc);
18062 case NODE_GASGN: return NEW_GASGN(id, val, loc);
18063 case NODE_IASGN: return NEW_IASGN(id, val, loc);
18064 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
18065 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
18066 }
18067 if (err) yyerror1(loc, err);
18068 return NEW_BEGIN(0, loc);
18069}
18070#else
18071static VALUE
18072assignable(struct parser_params *p, VALUE lhs)
18073{
18074 const char *err = 0;
18075 assignable0(p, get_id(lhs), &err);
18076 if (err) lhs = assign_error(p, lhs);
18077 return lhs;
18078}
18079#endif
18080
18081static int
18082is_private_local_id(ID name)
18083{
18084 VALUE s;
18085 if (name == idUScore) return 1;
18086 if (!is_local_id(name)) return 0;
18087 s = rb_id2str(name);
18088 if (!s) return 0;
18089 return RSTRING_PTR(s)[0] == '_';
18090}
18091
18092static int
18093shadowing_lvar_0(struct parser_params *p, ID name)
18094{
18095 if (is_private_local_id(name)) return 1;
18096 if (dyna_in_block(p)) {
18097 if (dvar_curr(p, name)) {
18098 yyerror0("duplicated argument name");
18099 }
18100 else if (dvar_defined(p, name) || local_id(p, name)) {
18101 vtable_add(p->lvtbl->vars, name);
18102 if (p->lvtbl->used) {
18104 }
18105 return 0;
18106 }
18107 }
18108 else {
18109 if (local_id(p, name)) {
18110 yyerror0("duplicated argument name");
18111 }
18112 }
18113 return 1;
18114}
18115
18116static ID
18117shadowing_lvar(struct parser_params *p, ID name)
18118{
18119 shadowing_lvar_0(p, name);
18120 return name;
18121}
18122
18123static void
18124new_bv(struct parser_params *p, ID name)
18125{
18126 if (!name) return;
18127 if (!is_local_id(name)) {
18128 compile_error(p, "invalid local variable - %"PRIsVALUE,
18129 rb_id2str(name));
18130 return;
18131 }
18132 if (!shadowing_lvar_0(p, name)) return;
18133 dyna_var(p, name);
18134}
18135
18136#ifndef RIPPER
18137static NODE *
18138aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
18139{
18140 return NEW_ATTRASGN(recv, tASET, idx, loc);
18141}
18142
18143static void
18144block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
18145{
18146 if (node2 && node1 && nd_type(node1) == NODE_BLOCK_PASS) {
18147 compile_error(p, "both block arg and actual block given");
18148 }
18149}
18150
18151static NODE *
18152attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
18153{
18154 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
18155 return NEW_ATTRASGN(recv, id, 0, loc);
18156}
18157
18158static void
18159rb_backref_error(struct parser_params *p, NODE *node)
18160{
18161 switch (nd_type(node)) {
18162 case NODE_NTH_REF:
18163 compile_error(p, "Can't set variable $%ld", node->nd_nth);
18164 break;
18165 case NODE_BACK_REF:
18166 compile_error(p, "Can't set variable $%c", (int)node->nd_nth);
18167 break;
18168 }
18169}
18170
18171static NODE *
18172arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18173{
18174 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
18175 switch (nd_type(node1)) {
18176 case NODE_LIST:
18177 return list_append(p, node1, node2);
18178 case NODE_BLOCK_PASS:
18179 node1->nd_head = arg_append(p, node1->nd_head, node2, loc);
18180 node1->nd_loc.end_pos = node1->nd_head->nd_loc.end_pos;
18181 return node1;
18182 case NODE_ARGSPUSH:
18183 node1->nd_body = list_append(p, NEW_LIST(node1->nd_body, &node1->nd_body->nd_loc), node2);
18184 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18185 nd_set_type(node1, NODE_ARGSCAT);
18186 return node1;
18187 case NODE_ARGSCAT:
18188 if (nd_type(node1->nd_body) != NODE_LIST) break;
18189 node1->nd_body = list_append(p, node1->nd_body, node2);
18190 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18191 return node1;
18192 }
18193 return NEW_ARGSPUSH(node1, node2, loc);
18194}
18195
18196static NODE *
18197arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18198{
18199 if (!node2) return node1;
18200 switch (nd_type(node1)) {
18201 case NODE_BLOCK_PASS:
18202 if (node1->nd_head)
18203 node1->nd_head = arg_concat(p, node1->nd_head, node2, loc);
18204 else
18205 node1->nd_head = NEW_LIST(node2, loc);
18206 return node1;
18207 case NODE_ARGSPUSH:
18208 if (nd_type(node2) != NODE_LIST) break;
18209 node1->nd_body = list_concat(NEW_LIST(node1->nd_body, loc), node2);
18210 nd_set_type(node1, NODE_ARGSCAT);
18211 return node1;
18212 case NODE_ARGSCAT:
18213 if (nd_type(node2) != NODE_LIST ||
18214 nd_type(node1->nd_body) != NODE_LIST) break;
18215 node1->nd_body = list_concat(node1->nd_body, node2);
18216 return node1;
18217 }
18218 return NEW_ARGSCAT(node1, node2, loc);
18219}
18220
18221static NODE *
18222last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
18223{
18224 NODE *n1;
18225 if ((n1 = splat_array(args)) != 0) {
18226 return list_append(p, n1, last_arg);
18227 }
18228 return arg_append(p, args, last_arg, loc);
18229}
18230
18231static NODE *
18232rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
18233{
18234 NODE *n1;
18235 if ((nd_type(rest_arg) == NODE_LIST) && (n1 = splat_array(args)) != 0) {
18236 return list_concat(n1, rest_arg);
18237 }
18238 return arg_concat(p, args, rest_arg, loc);
18239}
18240
18241static NODE *
18242splat_array(NODE* node)
18243{
18244 if (nd_type(node) == NODE_SPLAT) node = node->nd_head;
18245 if (nd_type(node) == NODE_LIST) return node;
18246 return 0;
18247}
18248
18249static void
18250mark_lvar_used(struct parser_params *p, NODE *rhs)
18251{
18252 ID *vidp = NULL;
18253 if (!rhs) return;
18254 switch (nd_type(rhs)) {
18255 case NODE_LASGN:
18256 if (local_id_ref(p, rhs->nd_vid, &vidp)) {
18257 if (vidp) *vidp |= LVAR_USED;
18258 }
18259 break;
18260 case NODE_DASGN:
18261 case NODE_DASGN_CURR:
18262 if (dvar_defined_ref(p, rhs->nd_vid, &vidp)) {
18263 if (vidp) *vidp |= LVAR_USED;
18264 }
18265 break;
18266#if 0
18267 case NODE_MASGN:
18268 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
18269 mark_lvar_used(p, rhs->nd_head);
18270 }
18271 break;
18272#endif
18273 }
18274}
18275
18276static NODE *
18277node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, const YYLTYPE *loc)
18278{
18279 if (!lhs) return 0;
18280
18281 switch (nd_type(lhs)) {
18282 case NODE_GASGN:
18283 case NODE_IASGN:
18284 case NODE_LASGN:
18285 case NODE_DASGN:
18286 case NODE_DASGN_CURR:
18287 case NODE_MASGN:
18288 case NODE_CDECL:
18289 case NODE_CVASGN:
18290 lhs->nd_value = rhs;
18291 nd_set_loc(lhs, loc);
18292 break;
18293
18294 case NODE_ATTRASGN:
18295 lhs->nd_args = arg_append(p, lhs->nd_args, rhs, loc);
18296 nd_set_loc(lhs, loc);
18297 break;
18298
18299 default:
18300 /* should not happen */
18301 break;
18302 }
18303
18304 return lhs;
18305}
18306
18307static NODE *
18308value_expr_check(struct parser_params *p, NODE *node)
18309{
18310 NODE *void_node = 0, *vn;
18311
18312 if (!node) {
18313 rb_warning0("empty expression");
18314 }
18315 while (node) {
18316 switch (nd_type(node)) {
18317 case NODE_RETURN:
18318 case NODE_BREAK:
18319 case NODE_NEXT:
18320 case NODE_REDO:
18321 case NODE_RETRY:
18322 return void_node ? void_node : node;
18323
18324 case NODE_CASE3:
18325 if (!node->nd_body || nd_type(node->nd_body) != NODE_IN) {
18326 compile_error(p, "unexpected node");
18327 return NULL;
18328 }
18329 if (node->nd_body->nd_body) {
18330 return NULL;
18331 }
18332 /* single line pattern matching */
18333 return void_node ? void_node : node;
18334
18335 case NODE_BLOCK:
18336 while (node->nd_next) {
18337 node = node->nd_next;
18338 }
18339 node = node->nd_head;
18340 break;
18341
18342 case NODE_BEGIN:
18343 node = node->nd_body;
18344 break;
18345
18346 case NODE_IF:
18347 case NODE_UNLESS:
18348 if (!node->nd_body) {
18349 return NULL;
18350 }
18351 else if (!node->nd_else) {
18352 return NULL;
18353 }
18354 vn = value_expr_check(p, node->nd_body);
18355 if (!vn) return NULL;
18356 if (!void_node) void_node = vn;
18357 node = node->nd_else;
18358 break;
18359
18360 case NODE_AND:
18361 case NODE_OR:
18362 node = node->nd_1st;
18363 break;
18364
18365 case NODE_LASGN:
18366 case NODE_DASGN:
18367 case NODE_DASGN_CURR:
18368 case NODE_MASGN:
18369 mark_lvar_used(p, node);
18370 return NULL;
18371
18372 default:
18373 return NULL;
18374 }
18375 }
18376
18377 return NULL;
18378}
18379
18380static int
18381value_expr_gen(struct parser_params *p, NODE *node)
18382{
18383 NODE *void_node = value_expr_check(p, node);
18384 if (void_node) {
18385 yyerror1(&void_node->nd_loc, "void value expression");
18386 /* or "control never reach"? */
18387 return FALSE;
18388 }
18389 return TRUE;
18390}
18391static void
18392void_expr(struct parser_params *p, NODE *node)
18393{
18394 const char *useless = 0;
18395
18396 if (!RTEST(ruby_verbose)) return;
18397
18398 if (!node || !(node = nd_once_body(node))) return;
18399 switch (nd_type(node)) {
18400 case NODE_OPCALL:
18401 switch (node->nd_mid) {
18402 case '+':
18403 case '-':
18404 case '*':
18405 case '/':
18406 case '%':
18407 case tPOW:
18408 case tUPLUS:
18409 case tUMINUS:
18410 case '|':
18411 case '^':
18412 case '&':
18413 case tCMP:
18414 case '>':
18415 case tGEQ:
18416 case '<':
18417 case tLEQ:
18418 case tEQ:
18419 case tNEQ:
18420 useless = rb_id2name(node->nd_mid);
18421 break;
18422 }
18423 break;
18424
18425 case NODE_LVAR:
18426 case NODE_DVAR:
18427 case NODE_GVAR:
18428 case NODE_IVAR:
18429 case NODE_CVAR:
18430 case NODE_NTH_REF:
18431 case NODE_BACK_REF:
18432 useless = "a variable";
18433 break;
18434 case NODE_CONST:
18435 useless = "a constant";
18436 break;
18437 case NODE_LIT:
18438 case NODE_STR:
18439 case NODE_DSTR:
18440 case NODE_DREGX:
18441 useless = "a literal";
18442 break;
18443 case NODE_COLON2:
18444 case NODE_COLON3:
18445 useless = "::";
18446 break;
18447 case NODE_DOT2:
18448 useless = "..";
18449 break;
18450 case NODE_DOT3:
18451 useless = "...";
18452 break;
18453 case NODE_SELF:
18454 useless = "self";
18455 break;
18456 case NODE_NIL:
18457 useless = "nil";
18458 break;
18459 case NODE_TRUE:
18460 useless = "true";
18461 break;
18462 case NODE_FALSE:
18463 useless = "false";
18464 break;
18465 case NODE_DEFINED:
18466 useless = "defined?";
18467 break;
18468 }
18469
18470 if (useless) {
18471 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
18472 }
18473}
18474
18475static NODE *
18476void_stmts(struct parser_params *p, NODE *node)
18477{
18478 NODE *const n = node;
18479 if (!RTEST(ruby_verbose)) return n;
18480 if (!node) return n;
18481 if (nd_type(node) != NODE_BLOCK) return n;
18482
18483 while (node->nd_next) {
18484 void_expr(p, node->nd_head);
18485 node = node->nd_next;
18486 }
18487 return n;
18488}
18489
18490static NODE *
18491remove_begin(NODE *node)
18492{
18493 NODE **n = &node, *n1 = node;
18494 while (n1 && nd_type(n1) == NODE_BEGIN && n1->nd_body) {
18495 *n = n1 = n1->nd_body;
18496 }
18497 return node;
18498}
18499
18500static NODE *
18501remove_begin_all(NODE *node)
18502{
18503 NODE **n = &node, *n1 = node;
18504 while (n1 && nd_type(n1) == NODE_BEGIN) {
18505 *n = n1 = n1->nd_body;
18506 }
18507 return node;
18508}
18509
18510static void
18511reduce_nodes(struct parser_params *p, NODE **body)
18512{
18513 NODE *node = *body;
18514
18515 if (!node) {
18516 *body = NEW_NIL(&NULL_LOC);
18517 return;
18518 }
18519#define subnodes(n1, n2) \
18520 ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
18521 (!node->n2) ? (body = &node->n1, 1) : \
18522 (reduce_nodes(p, &node->n1), body = &node->n2, 1))
18523
18524 while (node) {
18525 int newline = (int)(node->flags & NODE_FL_NEWLINE);
18526 switch (nd_type(node)) {
18527 end:
18528 case NODE_NIL:
18529 *body = 0;
18530 return;
18531 case NODE_RETURN:
18532 *body = node = node->nd_stts;
18533 if (newline && node) node->flags |= NODE_FL_NEWLINE;
18534 continue;
18535 case NODE_BEGIN:
18536 *body = node = node->nd_body;
18537 if (newline && node) node->flags |= NODE_FL_NEWLINE;
18538 continue;
18539 case NODE_BLOCK:
18540 body = &node->nd_end->nd_head;
18541 break;
18542 case NODE_IF:
18543 case NODE_UNLESS:
18544 if (subnodes(nd_body, nd_else)) break;
18545 return;
18546 case NODE_CASE:
18547 body = &node->nd_body;
18548 break;
18549 case NODE_WHEN:
18550 if (!subnodes(nd_body, nd_next)) goto end;
18551 break;
18552 case NODE_ENSURE:
18553 if (!subnodes(nd_head, nd_resq)) goto end;
18554 break;
18555 case NODE_RESCUE:
18556 if (node->nd_else) {
18557 body = &node->nd_resq;
18558 break;
18559 }
18560 if (!subnodes(nd_head, nd_resq)) goto end;
18561 break;
18562 default:
18563 return;
18564 }
18565 node = *body;
18566 if (newline && node) node->flags |= NODE_FL_NEWLINE;
18567 }
18568
18569#undef subnodes
18570}
18571
18572static int
18573is_static_content(NODE *node)
18574{
18575 if (!node) return 1;
18576 switch (nd_type(node)) {
18577 case NODE_HASH:
18578 if (!(node = node->nd_head)) break;
18579 case NODE_LIST:
18580 do {
18581 if (!is_static_content(node->nd_head)) return 0;
18582 } while ((node = node->nd_next) != 0);
18583 case NODE_LIT:
18584 case NODE_STR:
18585 case NODE_NIL:
18586 case NODE_TRUE:
18587 case NODE_FALSE:
18588 case NODE_ZLIST:
18589 break;
18590 default:
18591 return 0;
18592 }
18593 return 1;
18594}
18595
18596static int
18597assign_in_cond(struct parser_params *p, NODE *node)
18598{
18599 switch (nd_type(node)) {
18600 case NODE_MASGN:
18601 case NODE_LASGN:
18602 case NODE_DASGN:
18603 case NODE_DASGN_CURR:
18604 case NODE_GASGN:
18605 case NODE_IASGN:
18606 break;
18607
18608 default:
18609 return 0;
18610 }
18611
18612 if (!node->nd_value) return 1;
18613 if (is_static_content(node->nd_value)) {
18614 /* reports always */
18615 parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
18616 }
18617 return 1;
18618}
18619
18625
18626#define SWITCH_BY_COND_TYPE(t, w, arg) \
18627 switch (t) { \
18628 case COND_IN_OP: break; \
18629 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
18630 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
18631 }
18632
18633static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
18634
18635static NODE*
18636range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18637{
18638 enum node_type type;
18639
18640 if (node == 0) return 0;
18641
18642 type = nd_type(node);
18643 value_expr(node);
18644 if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
18645 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
18646 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(rb_intern("$."), loc), loc), loc);
18647 }
18648 return cond0(p, node, COND_IN_FF, loc);
18649}
18650
18651static NODE*
18652cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc)
18653{
18654 if (node == 0) return 0;
18655 if (!(node = nd_once_body(node))) return 0;
18656 assign_in_cond(p, node);
18657
18658 switch (nd_type(node)) {
18659 case NODE_DSTR:
18660 case NODE_EVSTR:
18661 case NODE_STR:
18662 SWITCH_BY_COND_TYPE(type, warn, "string ")
18663 break;
18664
18665 case NODE_DREGX:
18666 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
18667
18668 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
18669
18670 case NODE_AND:
18671 case NODE_OR:
18672 node->nd_1st = cond0(p, node->nd_1st, COND_IN_COND, loc);
18673 node->nd_2nd = cond0(p, node->nd_2nd, COND_IN_COND, loc);
18674 break;
18675
18676 case NODE_DOT2:
18677 case NODE_DOT3:
18678 node->nd_beg = range_op(p, node->nd_beg, loc);
18679 node->nd_end = range_op(p, node->nd_end, loc);
18680 if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
18681 else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
18682 break;
18683
18684 case NODE_DSYM:
18685 SWITCH_BY_COND_TYPE(type, warning, "string ")
18686 break;
18687
18688 case NODE_LIT:
18689 if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
18690 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
18691 nd_set_type(node, NODE_MATCH);
18692 }
18693 else if (node->nd_lit == Qtrue ||
18694 node->nd_lit == Qfalse) {
18695 /* booleans are OK, e.g., while true */
18696 }
18697 else {
18698 SWITCH_BY_COND_TYPE(type, warning, "")
18699 }
18700 default:
18701 break;
18702 }
18703 return node;
18704}
18705
18706static NODE*
18707cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18708{
18709 if (node == 0) return 0;
18710 return cond0(p, node, COND_IN_COND, loc);
18711}
18712
18713static NODE*
18714method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18715{
18716 if (node == 0) return 0;
18717 return cond0(p, node, COND_IN_OP, loc);
18718}
18719
18720static NODE*
18721new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
18722{
18723 if (!cc) return right;
18724 cc = cond0(p, cc, COND_IN_COND, loc);
18725 return newline_node(NEW_IF(cc, left, right, loc));
18726}
18727
18728static NODE*
18729new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
18730{
18731 if (!cc) return right;
18732 cc = cond0(p, cc, COND_IN_COND, loc);
18733 return newline_node(NEW_UNLESS(cc, left, right, loc));
18734}
18735
18736static NODE*
18737logop(struct parser_params *p, ID id, NODE *left, NODE *right,
18738 const YYLTYPE *op_loc, const YYLTYPE *loc)
18739{
18740 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
18741 NODE *op;
18742 value_expr(left);
18743 if (left && (enum node_type)nd_type(left) == type) {
18744 NODE *node = left, *second;
18745 while ((second = node->nd_2nd) != 0 && (enum node_type)nd_type(second) == type) {
18746 node = second;
18747 }
18748 node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
18749 nd_set_line(node->nd_2nd, op_loc->beg_pos.lineno);
18750 left->nd_loc.end_pos = loc->end_pos;
18751 return left;
18752 }
18753 op = NEW_NODE(type, left, right, 0, loc);
18754 nd_set_line(op, op_loc->beg_pos.lineno);
18755 return op;
18756}
18757
18758static void
18759no_blockarg(struct parser_params *p, NODE *node)
18760{
18761 if (node && nd_type(node) == NODE_BLOCK_PASS) {
18762 compile_error(p, "block argument should not be given");
18763 }
18764}
18765
18766static NODE *
18767ret_args(struct parser_params *p, NODE *node)
18768{
18769 if (node) {
18770 no_blockarg(p, node);
18771 if (nd_type(node) == NODE_LIST) {
18772 if (node->nd_next == 0) {
18773 node = node->nd_head;
18774 }
18775 else {
18776 nd_set_type(node, NODE_VALUES);
18777 }
18778 }
18779 }
18780 return node;
18781}
18782
18783static NODE *
18784new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18785{
18786 if (node) no_blockarg(p, node);
18787
18788 return NEW_YIELD(node, loc);
18789}
18790
18791static VALUE
18792negate_lit(struct parser_params *p, VALUE lit)
18793{
18794 if (FIXNUM_P(lit)) {
18795 return LONG2FIX(-FIX2LONG(lit));
18796 }
18797 if (SPECIAL_CONST_P(lit)) {
18798#if USE_FLONUM
18799 if (FLONUM_P(lit)) {
18800 return DBL2NUM(-RFLOAT_VALUE(lit));
18801 }
18802#endif
18803 goto unknown;
18804 }
18805 switch (BUILTIN_TYPE(lit)) {
18806 case T_BIGNUM:
18807 BIGNUM_NEGATE(lit);
18808 lit = rb_big_norm(lit);
18809 break;
18810 case T_RATIONAL:
18811 RRATIONAL_SET_NUM(lit, negate_lit(p, RRATIONAL(lit)->num));
18812 break;
18813 case T_COMPLEX:
18814 RCOMPLEX_SET_REAL(lit, negate_lit(p, RCOMPLEX(lit)->real));
18815 RCOMPLEX_SET_IMAG(lit, negate_lit(p, RCOMPLEX(lit)->imag));
18816 break;
18817 case T_FLOAT:
18818 RFLOAT(lit)->float_value = -RFLOAT_VALUE(lit);
18819 break;
18820 unknown:
18821 default:
18822 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
18824 break;
18825 }
18826 return lit;
18827}
18828
18829static NODE *
18830arg_blk_pass(NODE *node1, NODE *node2)
18831{
18832 if (node2) {
18833 if (!node1) return node2;
18834 node2->nd_head = node1;
18835 nd_set_first_lineno(node2, nd_first_lineno(node1));
18836 nd_set_first_column(node2, nd_first_column(node1));
18837 return node2;
18838 }
18839 return node1;
18840}
18841
18842static bool
18843args_info_empty_p(struct rb_args_info *args)
18844{
18845 if (args->pre_args_num) return false;
18846 if (args->post_args_num) return false;
18847 if (args->rest_arg) return false;
18848 if (args->opt_args) return false;
18849 if (args->block_arg) return false;
18850 if (args->kw_args) return false;
18851 if (args->kw_rest_arg) return false;
18852 return true;
18853}
18854
18855static NODE*
18856new_args(struct parser_params *p, NODE *pre_args, NODE *opt_args, ID rest_arg, NODE *post_args, NODE *tail, const YYLTYPE *loc)
18857{
18858 int saved_line = p->ruby_sourceline;
18859 struct rb_args_info *args = tail->nd_ainfo;
18860
18861 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
18862 args->pre_init = pre_args ? pre_args->nd_next : 0;
18863
18864 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
18865 args->post_init = post_args ? post_args->nd_next : 0;
18866 args->first_post_arg = post_args ? post_args->nd_pid : 0;
18867
18868 args->rest_arg = rest_arg;
18869
18870 args->opt_args = opt_args;
18871
18873
18874 p->ruby_sourceline = saved_line;
18875 nd_set_loc(tail, loc);
18876
18877 return tail;
18878}
18879
18880static NODE*
18881new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *loc)
18882{
18883 int saved_line = p->ruby_sourceline;
18884 NODE *node;
18886 struct rb_args_info *args = ZALLOC(struct rb_args_info);
18887 rb_imemo_tmpbuf_set_ptr(tmpbuf, args);
18888 args->imemo = tmpbuf;
18889 node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
18890 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
18891 if (p->error_p) return node;
18892
18893 args->block_arg = block;
18894 args->kw_args = kw_args;
18895
18896 if (kw_args) {
18897 /*
18898 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
18899 * variable order: k1, kr1, k2, &b, internal_id, krest
18900 * #=> <reorder>
18901 * variable order: kr1, k1, k2, internal_id, krest, &b
18902 */
18903 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
18904 struct vtable *vtargs = p->lvtbl->args;
18905 NODE *kwn = kw_args;
18906
18907 vtable_pop(vtargs, !!block + !!kw_rest_arg);
18908 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
18909 while (kwn) {
18910 if (!NODE_REQUIRED_KEYWORD_P(kwn->nd_body))
18911 --kw_vars;
18912 --required_kw_vars;
18913 kwn = kwn->nd_next;
18914 }
18915
18916 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
18917 ID vid = kwn->nd_body->nd_vid;
18918 if (NODE_REQUIRED_KEYWORD_P(kwn->nd_body)) {
18919 *required_kw_vars++ = vid;
18920 }
18921 else {
18922 *kw_vars++ = vid;
18923 }
18924 }
18925
18926 arg_var(p, kw_bits);
18927 if (kw_rest_arg) arg_var(p, kw_rest_arg);
18928 if (block) arg_var(p, block);
18929
18930 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, loc);
18931 args->kw_rest_arg->nd_cflag = kw_bits;
18932 }
18933 else if (kw_rest_arg == idNil) {
18934 args->no_kwarg = 1;
18935 }
18936 else if (kw_rest_arg) {
18937 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, loc);
18938 }
18939
18940 p->ruby_sourceline = saved_line;
18941 return node;
18942}
18943
18944static NODE *
18945args_with_numbered(struct parser_params *p, NODE *args, int max_numparam)
18946{
18947 if (max_numparam > NO_PARAM) {
18948 if (!args) {
18949 YYLTYPE loc = RUBY_INIT_YYLLOC();
18950 args = new_args_tail(p, 0, 0, 0, 0);
18951 nd_set_loc(args, &loc);
18952 }
18953 args->nd_ainfo->pre_args_num = max_numparam;
18954 }
18955 return args;
18956}
18957
18958static NODE*
18959new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
18960{
18961 struct rb_ary_pattern_info *apinfo = aryptn->nd_apinfo;
18962
18963 aryptn->nd_pconst = constant;
18964
18965 if (pre_arg) {
18966 NODE *pre_args = NEW_LIST(pre_arg, loc);
18967 if (apinfo->pre_args) {
18968 apinfo->pre_args = list_concat(pre_args, apinfo->pre_args);
18969 }
18970 else {
18971 apinfo->pre_args = pre_args;
18972 }
18973 }
18974 return aryptn;
18975}
18976
18977static NODE*
18978new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc)
18979{
18980 int saved_line = p->ruby_sourceline;
18981 NODE *node;
18983 struct rb_ary_pattern_info *apinfo = ZALLOC(struct rb_ary_pattern_info);
18984 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
18985 node = NEW_NODE(NODE_ARYPTN, 0, 0, apinfo, loc);
18986 apinfo->imemo = tmpbuf;
18987 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
18988
18989 apinfo->pre_args = pre_args;
18990
18991 if (has_rest) {
18992 if (rest_arg) {
18993 apinfo->rest_arg = assignable(p, rest_arg, 0, loc);
18994 }
18995 else {
18997 }
18998 }
18999 else {
19000 apinfo->rest_arg = NULL;
19001 }
19002
19003 apinfo->post_args = post_args;
19004
19005 p->ruby_sourceline = saved_line;
19006 return node;
19007}
19008
19009static NODE*
19010new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
19011{
19012 hshptn->nd_pconst = constant;
19013 return hshptn;
19014}
19015
19016static NODE*
19017new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
19018{
19019 int saved_line = p->ruby_sourceline;
19020 NODE *node, *kw_rest_arg_node;
19021
19022 if (kw_rest_arg == idNil) {
19023 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
19024 }
19025 else if (kw_rest_arg) {
19026 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
19027 }
19028 else {
19029 kw_rest_arg_node = NULL;
19030 }
19031
19032 node = NEW_NODE(NODE_HSHPTN, 0, kw_args, kw_rest_arg_node, loc);
19033
19034 p->ruby_sourceline = saved_line;
19035 return node;
19036}
19037
19038static NODE *
19039new_case3(struct parser_params *p, NODE *val, NODE *pat, const YYLTYPE *loc)
19040{
19041 NODE *node = NEW_CASE3(val, pat, loc);
19042
19044 rb_warn0L(nd_line(node), "Pattern matching is experimental, and the behavior may change in future versions of Ruby!");
19045 return node;
19046}
19047
19048static NODE*
19049dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19050{
19051 VALUE lit;
19052
19053 if (!node) {
19054 return NEW_LIT(ID2SYM(idNULL), loc);
19055 }
19056
19057 switch (nd_type(node)) {
19058 case NODE_DSTR:
19059 nd_set_type(node, NODE_DSYM);
19060 nd_set_loc(node, loc);
19061 break;
19062 case NODE_STR:
19063 lit = node->nd_lit;
19064 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = ID2SYM(rb_intern_str(lit)));
19065 nd_set_type(node, NODE_LIT);
19066 nd_set_loc(node, loc);
19067 break;
19068 default:
19069 node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node, loc), loc);
19070 break;
19071 }
19072 return node;
19073}
19074
19075static int
19076append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
19077{
19078 NODE *node = (NODE *)v;
19079 NODE **result = (NODE **)h;
19080 node->nd_alen = 2;
19081 node->nd_next->nd_end = node->nd_next;
19082 node->nd_next->nd_next = 0;
19083 if (*result)
19084 list_concat(*result, node);
19085 else
19086 *result = node;
19087 return ST_CONTINUE;
19088}
19089
19090static NODE *
19091remove_duplicate_keys(struct parser_params *p, NODE *hash)
19092{
19093 st_table *literal_keys = st_init_numtable_with_size(hash->nd_alen / 2);
19094 NODE *result = 0;
19095 rb_code_location_t loc = hash->nd_loc;
19096 while (hash && hash->nd_head && hash->nd_next) {
19097 NODE *head = hash->nd_head;
19098 NODE *value = hash->nd_next;
19099 NODE *next = value->nd_next;
19100 VALUE key = (VALUE)head;
19101 st_data_t data;
19102 if (nd_type(head) == NODE_LIT &&
19103 st_lookup(literal_keys, (key = head->nd_lit), &data)) {
19105 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
19106 head->nd_lit, nd_line(head));
19107 head = ((NODE *)data)->nd_next;
19108 head->nd_head = block_append(p, head->nd_head, value->nd_head);
19109 }
19110 else {
19111 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
19112 }
19113 hash = next;
19114 }
19115 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
19116 st_free_table(literal_keys);
19117 if (hash) {
19118 if (!result) result = hash;
19119 else list_concat(result, hash);
19120 }
19121 result->nd_loc = loc;
19122 return result;
19123}
19124
19125static NODE *
19126new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
19127{
19128 if (hash) hash = remove_duplicate_keys(p, hash);
19129 return NEW_HASH(hash, loc);
19130}
19131#endif
19132
19133static void
19134error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
19135{
19136 if (is_private_local_id(id)) {
19137 return;
19138 }
19139 if (st_is_member(p->pvtbl, id)) {
19140 yyerror1(loc, "duplicated variable name");
19141 }
19142 else {
19143 st_insert(p->pvtbl, (st_data_t)id, 0);
19144 }
19145}
19146
19147static void
19148error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
19149{
19150 if (!p->pktbl) {
19151 p->pktbl = st_init_numtable();
19152 }
19153 else if (st_is_member(p->pktbl, key)) {
19154 yyerror1(loc, "duplicated key name");
19155 return;
19156 }
19157 st_insert(p->pktbl, (st_data_t)key, 0);
19158}
19159
19160#ifndef RIPPER
19161static NODE *
19162new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
19163{
19164 return NEW_HASH(hash, loc);
19165}
19166#endif /* !RIPPER */
19167
19168#ifndef RIPPER
19169static NODE *
19170new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *loc)
19171{
19172 NODE *asgn;
19173
19174 if (lhs) {
19175 ID vid = lhs->nd_vid;
19176 YYLTYPE lhs_loc = lhs->nd_loc;
19177 if (op == tOROP) {
19178 lhs->nd_value = rhs;
19179 nd_set_loc(lhs, loc);
19180 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
19181 if (is_notop_id(vid)) {
19182 switch (id_type(vid)) {
19183 case ID_GLOBAL:
19184 case ID_INSTANCE:
19185 case ID_CLASS:
19186 asgn->nd_aid = vid;
19187 }
19188 }
19189 }
19190 else if (op == tANDOP) {
19191 lhs->nd_value = rhs;
19192 nd_set_loc(lhs, loc);
19193 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
19194 }
19195 else {
19196 asgn = lhs;
19197 asgn->nd_value = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
19198 nd_set_loc(asgn, loc);
19199 }
19200 }
19201 else {
19202 asgn = NEW_BEGIN(0, loc);
19203 }
19204 return asgn;
19205}
19206
19207static NODE *
19208new_ary_op_assign(struct parser_params *p, NODE *ary,
19209 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
19210{
19211 NODE *asgn;
19212
19213 args = make_list(args, args_loc);
19214 if (nd_type(args) == NODE_BLOCK_PASS) {
19215 args = NEW_ARGSCAT(args, rhs, loc);
19216 }
19217 else {
19218 args = arg_concat(p, args, rhs, loc);
19219 }
19220 asgn = NEW_OP_ASGN1(ary, op, args, loc);
19221 fixpos(asgn, ary);
19222 return asgn;
19223}
19224
19225static NODE *
19226new_attr_op_assign(struct parser_params *p, NODE *lhs,
19227 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
19228{
19229 NODE *asgn;
19230
19231 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
19232 fixpos(asgn, lhs);
19233 return asgn;
19234}
19235
19236static NODE *
19237new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *loc)
19238{
19239 NODE *asgn;
19240
19241 if (lhs) {
19242 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
19243 }
19244 else {
19245 asgn = NEW_BEGIN(0, loc);
19246 }
19247 fixpos(asgn, lhs);
19248 return asgn;
19249}
19250
19251static NODE *
19252const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
19253{
19254 if (p->in_def) {
19255 yyerror1(loc, "dynamic constant assignment");
19256 }
19257 return NEW_CDECL(0, 0, (path), loc);
19258}
19259#else
19260static VALUE
19261const_decl(struct parser_params *p, VALUE path)
19262{
19263 if (p->in_def) {
19264 path = dispatch1(assign_error, path);
19265 ripper_error(p);
19266 }
19267 return path;
19268}
19269
19270static VALUE
19271assign_error(struct parser_params *p, VALUE a)
19272{
19273 a = dispatch1(assign_error, a);
19274 ripper_error(p);
19275 return a;
19276}
19277
19278static VALUE
19279var_field(struct parser_params *p, VALUE a)
19280{
19281 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
19282}
19283#endif
19284
19285#ifndef RIPPER
19286static NODE *
19287new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
19288{
19289 NODE *result = head;
19290 if (rescue) {
19291 NODE *tmp = rescue_else ? rescue_else : rescue;
19292 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
19293
19294 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
19295 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
19296 }
19297 else if (rescue_else) {
19298 result = block_append(p, result, rescue_else);
19299 }
19300 if (ensure) {
19301 result = NEW_ENSURE(result, ensure, loc);
19302 }
19303 fixpos(result, head);
19304 return result;
19305}
19306#endif
19307
19308static void
19309warn_unused_var(struct parser_params *p, struct local_vars *local)
19310{
19311 int cnt;
19312
19313 if (!local->used) return;
19314 cnt = local->used->pos;
19315 if (cnt != local->vars->pos) {
19316 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
19317 }
19318#ifndef RIPPER
19319 ID *v = local->vars->tbl;
19320 ID *u = local->used->tbl;
19321 for (int i = 0; i < cnt; ++i) {
19322 if (!v[i] || (u[i] & LVAR_USED)) continue;
19323 if (is_private_local_id(v[i])) continue;
19324 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
19325 }
19326#endif
19327}
19328
19329static void
19330local_push(struct parser_params *p, int toplevel_scope)
19331{
19332 struct local_vars *local;
19333 int inherits_dvars = toplevel_scope && compile_for_eval;
19334 int warn_unused_vars = RTEST(ruby_verbose);
19335
19336 local = ALLOC(struct local_vars);
19337 local->prev = p->lvtbl;
19338 local->args = vtable_alloc(0);
19339 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
19340#ifndef RIPPER
19341 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
19342 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
19343 local->numparam.outer = 0;
19344 local->numparam.inner = 0;
19345 local->numparam.current = 0;
19346#endif
19347 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
19348
19349# if WARN_PAST_SCOPE
19350 local->past = 0;
19351# endif
19352 CMDARG_PUSH(0);
19353 COND_PUSH(0);
19354 p->lvtbl = local;
19355}
19356
19357static void
19358local_pop(struct parser_params *p)
19359{
19360 struct local_vars *local = p->lvtbl->prev;
19361 if (p->lvtbl->used) {
19362 warn_unused_var(p, p->lvtbl);
19363 vtable_free(p->lvtbl->used);
19364 }
19365# if WARN_PAST_SCOPE
19366 while (p->lvtbl->past) {
19367 struct vtable *past = p->lvtbl->past;
19368 p->lvtbl->past = past->prev;
19369 vtable_free(past);
19370 }
19371# endif
19372 vtable_free(p->lvtbl->args);
19373 vtable_free(p->lvtbl->vars);
19374 CMDARG_POP();
19375 COND_POP();
19376 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
19377 p->lvtbl = local;
19378}
19379
19380#ifndef RIPPER
19381static ID*
19382local_tbl(struct parser_params *p)
19383{
19384 int cnt_args = vtable_size(p->lvtbl->args);
19385 int cnt_vars = vtable_size(p->lvtbl->vars);
19386 int cnt = cnt_args + cnt_vars;
19387 int i, j;
19388 ID *buf;
19389
19390 if (cnt <= 0) return 0;
19391 buf = ALLOC_N(ID, cnt + 2);
19392 MEMCPY(buf+1, p->lvtbl->args->tbl, ID, cnt_args);
19393 /* remove IDs duplicated to warn shadowing */
19394 for (i = 0, j = cnt_args+1; i < cnt_vars; ++i) {
19395 ID id = p->lvtbl->vars->tbl[i];
19396 if (!vtable_included(p->lvtbl->args, id)) {
19397 buf[j++] = id;
19398 }
19399 }
19400 if (--j < cnt) {
19401 REALLOC_N(buf, ID, (cnt = j) + 2);
19402 }
19403 buf[0] = cnt;
19405
19406 return buf;
19407}
19408
19409static NODE*
19410node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc)
19411{
19412 ID *a0;
19413 NODE *n;
19414
19415 a0 = local_tbl(p);
19416 n = NEW_NODE(type, a0, a1, a2, loc);
19417 return n;
19418}
19419
19420#endif
19421
19422static void
19423numparam_name(struct parser_params *p, ID id)
19424{
19425 if (!NUMPARAM_ID_P(id)) return;
19426 rb_warn1("`_%d' is reserved for numbered parameter; consider another name",
19428}
19429
19430static void
19431arg_var(struct parser_params *p, ID id)
19432{
19433 numparam_name(p, id);
19434 vtable_add(p->lvtbl->args, id);
19435}
19436
19437static void
19438local_var(struct parser_params *p, ID id)
19439{
19440 numparam_name(p, id);
19441 vtable_add(p->lvtbl->vars, id);
19442 if (p->lvtbl->used) {
19444 }
19445}
19446
19447static int
19448local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
19449{
19450 struct vtable *vars, *args, *used;
19451
19452 vars = p->lvtbl->vars;
19453 args = p->lvtbl->args;
19454 used = p->lvtbl->used;
19455
19456 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
19457 vars = vars->prev;
19458 args = args->prev;
19459 if (used) used = used->prev;
19460 }
19461
19462 if (vars && vars->prev == DVARS_INHERIT) {
19463 return rb_local_defined(id, p->parent_iseq);
19464 }
19465 else if (vtable_included(args, id)) {
19466 return 1;
19467 }
19468 else {
19469 int i = vtable_included(vars, id);
19470 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
19471 return i != 0;
19472 }
19473}
19474
19475static int
19476local_id(struct parser_params *p, ID id)
19477{
19478 return local_id_ref(p, id, NULL);
19479}
19480
19481static NODE *
19482numparam_push(struct parser_params *p)
19483{
19484#ifndef RIPPER
19485 struct local_vars *local = p->lvtbl;
19486 NODE *inner = local->numparam.inner;
19487 if (!local->numparam.outer) {
19488 local->numparam.outer = local->numparam.current;
19489 }
19490 local->numparam.inner = 0;
19491 local->numparam.current = 0;
19492 return inner;
19493#else
19494 return 0;
19495#endif
19496}
19497
19498static void
19499numparam_pop(struct parser_params *p, NODE *prev_inner)
19500{
19501#ifndef RIPPER
19502 struct local_vars *local = p->lvtbl;
19503 if (prev_inner) {
19504 /* prefer first one */
19505 local->numparam.inner = prev_inner;
19506 }
19507 else if (local->numparam.current) {
19508 /* current and inner are exclusive */
19509 local->numparam.inner = local->numparam.current;
19510 }
19511 if (p->max_numparam > NO_PARAM) {
19512 /* current and outer are exclusive */
19513 local->numparam.current = local->numparam.outer;
19514 local->numparam.outer = 0;
19515 }
19516 else {
19517 /* no numbered parameter */
19518 local->numparam.current = 0;
19519 }
19520#endif
19521}
19522
19523static const struct vtable *
19524dyna_push(struct parser_params *p)
19525{
19526 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
19527 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
19528 if (p->lvtbl->used) {
19529 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
19530 }
19531 return p->lvtbl->args;
19532}
19533
19534static void
19535dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
19536{
19537 struct vtable *tmp = *vtblp;
19538 *vtblp = tmp->prev;
19539# if WARN_PAST_SCOPE
19540 if (p->past_scope_enabled) {
19541 tmp->prev = p->lvtbl->past;
19542 p->lvtbl->past = tmp;
19543 return;
19544 }
19545# endif
19546 vtable_free(tmp);
19547}
19548
19549static void
19550dyna_pop_1(struct parser_params *p)
19551{
19552 struct vtable *tmp;
19553
19554 if ((tmp = p->lvtbl->used) != 0) {
19555 warn_unused_var(p, p->lvtbl);
19556 p->lvtbl->used = p->lvtbl->used->prev;
19557 vtable_free(tmp);
19558 }
19559 dyna_pop_vtable(p, &p->lvtbl->args);
19560 dyna_pop_vtable(p, &p->lvtbl->vars);
19561}
19562
19563static void
19564dyna_pop(struct parser_params *p, const struct vtable *lvargs)
19565{
19566 while (p->lvtbl->args != lvargs) {
19567 dyna_pop_1(p);
19568 if (!p->lvtbl->args) {
19569 struct local_vars *local = p->lvtbl->prev;
19570 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
19571 p->lvtbl = local;
19572 }
19573 }
19574 dyna_pop_1(p);
19575}
19576
19577static int
19578dyna_in_block(struct parser_params *p)
19579{
19580 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
19581}
19582
19583static int
19584dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
19585{
19586 struct vtable *vars, *args, *used;
19587 int i;
19588
19589 args = p->lvtbl->args;
19590 vars = p->lvtbl->vars;
19591 used = p->lvtbl->used;
19592
19593 while (!DVARS_TERMINAL_P(vars)) {
19594 if (vtable_included(args, id)) {
19595 return 1;
19596 }
19597 if ((i = vtable_included(vars, id)) != 0) {
19598 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
19599 return 1;
19600 }
19601 args = args->prev;
19602 vars = vars->prev;
19603 if (!vidrefp) used = 0;
19604 if (used) used = used->prev;
19605 }
19606
19607 if (vars == DVARS_INHERIT) {
19608 return rb_dvar_defined(id, p->parent_iseq);
19609 }
19610
19611 return 0;
19612}
19613
19614static int
19615dvar_defined(struct parser_params *p, ID id)
19616{
19617 return dvar_defined_ref(p, id, NULL);
19618}
19619
19620static int
19621dvar_curr(struct parser_params *p, ID id)
19622{
19623 return (vtable_included(p->lvtbl->args, id) ||
19624 vtable_included(p->lvtbl->vars, id));
19625}
19626
19627static void
19628reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
19629{
19630 compile_error(p,
19631 "regexp encoding option '%c' differs from source encoding '%s'",
19633}
19634
19635#ifndef RIPPER
19636int
19638{
19639 int c = RE_OPTION_ENCODING_IDX(options);
19640
19641 if (c) {
19642 int opt, idx;
19643 rb_char_to_option_kcode(c, &opt, &idx);
19644 if (idx != ENCODING_GET(str) &&
19646 goto error;
19647 }
19648 ENCODING_SET(str, idx);
19649 }
19650 else if (RE_OPTION_ENCODING_NONE(options)) {
19651 if (!ENCODING_IS_ASCII8BIT(str) &&
19653 c = 'n';
19654 goto error;
19655 }
19657 }
19658 else if (p->enc == rb_usascii_encoding()) {
19660 /* raise in re.c */
19662 }
19663 else {
19665 }
19666 }
19667 return 0;
19668
19669 error:
19670 return c;
19671}
19672
19673static void
19674reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
19675{
19676 int c = rb_reg_fragment_setenc(p, str, options);
19677 if (c) reg_fragment_enc_error(p, str, c);
19678}
19679
19680static int
19681reg_fragment_check(struct parser_params* p, VALUE str, int options)
19682{
19683 VALUE err;
19684 reg_fragment_setenc(p, str, options);
19686 if (err != Qnil) {
19688 compile_error(p, "%"PRIsVALUE, err);
19689 return 0;
19690 }
19691 return 1;
19692}
19693
19694typedef struct {
19695 struct parser_params* parser;
19697 NODE *succ_block;
19698 const YYLTYPE *loc;
19700
19701static int
19702reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
19703 int back_num, int *back_refs, OnigRegex regex, void *arg0)
19704{
19706 struct parser_params* p = arg->parser;
19707 rb_encoding *enc = arg->enc;
19708 long len = name_end - name;
19709 const char *s = (const char *)name;
19710 ID var;
19711 NODE *node, *succ;
19712
19713 if (!len) return ST_CONTINUE;
19714 if (rb_enc_symname_type(s, len, enc, (1U<<ID_LOCAL)) != ID_LOCAL)
19715 return ST_CONTINUE;
19716
19717 var = intern_cstr(s, len, enc);
19718 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
19719 if (!lvar_defined(p, var)) return ST_CONTINUE;
19720 }
19721 node = node_assign(p, assignable(p, var, 0, arg->loc), NEW_LIT(ID2SYM(var), arg->loc), arg->loc);
19722 succ = arg->succ_block;
19723 if (!succ) succ = NEW_BEGIN(0, arg->loc);
19724 succ = block_append(p, succ, node);
19725 arg->succ_block = succ;
19726 return ST_CONTINUE;
19727}
19728
19729static NODE *
19730reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
19731{
19733
19734 arg.parser = p;
19735 arg.enc = rb_enc_get(regexp);
19736 arg.succ_block = 0;
19737 arg.loc = loc;
19738 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
19739
19740 if (!arg.succ_block) return 0;
19741 return arg.succ_block->nd_next;
19742}
19743
19744static VALUE
19745parser_reg_compile(struct parser_params* p, VALUE str, int options)
19746{
19747 reg_fragment_setenc(p, str, options);
19748 return rb_parser_reg_compile(p, str, options);
19749}
19750
19751VALUE
19753{
19755}
19756
19757static VALUE
19758reg_compile(struct parser_params* p, VALUE str, int options)
19759{
19760 VALUE re;
19761 VALUE err;
19762
19763 err = rb_errinfo();
19764 re = parser_reg_compile(p, str, options);
19765 if (NIL_P(re)) {
19768 compile_error(p, "%"PRIsVALUE, m);
19769 return Qnil;
19770 }
19771 return re;
19772}
19773#else
19774static VALUE
19775parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
19776{
19777 VALUE err = rb_errinfo();
19778 VALUE re;
19779 str = ripper_is_node_yylval(str) ? RNODE(str)->nd_cval : str;
19780 int c = rb_reg_fragment_setenc(p, str, options);
19781 if (c) reg_fragment_enc_error(p, str, c);
19782 re = rb_parser_reg_compile(p, str, options);
19783 if (NIL_P(re)) {
19784 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
19786 }
19787 return re;
19788}
19789#endif
19790
19791#ifndef RIPPER
19792void
19793rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
19794{
19795 struct parser_params *p;
19796 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
19797 p->do_print = print;
19798 p->do_loop = loop;
19799 p->do_chomp = chomp;
19800 p->do_split = split;
19801}
19802
19803void
19805{
19806 struct parser_params *p;
19807 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
19808 p->warn_location = warn;
19809}
19810
19811static NODE *
19812parser_append_options(struct parser_params *p, NODE *node)
19813{
19814 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
19815 const YYLTYPE *const LOC = &default_location;
19816
19817 if (p->do_print) {
19818 NODE *print = NEW_FCALL(rb_intern("print"),
19819 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
19820 LOC);
19821 node = block_append(p, node, print);
19822 }
19823
19824 if (p->do_loop) {
19825 if (p->do_split) {
19826 NODE *args = NEW_LIST(NEW_GVAR(rb_intern("$;"), LOC), LOC);
19827 NODE *split = NEW_GASGN(rb_intern("$F"),
19829 rb_intern("split"), args, LOC),
19830 LOC);
19831 node = block_append(p, split, node);
19832 }
19833 if (p->do_chomp) {
19834 NODE *chomp = NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
19835 rb_intern("chomp!"), 0, LOC);
19836 node = block_append(p, chomp, node);
19837 }
19838
19839 node = NEW_WHILE(NEW_VCALL(idGets, LOC), node, 1, LOC);
19840 }
19841
19842 return node;
19843}
19844
19845void
19847{
19848 /* just to suppress unused-function warnings */
19849 (void)nodetype;
19850 (void)nodeline;
19851}
19852
19853static ID
19854internal_id(struct parser_params *p)
19855{
19856 const ID max_id = RB_ID_SERIAL_MAX & ~0xffff;
19857 ID id = (ID)vtable_size(p->lvtbl->args) + (ID)vtable_size(p->lvtbl->vars);
19858 id = max_id - id;
19859 return ID_STATIC_SYM | ID_INTERNAL | (id << ID_SCOPE_SHIFT);
19860}
19861#endif /* !RIPPER */
19862
19863static void
19864parser_initialize(struct parser_params *p)
19865{
19866 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
19867 p->command_start = TRUE;
19869 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
19870 p->node_id = 0;
19871#ifdef RIPPER
19872 p->delayed.token = Qnil;
19873 p->result = Qnil;
19874 p->parsing_thread = Qnil;
19875#else
19876 p->error_buffer = Qfalse;
19877#endif
19878 p->debug_buffer = Qnil;
19880 p->enc = rb_utf8_encoding();
19881}
19882
19883#ifdef RIPPER
19884#define parser_mark ripper_parser_mark
19885#define parser_free ripper_parser_free
19886#endif
19887
19888static void
19889parser_mark(void *ptr)
19890{
19891 struct parser_params *p = (struct parser_params*)ptr;
19892
19893 rb_gc_mark(p->lex.input);
19899 rb_gc_mark((VALUE)p->ast);
19901#ifndef RIPPER
19905#else
19906 rb_gc_mark(p->delayed.token);
19907 rb_gc_mark(p->value);
19908 rb_gc_mark(p->result);
19909 rb_gc_mark(p->parsing_thread);
19910#endif
19913#ifdef YYMALLOC
19914 rb_gc_mark((VALUE)p->heap);
19915#endif
19916}
19917
19918static void
19919parser_free(void *ptr)
19920{
19921 struct parser_params *p = (struct parser_params*)ptr;
19922 struct local_vars *local, *prev;
19923
19924 if (p->tokenbuf) {
19926 }
19927 for (local = p->lvtbl; local; local = prev) {
19928 if (local->vars) xfree(local->vars);
19929 prev = local->prev;
19930 xfree(local);
19931 }
19932 {
19933 token_info *ptinfo;
19934 while ((ptinfo = p->token_info) != 0) {
19935 p->token_info = ptinfo->next;
19936 xfree(ptinfo);
19937 }
19938 }
19939 xfree(ptr);
19940}
19941
19942static size_t
19943parser_memsize(const void *ptr)
19944{
19945 struct parser_params *p = (struct parser_params*)ptr;
19946 struct local_vars *local;
19947 size_t size = sizeof(*p);
19948
19949 size += p->toksiz;
19950 for (local = p->lvtbl; local; local = local->prev) {
19951 size += sizeof(*local);
19952 if (local->vars) size += local->vars->capa * sizeof(ID);
19953 }
19954 return size;
19955}
19956
19957static const rb_data_type_t parser_data_type = {
19958#ifndef RIPPER
19959 "parser",
19960#else
19961 "ripper",
19962#endif
19963 {
19964 parser_mark,
19965 parser_free,
19966 parser_memsize,
19967 },
19969};
19970
19971#ifndef RIPPER
19972#undef rb_reserved_word
19973
19974const struct kwtable *
19975rb_reserved_word(const char *str, unsigned int len)
19976{
19977 return reserved_word(str, len);
19978}
19979
19980VALUE
19982{
19983 struct parser_params *p;
19984 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
19985 &parser_data_type, p);
19986 parser_initialize(p);
19987 return parser;
19988}
19989
19990VALUE
19991rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
19992{
19993 struct parser_params *p;
19994
19995 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
19996 p->error_buffer = main ? Qfalse : Qnil;
19997 p->parent_iseq = base;
19998 return vparser;
19999}
20000#endif
20001
20002#ifdef RIPPER
20003#define rb_parser_end_seen_p ripper_parser_end_seen_p
20004#define rb_parser_encoding ripper_parser_encoding
20005#define rb_parser_get_yydebug ripper_parser_get_yydebug
20006#define rb_parser_set_yydebug ripper_parser_set_yydebug
20007#define rb_parser_get_debug_output ripper_parser_get_debug_output
20008#define rb_parser_set_debug_output ripper_parser_set_debug_output
20009static VALUE ripper_parser_end_seen_p(VALUE vparser);
20010static VALUE ripper_parser_encoding(VALUE vparser);
20011static VALUE ripper_parser_get_yydebug(VALUE self);
20012static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
20013static VALUE ripper_parser_get_debug_output(VALUE self);
20014static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output);
20015
20016/*
20017 * call-seq:
20018 * ripper.error? -> Boolean
20019 *
20020 * Return true if parsed source has errors.
20021 */
20022static VALUE
20023ripper_error_p(VALUE vparser)
20024{
20025 struct parser_params *p;
20026
20027 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20028 return p->error_p ? Qtrue : Qfalse;
20029}
20030#endif
20031
20032/*
20033 * call-seq:
20034 * ripper.end_seen? -> Boolean
20035 *
20036 * Return true if parsed source ended by +\_\_END\_\_+.
20037 */
20038VALUE
20040{
20041 struct parser_params *p;
20042
20043 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20044 return p->ruby__end__seen ? Qtrue : Qfalse;
20045}
20046
20047/*
20048 * call-seq:
20049 * ripper.encoding -> encoding
20050 *
20051 * Return encoding of the source.
20052 */
20053VALUE
20055{
20056 struct parser_params *p;
20057
20058 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20059 return rb_enc_from_encoding(p->enc);
20060}
20061
20062#ifdef RIPPER
20063/*
20064 * call-seq:
20065 * ripper.yydebug -> true or false
20066 *
20067 * Get yydebug.
20068 */
20069VALUE
20070rb_parser_get_yydebug(VALUE self)
20071{
20072 struct parser_params *p;
20073
20074 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20075 return p->debug ? Qtrue : Qfalse;
20076}
20077#endif
20078
20079/*
20080 * call-seq:
20081 * ripper.yydebug = flag
20082 *
20083 * Set yydebug.
20084 */
20085VALUE
20087{
20088 struct parser_params *p;
20089
20090 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20091 p->debug = RTEST(flag);
20092 return flag;
20093}
20094
20095/*
20096 * call-seq:
20097 * ripper.debug_output -> obj
20098 *
20099 * Get debug output.
20100 */
20101VALUE
20103{
20104 struct parser_params *p;
20105
20106 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20107 return p->debug_output;
20108}
20109
20110/*
20111 * call-seq:
20112 * ripper.debug_output = obj
20113 *
20114 * Set debug output.
20115 */
20116VALUE
20118{
20119 struct parser_params *p;
20120
20121 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20122 return p->debug_output = output;
20123}
20124
20125#ifndef RIPPER
20126#ifdef YYMALLOC
20127#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
20128/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
20129 * potential memory leak */
20130#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
20131#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
20132 (new)->cnt = (cnt), (ptr))
20133
20134void *
20136{
20137 size_t cnt = HEAPCNT(1, size);
20139 void *ptr = xmalloc(size);
20140
20141 return ADD2HEAP(n, cnt, ptr);
20142}
20143
20144void *
20145rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
20146{
20147 size_t cnt = HEAPCNT(nelem, size);
20149 void *ptr = xcalloc(nelem, size);
20150
20151 return ADD2HEAP(n, cnt, ptr);
20152}
20153
20154void *
20155rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
20156{
20158 size_t cnt = HEAPCNT(1, size);
20159
20160 if (ptr && (n = p->heap) != NULL) {
20161 do {
20162 if (n->ptr == ptr) {
20163 n->ptr = ptr = xrealloc(ptr, size);
20164 if (n->cnt) n->cnt = cnt;
20165 return ptr;
20166 }
20167 } while ((n = n->next) != NULL);
20168 }
20169 n = NEWHEAP();
20170 ptr = xrealloc(ptr, size);
20171 return ADD2HEAP(n, cnt, ptr);
20172}
20173
20174void
20176{
20177 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
20178
20179 while ((n = *prev) != NULL) {
20180 if (n->ptr == ptr) {
20181 *prev = n->next;
20183 break;
20184 }
20185 prev = &n->next;
20186 }
20187 xfree(ptr);
20188}
20189#endif
20190
20191void
20192rb_parser_printf(struct parser_params *p, const char *fmt, ...)
20193{
20194 va_list ap;
20195 VALUE mesg = p->debug_buffer;
20196
20197 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
20198 va_start(ap, fmt);
20199 rb_str_vcatf(mesg, fmt, ap);
20200 va_end(ap);
20201 if (RSTRING_END(mesg)[-1] == '\n') {
20202 rb_io_write(p->debug_output, mesg);
20203 p->debug_buffer = Qnil;
20204 }
20205}
20206
20207static void
20208parser_compile_error(struct parser_params *p, const char *fmt, ...)
20209{
20210 va_list ap;
20211
20213 p->error_p = 1;
20214 va_start(ap, fmt);
20215 p->error_buffer =
20218 p->ruby_sourceline,
20219 rb_long2int(p->lex.pcur - p->lex.pbeg),
20220 p->enc, fmt, ap);
20221 va_end(ap);
20222}
20223
20224static size_t
20225count_char(const char *str, int c)
20226{
20227 int n = 0;
20228 while (str[n] == c) ++n;
20229 return n;
20230}
20231
20232/*
20233 * strip enclosing double-quotes, same as the default yytnamerr except
20234 * for that single-quotes matching back-quotes do not stop stripping.
20235 *
20236 * "\"`class' keyword\"" => "`class' keyword"
20237 */
20238RUBY_FUNC_EXPORTED size_t
20239rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
20240{
20241 if (*yystr == '"') {
20242 size_t yyn = 0, bquote = 0;
20243 const char *yyp = yystr;
20244
20245 while (*++yyp) {
20246 switch (*yyp) {
20247 case '`':
20248 if (!bquote) {
20249 bquote = count_char(yyp+1, '`') + 1;
20250 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
20251 yyn += bquote;
20252 yyp += bquote - 1;
20253 break;
20254 }
20255 goto default_char;
20256
20257 case '\'':
20258 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
20259 if (yyres) memcpy(yyres + yyn, yyp, bquote);
20260 yyn += bquote;
20261 yyp += bquote - 1;
20262 bquote = 0;
20263 break;
20264 }
20265 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
20266 if (yyres) memcpy(yyres + yyn, yyp, 3);
20267 yyn += 3;
20268 yyp += 2;
20269 break;
20270 }
20271 goto do_not_strip_quotes;
20272
20273 case ',':
20274 goto do_not_strip_quotes;
20275
20276 case '\\':
20277 if (*++yyp != '\\')
20278 goto do_not_strip_quotes;
20279 /* Fall through. */
20280 default_char:
20281 default:
20282 if (yyres)
20283 yyres[yyn] = *yyp;
20284 yyn++;
20285 break;
20286
20287 case '"':
20288 case '\0':
20289 if (yyres)
20290 yyres[yyn] = '\0';
20291 return yyn;
20292 }
20293 }
20294 do_not_strip_quotes: ;
20295 }
20296
20297 if (!yyres) return strlen(yystr);
20298
20299 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
20300}
20301#endif
20302
20303#ifdef RIPPER
20304#ifdef RIPPER_DEBUG
20305/* :nodoc: */
20306static VALUE
20307ripper_validate_object(VALUE self, VALUE x)
20308{
20309 if (x == Qfalse) return x;
20310 if (x == Qtrue) return x;
20311 if (x == Qnil) return x;
20312 if (x == Qundef)
20313 rb_raise(rb_eArgError, "Qundef given");
20314 if (FIXNUM_P(x)) return x;
20315 if (SYMBOL_P(x)) return x;
20316 switch (BUILTIN_TYPE(x)) {
20317 case T_STRING:
20318 case T_OBJECT:
20319 case T_ARRAY:
20320 case T_BIGNUM:
20321 case T_FLOAT:
20322 case T_COMPLEX:
20323 case T_RATIONAL:
20324 break;
20325 case T_NODE:
20326 if (nd_type((NODE *)x) != NODE_RIPPER) {
20327 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
20328 }
20329 x = ((NODE *)x)->nd_rval;
20330 break;
20331 default:
20332 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
20333 (void *)x, rb_obj_classname(x));
20334 }
20335 if (!RBASIC_CLASS(x)) {
20336 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
20337 (void *)x, rb_builtin_type_name(TYPE(x)));
20338 }
20339 return x;
20340}
20341#endif
20342
20343#define validate(x) ((x) = get_value(x))
20344
20345static VALUE
20346ripper_dispatch0(struct parser_params *p, ID mid)
20347{
20348 return rb_funcall(p->value, mid, 0);
20349}
20350
20351static VALUE
20352ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
20353{
20354 validate(a);
20355 return rb_funcall(p->value, mid, 1, a);
20356}
20357
20358static VALUE
20359ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
20360{
20361 validate(a);
20362 validate(b);
20363 return rb_funcall(p->value, mid, 2, a, b);
20364}
20365
20366static VALUE
20367ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
20368{
20369 validate(a);
20370 validate(b);
20371 validate(c);
20372 return rb_funcall(p->value, mid, 3, a, b, c);
20373}
20374
20375static VALUE
20376ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
20377{
20378 validate(a);
20379 validate(b);
20380 validate(c);
20381 validate(d);
20382 return rb_funcall(p->value, mid, 4, a, b, c, d);
20383}
20384
20385static VALUE
20386ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
20387{
20388 validate(a);
20389 validate(b);
20390 validate(c);
20391 validate(d);
20392 validate(e);
20393 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
20394}
20395
20396static VALUE
20397ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
20398{
20399 validate(a);
20400 validate(b);
20401 validate(c);
20402 validate(d);
20403 validate(e);
20404 validate(f);
20405 validate(g);
20406 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
20407}
20408
20409static ID
20410ripper_get_id(VALUE v)
20411{
20412 NODE *nd;
20413 if (!RB_TYPE_P(v, T_NODE)) return 0;
20414 nd = (NODE *)v;
20415 if (nd_type(nd) != NODE_RIPPER) return 0;
20416 return nd->nd_vid;
20417}
20418
20419static VALUE
20420ripper_get_value(VALUE v)
20421{
20422 NODE *nd;
20423 if (v == Qundef) return Qnil;
20424 if (!RB_TYPE_P(v, T_NODE)) return v;
20425 nd = (NODE *)v;
20426 if (nd_type(nd) != NODE_RIPPER) return Qnil;
20427 return nd->nd_rval;
20428}
20429
20430static void
20431ripper_error(struct parser_params *p)
20432{
20433 p->error_p = TRUE;
20434}
20435
20436static void
20437ripper_compile_error(struct parser_params *p, const char *fmt, ...)
20438{
20439 VALUE str;
20440 va_list args;
20441
20442 va_start(args, fmt);
20443 str = rb_vsprintf(fmt, args);
20444 va_end(args);
20445 rb_funcall(p->value, rb_intern("compile_error"), 1, str);
20446 ripper_error(p);
20447}
20448
20449static VALUE
20450ripper_lex_get_generic(struct parser_params *p, VALUE src)
20451{
20452 VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
20453 if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
20455 "gets returned %"PRIsVALUE" (expected String or nil)",
20456 rb_obj_class(line));
20457 }
20458 return line;
20459}
20460
20461static VALUE
20462ripper_lex_io_get(struct parser_params *p, VALUE src)
20463{
20464 return rb_io_gets(src);
20465}
20466
20467static VALUE
20468ripper_s_allocate(VALUE klass)
20469{
20470 struct parser_params *p;
20472 &parser_data_type, p);
20473 p->value = self;
20474 return self;
20475}
20476
20477#define ripper_initialized_p(r) ((r)->lex.input != 0)
20478
20479/*
20480 * call-seq:
20481 * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
20482 *
20483 * Create a new Ripper object.
20484 * _src_ must be a String, an IO, or an Object which has #gets method.
20485 *
20486 * This method does not starts parsing.
20487 * See also Ripper#parse and Ripper.parse.
20488 */
20489static VALUE
20490ripper_initialize(int argc, VALUE *argv, VALUE self)
20491{
20492 struct parser_params *p;
20493 VALUE src, fname, lineno;
20494
20495 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20496 rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
20497 if (RB_TYPE_P(src, T_FILE)) {
20498 p->lex.gets = ripper_lex_io_get;
20499 }
20500 else if (rb_respond_to(src, id_gets)) {
20501 p->lex.gets = ripper_lex_get_generic;
20502 }
20503 else {
20505 p->lex.gets = lex_get_str;
20506 }
20507 p->lex.input = src;
20508 p->eofp = 0;
20509 if (NIL_P(fname)) {
20510 fname = STR_NEW2("(ripper)");
20511 OBJ_FREEZE(fname);
20512 }
20513 else {
20514 StringValueCStr(fname);
20515 fname = rb_str_new_frozen(fname);
20516 }
20517 parser_initialize(p);
20518
20519 p->ruby_sourcefile_string = fname;
20520 p->ruby_sourcefile = RSTRING_PTR(fname);
20521 p->ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
20522
20523 return Qnil;
20524}
20525
20526static VALUE
20527ripper_parse0(VALUE parser_v)
20528{
20529 struct parser_params *p;
20530
20531 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
20532 parser_prepare(p);
20533 p->ast = rb_ast_new();
20534 ripper_yyparse((void*)p);
20535 rb_ast_dispose(p->ast);
20536 p->ast = 0;
20537 return p->result;
20538}
20539
20540static VALUE
20541ripper_ensure(VALUE parser_v)
20542{
20543 struct parser_params *p;
20544
20545 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
20546 p->parsing_thread = Qnil;
20547 return Qnil;
20548}
20549
20550/*
20551 * call-seq:
20552 * ripper.parse
20553 *
20554 * Start parsing and returns the value of the root action.
20555 */
20556static VALUE
20557ripper_parse(VALUE self)
20558{
20559 struct parser_params *p;
20560
20561 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20562 if (!ripper_initialized_p(p)) {
20563 rb_raise(rb_eArgError, "method called for uninitialized object");
20564 }
20565 if (!NIL_P(p->parsing_thread)) {
20566 if (p->parsing_thread == rb_thread_current())
20567 rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
20568 else
20569 rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
20570 }
20571 p->parsing_thread = rb_thread_current();
20572 rb_ensure(ripper_parse0, self, ripper_ensure, self);
20573
20574 return p->result;
20575}
20576
20577/*
20578 * call-seq:
20579 * ripper.column -> Integer
20580 *
20581 * Return column number of current parsing line.
20582 * This number starts from 0.
20583 */
20584static VALUE
20585ripper_column(VALUE self)
20586{
20587 struct parser_params *p;
20588 long col;
20589
20590 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20591 if (!ripper_initialized_p(p)) {
20592 rb_raise(rb_eArgError, "method called for uninitialized object");
20593 }
20594 if (NIL_P(p->parsing_thread)) return Qnil;
20595 col = p->lex.ptok - p->lex.pbeg;
20596 return LONG2NUM(col);
20597}
20598
20599/*
20600 * call-seq:
20601 * ripper.filename -> String
20602 *
20603 * Return current parsing filename.
20604 */
20605static VALUE
20606ripper_filename(VALUE self)
20607{
20608 struct parser_params *p;
20609
20610 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20611 if (!ripper_initialized_p(p)) {
20612 rb_raise(rb_eArgError, "method called for uninitialized object");
20613 }
20614 return p->ruby_sourcefile_string;
20615}
20616
20617/*
20618 * call-seq:
20619 * ripper.lineno -> Integer
20620 *
20621 * Return line number of current parsing line.
20622 * This number starts from 1.
20623 */
20624static VALUE
20625ripper_lineno(VALUE self)
20626{
20627 struct parser_params *p;
20628
20629 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20630 if (!ripper_initialized_p(p)) {
20631 rb_raise(rb_eArgError, "method called for uninitialized object");
20632 }
20633 if (NIL_P(p->parsing_thread)) return Qnil;
20634 return INT2NUM(p->ruby_sourceline);
20635}
20636
20637/*
20638 * call-seq:
20639 * ripper.state -> Integer
20640 *
20641 * Return scanner state of current token.
20642 */
20643static VALUE
20644ripper_state(VALUE self)
20645{
20646 struct parser_params *p;
20647
20648 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20649 if (!ripper_initialized_p(p)) {
20650 rb_raise(rb_eArgError, "method called for uninitialized object");
20651 }
20652 if (NIL_P(p->parsing_thread)) return Qnil;
20653 return INT2NUM(p->lex.state);
20654}
20655
20656/*
20657 * call-seq:
20658 * ripper.token -> String
20659 *
20660 * Return the current token string.
20661 */
20662static VALUE
20663ripper_token(VALUE self)
20664{
20665 struct parser_params *p;
20666 long pos, len;
20667
20668 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20669 if (!ripper_initialized_p(p)) {
20670 rb_raise(rb_eArgError, "method called for uninitialized object");
20671 }
20672 if (NIL_P(p->parsing_thread)) return Qnil;
20673 pos = p->lex.ptok - p->lex.pbeg;
20674 len = p->lex.pcur - p->lex.ptok;
20675 return rb_str_subseq(p->lex.lastline, pos, len);
20676}
20677
20678#ifdef RIPPER_DEBUG
20679/* :nodoc: */
20680static VALUE
20681ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
20682{
20683 StringValue(msg);
20684 if (obj == Qundef) {
20686 }
20687 return Qnil;
20688}
20689
20690/* :nodoc: */
20691static VALUE
20692ripper_value(VALUE self, VALUE obj)
20693{
20694 return ULONG2NUM(obj);
20695}
20696#endif
20697
20698/*
20699 * call-seq:
20700 * Ripper.lex_state_name(integer) -> string
20701 *
20702 * Returns a string representation of lex_state.
20703 */
20704static VALUE
20705ripper_lex_state_name(VALUE self, VALUE state)
20706{
20708}
20709
20710void
20711Init_ripper(void)
20712{
20713 ripper_init_eventids1();
20714 ripper_init_eventids2();
20715 id_warn = rb_intern_const("warn");
20716 id_warning = rb_intern_const("warning");
20717 id_gets = rb_intern_const("gets");
20718 id_assoc = rb_intern_const("=>");
20719
20720 (void)yystpcpy; /* may not used in newer bison */
20721
20722 InitVM(ripper);
20723}
20724
20725void
20726InitVM_ripper(void)
20727{
20728 VALUE Ripper;
20729
20730 Ripper = rb_define_class("Ripper", rb_cObject);
20731 /* version of Ripper */
20732 rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
20733 rb_define_alloc_func(Ripper, ripper_s_allocate);
20734 rb_define_method(Ripper, "initialize", ripper_initialize, -1);
20735 rb_define_method(Ripper, "parse", ripper_parse, 0);
20736 rb_define_method(Ripper, "column", ripper_column, 0);
20737 rb_define_method(Ripper, "filename", ripper_filename, 0);
20738 rb_define_method(Ripper, "lineno", ripper_lineno, 0);
20739 rb_define_method(Ripper, "state", ripper_state, 0);
20740 rb_define_method(Ripper, "token", ripper_token, 0);
20741 rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
20742 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
20743 rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
20744 rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
20745 rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0);
20746 rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1);
20747 rb_define_method(Ripper, "error?", ripper_error_p, 0);
20748#ifdef RIPPER_DEBUG
20749 rb_define_method(Ripper, "assert_Qundef", ripper_assert_Qundef, 2);
20750 rb_define_method(Ripper, "rawVALUE", ripper_value, 1);
20751 rb_define_method(Ripper, "validate_object", ripper_validate_object, 1);
20752#endif
20753
20754 rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
20755 rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
20756
20757 rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
20758
20759<% @exprs.each do |expr, desc| -%>
20760 /* <%=desc%> */
20761 rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
20762<% end %>
20763 ripper_init_eventids1_table(Ripper);
20764 ripper_init_eventids2_table(Ripper);
20765
20766# if 0
20767 /* Hack to let RDoc document SCRIPT_LINES__ */
20768
20769 /*
20770 * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
20771 * after the assignment will be added as an Array of lines with the file
20772 * name as the key.
20773 */
20774 rb_define_global_const("SCRIPT_LINES__", Qnil);
20775#endif
20776
20777}
20778#endif /* RIPPER */
20779
20780/*
20781 * Local variables:
20782 * mode: c
20783 * c-file-style: "ruby"
20784 * End:
20785 */
int errno
#define END(name)
Definition: asm.h:115
int main(void)
Definition: closure_fn0.c:49
enum @73::@75::@76 mask
struct RIMemo * ptr
Definition: debug.c:65
#define free(x)
Definition: dln.c:52
struct rb_encoding_entry * list
Definition: encoding.c:56
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
Definition: encoding.c:1032
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
Definition: encoding.c:866
rb_encoding * rb_utf8_encoding(void)
Definition: encoding.c:1328
rb_encoding * rb_ascii8bit_encoding(void)
Definition: encoding.c:1316
rb_encoding * rb_enc_from_index(int index)
Definition: encoding.c:609
rb_encoding * rb_enc_get(VALUE obj)
Definition: encoding.c:872
int rb_ascii8bit_encindex(void)
Definition: encoding.c:1322
rb_encoding * rb_enc_compatible(VALUE str1, VALUE str2)
Definition: encoding.c:974
rb_encoding * rb_usascii_encoding(void)
Definition: encoding.c:1340
VALUE rb_enc_from_encoding(rb_encoding *encoding)
Definition: encoding.c:116
VALUE rb_enc_associate_index(VALUE obj, int idx)
Definition: encoding.c:838
int rb_enc_find_index(const char *name)
Definition: encoding.c:693
int rb_enc_codelen(int c, rb_encoding *enc)
Definition: encoding.c:1089
#define ENC_CODERANGE_7BIT
Definition: encoding.h:104
#define rb_enc_mbcput(c, buf, enc)
Definition: encoding.h:217
#define rb_enc_prev_char(s, p, e, enc)
Definition: encoding.h:220
int rb_enc_str_coderange(VALUE)
Definition: string.c:657
#define ENC_CODERANGE_UNKNOWN
Definition: encoding.h:103
VALUE rb_enc_str_new(const char *, long, rb_encoding *)
Definition: string.c:796
#define rb_enc_name(enc)
Definition: encoding.h:177
#define ENCODING_GET(obj)
Definition: encoding.h:62
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc)
Definition: string.c:2919
#define rb_enc_asciicompat(enc)
Definition: encoding.h:245
#define rb_enc_isalnum(c, enc)
Definition: encoding.h:235
int rb_char_to_option_kcode(int c, int *option, int *kcode)
Definition: re.c:319
long rb_str_coderange_scan_restartable(const char *, const char *, rb_encoding *, int *)
Definition: string.c:567
#define MBCLEN_CHARFOUND_P(ret)
Definition: encoding.h:191
#define ENCODING_SET(obj, i)
Definition: encoding.h:60
#define ENCODING_IS_ASCII8BIT(obj)
Definition: encoding.h:63
#define rb_enc_isspace(c, enc)
Definition: encoding.h:237
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
@ tHEREDOC_END
Definition: eventids2.c:8
@ tEMBDOC
Definition: eventids2.c:5
@ tEMBDOC_END
Definition: eventids2.c:6
@ tIGNORED_NL
Definition: eventids2.c:2
@ k__END__
Definition: eventids2.c:9
@ tHEREDOC_BEG
Definition: eventids2.c:7
@ tEMBDOC_BEG
Definition: eventids2.c:4
@ tCOMMENT
Definition: eventids2.c:3
#define rb_intern_str(string)
Definition: generator.h:16
VALUE rb_define_class(const char *, VALUE)
Defines a top-level class.
Definition: class.c:662
VALUE rb_cObject
Object class.
Definition: ruby.h:2012
VALUE rb_syntax_error_append(VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args)
Definition: error.c:104
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:2671
_Bool rb_warning_category_enabled_p(rb_warning_category_t category)
Definition: error.c:166
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
Definition: eval.c:668
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
Definition: eval.c:1896
const char * rb_builtin_type_name(int t)
Definition: error.c:763
VALUE rb_eTypeError
Definition: error.c:924
void rb_fatal(const char *fmt,...)
Definition: error.c:2722
const char * rb_builtin_class_name(VALUE x)
Definition: error.c:799
VALUE rb_make_exception(int, const VALUE *)
Make an Exception object from the list of arguments in a manner similar to Kernel#raise.
Definition: eval.c:851
VALUE rb_eRuntimeError
Definition: error.c:922
VALUE rb_eArgError
Definition: error.c:925
VALUE rb_ensure(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE), VALUE)
An equivalent to ensure clause.
Definition: eval.c:1115
VALUE rb_errinfo(void)
The current exception in the current thread.
Definition: eval.c:1882
VALUE rb_eSyntaxError
Definition: error.c:940
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
Definition: object.c:1955
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
Definition: object.c:78
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
Definition: object.c:217
VALUE rb_obj_freeze(VALUE)
Make the object unmodifiable.
Definition: object.c:1080
const char term
Definition: id.c:37
unsigned short token
Definition: id.c:36
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:39
unsigned int input
Definition: nkf.c:4325
const char * name
Definition: nkf.c:208
unsigned int last
Definition: nkf.c:4324
unsigned char OnigUChar
Definition: onigmo.h:79
ONIG_EXTERN int onig_foreach_name(OnigRegex reg, int(*func)(const OnigUChar *, const OnigUChar *, int, int *, OnigRegex, void *), void *arg)
#define RE_OPTION_ENCODING(e)
Definition: parse.c:706
enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int)
Definition: parse.c:17889
#define NUM_SUFFIX_I
Definition: parse.c:14995
#define HERETERM_LENGTH_BITS
Definition: parse.c:732
#define Qnull
Definition: parse.c:945
void rb_parser_fatal(struct parser_params *p, const char *fmt,...)
Definition: parse.c:17932
#define yyerror0(msg)
Definition: parse.c:418
#define DEF_EXPR(n)
Definition: parse.c:156
#define dispatch_delayed_token(p, t)
Definition: parse.c:13087
#define IS_LABEL_POSSIBLE()
Definition: parse.c:14639
#define has_delayed_token(p)
Definition: parse.c:13088
#define set_yylval_name(x)
Definition: parse.c:13064
#define DVARS_TOPSCOPE
Definition: parse.c:252
#define idFWD_REST
Definition: parse.c:696
#define IS_BEG()
Definition: parse.c:14637
#define DVARS_TERMINAL_P(tbl)
Definition: parse.c:253
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: parse.c:1836
#define YYMAXDEPTH
Definition: parse.c:6126
#define STR_NEW2(ptr)
Definition: parse.c:383
VALUE rb_parser_new(void)
Definition: parse.c:19981
#define RUBY_DTRACE_PARSE_HOOK(name)
#define YYSTACK_FREE
Definition: parse.c:1898
#define STR_FUNC_QWORDS
Definition: parse.c:13748
#define DVARS_INHERIT
Definition: parse.c:251
#define LVAR_USED
Definition: parse.c:17114
yysymbol_kind_t
Definition: parse.c:1239
@ YYSYMBOL_none
Definition: parse.c:1660
@ YYSYMBOL_137_
Definition: parse.c:1378
@ YYSYMBOL_exc_var
Definition: parse.c:1572
@ YYSYMBOL_keyword_redo
Definition: parse.c:1264
@ YYSYMBOL_177_8
Definition: parse.c:1418
@ YYSYMBOL_command_call
Definition: parse.c:1420
@ YYSYMBOL_if_tail
Definition: parse.c:1496
@ YYSYMBOL_k_if
Definition: parse.c:1476
@ YYSYMBOL_keyword_not
Definition: parse.c:1280
@ YYSYMBOL_68_
Definition: parse.c:1309
@ YYSYMBOL_tAMPER
Definition: parse.c:1350
@ YYSYMBOL_74_escaped_vertical_tab_
Definition: parse.c:1315
@ YYSYMBOL_353_49
Definition: parse.c:1594
@ YYSYMBOL_assocs
Definition: parse.c:1644
@ YYSYMBOL_fitem
Definition: parse.c:1436
@ YYSYMBOL_f_no_kwarg
Definition: parse.c:1630
@ YYSYMBOL_k_case
Definition: parse.c:1480
@ YYSYMBOL_mlhs_head
Definition: parse.c:1429
@ YYSYMBOL_operation3
Definition: parse.c:1648
@ YYSYMBOL_undef_list
Definition: parse.c:1437
@ YYSYMBOL_method_call
Definition: parse.c:1521
@ YYSYMBOL_mrhs
Definition: parse.c:1458
@ YYSYMBOL_keyword_module
Definition: parse.c:1245
@ YYSYMBOL_355_51
Definition: parse.c:1596
@ YYSYMBOL_f_kwrest
Definition: parse.c:1631
@ YYSYMBOL_restarg_mark
Definition: parse.c:1636
@ YYSYMBOL_168_4
Definition: parse.c:1409
@ YYSYMBOL_310_45
Definition: parse.c:1551
@ YYSYMBOL_271_27
Definition: parse.c:1512
@ YYSYMBOL_k_def
Definition: parse.c:1484
@ YYSYMBOL_tASET
Definition: parse.c:1334
@ YYSYMBOL_275_31
Definition: parse.c:1516
@ YYSYMBOL_tNMATCH
Definition: parse.c:1328
@ YYSYMBOL_stmt
Definition: parse.c:1408
@ YYSYMBOL_YYUNDEF
Definition: parse.c:1243
@ YYSYMBOL_expr_value_do
Definition: parse.c:1417
@ YYSYMBOL_152_
Definition: parse.c:1393
@ YYSYMBOL_trailer
Definition: parse.c:1657
@ YYSYMBOL_expr_value
Definition: parse.c:1416
@ YYSYMBOL_294_38
Definition: parse.c:1535
@ YYSYMBOL_tSTRING_DEND
Definition: parse.c:1361
@ YYSYMBOL_tWORDS_BEG
Definition: parse.c:1356
@ YYSYMBOL_224_18
Definition: parse.c:1465
@ YYSYMBOL_69_backslash_
Definition: parse.c:1310
@ YYSYMBOL_tSTRING_DBEG
Definition: parse.c:1362
@ YYSYMBOL_call_op2
Definition: parse.c:1651
@ YYSYMBOL_k_module
Definition: parse.c:1483
@ YYSYMBOL_226_20
Definition: parse.c:1467
@ YYSYMBOL_k_ensure
Definition: parse.c:1488
@ YYSYMBOL_tLOWEST
Definition: parse.c:1366
@ YYSYMBOL_178_9
Definition: parse.c:1419
@ YYSYMBOL_tAREF
Definition: parse.c:1333
@ YYSYMBOL_tSTRING_END
Definition: parse.c:1360
@ YYSYMBOL_tCOLON3
Definition: parse.c:1339
@ YYSYMBOL_keyword_end
Definition: parse.c:1251
@ YYSYMBOL_147_
Definition: parse.c:1388
@ YYSYMBOL_tREGEXP_END
Definition: parse.c:1308
@ YYSYMBOL_regexp
Definition: parse.c:1579
@ YYSYMBOL_225_19
Definition: parse.c:1466
@ YYSYMBOL_tQSYMBOLS_BEG
Definition: parse.c:1359
@ YYSYMBOL_args_forward
Definition: parse.c:1618
@ YYSYMBOL_p_args_tail
Definition: parse.c:1555
@ YYSYMBOL_p_expr
Definition: parse.c:1544
@ YYSYMBOL_tLABEL_END
Definition: parse.c:1365
@ YYSYMBOL_k_else
Definition: parse.c:1490
@ YYSYMBOL_do_body
Definition: parse.c:1527
@ YYSYMBOL_222_16
Definition: parse.c:1463
@ YYSYMBOL_354_50
Definition: parse.c:1595
@ YYSYMBOL_primary
Definition: parse.c:1459
@ YYSYMBOL_223_17
Definition: parse.c:1464
@ YYSYMBOL_k_do_block
Definition: parse.c:1486
@ YYSYMBOL_blkarg_mark
Definition: parse.c:1638
@ YYSYMBOL_tNTH_REF
Definition: parse.c:1305
@ YYSYMBOL_tDSTAR
Definition: parse.c:1349
@ YYSYMBOL_tANDDOT
Definition: parse.c:1337
@ YYSYMBOL_keyword_while
Definition: parse.c:1259
@ YYSYMBOL_309_44
Definition: parse.c:1550
@ YYSYMBOL_73_escaped_carriage_return_
Definition: parse.c:1314
@ YYSYMBOL_138_
Definition: parse.c:1379
@ YYSYMBOL_f_block_opt
Definition: parse.c:1633
@ YYSYMBOL_keyword_else
Definition: parse.c:1256
@ YYSYMBOL_f_arg_asgn
Definition: parse.c:1621
@ YYSYMBOL_literal
Definition: parse.c:1574
@ YYSYMBOL_keyword_do
Definition: parse.c:1267
@ YYSYMBOL_block_args_tail
Definition: parse.c:1503
@ YYSYMBOL_keyword_false
Definition: parse.c:1277
@ YYSYMBOL_131_
Definition: parse.c:1372
@ YYSYMBOL_symbol_list
Definition: parse.c:1584
@ YYSYMBOL_rel_expr
Definition: parse.c:1444
@ YYSYMBOL_p_case_body
Definition: parse.c:1534
@ YYSYMBOL_opt_block_args_tail
Definition: parse.c:1504
@ YYSYMBOL_tUMINUS_NUM
Definition: parse.c:1380
@ YYSYMBOL_lhs
Definition: parse.c:1432
@ YYSYMBOL_p_cases
Definition: parse.c:1541
@ YYSYMBOL_YYerror
Definition: parse.c:1242
@ YYSYMBOL_352_48
Definition: parse.c:1593
@ YYSYMBOL_modifier_unless
Definition: parse.c:1282
@ YYSYMBOL_modifier_if
Definition: parse.c:1281
@ YYSYMBOL_keyword_def
Definition: parse.c:1246
@ YYSYMBOL_357_53
Definition: parse.c:1598
@ YYSYMBOL_word
Definition: parse.c:1582
@ YYSYMBOL_numeric
Definition: parse.c:1604
@ YYSYMBOL_keyword_do_LAMBDA
Definition: parse.c:1270
@ YYSYMBOL_274_30
Definition: parse.c:1515
@ YYSYMBOL_f_larglist
Definition: parse.c:1517
@ YYSYMBOL_p_variable
Definition: parse.c:1567
@ YYSYMBOL_p_expr_basic
Definition: parse.c:1549
@ YYSYMBOL_operation
Definition: parse.c:1646
@ YYSYMBOL_tSYMBOLS_BEG
Definition: parse.c:1358
@ YYSYMBOL_keyword_case
Definition: parse.c:1257
@ YYSYMBOL_401_56
Definition: parse.c:1642
@ YYSYMBOL_modifier_until
Definition: parse.c:1284
@ YYSYMBOL_bv_decls
Definition: parse.c:1509
@ YYSYMBOL_325_47
Definition: parse.c:1566
@ YYSYMBOL_tOROP
Definition: parse.c:1326
@ YYSYMBOL_127_
Definition: parse.c:1368
@ YYSYMBOL_p_args
Definition: parse.c:1553
@ YYSYMBOL_283_32
Definition: parse.c:1524
@ YYSYMBOL_tRPAREN
Definition: parse.c:1344
@ YYSYMBOL_k_unless
Definition: parse.c:1477
@ YYSYMBOL_k_while
Definition: parse.c:1478
@ YYSYMBOL_f_arglist
Definition: parse.c:1613
@ YYSYMBOL_opt_bv_decl
Definition: parse.c:1508
@ YYSYMBOL_p_arg
Definition: parse.c:1557
@ YYSYMBOL_272_28
Definition: parse.c:1513
@ YYSYMBOL_220_14
Definition: parse.c:1461
@ YYSYMBOL_keyword_BEGIN
Definition: parse.c:1288
@ YYSYMBOL_dot_or_colon
Definition: parse.c:1649
@ YYSYMBOL_p_const
Definition: parse.c:1569
@ YYSYMBOL_p_lbracket
Definition: parse.c:1548
@ YYSYMBOL_words
Definition: parse.c:1580
@ YYSYMBOL_modifier_rescue
Definition: parse.c:1285
@ YYSYMBOL_p_value
Definition: parse.c:1564
@ YYSYMBOL_f_optarg
Definition: parse.c:1635
@ YYSYMBOL_assoc
Definition: parse.c:1645
@ YYSYMBOL_232_26
Definition: parse.c:1473
@ YYSYMBOL_dsym
Definition: parse.c:1603
@ YYSYMBOL_opt_block_arg
Definition: parse.c:1455
@ YYSYMBOL_tLABEL
Definition: parse.c:1299
@ YYSYMBOL_bodystmt
Definition: parse.c:1402
@ YYSYMBOL_tCVAR
Definition: parse.c:1298
@ YYSYMBOL_tFID
Definition: parse.c:1294
@ YYSYMBOL_opt_terms
Definition: parse.c:1652
@ YYSYMBOL_tLBRACK
Definition: parse.c:1345
@ YYSYMBOL_keyword_break
Definition: parse.c:1262
@ YYSYMBOL_expr
Definition: parse.c:1412
@ YYSYMBOL_p_primitive
Definition: parse.c:1565
@ YYSYMBOL_311_46
Definition: parse.c:1552
@ YYSYMBOL_xstring_contents
Definition: parse.c:1590
@ YYSYMBOL_string_dvar
Definition: parse.c:1599
@ YYSYMBOL_tREGEXP_BEG
Definition: parse.c:1355
@ YYSYMBOL_p_top_expr_body
Definition: parse.c:1543
@ YYSYMBOL_tSTRING_BEG
Definition: parse.c:1353
@ YYSYMBOL_tLPAREN_ARG
Definition: parse.c:1343
@ YYSYMBOL_assoc_list
Definition: parse.c:1643
@ YYSYMBOL_tLBRACE
Definition: parse.c:1346
@ YYSYMBOL_129_
Definition: parse.c:1370
@ YYSYMBOL_aref_args
Definition: parse.c:1446
@ YYSYMBOL_f_rest_marg
Definition: parse.c:1502
@ YYSYMBOL_tSTAR
Definition: parse.c:1348
@ YYSYMBOL_150_
Definition: parse.c:1391
@ YYSYMBOL_tIMAGINARY
Definition: parse.c:1303
@ YYSYMBOL_lambda_body
Definition: parse.c:1518
@ YYSYMBOL_229_23
Definition: parse.c:1470
@ YYSYMBOL_k_end
Definition: parse.c:1492
@ YYSYMBOL_146_
Definition: parse.c:1387
@ YYSYMBOL_command_asgn
Definition: parse.c:1410
@ YYSYMBOL_tIDENTIFIER
Definition: parse.c:1293
@ YYSYMBOL_command_args
Definition: parse.c:1452
@ YYSYMBOL_136_
Definition: parse.c:1377
@ YYSYMBOL_p_var_ref
Definition: parse.c:1568
@ YYSYMBOL_130_
Definition: parse.c:1371
@ YYSYMBOL_block_call
Definition: parse.c:1520
@ YYSYMBOL_block_param
Definition: parse.c:1505
@ YYSYMBOL_f_arg_item
Definition: parse.c:1622
@ YYSYMBOL_args_tail
Definition: parse.c:1615
@ YYSYMBOL_tRATIONAL
Definition: parse.c:1302
@ YYSYMBOL_block_param_def
Definition: parse.c:1507
@ YYSYMBOL_172_5
Definition: parse.c:1413
@ YYSYMBOL_symbol
Definition: parse.c:1600
@ YYSYMBOL_tRSHFT
Definition: parse.c:1336
@ YYSYMBOL_fcall
Definition: parse.c:1423
@ YYSYMBOL_keyword_when
Definition: parse.c:1258
@ YYSYMBOL_133_
Definition: parse.c:1374
@ YYSYMBOL_287_35
Definition: parse.c:1528
@ YYSYMBOL_singleton
Definition: parse.c:1641
@ YYSYMBOL_keyword__LINE__
Definition: parse.c:1290
@ YYSYMBOL_k_rescue
Definition: parse.c:1487
@ YYSYMBOL_tLPAREN
Definition: parse.c:1342
@ YYSYMBOL_p_kwarg
Definition: parse.c:1559
@ YYSYMBOL_relop
Definition: parse.c:1443
@ YYSYMBOL_k_until
Definition: parse.c:1479
@ YYSYMBOL_keyword_or
Definition: parse.c:1279
@ YYSYMBOL_k_return
Definition: parse.c:1493
@ YYSYMBOL_op
Definition: parse.c:1439
@ YYSYMBOL_tASSOC
Definition: parse.c:1341
@ YYSYMBOL_simple_numeric
Definition: parse.c:1605
@ YYSYMBOL_tSTRING_CONTENT
Definition: parse.c:1307
@ YYSYMBOL_f_block_kwarg
Definition: parse.c:1627
@ YYSYMBOL_p_top_expr
Definition: parse.c:1542
@ YYSYMBOL_f_block_kw
Definition: parse.c:1626
@ YYSYMBOL_f_bad_arg
Definition: parse.c:1619
@ YYSYMBOL_mlhs_node
Definition: parse.c:1431
@ YYSYMBOL_166_3
Definition: parse.c:1407
@ YYSYMBOL_tNEQ
Definition: parse.c:1322
@ YYSYMBOL_keyword_variable
Definition: parse.c:1607
@ YYSYMBOL_regexp_contents
Definition: parse.c:1591
@ YYSYMBOL_opt_args_tail
Definition: parse.c:1616
@ YYSYMBOL_keyword_undef
Definition: parse.c:1247
@ YYSYMBOL_k_begin
Definition: parse.c:1475
@ YYSYMBOL_do_block
Definition: parse.c:1519
@ YYSYMBOL_modifier_while
Definition: parse.c:1283
@ YYSYMBOL_f_arg
Definition: parse.c:1623
@ YYSYMBOL_backref
Definition: parse.c:1610
@ YYSYMBOL_tCMP
Definition: parse.c:1319
@ YYSYMBOL_keyword_unless
Definition: parse.c:1253
@ YYSYMBOL_tQWORDS_BEG
Definition: parse.c:1357
@ YYSYMBOL_keyword_alias
Definition: parse.c:1286
@ YYSYMBOL_brace_block
Definition: parse.c:1522
@ YYSYMBOL_string
Definition: parse.c:1576
@ YYSYMBOL_mrhs_arg
Definition: parse.c:1457
@ YYSYMBOL_lambda
Definition: parse.c:1511
@ YYSYMBOL_args
Definition: parse.c:1456
@ YYSYMBOL_f_label
Definition: parse.c:1624
@ YYSYMBOL_tFLOAT
Definition: parse.c:1301
@ YYSYMBOL_keyword_do_cond
Definition: parse.c:1268
@ YYSYMBOL_128_
Definition: parse.c:1369
@ YYSYMBOL_cmd_brace_block
Definition: parse.c:1422
@ YYSYMBOL_295_39
Definition: parse.c:1536
@ YYSYMBOL_tBDOT3
Definition: parse.c:1332
@ YYSYMBOL_285_34
Definition: parse.c:1526
@ YYSYMBOL_228_22
Definition: parse.c:1469
@ YYSYMBOL_block_command
Definition: parse.c:1421
@ YYSYMBOL_top_stmts
Definition: parse.c:1399
@ YYSYMBOL_keyword_true
Definition: parse.c:1276
@ YYSYMBOL_qsym_list
Definition: parse.c:1588
@ YYSYMBOL_strings
Definition: parse.c:1575
@ YYSYMBOL_tBACK_REF
Definition: parse.c:1306
@ YYSYMBOL_p_kwrest
Definition: parse.c:1562
@ YYSYMBOL_keyword__ENCODING__
Definition: parse.c:1292
@ YYSYMBOL_141_
Definition: parse.c:1382
@ YYSYMBOL_keyword_in
Definition: parse.c:1266
@ YYSYMBOL_tLSHFT
Definition: parse.c:1335
@ YYSYMBOL_keyword_yield
Definition: parse.c:1272
@ YYSYMBOL_135_
Definition: parse.c:1376
@ YYSYMBOL_tLAST_TOKEN
Definition: parse.c:1383
@ YYSYMBOL_string_content
Definition: parse.c:1592
@ YYSYMBOL_tEQ
Definition: parse.c:1320
@ YYSYMBOL_keyword_then
Definition: parse.c:1254
@ YYSYMBOL_top_compstmt
Definition: parse.c:1398
@ YYSYMBOL_exc_list
Definition: parse.c:1571
@ YYSYMBOL_stmt_or_begin
Definition: parse.c:1406
@ YYSYMBOL_call_op
Definition: parse.c:1650
@ YYSYMBOL_rbrace
Definition: parse.c:1656
@ YYSYMBOL_compstmt
Definition: parse.c:1404
@ YYSYMBOL_p_args_head
Definition: parse.c:1554
@ YYSYMBOL_kwrest_mark
Definition: parse.c:1629
@ YYSYMBOL_keyword_class
Definition: parse.c:1244
@ YYSYMBOL_keyword_retry
Definition: parse.c:1265
@ YYSYMBOL_var_ref
Definition: parse.c:1608
@ YYSYMBOL_keyword_ensure
Definition: parse.c:1250
@ YYSYMBOL_qsymbols
Definition: parse.c:1586
@ YYSYMBOL_symbols
Definition: parse.c:1583
@ YYSYMBOL_paren_args
Definition: parse.c:1448
@ YYSYMBOL_arg
Definition: parse.c:1441
@ YYSYMBOL_opt_ensure
Definition: parse.c:1573
@ YYSYMBOL_197_10
Definition: parse.c:1438
@ YYSYMBOL_keyword_rescue
Definition: parse.c:1249
@ YYSYMBOL_keyword_until
Definition: parse.c:1260
@ YYSYMBOL_do
Definition: parse.c:1495
@ YYSYMBOL_term
Definition: parse.c:1658
@ YYSYMBOL_p_args_post
Definition: parse.c:1556
@ YYSYMBOL_for_var
Definition: parse.c:1498
@ YYSYMBOL_356_52
Definition: parse.c:1597
@ YYSYMBOL_arg_rhs
Definition: parse.c:1447
@ YYSYMBOL_then
Definition: parse.c:1494
@ YYSYMBOL_f_block_arg
Definition: parse.c:1639
@ YYSYMBOL_YYACCEPT
Definition: parse.c:1395
@ YYSYMBOL_cpath
Definition: parse.c:1434
@ YYSYMBOL_288_36
Definition: parse.c:1529
@ YYSYMBOL_173_6
Definition: parse.c:1414
@ YYSYMBOL_keyword_for
Definition: parse.c:1261
@ YYSYMBOL_140_
Definition: parse.c:1381
@ YYSYMBOL_keyword_next
Definition: parse.c:1263
@ YYSYMBOL_153_n_
Definition: parse.c:1394
@ YYSYMBOL_212_12
Definition: parse.c:1453
@ YYSYMBOL_fname
Definition: parse.c:1435
@ YYSYMBOL_f_block_optarg
Definition: parse.c:1634
@ YYSYMBOL_begin_block
Definition: parse.c:1401
@ YYSYMBOL_keyword_super
Definition: parse.c:1273
@ YYSYMBOL_298_42
Definition: parse.c:1539
@ YYSYMBOL_148_
Definition: parse.c:1389
@ YYSYMBOL_opt_f_block_arg
Definition: parse.c:1640
@ YYSYMBOL_tGVAR
Definition: parse.c:1295
@ YYSYMBOL_134_
Definition: parse.c:1375
@ YYSYMBOL_arg_value
Definition: parse.c:1445
@ YYSYMBOL_219_13
Definition: parse.c:1460
@ YYSYMBOL_tUPLUS
Definition: parse.c:1316
@ YYSYMBOL_tIVAR
Definition: parse.c:1296
@ YYSYMBOL_tOP_ASGN
Definition: parse.c:1340
@ YYSYMBOL_174_7
Definition: parse.c:1415
@ YYSYMBOL_230_24
Definition: parse.c:1471
@ YYSYMBOL_case_args
Definition: parse.c:1531
@ YYSYMBOL_keyword_if
Definition: parse.c:1252
@ YYSYMBOL_tCONSTANT
Definition: parse.c:1297
@ YYSYMBOL_terms
Definition: parse.c:1659
@ YYSYMBOL_tSYMBEG
Definition: parse.c:1352
@ YYSYMBOL_keyword_END
Definition: parse.c:1289
@ YYSYMBOL_f_norm_arg
Definition: parse.c:1620
@ YYSYMBOL_f_margs
Definition: parse.c:1501
@ YYSYMBOL_YYEOF
Definition: parse.c:1241
@ YYSYMBOL_p_as
Definition: parse.c:1545
@ YYSYMBOL_mlhs_post
Definition: parse.c:1430
@ YYSYMBOL_opt_else
Definition: parse.c:1497
@ YYSYMBOL_case_body
Definition: parse.c:1532
@ YYSYMBOL_rparen
Definition: parse.c:1654
@ YYSYMBOL_284_33
Definition: parse.c:1525
@ YYSYMBOL_opt_nl
Definition: parse.c:1653
@ YYSYMBOL_primary_value
Definition: parse.c:1474
@ YYSYMBOL_qwords
Definition: parse.c:1585
@ YYSYMBOL_201_11
Definition: parse.c:1442
@ YYSYMBOL_keyword_elsif
Definition: parse.c:1255
@ YYSYMBOL_tEQQ
Definition: parse.c:1321
@ YYSYMBOL_tLAMBDA
Definition: parse.c:1351
@ YYSYMBOL_reswords
Definition: parse.c:1440
@ YYSYMBOL_mlhs_basic
Definition: parse.c:1427
@ YYSYMBOL_ssym
Definition: parse.c:1601
@ YYSYMBOL_k_when
Definition: parse.c:1489
@ YYSYMBOL_227_21
Definition: parse.c:1468
@ YYSYMBOL_mlhs
Definition: parse.c:1425
@ YYSYMBOL_p_alt
Definition: parse.c:1546
@ YYSYMBOL_151_
Definition: parse.c:1392
@ YYSYMBOL_f_marg
Definition: parse.c:1499
@ YYSYMBOL_k_class
Definition: parse.c:1482
@ YYSYMBOL_keyword_self
Definition: parse.c:1274
@ YYSYMBOL_143_
Definition: parse.c:1384
@ YYSYMBOL_p_kwargs
Definition: parse.c:1558
@ YYSYMBOL_145_
Definition: parse.c:1386
@ YYSYMBOL_273_29
Definition: parse.c:1514
@ YYSYMBOL_p_kwnorest
Definition: parse.c:1563
@ YYSYMBOL_371_54
Definition: parse.c:1612
@ YYSYMBOL_program
Definition: parse.c:1396
@ YYSYMBOL_tANDOP
Definition: parse.c:1325
@ YYSYMBOL_tINTEGER
Definition: parse.c:1300
@ YYSYMBOL_f_marg_list
Definition: parse.c:1500
@ YYSYMBOL_k_do
Definition: parse.c:1485
@ YYSYMBOL_162_2
Definition: parse.c:1403
@ YYSYMBOL_sym
Definition: parse.c:1602
@ YYSYMBOL_opt_call_args
Definition: parse.c:1450
@ YYSYMBOL_f_kwarg
Definition: parse.c:1628
@ YYSYMBOL_operation2
Definition: parse.c:1647
@ YYSYMBOL_p_lparen
Definition: parse.c:1547
@ YYSYMBOL_132_
Definition: parse.c:1373
@ YYSYMBOL_tLBRACE_ARG
Definition: parse.c:1347
@ YYSYMBOL_289_37
Definition: parse.c:1530
@ YYSYMBOL_f_opt
Definition: parse.c:1632
@ YYSYMBOL_k_elsif
Definition: parse.c:1491
@ YYSYMBOL_296_40
Definition: parse.c:1537
@ YYSYMBOL_cases
Definition: parse.c:1533
@ YYSYMBOL_keyword_defined
Definition: parse.c:1287
@ YYSYMBOL_keyword_begin
Definition: parse.c:1248
@ YYSYMBOL_user_variable
Definition: parse.c:1606
@ YYSYMBOL_tBDOT2
Definition: parse.c:1331
@ YYSYMBOL_mlhs_inner
Definition: parse.c:1426
@ YYSYMBOL_p_kw
Definition: parse.c:1560
@ YYSYMBOL_231_25
Definition: parse.c:1472
@ YYSYMBOL_keyword_return
Definition: parse.c:1271
@ YYSYMBOL_tUMINUS
Definition: parse.c:1317
@ YYSYMBOL_word_list
Definition: parse.c:1581
@ YYSYMBOL_YYEMPTY
Definition: parse.c:1240
@ YYSYMBOL_tMATCH
Definition: parse.c:1327
@ YYSYMBOL_tDOT2
Definition: parse.c:1329
@ YYSYMBOL_opt_block_param
Definition: parse.c:1506
@ YYSYMBOL_373_55
Definition: parse.c:1614
@ YYSYMBOL_156_1
Definition: parse.c:1397
@ YYSYMBOL_tSTRING_DVAR
Definition: parse.c:1363
@ YYSYMBOL_f_kw
Definition: parse.c:1625
@ YYSYMBOL_221_15
Definition: parse.c:1462
@ YYSYMBOL_top_stmt
Definition: parse.c:1400
@ YYSYMBOL_tSP
Definition: parse.c:1311
@ YYSYMBOL_brace_body
Definition: parse.c:1523
@ YYSYMBOL_126_
Definition: parse.c:1367
@ YYSYMBOL_qword_list
Definition: parse.c:1587
@ YYSYMBOL_tLEQ
Definition: parse.c:1324
@ YYSYMBOL_149_
Definition: parse.c:1390
@ YYSYMBOL_tCOLON2
Definition: parse.c:1338
@ YYSYMBOL_keyword__FILE__
Definition: parse.c:1291
@ YYSYMBOL_tCHAR
Definition: parse.c:1304
@ YYSYMBOL_mlhs_item
Definition: parse.c:1428
@ YYSYMBOL_cname
Definition: parse.c:1433
@ YYSYMBOL_superclass
Definition: parse.c:1611
@ YYSYMBOL_tGEQ
Definition: parse.c:1323
@ YYSYMBOL_p_kw_label
Definition: parse.c:1561
@ YYSYMBOL_string_contents
Definition: parse.c:1589
@ YYSYMBOL_144_
Definition: parse.c:1385
@ YYSYMBOL_string1
Definition: parse.c:1577
@ YYSYMBOL_stmts
Definition: parse.c:1405
@ YYSYMBOL_opt_paren_args
Definition: parse.c:1449
@ YYSYMBOL_keyword_and
Definition: parse.c:1278
@ YYSYMBOL_tPOW
Definition: parse.c:1318
@ YYSYMBOL_tXSTRING_BEG
Definition: parse.c:1354
@ YYSYMBOL_xstring
Definition: parse.c:1578
@ YYSYMBOL_f_rest_arg
Definition: parse.c:1637
@ YYSYMBOL_f_args
Definition: parse.c:1617
@ YYSYMBOL_tDOT3
Definition: parse.c:1330
@ YYSYMBOL_297_41
Definition: parse.c:1538
@ YYSYMBOL_command
Definition: parse.c:1424
@ YYSYMBOL_bvar
Definition: parse.c:1510
@ YYSYMBOL_k_for
Definition: parse.c:1481
@ YYSYMBOL_block_arg
Definition: parse.c:1454
@ YYSYMBOL_var_lhs
Definition: parse.c:1609
@ YYSYMBOL_opt_rescue
Definition: parse.c:1570
@ YYSYMBOL_299_43
Definition: parse.c:1540
@ YYSYMBOL_command_rhs
Definition: parse.c:1411
@ YYSYMBOL_keyword_do_block
Definition: parse.c:1269
@ YYSYMBOL_call_args
Definition: parse.c:1451
@ YYSYMBOL_72_escaped_form_feed_
Definition: parse.c:1313
@ YYSYMBOL_keyword_nil
Definition: parse.c:1275
@ YYSYMBOL_tLAMBEG
Definition: parse.c:1364
@ YYSYMBOL_rbracket
Definition: parse.c:1655
@ YYSYMBOL_71_escaped_horizontal_tab_
Definition: parse.c:1312
#define yyerrok
Definition: parse.c:5666
#define add_delayed_token(p, tok, end)
Definition: parse.c:13808
#define STRTERM_HEREDOC
Definition: parse.c:756
#define YY_ASSERT(E)
Definition: parse.c:1856
#define NUMPARAM_ID_P(id)
Definition: parse.c:239
#define str_copy(_s, _p, _n)
#define YY_(Msgid)
Definition: parse.c:1790
#define get_value(val)
Definition: parse.c:592
#define YYNOMEM
Definition: parse.c:5672
#define SWITCH_BY_COND_TYPE(t, w, arg)
Definition: parse.c:18626
#define make_list(list, loc)
Definition: parse.c:571
#define rb_warn1L(l, fmt, a)
Definition: parse.c:964
void * rb_parser_malloc(struct parser_params *p, size_t size)
Definition: parse.c:20135
#define dispatch_heredoc_end(p)
Definition: parse.c:15066
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: parse.c:1837
#define YYNSTATES
Definition: parse.c:2000
VALUE rb_io_gets_internal(VALUE io)
Definition: io.c:3583
rb_ast_t * rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
Definition: parse.c:13689
void(* rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val)
Definition: parse.c:15353
#define NEW_STRTERM(func, term, paren)
Definition: parse.c:14550
STATIC_ASSERT(rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t)<=4 *SIZEOF_VALUE)
#define YY_IGNORE_USELESS_CAST_END
Definition: parse.c:1852
#define lex_goto_eol(p)
Definition: parse.c:13784
short yytype_int16
Definition: parse.c:1701
#define literal_flush(p, ptr)
Definition: parse.c:13085
#define IS_END()
Definition: parse.c:14636
#define RE_OPTION_MASK
Definition: parse.c:709
#define yyerror(yylloc, p, msg)
Definition: parse.c:420
struct token_info token_info
void rb_parser_printf(struct parser_params *p, const char *fmt,...)
Definition: parse.c:20192
#define WARN_S(s)
Definition: parse.c:999
#define tok(p)
Definition: parse.c:13894
#define KWD2EID(t, v)
Definition: parse.c:940
#define ESCAPE_CONTROL
Definition: parse.c:14100
#define YYABORT
Definition: parse.c:5670
#define idFWD_KWREST
Definition: parse.c:700
#define tokcopy(p, n)
Definition: parse.c:13964
#define PRIsWARN
Definition: parse.c:1003
#define YYSTACK_BYTES(N)
Definition: parse.c:1943
@ EXPR_END_ANY
Definition: parse.c:173
@ EXPR_VALUE
Definition: parse.c:170
@ EXPR_NONE
Definition: parse.c:174
@ EXPR_BEG_ANY
Definition: parse.c:171
@ EXPR_ARG_ANY
Definition: parse.c:172
@ NUMPARAM_MAX
Definition: parse.c:236
@ ORDINAL_PARAM
Definition: parse.c:234
@ NO_PARAM
Definition: parse.c:235
#define IS_lex_state(ls)
Definition: parse.c:178
YYLTYPE * rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
Definition: parse.c:17983
yytype_int16 yy_state_t
Definition: parse.c:1777
#define WARN_SPACE_CHAR(c, prefix)
Definition: parse.c:13993
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: parse.c:112
#define intern_cstr(n, l, en)
Definition: parse.c:379
#define TAB_WIDTH
Definition: parse.c:99
#define CMDARG_POP()
Definition: parse.c:207
#define YY_REDUCE_PRINT(Rule)
Definition: parse.c:6094
rb_ast_t * rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
Definition: parse.c:13695
#define YY_CAST(Type, Val)
Definition: parse.c:1032
void rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
Definition: parse.c:19793
#define vtable_alloc(prev)
Definition: parse.c:13436
VALUE rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
Definition: parse.c:19991
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_parser_reg_compile(struct parser_params *p, VALUE str, int options)
Definition: parse.c:19752
#define was_bol(p)
Definition: parse.c:13891
#define IS_lex_state_for(x, ls)
Definition: parse.c:176
#define WARN_S_L(s, l)
Definition: parse.c:998
#define dispatch_scan_event(p, t)
Definition: parse.c:13086
#define YYCASE_(N, S)
#define set_yylval_id(x)
Definition: parse.c:13063
#define NUM_SUFFIX_R
Definition: parse.c:14994
#define NEW_QCALL(q, r, m, a, loc)
Definition: parse.c:433
long(* rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len)
Definition: parse.c:15352
#define warn_balanced(tok, op, syn)
Definition: parse.c:15648
#define YY_NULLPTR
Definition: parse.c:1044
RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20+31)/32]
Definition: parse.c:14578
#define RE_OPTION_ENCODING_NONE(o)
Definition: parse.c:708
YYLTYPE * rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
Definition: parse.c:17958
#define STR_FUNC_TERM
Definition: parse.c:13753
#define set_yylval_literal(x)
Definition: parse.c:13057
#define set_yylval_str(x)
Definition: parse.c:13052
#define YYFINAL
Definition: parse.c:1989
#define WARN_LOCATION(type)
Definition: parse.c:17517
rb_ast_t * rb_parser_compile_generic(VALUE vparser, VALUE(*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
Definition: parse.c:13730
#define RUBY_INIT_YYLLOC()
Definition: parse.c:132
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: parse.c:2140
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: parse.c:5799
void rb_init_parse(void)
Definition: parse.c:19846
#define YY_INITIAL_VALUE(Value)
Definition: parse.c:1833
#define TOK_INTERN()
Definition: parse.c:385
#define vtable_free(tbl)
Definition: parse.c:13454
#define CALL_Q_P(q)
Definition: parse.c:431
#define yyparse
Definition: parse.c:487
#define STR_NEW3(ptr, len, e, func)
Definition: parse.c:384
#define yylval
Definition: parse.c:13038
#define YYNTOKENS
Definition: parse.c:1994
VALUE rb_parser_encoding(VALUE vparser)
Definition: parse.c:20054
int rb_reg_fragment_setenc(struct parser_params *, VALUE, int)
Definition: parse.c:19637
#define yytnamerr(yyres, yystr)
Definition: parse.c:778
VALUE rb_parser_get_debug_output(VALUE self)
Definition: parse.c:20102
#define Qnone
Definition: parse.c:944
unsigned char yytype_uint8
Definition: parse.c:1722
#define peek(p, c)
Definition: parse.c:13787
#define YY_STACK_PRINT(Bottom, Top)
Definition: parse.c:6062
#define compile_for_eval
Definition: parse.c:426
const struct kwtable * rb_reserved_word(const char *str, unsigned int len)
Definition: parse.c:19975
@ EXPR_ENDARG_bit
Definition: parse.c:141
@ EXPR_ENDFN_bit
Definition: parse.c:142
@ EXPR_MAX_STATE
Definition: parse.c:152
@ EXPR_END_bit
Definition: parse.c:140
@ EXPR_FNAME_bit
Definition: parse.c:146
@ EXPR_LABEL_bit
Definition: parse.c:149
@ EXPR_FITEM_bit
Definition: parse.c:151
@ EXPR_CLASS_bit
Definition: parse.c:148
@ EXPR_MID_bit
Definition: parse.c:145
@ EXPR_CMDARG_bit
Definition: parse.c:144
@ EXPR_LABELED_bit
Definition: parse.c:150
@ EXPR_ARG_bit
Definition: parse.c:143
@ EXPR_DOT_bit
Definition: parse.c:147
@ EXPR_BEG_bit
Definition: parse.c:139
#define STR_NEW(ptr, len)
Definition: parse.c:381
#define lambda_beginning_p()
Definition: parse.c:435
#define YYSIZE_T
Definition: parse.c:1763
#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current)
Definition: parse.c:126
#define YYSTACK_ALLOC_MAXIMUM
Definition: parse.c:1900
#define IS_lex_state_all(ls)
Definition: parse.c:179
#define yydebug
Definition: parse.c:101
#define NUMPARAM_IDX_TO_ID(idx)
Definition: parse.c:241
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: parse.c:1851
#define IS_SPCARG(c)
Definition: parse.c:14638
void rb_strterm_mark(VALUE obj)
Definition: parse.c:768
#define rb_warn2(fmt, a, b)
Definition: parse.c:955
void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int)
Definition: parse.c:17922
#define IS_ARG()
Definition: parse.c:14635
#define value_expr(node)
Definition: parse.c:503
#define RE_OPTION_ONCE
Definition: parse.c:704
#define YYLOCATION_PRINT(File, Loc)
Definition: parse.c:5750
#define ADD2HEAP(new, cnt, ptr)
Definition: parse.c:20131
#define YYPTRDIFF_T
Definition: parse.c:1749
#define NEWHEAP()
Definition: parse.c:20130
#define WARN_EOL(tok)
Definition: parse.c:1019
#define mixed_escape(beg, enc1, enc2)
#define COND_POP()
Definition: parse.c:200
#define lex_eol_p(p)
Definition: parse.c:13785
#define RE_OPTION_ENCODING_IDX(o)
Definition: parse.c:707
#define vtable_pop(tbl, n)
Definition: parse.c:13493
#define WARN_ID(i)
Definition: parse.c:1001
#define set_yylval_noname()
Definition: parse.c:13082
size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
Definition: parse.c:20239
void * rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
Definition: parse.c:20155
VALUE rb_parser_set_debug_output(VALUE self, VALUE output)
Definition: parse.c:20117
#define rb_warn1(fmt, a)
Definition: parse.c:954
#define set_yylval_node(x)
Definition: parse.c:13047
VALUE rb_parser_set_yydebug(VALUE self, VALUE flag)
Definition: parse.c:20086
VALUE rb_parser_end_seen_p(VALUE vparser)
Definition: parse.c:20039
#define RUBY_SET_YYLLOC(Current)
Definition: parse.c:130
@ YYENOMEM
Definition: parse.c:5664
#define WARN_IVAL(i)
Definition: parse.c:1002
#define YYACCEPT
Definition: parse.c:5669
#define ID2VAL(id)
Definition: parse.c:938
#define yytable_value_is_error(Yyn)
Definition: parse.c:2246
#define toklen(p)
Definition: parse.c:13895
#define new_nil(loc)
Definition: parse.c:491
struct rb_strterm_literal_struct rb_strterm_literal_t
#define YYTRANSLATE(YYX)
Definition: parse.c:2008
#define subnodes(n1, n2)
#define HERETERM_LENGTH_MAX
#define rb_warn0(fmt)
Definition: parse.c:953
YYLTYPE * rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
Definition: parse.c:17973
#define STR_FUNC_LIST
Definition: parse.c:13752
#define YY_ATTRIBUTE_UNUSED
Definition: parse.c:1807
#define STR_FUNC_ESCAPE
Definition: parse.c:13745
#define ifndef_ripper(x)
Definition: parse.c:946
#define STR_FUNC_SYMBOL
Definition: parse.c:13749
#define CMDARG_PUSH(n)
Definition: parse.c:206
void rb_parser_free(struct parser_params *p, void *ptr)
Definition: parse.c:20175
#define CMDARG_P()
Definition: parse.c:208
#define STR_FUNC_LABEL
Definition: parse.c:13751
#define rb_warning0(fmt)
Definition: parse.c:958
#define STR_FUNC_INDENT
Definition: parse.c:13750
#define peek_n(p, c, n)
Definition: parse.c:13788
#define COND_P()
Definition: parse.c:201
#define ESCAPE_META
Definition: parse.c:14101
PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt,...), 2, 3)
#define METHOD_NOT
Definition: parse.c:693
rb_ast_t * rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
Definition: parse.c:13710
#define NUMPARAM_ID_TO_IDX(id)
Definition: parse.c:240
#define HEAPCNT(n, size)
Definition: parse.c:20127
void rb_parser_warn_location(VALUE vparser, int warn)
Definition: parse.c:19804
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition: parse.c:1780
#define SET_LEX_STATE(ls)
Definition: parse.c:181
#define STR_FUNC_REGEXP
Definition: parse.c:13747
#define RUBY_SET_YYLLOC_OF_NONE(Current)
Definition: parse.c:128
#define idFWD_BLOCK
Definition: parse.c:702
#define vtable_add(tbl, id)
Definition: parse.c:13476
#define WARN_I(i)
Definition: parse.c:1000
#define COND_PUSH(n)
Definition: parse.c:199
unsigned short yytype_uint16
Definition: parse.c:1733
#define token_flush(ptr)
Definition: parse.c:421
#define get_id(id)
Definition: parse.c:591
@ str_dsym
Definition: parse.c:13764
@ str_dword
Definition: parse.c:13762
@ str_label
Definition: parse.c:13756
@ str_ssym
Definition: parse.c:13763
@ str_xquote
Definition: parse.c:13759
@ str_dquote
Definition: parse.c:13758
@ str_regexp
Definition: parse.c:13760
@ str_squote
Definition: parse.c:13757
@ str_sword
Definition: parse.c:13761
#define mixed_error(enc1, enc2)
#define dyna_var(p, id)
Definition: parse.c:680
#define rb_node_newnode(type, a1, a2, a3, loc)
Definition: parse.c:463
#define IS_LABEL_SUFFIX(n)
Definition: parse.c:14642
#define nd_once_body(node)
Definition: parse.c:17455
#define yyerror1(loc, msg)
Definition: parse.c:419
#define tokfix(p)
Definition: parse.c:13893
#define YYLAST
Definition: parse.c:1991
#define NUM_SUFFIX_ALL
Definition: parse.c:14996
VALUE stack_type
Definition: parse.c:187
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: parse.c:1955
#define yypact_value_is_default(Yyn)
Definition: parse.c:2241
@ COND_IN_COND
Definition: parse.c:18622
@ COND_IN_OP
Definition: parse.c:18621
@ COND_IN_FF
Definition: parse.c:18623
#define YYINITDEPTH
Definition: parse.c:6115
#define flush_string_content(p, enc)
Definition: parse.c:14575
#define rb_warn0L(l, fmt)
Definition: parse.c:963
#define CSI_BEGIN
#define STR_NEW0()
Definition: parse.c:382
signed char yytype_int8
Definition: parse.c:1693
#define rb_warn3L(l, fmt, a, b, c)
Definition: parse.c:966
#define CSI_SGR
#define STR_FUNC_EXPAND
Definition: parse.c:13746
#define rb_warning1(fmt, a)
Definition: parse.c:959
#define YYERROR
Definition: parse.c:5671
void * rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
Definition: parse.c:20145
#define YYSIZEOF(X)
Definition: parse.c:1773
#define YYFPRINTF
Definition: parse.c:107
#define YYSTACK_ALLOC
Definition: parse.c:1897
#define YYDPRINTF(Args)
Definition: parse.c:5733
VALUE rb_parser_lex_state_name(enum lex_state_e state)
Definition: parse.c:17903
#define peekc_n(p, n)
Definition: parse.c:13790
#define compile_error
Definition: parse.c:1011
#define IS_AFTER_OPERATOR()
Definition: parse.c:14643
#define YY_USE(E)
Definition: parse.c:1813
yytokentype
Definition: parse.h:52
@ tBACK_REF
Definition: parse.h:119
@ tGEQ
Definition: parse.h:130
@ keyword_alias
Definition: parse.h:99
@ tLPAREN_ARG
Definition: parse.h:150
@ tBDOT3
Definition: parse.h:139
@ tWORDS_BEG
Definition: parse.h:163
@ tAMPER
Definition: parse.h:157
@ keyword_do_cond
Definition: parse.h:81
@ END_OF_INPUT
Definition: parse.h:54
@ keyword_do_block
Definition: parse.h:82
@ keyword_defined
Definition: parse.h:100
@ tLPAREN
Definition: parse.h:149
@ tASET
Definition: parse.h:141
@ tSTRING_DEND
Definition: parse.h:168
@ tNMATCH
Definition: parse.h:135
@ tCHAR
Definition: parse.h:117
@ keyword_return
Definition: parse.h:84
@ tCONSTANT
Definition: parse.h:110
@ tMATCH
Definition: parse.h:134
@ tFLOAT
Definition: parse.h:114
@ tANDDOT
Definition: parse.h:144
@ tLABEL_END
Definition: parse.h:172
@ tNEQ
Definition: parse.h:129
@ tDOT2
Definition: parse.h:136
@ tEQ
Definition: parse.h:127
@ keyword_module
Definition: parse.h:58
@ tLAMBEG
Definition: parse.h:171
@ tCOLON2
Definition: parse.h:145
@ tCVAR
Definition: parse.h:111
@ tSTRING_DVAR
Definition: parse.h:170
@ keyword_undef
Definition: parse.h:60
@ tLEQ
Definition: parse.h:131
@ tLBRACE
Definition: parse.h:153
@ keyword_redo
Definition: parse.h:77
@ tSTRING_CONTENT
Definition: parse.h:120
@ keyword_false
Definition: parse.h:90
@ keyword_class
Definition: parse.h:57
@ keyword_ensure
Definition: parse.h:63
@ keyword_end
Definition: parse.h:64
@ keyword_and
Definition: parse.h:91
@ keyword_when
Definition: parse.h:71
@ YYerror
Definition: parse.h:55
@ tASSOC
Definition: parse.h:148
@ keyword_retry
Definition: parse.h:78
@ tSYMBOLS_BEG
Definition: parse.h:165
@ tLBRACE_ARG
Definition: parse.h:154
@ YYEMPTY
Definition: parse.h:53
@ tREGEXP_END
Definition: parse.h:121
@ keyword_or
Definition: parse.h:92
@ keyword__ENCODING__
Definition: parse.h:105
@ keyword_do
Definition: parse.h:80
@ keyword_rescue
Definition: parse.h:62
@ keyword_END
Definition: parse.h:102
@ tLSHFT
Definition: parse.h:142
@ tUMINUS
Definition: parse.h:124
@ tBDOT2
Definition: parse.h:138
@ keyword_next
Definition: parse.h:76
@ modifier_if
Definition: parse.h:94
@ tLOWEST
Definition: parse.h:173
@ tSYMBEG
Definition: parse.h:159
@ keyword_nil
Definition: parse.h:88
@ tLABEL
Definition: parse.h:112
@ tSTAR
Definition: parse.h:155
@ tCMP
Definition: parse.h:126
@ keyword_if
Definition: parse.h:65
@ keyword_BEGIN
Definition: parse.h:101
@ tIMAGINARY
Definition: parse.h:116
@ tRSHFT
Definition: parse.h:143
@ tSTRING_DBEG
Definition: parse.h:169
@ tNTH_REF
Definition: parse.h:118
@ tINTEGER
Definition: parse.h:113
@ tSTRING_BEG
Definition: parse.h:160
@ tXSTRING_BEG
Definition: parse.h:161
@ tIVAR
Definition: parse.h:109
@ keyword_then
Definition: parse.h:67
@ YYUNDEF
Definition: parse.h:56
@ modifier_while
Definition: parse.h:96
@ tQSYMBOLS_BEG
Definition: parse.h:166
@ keyword_def
Definition: parse.h:59
@ tDOT3
Definition: parse.h:137
@ keyword__FILE__
Definition: parse.h:104
@ tIDENTIFIER
Definition: parse.h:106
@ keyword_super
Definition: parse.h:86
@ tOP_ASGN
Definition: parse.h:147
@ keyword_while
Definition: parse.h:72
@ tGVAR
Definition: parse.h:108
@ tPOW
Definition: parse.h:125
@ keyword_true
Definition: parse.h:89
@ keyword__LINE__
Definition: parse.h:103
@ keyword_else
Definition: parse.h:69
@ tSTRING_END
Definition: parse.h:167
@ keyword_in
Definition: parse.h:79
@ modifier_unless
Definition: parse.h:95
@ tEQQ
Definition: parse.h:128
@ tRATIONAL
Definition: parse.h:115
@ tUMINUS_NUM
Definition: parse.h:174
@ keyword_unless
Definition: parse.h:66
@ tDSTAR
Definition: parse.h:156
@ tANDOP
Definition: parse.h:132
@ keyword_do_LAMBDA
Definition: parse.h:83
@ tCOLON3
Definition: parse.h:146
@ keyword_for
Definition: parse.h:74
@ modifier_rescue
Definition: parse.h:98
@ tFID
Definition: parse.h:107
@ keyword_not
Definition: parse.h:93
@ tAREF
Definition: parse.h:140
@ keyword_begin
Definition: parse.h:61
@ keyword_self
Definition: parse.h:87
@ tRPAREN
Definition: parse.h:151
@ keyword_break
Definition: parse.h:75
@ keyword_until
Definition: parse.h:73
@ keyword_case
Definition: parse.h:70
@ tSP
Definition: parse.h:122
@ tOROP
Definition: parse.h:133
@ keyword_yield
Definition: parse.h:85
@ tLBRACK
Definition: parse.h:152
@ tQWORDS_BEG
Definition: parse.h:164
@ tREGEXP_BEG
Definition: parse.h:162
@ modifier_until
Definition: parse.h:97
@ tLAST_TOKEN
Definition: parse.h:175
@ tLAMBDA
Definition: parse.h:158
@ keyword_elsif
Definition: parse.h:68
@ tUPLUS
Definition: parse.h:123
enum yytokentype yytoken_kind_t
Definition: parse.h:177
#define RARRAY_LEN(a)
void * memchr(const void *, int, size_t)
#define NEW_DSTR(s, loc)
VALUE rb_hash_lookup(VALUE, VALUE)
Definition: hash.c:2063
void rb_ast_dispose(rb_ast_t *)
Definition: node.c:1387
#define MEMCPY(p1, p2, type, n)
#define NEW_VCALL(m, loc)
#define T_COMPLEX
#define NULL
void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
Definition: node.c:1095
#define NEW_DEFS(r, i, a, d, loc)
const char *void void rb_compile_warning(const char *, int, const char *,...) __attribute__((format(printf
VALUE rb_str_resize(VALUE, long)
Definition: string.c:2709
#define NEW_ITER(a, b, loc)
#define T_FILE
@ RB_WARN_CATEGORY_EXPERIMENTAL
#define nd_state
use StringValue() instead")))
#define RSTRING_LEN(str)
#define NEW_BLOCK(a, loc)
#define NEW_POSTEXE(b, loc)
VALUE rb_reg_check_preprocess(VALUE)
Definition: re.c:2707
#define RTEST(v)
#define NEW_CVASGN(v, val, loc)
#define NEW_DOT2(b, e, loc)
#define ALLOCA_N(type, n)
NODE * rb_ast_newnode(rb_ast_t *, enum node_type type)
Definition: node.c:1198
#define NEW_UNLESS(c, t, e, loc)
#define NEW_DEFN(i, a, d, loc)
#define NEW_RETURN(s, loc)
unsigned long st_data_t
#define NEW_ALIAS(n, o, loc)
#define RBASIC(obj)
const VALUE int int int int int int VALUE * vars[]
void rb_compile_warn(const char *, int, const char *,...) __attribute__((format(printf
#define ID_GLOBAL
#define NEW_MODULE(n, b, loc)
size_t strlen(const char *)
int strcmp(const char *, const char *)
void rb_define_private_method(VALUE, const char *, VALUE(*)(), int)
#define T_STRING
#define nd_first_lineno(n)
long int ptrdiff_t
void * malloc(size_t) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) __attribute__((__alloc_size__(1)))
#define ID_CLASS
__uint8_t uint8_t
#define xfree
#define nd_set_type(n, t)
#define NEW_DOT3(b, e, loc)
#define LONG2FIX(i)
#define Qundef
const struct rb_call_cache * cc
#define NEW_HASH(a, loc)
#define NEW_BREAK(s, loc)
#define CHAR_BIT
#define MAYBE_UNUSED(x)
VALUE rb_big_norm(VALUE)
Definition: bignum.c:3152
#define NEW_EVSTR(n, loc)
#define RSTRING_END(str)
void rb_write_error_str(VALUE mesg)
Definition: io.c:7940
const VALUE VALUE obj
#define NEW_COLON2(c, i, loc)
#define TYPE(x)
#define T_FLOAT
#define st_is_member(table, key)
VALUE rb_suppress_tracing(VALUE(*func)(VALUE), VALUE arg)
Definition: vm_trace.c:415
#define RSTRING_PTR(str)
void rb_gc_register_mark_object(VALUE)
Definition: gc.c:7079
const rb_iseq_t const char * error
#define xrealloc
#define ISXDIGIT(c)
#define T_BIGNUM
#define NEW_IF(c, t, e, loc)
#define NEW_NIL(loc)
VALUE VALUE rb_str_vcatf(VALUE, const char *, va_list)
Definition: sprintf.c:1210
VALUE rb_ident_hash_new(void)
Definition: hash.c:4278
#define rb_str_new(str, len)
#define NIL_P(v)
#define rb_str_buf_cat
#define numberof(array)
#define ID_CONST
#define DBL2NUM(dbl)
#define nd_resq
VALUE rb_str_cat(VALUE, const char *, long)
Definition: string.c:2812
#define NEW_GASGN(v, val, loc)
rb_ast_t * rb_ast_new(void)
Definition: node.c:1235
#define ID2SYM(x)
VALUE rb_io_gets(VALUE)
Definition: io.c:3577
#define NEW_BEGIN(b, loc)
#define nd_end
const char * rb_id2name(ID)
Definition: symbol.c:801
#define ISCNTRL(c)
#define REALLOC_N(var, type, n)
#define NEW_OPT_ARG(i, v, loc)
#define nd_line(n)
const char size_t n
#define rb_usascii_str_new(str, len)
#define ruby_verbose
#define RUBY_SYMBOL_EXPORT_BEGIN
#define rb_intern_const(str)
#define NEW_SPLAT(a, loc)
VALUE rb_io_write(VALUE, VALUE)
Definition: io.c:1804
#define NEW_IASGN(v, val, loc)
#define EOF
void rb_define_global_const(const char *, VALUE)
Definition: variable.c:2903
#define NEW_ARGS_AUX(r, b, loc)
#define SYM2ID(x)
#define NEW_CDECL(v, val, path, loc)
void rb_str_set_len(VALUE, long)
Definition: string.c:2692
int rb_respond_to(VALUE, ID)
Definition: vm_method.c:2207
unsigned long VALUE
VALUE rb_ary_push(VALUE, VALUE)
Definition: array.c:1195
#define stderr
#define nd_ainfo
#define NEW_SELF(loc)
#define NEW_CALL(r, m, a, loc)
#define NEW_DASGN(v, val, loc)
#define T_NODE
#define BIGNUM_NEGATE(b)
#define nd_1st
__inline__ const void *__restrict__ src
#define NEW_ARGSPUSH(a, b, loc)
int rb_local_defined(ID, const struct rb_iseq_struct *)
#define NEW_FALSE(loc)
void rb_str_modify(VALUE)
Definition: string.c:2114
#define NEW_CASE(h, b, loc)
VALUE rb_str_buf_new(long)
Definition: string.c:1315
#define rb_sym_intern_ascii_cstr(ptr)
#define NEW_RETRY(loc)
#define nd_first_column(n)
#define rb_rational_raw1(x)
VALUE rb_int_positive_pow(long x, unsigned long y)
Definition: numeric.c:4038
int rb_const_defined_at(VALUE, ID)
Definition: variable.c:2692
VALUE rb_filesystem_str_new_cstr(const char *)
Definition: string.c:1117
#define nd_brace
#define xmalloc
VALUE rb_cstr_to_inum(const char *, int, int)
Definition: bignum.c:4012
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
#define nd_2nd
uint32_t i
#define char
#define NEW_SUPER(a, loc)
#define nd_set_node_id(n, id)
VALUE rb_fstring(VALUE)
Definition: string.c:312
#define NUM2UINT(x)
#define RSTRING_GETMEM(str, ptrvar, lenvar)
int strncmp(const char *, const char *, size_t)
__inline__ const void *__restrict__ size_t len
const VALUE int int int int int int VALUE char * fmt
#define NEW_LASGN(v, val, loc)
VALUE rb_io_flush(VALUE)
Definition: io.c:1903
#define NEW_MATCH2(n1, n2, loc)
#define nd_set_last_loc(n, v)
const char * rb_obj_classname(VALUE)
Definition: variable.c:289
#define NEW_OPCALL(r, m, a, loc)
#define ALLOC_N(type, n)
#define NEW_SCOPE(a, b, loc)
void rb_ast_add_mark_object(rb_ast_t *, VALUE)
Definition: node.c:1393
#define NEW_MATCH3(r, n2, loc)
#define OBJ_FREEZE(x)
#define NEW_LIST(a, loc)
#define INT2NUM(x)
VALUE rb_stderr
#define NEW_XSTR(s, loc)
#define ZALLOC(type)
#define SIZED_REALLOC_N(var, type, n, old_n)
VALUE rb_complex_raw(VALUE, VALUE)
Definition: complex.c:1521
int strcasecmp(const char *, const char *) __attribute__((__pure__))
#define NEW_CASE2(b, loc)
#define T_RATIONAL
#define RNODE(obj)
#define RB_OBJ_WRITE(a, slot, b)
#define va_end(v)
VALUE rb_const_get_at(VALUE, ID)
Definition: variable.c:2397
#define FLONUM_P(x)
#define nd_last_loc(n)
#define T_HASH
#define LONG2NUM(x)
#define NEW_UNTIL(c, b, n, loc)
__int_least8_t int_least8_t
void rb_define_const(VALUE, const char *, VALUE)
Definition: variable.c:2891
__gnuc_va_list va_list
#define long
#define NUM2INT(x)
void rb_define_singleton_method(VALUE, const char *, VALUE(*)(), int)
#define NEW_OP_ASGN_OR(i, val, loc)
#define rb_long2int(n)
#define NEW_OP_ASGN1(p, id, a, loc)
#define RB_GC_GUARD(v)
#define RUBY_TYPED_FREE_IMMEDIATELY
#define NEW_SCLASS(r, b, loc)
#define nd_set_first_lineno(n, v)
#define ISALNUM(c)
#define RREGEXP_PTR(r)
#define NEW_DEFINED(e, loc)
#define NEW_REDO(loc)
#define RUBY_SYMBOL_EXPORT_END
#define NEW_CONST(v, loc)
#define TypedData_Get_Struct(obj, type, data_type, sval)
#define PRIsVALUE
#define NEW_DVAR(v, loc)
void * memset(void *, int, size_t)
#define NEW_FOR_MASGN(v, loc)
#define rb_funcall(recv, mid, argc,...)
#define NODE_SPECIAL_REQUIRED_KEYWORD
int VALUE v
VALUE rb_ary_new(void)
Definition: array.c:723
#define ID_SCOPE_SHIFT
#define rb_scan_args(argc, argvp, fmt,...)
__uint_least16_t uint_least16_t
#define nd_args
#define NEW_RESCUE(b, res, e, loc)
#define rb_usascii_str_new2
ID rb_intern2(const char *, long)
Definition: symbol.c:653
VALUE rb_rational_new(VALUE, VALUE)
Definition: rational.c:1957
#define rb_str_cat_cstr(str, ptr)
#define NEW_TRUE(loc)
void rb_gc_mark(VALUE)
Definition: gc.c:5228
#define rb_intern(str)
#define va_start(v, l)
#define ERANGE
int rb_memcicmp(const void *, const void *, long)
Definition: re.c:80
VALUE rb_str_catf(VALUE, const char *,...) __attribute__((format(printf
VALUE rb_node_case_when_optimizable_literal(const NODE *const node)
Definition: compile.c:4284
#define CONST_ID(var, str)
#define RRATIONAL(obj)
#define NEW_YIELD(a, loc)
#define RFLOAT_VALUE(v)
#define TRUE
#define FALSE
#define NEW_MASGN(l, r, loc)
#define rb_imemo_tmpbuf_auto_free_pointer()
#define NEW_NEXT(s, loc)
unsigned int size
#define RRATIONAL_SET_NUM(rat, n)
@ imemo_parser_strterm
#define Qtrue
#define MEMMOVE(p1, p2, type, n)
VALUE rb_str_subseq(VALUE, long, long)
Definition: string.c:2474
#define ruby_sized_xfree(ptr, size)
#define NEW_BLOCK_PASS(b, loc)
#define rb_strlen_lit(str)
#define UNLIKELY(x)
void rb_ast_add_local_table(rb_ast_t *, ID *buf)
Definition: node.c:1219
struct rb_call_cache buf
#define memmove(dst, src, len)
#define nd_else
#define NODE_SPECIAL_NO_REST_KEYWORD
#define NEW_FCALL(m, a, loc)
#define ISDIGIT(c)
VALUE rb_str_new_frozen(VALUE)
Definition: string.c:1203
VALUE rb_attr_get(VALUE, ID)
Definition: variable.c:1084
#define Qnil
#define Qfalse
#define NEW_OP_ASGN_AND(i, val, loc)
VALUE rb_io_puts(int, const VALUE *, VALUE)
Definition: io.c:7751
#define T_ARRAY
#define nd_lit
void * memcpy(void *__restrict__, const void *__restrict__, size_t)
VALUE rb_str_buf_append(VALUE, VALUE)
Definition: string.c:2950
#define ID_INSTANCE
#define T_OBJECT
VALUE rb_str_intern(VALUE)
Definition: symbol.c:710
int rb_stderr_tty_p(void)
Definition: io.c:7962
#define NEW_CLASS(n, b, s, loc)
__int_least16_t int_least16_t
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
Definition: gc.c:2321
#define nd_head
#define ULONG2NUM(x)
VALUE rb_thread_current(void)
Definition: thread.c:2675
#define RB_TYPE_P(obj, type)
#define INT2FIX(i)
#define SPECIAL_CONST_P(x)
#define NEW_LVAR(v, loc)
#define nd_set_line(n, l)
#define ALLOC(type)
void rb_gc_force_recycle(VALUE)
Definition: gc.c:7027
#define NODE_FL_NEWLINE
#define NEW_LAMBDA(a, b, loc)
VALUE rb_ary_unshift(VALUE, VALUE)
Definition: array.c:1494
VALUE rb_obj_as_string(VALUE)
Definition: string.c:1440
#define TypedData_Make_Struct(klass, type, data_type, sval)
const VALUE * argv
#define NEW_WHILE(c, b, n, loc)
#define SYMBOL_P(x)
#define NODE_REQUIRED_KEYWORD_P(node)
__inline__ int
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline)
Definition: re.c:2953
#define NEW_FOR(i, b, loc)
#define FIXNUM_P(f)
#define NEW_RESBODY(a, ex, n, loc)
#define NEW_IN(c, t, e, loc)
__uint_least8_t uint_least8_t
#define nd_beg
#define RCOMPLEX_SET_IMAG(cmp, i)
#define NEW_ZSUPER(loc)
#define NEW_CASE3(h, b, loc)
#define NEW_WHEN(c, t, e, loc)
#define RCOMPLEX_SET_REAL(cmp, r)
if((__builtin_expect(!!(!me), 0)))
VALUE rb_hash_aset(VALUE, VALUE, VALUE)
Definition: hash.c:2852
unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
Definition: util.c:97
#define NEW_GVAR(v, loc)
#define nd_set_first_column(n, v)
#define ID_LOCAL
#define NEW_OP_CDECL(v, op, val, loc)
#define NEW_UNDEF(i, loc)
#define NEW_COLON3(i, loc)
#define NEW_BACK_REF(n, loc)
#define RFLOAT(obj)
#define nd_type(n)
ID rb_id_attrset(ID)
Definition: symbol.c:98
#define xcalloc
#define NEW_IVAR(v, loc)
VALUE rb_str_dup(VALUE)
Definition: string.c:1516
VALUE rb_sprintf(const char *,...) __attribute__((format(printf
#define RBASIC_CLASS(obj)
#define NEW_VALIAS(n, o, loc)
#define nd_set_first_loc(n, v)
unsigned long ID
#define nd_body
#define NEW_POSTARG(i, v, loc)
#define InitVM(ext)
#define nd_value
size_t st_index_t h
#define ISSPACE(c)
#define rb_ary_new_from_args(n,...)
#define RUBY_FUNC_EXPORTED
VALUE ID id
#define NEW_NODE(t, a0, a1, a2, loc)
#define FIX2LONG(x)
VALUE rb_hash_clear(VALUE)
Definition: hash.c:2769
#define NEW_ENSURE(b, en, loc)
#define NODE_SPECIAL_NO_NAME_REST
#define NEW_CVAR(v, loc)
#define ID_SCOPE_MASK
void rb_define_method(VALUE, const char *, VALUE(*)(), int)
#define NODE_SPECIAL_EXCESSIVE_COMMA
#define RARRAY_AREF(a, i)
#define BUILTIN_TYPE(x)
#define SIZEOF_VALUE
#define NEW_KW_ARG(i, v, loc)
#define NEW_STR(s, loc)
VALUE rb_stdout
#define nd_next
VALUE rb_make_backtrace(void)
Definition: vm_backtrace.c:872
VALUE rb_hash_new(void)
Definition: hash.c:1523
void rb_ast_delete_node(rb_ast_t *, NODE *n)
Definition: node.c:1227
#define NEW_ARGSCAT(a, b, loc)
#define rb_str_new_cstr(str)
#define RB_OBJ_WRITTEN(a, oldv, b)
VALUE VALUE rb_vsprintf(const char *, va_list)
Definition: sprintf.c:1191
VALUE rb_funcallv_public(VALUE, ID, int, const VALUE *)
Calls a method.
Definition: vm_eval.c:980
#define NEW_DASGN_CURR(v, val, loc)
#define ID_INTERNAL
#define ID_STATIC_SYM
#define ISASCII(c)
VALUE rb_ary_entry(VALUE, long)
Definition: array.c:1512
#define NEW_ATTRASGN(r, m, a, loc)
#define NEW_OP_ASGN2(r, t, i, o, val, loc)
#define StringValueCStr(v)
#define NEW_LIT(l, loc)
#define STRNCASECMP(s1, s2, n)
#define T_REGEXP
#define NEW_ERRINFO(loc)
#define RCOMPLEX(obj)
#define ISALPHA(c)
#define NEW_NTH_REF(n, loc)
int rb_dvar_defined(ID, const struct rb_iseq_struct *)
#define nd_plen
#define BEG(no)
Definition: re.c:25
yysymbol_kind_t
Definition: ripper.c:1236
short yytype_int16
Definition: ripper.c:1698
lex_state_e
Definition: ripper.c:155
yytype_int16 yy_state_t
Definition: ripper.c:1774
unsigned char yytype_uint8
Definition: ripper.c:1719
lex_state_bits
Definition: ripper.c:138
int yy_state_fast_t
Definition: ripper.c:1777
string_type
Definition: ripper.c:13800
VALUE stack_type
Definition: ripper.c:187
cond_type
Definition: ripper.c:18665
signed char yytype_int8
Definition: ripper.c:1690
rb_atomic_t cnt[RUBY_NSIG]
Definition: signal.c:503
#define f
void st_free_table(st_table *tab)
Definition: st.c:709
st_table * st_init_numtable_with_size(st_index_t size)
Definition: st.c:660
st_table * st_init_numtable(void)
Definition: st.c:653
int st_insert(st_table *tab, st_data_t key, st_data_t value)
Definition: st.c:1171
int st_lookup(st_table *tab, st_data_t key, st_data_t *value)
Definition: st.c:1101
int st_foreach(st_table *tab, st_foreach_callback_func *func, st_data_t arg)
Definition: st.c:1717
rb_code_location_t nd_loc
union RNode::@39 u2
union RNode::@40 u3
union RNode::@38 u1
Definition: parse.h:204
int last_line
Definition: parse.h:207
int first_column
Definition: parse.h:206
int first_line
Definition: parse.h:205
int last_column
Definition: parse.h:208
Definition: lex.c:34
short id[2]
Definition: lex.c:34
short state
Definition: lex.c:34
struct local_vars * prev
Definition: ripper.c:225
NODE * current
Definition: ripper.c:228
struct vtable * vars
Definition: ripper.c:220
NODE * outer
Definition: ripper.c:228
NODE * inner
Definition: ripper.c:228
struct vtable * args
Definition: ripper.c:219
struct vtable * used
Definition: ripper.c:221
struct local_vars::@126 numparam
rb_magic_comment_length_t length
Definition: ripper.c:15466
rb_magic_comment_setter_t func
Definition: ripper.c:15465
const char * name
Definition: ripper.c:15464
VALUE(* gets)(struct parser_params *, VALUE)
Definition: ripper.c:281
int brace_nest
Definition: ripper.c:300
VALUE compile_option
Definition: ripper.c:321
rb_strterm_t * strterm
Definition: ripper.c:280
st_table * pktbl
Definition: ripper.c:313
const char * ruby_sourcefile
Definition: ripper.c:316
int heredoc_line_indent
Definition: ripper.c:309
unsigned int debug
Definition: ripper.c:336
unsigned int ruby__end__seen
Definition: ripper.c:335
YYSTYPE * lval
Definition: ripper.c:277
unsigned int has_shebang
Definition: ripper.c:337
VALUE(* call)(VALUE, int)
Definition: ripper.c:292
int lpar_beg
Definition: ripper.c:298
int heredoc_end
Definition: ripper.c:307
st_table * pvtbl
Definition: ripper.c:312
int tokline
Definition: ripper.c:306
int line_count
Definition: ripper.c:314
rb_encoding * enc
Definition: ripper.c:318
token_info * token_info
Definition: ripper.c:319
unsigned int do_chomp
Definition: ripper.c:355
VALUE input
Definition: ripper.c:282
char * tokenbuf
Definition: ripper.c:310
VALUE nextline
Definition: ripper.c:285
const char * ptok
Definition: ripper.c:289
rb_imemo_tmpbuf_t * heap
Definition: ripper.c:275
unsigned int token_seen
Definition: ripper.c:342
VALUE debug_lines
Definition: ripper.c:362
unsigned int command_start
Definition: ripper.c:333
unsigned int in_kwarg
Definition: ripper.c:339
enum lex_state_e state
Definition: ripper.c:294
unsigned int warn_location
Definition: ripper.c:357
unsigned int in_class
Definition: ripper.c:341
union parser_params::@127::@128 gets_
VALUE lastline
Definition: ripper.c:284
stack_type cond_stack
Definition: ripper.c:302
struct parser_params::@127 lex
int node_id
Definition: ripper.c:329
NODE * eval_tree
Definition: ripper.c:360
const char * pend
Definition: ripper.c:288
unsigned int eofp
Definition: ripper.c:334
unsigned int error_p
Definition: ripper.c:347
int heredoc_indent
Definition: ripper.c:308
VALUE case_labels
Definition: ripper.c:320
unsigned int in_defined
Definition: ripper.c:338
int max_numparam
Definition: ripper.c:331
unsigned int do_loop
Definition: ripper.c:354
VALUE debug_buffer
Definition: ripper.c:323
const char * pbeg
Definition: ripper.c:286
long ptr
Definition: ripper.c:291
rb_ast_t * ast
Definition: ripper.c:328
const struct rb_iseq_struct * parent_iseq
Definition: ripper.c:363
int ruby_sourceline
Definition: ripper.c:315
unsigned int do_split
Definition: ripper.c:356
unsigned int do_print
Definition: ripper.c:353
NODE * eval_tree_begin
Definition: ripper.c:359
stack_type cmdarg_stack
Definition: ripper.c:303
VALUE error_buffer
Definition: ripper.c:361
unsigned int in_def
Definition: ripper.c:340
VALUE debug_output
Definition: ripper.c:324
unsigned int token_info_enabled
Definition: ripper.c:343
VALUE ruby_sourcefile_string
Definition: ripper.c:317
int paren_nest
Definition: ripper.c:296
int tokidx
Definition: ripper.c:304
const char * pcur
Definition: ripper.c:287
VALUE prevline
Definition: ripper.c:283
int toksiz
Definition: ripper.c:305
struct local_vars * lvtbl
Definition: ripper.c:311
unsigned int cr_seen
Definition: ripper.c:348
union rb_strterm_literal_struct::@130 u1
union rb_strterm_literal_struct::@131 u2
union rb_strterm_literal_struct::@132 u3
union rb_strterm_literal_struct::@129 u0
rb_strterm_literal_t literal
Definition: ripper.c:761
union rb_strterm_struct::@133 u
rb_strterm_heredoc_t heredoc
Definition: ripper.c:762
int nonspc
Definition: ripper.c:259
int indent
Definition: ripper.c:258
rb_code_position_t beg
Definition: ripper.c:257
const char * token
Definition: ripper.c:256
struct token_info * next
Definition: ripper.c:260
Definition: ripper.c:211
ID * tbl
Definition: ripper.c:212
int capa
Definition: ripper.c:214
struct vtable * prev
Definition: ripper.c:215
int pos
Definition: ripper.c:213
yysymbol_kind_t yytoken
Definition: ripper.c:6131
yy_state_t * yyssp
Definition: ripper.c:6130
#define is_identchar(p, e, enc)
Definition: symbol.c:35
int rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset)
Definition: symbol.c:233
#define is_notop_id(id)
Definition: symbol.h:35
#define is_local_id(id)
Definition: symbol.h:36
Definition: parse.h:183
struct rb_strterm_struct * strterm
Definition: parse.h:191
ID id
Definition: parse.h:187
VALUE val
Definition: parse.h:185
int num
Definition: parse.h:188
NODE * node
Definition: parse.h:186
st_table * tbl
Definition: parse.h:189
const struct vtable * vars
Definition: parse.h:190
YYLTYPE yyls_alloc
Definition: ripper.c:1932
YYSTYPE yyvs_alloc
Definition: ripper.c:1931
yy_state_t yyss_alloc
Definition: ripper.c:1930
unsigned long ruby_scan_oct(const char *, size_t, size_t *)
Definition: util.c:34
#define strtod(s, e)
Definition: util.h:76
#define scan_hex(s, l, e)
Definition: util.h:55
#define scan_oct(s, l, e)
Definition: util.h:53
#define rb_id2str(id)
Definition: vm_backtrace.c:30
#define MAX_WORD_LENGTH
Definition: zonetab.h:45