Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
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
83
84#include <ctype.h>
85#include <errno.h>
86#include <stdio.h>
87
88struct lex_context;
89
90#include "internal.h"
91#include "internal/compile.h"
92#include "internal/compilers.h"
93#include "internal/complex.h"
94#include "internal/error.h"
95#include "internal/hash.h"
96#include "internal/imemo.h"
97#include "internal/io.h"
98#include "internal/numeric.h"
99#include "internal/parse.h"
100#include "internal/rational.h"
101#include "internal/re.h"
102#include "internal/symbol.h"
103#include "internal/thread.h"
104#include "internal/util.h"
105#include "internal/variable.h"
106#include "node.h"
107#include "probes.h"
108#include "regenc.h"
109#include "ruby/encoding.h"
110#include "ruby/regex.h"
111#include "ruby/ruby.h"
112#include "ruby/st.h"
113#include "ruby/util.h"
114#include "ruby/ractor.h"
115#include "symbol.h"
116
122};
123
124struct lex_context {
125 unsigned int in_defined: 1;
126 unsigned int in_kwarg: 1;
127 unsigned int in_def: 1;
128 unsigned int in_class: 1;
129 BITFIELD(enum shareability, shareable_constant_value, 2);
130};
131
132#include "parse.h"
133
134#define NO_LEX_CTXT (struct lex_context){0}
135
136#define AREF(ary, i) RARRAY_AREF(ary, i)
137
138#ifndef WARN_PAST_SCOPE
139# define WARN_PAST_SCOPE 0
140#endif
141
142#define TAB_WIDTH 8
143
144#define yydebug (p->debug) /* disable the global variable definition */
145
146#define YYMALLOC(size) rb_parser_malloc(p, (size))
147#define YYREALLOC(ptr, size) rb_parser_realloc(p, (ptr), (size))
148#define YYCALLOC(nelem, size) rb_parser_calloc(p, (nelem), (size))
149#define YYFREE(ptr) rb_parser_free(p, (ptr))
150#define YYFPRINTF rb_parser_printf
151#define YY_LOCATION_PRINT(File, loc) \
152 rb_parser_printf(p, "%d.%d-%d.%d", \
153 (loc).beg_pos.lineno, (loc).beg_pos.column,\
154 (loc).end_pos.lineno, (loc).end_pos.column)
155#define YYLLOC_DEFAULT(Current, Rhs, N) \
156 do \
157 if (N) \
158 { \
159 (Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
160 (Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
161 } \
162 else \
163 { \
164 (Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
165 (Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
166 } \
167 while (0)
168
169#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
170 rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
171#define RUBY_SET_YYLLOC_OF_NONE(Current) \
172 rb_parser_set_location_of_none(p, &(Current))
173#define RUBY_SET_YYLLOC(Current) \
174 rb_parser_set_location(p, &(Current))
175#define RUBY_INIT_YYLLOC() \
176 { \
177 {p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
178 {p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
179 }
180
182 EXPR_BEG_bit, /* ignore newline, +/- is a sign. */
183 EXPR_END_bit, /* newline significant, +/- is an operator. */
184 EXPR_ENDARG_bit, /* ditto, and unbound braces. */
185 EXPR_ENDFN_bit, /* ditto, and unbound braces. */
186 EXPR_ARG_bit, /* newline significant, +/- is an operator. */
187 EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */
188 EXPR_MID_bit, /* newline significant, +/- is an operator. */
189 EXPR_FNAME_bit, /* ignore newline, no reserved words. */
190 EXPR_DOT_bit, /* right after `.' or `::', no reserved words. */
191 EXPR_CLASS_bit, /* immediate after `class', no here document. */
192 EXPR_LABEL_bit, /* flag bit, label is allowed. */
193 EXPR_LABELED_bit, /* flag bit, just after a label. */
194 EXPR_FITEM_bit, /* symbol literal as FNAME. */
197/* examine combinations */
199#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit)
201 DEF_EXPR(END),
202 DEF_EXPR(ENDARG),
203 DEF_EXPR(ENDFN),
204 DEF_EXPR(ARG),
205 DEF_EXPR(CMDARG),
206 DEF_EXPR(MID),
207 DEF_EXPR(FNAME),
208 DEF_EXPR(DOT),
209 DEF_EXPR(CLASS),
211 DEF_EXPR(LABELED),
212 DEF_EXPR(FITEM),
213 EXPR_VALUE = EXPR_BEG,
214 EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS),
215 EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG),
216 EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN),
217 EXPR_NONE = 0
219#define IS_lex_state_for(x, ls) ((x) & (ls))
220#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
221#define IS_lex_state(ls) IS_lex_state_for(p->lex.state, (ls))
222#define IS_lex_state_all(ls) IS_lex_state_all_for(p->lex.state, (ls))
223
224# define SET_LEX_STATE(ls) \
225 (p->lex.state = \
226 (p->debug ? \
227 rb_parser_trace_lex_state(p, p->lex.state, (ls), __LINE__) : \
228 (enum lex_state_e)(ls)))
229
231
232static const rb_code_location_t NULL_LOC = { {0, -1}, {0, -1} };
233
234# define SHOW_BITSTACK(stack, name) (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
235# define BITSTACK_PUSH(stack, n) (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
236# define BITSTACK_POP(stack) (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
237# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
238# define BITSTACK_SET(stack, n) ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
239
240/* A flag to identify keyword_do_cond, "do" keyword after condition expression.
241 Examples: `while ... do`, `until ... do`, and `for ... in ... do` */
242#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
243#define COND_POP() BITSTACK_POP(cond_stack)
244#define COND_P() BITSTACK_SET_P(cond_stack)
245#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
246
247/* A flag to identify keyword_do_block; "do" keyword after command_call.
248 Example: `foo 1, 2 do`. */
249#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
250#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
251#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
252#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
253
254struct vtable {
255 ID *tbl;
256 int pos;
257 int capa;
258 struct vtable *prev;
259};
260
261struct local_vars {
262 struct vtable *args;
263 struct vtable *vars;
264 struct vtable *used;
265# if WARN_PAST_SCOPE
266 struct vtable *past;
267# endif
268 struct local_vars *prev;
269# ifndef RIPPER
270 struct {
271 NODE *outer, *inner, *current;
273# endif
274};
275
276enum {
280};
281
282#define NUMPARAM_ID_P(id) numparam_id_p(id)
283#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1)
284#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1))
285static int
286numparam_id_p(ID id)
287{
288 if (!is_local_id(id)) return 0;
289 unsigned int idx = NUMPARAM_ID_TO_IDX(id);
290 return idx > 0 && idx <= NUMPARAM_MAX;
291}
292static void numparam_name(struct parser_params *p, ID id);
293
294#define DVARS_INHERIT ((void*)1)
295#define DVARS_TOPSCOPE NULL
296#define DVARS_TERMINAL_P(tbl) ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
297
298typedef struct token_info {
299 const char *token;
301 int indent;
302 int nonspc;
303 struct token_info *next;
305
307
308/*
309 Structure of Lexer Buffer:
310
311 lex.pbeg lex.ptok lex.pcur lex.pend
312 | | | |
313 |------------+------------+------------|
314 |<---------->|
315 token
316*/
317struct parser_params {
319
320 YYSTYPE *lval;
321
322 struct {
324 VALUE (*gets)(struct parser_params*,VALUE);
325 VALUE input;
329 const char *pbeg;
330 const char *pcur;
331 const char *pend;
332 const char *ptok;
333 union {
334 long ptr;
335 VALUE (*call)(VALUE, int);
337 enum lex_state_e state;
338 /* track the nest level of any parens "()[]{}" */
339 int paren_nest;
340 /* keep p->lex.paren_nest at the beginning of lambda "->" to detect tLAMBEG and keyword_do_LAMBDA */
341 int lpar_beg;
342 /* track the nest level of only braces "{}" */
343 int brace_nest;
347 int tokidx;
348 int toksiz;
349 int tokline;
350 int heredoc_end;
351 int heredoc_indent;
353 char *tokenbuf;
354 struct local_vars *lvtbl;
357 int line_count;
358 int ruby_sourceline; /* current line no. */
359 const char *ruby_sourcefile; /* current source file */
365
368
369 ID cur_arg;
370
371 rb_ast_t *ast;
372 int node_id;
373
374 int max_numparam;
375
376 struct lex_context ctxt;
377
378 unsigned int command_start:1;
379 unsigned int eofp: 1;
380 unsigned int ruby__end__seen: 1;
381 unsigned int debug: 1;
382 unsigned int has_shebang: 1;
383 unsigned int token_seen: 1;
384 unsigned int token_info_enabled: 1;
385# if WARN_PAST_SCOPE
386 unsigned int past_scope_enabled: 1;
387# endif
388 unsigned int error_p: 1;
389 unsigned int cr_seen: 1;
390
391#ifndef RIPPER
392 /* Ruby core only */
393
394 unsigned int do_print: 1;
395 unsigned int do_loop: 1;
396 unsigned int do_chomp: 1;
397 unsigned int do_split: 1;
398
403 const struct rb_iseq_struct *parent_iseq;
404#else
405 /* Ripper only */
406
407 struct {
408 VALUE token;
409 int line;
410 int col;
411 } delayed;
412
413 VALUE value;
414 VALUE result;
415 VALUE parsing_thread;
416#endif
417};
418
419#define intern_cstr(n,l,en) rb_intern3(n,l,en)
420
421#define STR_NEW(ptr,len) rb_enc_str_new((ptr),(len),p->enc)
422#define STR_NEW0() rb_enc_str_new(0,0,p->enc)
423#define STR_NEW2(ptr) rb_enc_str_new((ptr),strlen(ptr),p->enc)
424#define STR_NEW3(ptr,len,e,func) parser_str_new((ptr),(len),(e),(func),p->enc)
425#define TOK_INTERN() intern_cstr(tok(p), toklen(p), p->enc)
426
427static st_table *
428push_pvtbl(struct parser_params *p)
429{
430 st_table *tbl = p->pvtbl;
431 p->pvtbl = st_init_numtable();
432 return tbl;
433}
434
435static void
436pop_pvtbl(struct parser_params *p, st_table *tbl)
437{
439 p->pvtbl = tbl;
440}
441
442static st_table *
443push_pktbl(struct parser_params *p)
444{
445 st_table *tbl = p->pktbl;
446 p->pktbl = 0;
447 return tbl;
448}
449
450static void
451pop_pktbl(struct parser_params *p, st_table *tbl)
452{
453 if (p->pktbl) st_free_table(p->pktbl);
454 p->pktbl = tbl;
455}
456
457static int parser_yyerror(struct parser_params*, const YYLTYPE *yylloc, const char*);
458#define yyerror0(msg) parser_yyerror(p, NULL, (msg))
459#define yyerror1(loc, msg) parser_yyerror(p, (loc), (msg))
460#define yyerror(yylloc, p, msg) parser_yyerror(p, yylloc, msg)
461#define token_flush(ptr) ((ptr)->lex.ptok = (ptr)->lex.pcur)
462
463static void token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc);
464static void token_info_push(struct parser_params*, const char *token, const rb_code_location_t *loc);
465static void token_info_pop(struct parser_params*, const char *token, const rb_code_location_t *loc);
466static void token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc);
467static void token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos);
468
469#ifdef RIPPER
470#define compile_for_eval (0)
471#else
472#define compile_for_eval (p->parent_iseq != 0)
473#endif
474
475#define token_column ((int)(p->lex.ptok - p->lex.pbeg))
476
477#define CALL_Q_P(q) ((q) == TOKEN2VAL(tANDDOT))
478#define NODE_CALL_Q(q) (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
479#define NEW_QCALL(q,r,m,a,loc) NEW_NODE(NODE_CALL_Q(q),r,m,a,loc)
480
481#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
482
483static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
484
485#ifndef RIPPER
486static inline void
487rb_discard_node(struct parser_params *p, NODE *n)
488{
489 rb_ast_delete_node(p->ast, n);
490}
491#endif
492
493#ifdef RIPPER
494static inline VALUE
495add_mark_object(struct parser_params *p, VALUE obj)
496{
497 if (!SPECIAL_CONST_P(obj)
498 && !RB_TYPE_P(obj, T_NODE) /* Ripper jumbles NODE objects and other objects... */
499 ) {
501 }
502 return obj;
503}
504#else
505static NODE* node_newnode_with_locals(struct parser_params *, enum node_type, VALUE, VALUE, const rb_code_location_t*);
506#endif
507
508static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE, const rb_code_location_t*);
509#define rb_node_newnode(type, a1, a2, a3, loc) node_newnode(p, (type), (a1), (a2), (a3), (loc))
510
511static NODE *nd_set_loc(NODE *nd, const YYLTYPE *loc);
512
513static int
514parser_get_node_id(struct parser_params *p)
515{
516 int node_id = p->node_id;
517 p->node_id++;
518 return node_id;
519}
520
521#ifndef RIPPER
522static inline void
523set_line_body(NODE *body, int line)
524{
525 if (!body) return;
526 switch (nd_type(body)) {
527 case NODE_RESCUE:
528 case NODE_ENSURE:
529 nd_set_line(body, line);
530 }
531}
532
533#define yyparse ruby_yyparse
534
535static NODE* cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
536static NODE* method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc);
537#define new_nil(loc) NEW_NIL(loc)
538static NODE *new_nil_at(struct parser_params *p, const rb_code_position_t *pos);
539static NODE *new_if(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
540static NODE *new_unless(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
541static NODE *logop(struct parser_params*,ID,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
542
543static NODE *newline_node(NODE*);
544static void fixpos(NODE*,NODE*);
545
546static int value_expr_gen(struct parser_params*,NODE*);
547static void void_expr(struct parser_params*,NODE*);
548static NODE *remove_begin(NODE*);
549static NODE *remove_begin_all(NODE*);
550#define value_expr(node) value_expr_gen(p, (node))
551static NODE *void_stmts(struct parser_params*,NODE*);
552static void reduce_nodes(struct parser_params*,NODE**);
553static void block_dup_check(struct parser_params*,NODE*,NODE*);
554
555static NODE *block_append(struct parser_params*,NODE*,NODE*);
556static NODE *list_append(struct parser_params*,NODE*,NODE*);
557static NODE *list_concat(NODE*,NODE*);
558static NODE *arg_append(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
559static NODE *last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc);
560static NODE *rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc);
561static NODE *literal_concat(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
562static NODE *new_evstr(struct parser_params*,NODE*,const YYLTYPE*);
563static NODE *new_dstr(struct parser_params*,NODE*,const YYLTYPE*);
564static NODE *evstr2dstr(struct parser_params*,NODE*);
565static NODE *splat_array(NODE*);
566static void mark_lvar_used(struct parser_params *p, NODE *rhs);
567
568static NODE *call_bin_op(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
569static NODE *call_uni_op(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
570static NODE *new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc);
571static 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);
572static 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;}
573
574static bool args_info_empty_p(struct rb_args_info *args);
575static NODE *new_args(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*,const YYLTYPE*);
576static NODE *new_args_tail(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
577static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc);
578static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc);
579static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc);
580static NODE *new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc);
581static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
582static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
583static void warn_one_line_pattern_matching(struct parser_params *p, NODE *node, NODE *pattern, bool right_assign);
584
585static NODE *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
586static NODE *args_with_numbered(struct parser_params*,NODE*,int);
587
588static VALUE negate_lit(struct parser_params*, VALUE);
589static NODE *ret_args(struct parser_params*,NODE*);
590static NODE *arg_blk_pass(NODE*,NODE*);
591static NODE *new_yield(struct parser_params*,NODE*,const YYLTYPE*);
592static NODE *dsym_node(struct parser_params*,NODE*,const YYLTYPE*);
593
594static NODE *gettable(struct parser_params*,ID,const YYLTYPE*);
595static NODE *assignable(struct parser_params*,ID,NODE*,const YYLTYPE*);
596
597static NODE *aryset(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
598static NODE *attrset(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
599
600static void rb_backref_error(struct parser_params*,NODE*);
601static NODE *node_assign(struct parser_params*,NODE*,NODE*,struct lex_context,const YYLTYPE*);
602
603static NODE *new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
604static NODE *new_ary_op_assign(struct parser_params *p, NODE *ary, NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc);
605static NODE *new_attr_op_assign(struct parser_params *p, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc);
606static NODE *new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context, const YYLTYPE *loc);
607static NODE *new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc);
608
609static NODE *const_decl(struct parser_params *p, NODE* path, const YYLTYPE *loc);
610
611static NODE *opt_arg_append(NODE*, NODE*);
612static NODE *kwd_append(NODE*, NODE*);
613
614static NODE *new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
615static NODE *new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc);
616
617static NODE *new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc);
618
619static NODE *new_regexp(struct parser_params *, NODE *, int, const YYLTYPE *);
620
621#define make_list(list, loc) ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
622
623static NODE *new_xstring(struct parser_params *, NODE *, const YYLTYPE *loc);
624
625static NODE *symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol);
626
627static NODE *match_op(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
628
629static ID *local_tbl(struct parser_params*);
630
631static VALUE reg_compile(struct parser_params*, VALUE, int);
632static void reg_fragment_setenc(struct parser_params*, VALUE, int);
633static int reg_fragment_check(struct parser_params*, VALUE, int);
634static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
635
636static int literal_concat0(struct parser_params *p, VALUE head, VALUE tail);
637static NODE *heredoc_dedent(struct parser_params*,NODE*);
638
639static void check_literal_when(struct parser_params *p, NODE *args, const YYLTYPE *loc);
640
641#define get_id(id) (id)
642#define get_value(val) (val)
643#define get_num(num) (num)
644#else /* RIPPER */
645#define NODE_RIPPER NODE_CDECL
646#define NEW_RIPPER(a,b,c,loc) (VALUE)NEW_CDECL(a,b,c,loc)
647
648static inline int ripper_is_node_yylval(VALUE n);
649
650static inline VALUE
651ripper_new_yylval(struct parser_params *p, ID a, VALUE b, VALUE c)
652{
653 if (ripper_is_node_yylval(c)) c = RNODE(c)->nd_cval;
654 add_mark_object(p, b);
655 add_mark_object(p, c);
656 return NEW_RIPPER(a, b, c, &NULL_LOC);
657}
658
659static inline int
660ripper_is_node_yylval(VALUE n)
661{
662 return RB_TYPE_P(n, T_NODE) && nd_type(RNODE(n)) == NODE_RIPPER;
663}
664
665#define value_expr(node) ((void)(node))
666#define remove_begin(node) (node)
667#define void_stmts(p,x) (x)
668#define rb_dvar_defined(id, base) 0
669#define rb_local_defined(id, base) 0
670static ID ripper_get_id(VALUE);
671#define get_id(id) ripper_get_id(id)
672static VALUE ripper_get_value(VALUE);
673#define get_value(val) ripper_get_value(val)
674#define get_num(num) (int)get_id(num)
675static VALUE assignable(struct parser_params*,VALUE);
676static int id_is_var(struct parser_params *p, ID id);
677
678#define method_cond(p,node,loc) (node)
679#define call_bin_op(p, recv,id,arg1,op_loc,loc) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
680#define match_op(p,node1,node2,op_loc,loc) call_bin_op(0, (node1), idEqTilde, (node2), op_loc, loc)
681#define call_uni_op(p, recv,id,op_loc,loc) dispatch2(unary, STATIC_ID2SYM(id), (recv))
682#define logop(p,id,node1,node2,op_loc,loc) call_bin_op(0, (node1), (id), (node2), op_loc, loc)
683
684#define new_nil(loc) Qnil
685
686static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *);
687
688static VALUE const_decl(struct parser_params *p, VALUE path);
689
690static VALUE var_field(struct parser_params *p, VALUE a);
691static VALUE assign_error(struct parser_params *p, const char *mesg, VALUE a);
692
693static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
694
695static VALUE backref_error(struct parser_params*, NODE *, VALUE);
696#endif /* !RIPPER */
697
698/* forward declaration */
700
701RUBY_SYMBOL_EXPORT_BEGIN
702VALUE rb_parser_reg_compile(struct parser_params* p, VALUE str, int options);
706void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
707PRINTF_ARGS(void rb_parser_fatal(struct parser_params *p, const char *fmt, ...), 2, 3);
711RUBY_SYMBOL_EXPORT_END
712
713static void error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc);
714static void error_duplicate_pattern_key(struct parser_params *p, ID id, const YYLTYPE *loc);
715#ifndef RIPPER
716static ID formal_argument(struct parser_params*, ID);
717#else
718static ID formal_argument(struct parser_params*, VALUE);
719#endif
720static ID shadowing_lvar(struct parser_params*,ID);
721static void new_bv(struct parser_params*,ID);
722
723static void local_push(struct parser_params*,int);
724static void local_pop(struct parser_params*);
725static void local_var(struct parser_params*, ID);
726static void arg_var(struct parser_params*, ID);
727static int local_id(struct parser_params *p, ID id);
728static int local_id_ref(struct parser_params*, ID, ID **);
729#ifndef RIPPER
730static ID internal_id(struct parser_params*);
731static NODE *new_args_forward_call(struct parser_params*, NODE*, const YYLTYPE*, const YYLTYPE*);
732static NODE *new_args_forward_def(struct parser_params*, NODE*, const YYLTYPE*);
733#endif
734static int check_forwarding_args(struct parser_params*);
735static void add_forwarding_args(struct parser_params *p);
736
737static const struct vtable *dyna_push(struct parser_params *);
738static void dyna_pop(struct parser_params*, const struct vtable *);
739static int dyna_in_block(struct parser_params*);
740#define dyna_var(p, id) local_var(p, id)
741static int dvar_defined(struct parser_params*, ID);
742static int dvar_defined_ref(struct parser_params*, ID, ID**);
743static int dvar_curr(struct parser_params*,ID);
744
745static int lvar_defined(struct parser_params*, ID);
746
747static NODE *numparam_push(struct parser_params *p);
748static void numparam_pop(struct parser_params *p, NODE *prev_inner);
749
750#ifdef RIPPER
751# define METHOD_NOT idNOT
752#else
753# define METHOD_NOT '!'
754#endif
755
756#define idFWD_REST '*'
757#ifdef RUBY3_KEYWORDS
758#define idFWD_KWREST idPow /* Use simple "**", as tDSTAR is "**arg" */
759#else
760#define idFWD_KWREST 0
761#endif
762#define idFWD_BLOCK '&'
763
764#define RE_OPTION_ONCE (1<<16)
765#define RE_OPTION_ENCODING_SHIFT 8
766#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
767#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
768#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
769#define RE_OPTION_MASK 0xff
770#define RE_OPTION_ARG_ENCODING_NONE 32
771
772/* structs for managing terminator of string literal and heredocment */
773typedef struct rb_strterm_literal_struct {
774 union {
775 VALUE dummy;
776 long nest;
777 } u0;
778 union {
779 VALUE dummy;
780 long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
781 } u1;
782 union {
783 VALUE dummy;
784 long paren; /* '(' of `%q(...)` */
785 } u2;
786 union {
787 VALUE dummy;
788 long term; /* ')' of `%q(...)` */
789 } u3;
791
792#define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
793
795 VALUE lastline; /* the string of line that contains `<<"END"` */
796 long offset; /* the column of END in `<<"END"` */
797 int sourceline; /* lineno of the line that contains `<<"END"` */
798 unsigned length /* the length of END in `<<"END"` */
799#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
801# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
802#else
803# define HERETERM_LENGTH_MAX UINT_MAX
804#endif
805 ;
806#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
807 unsigned quote: 1;
808 unsigned func: 8;
809#else
812#endif
813};
815
816#define STRTERM_HEREDOC IMEMO_FL_USER0
817
818struct rb_strterm_struct {
819 VALUE flags;
820 union {
823 } u;
824};
825
826#ifndef RIPPER
827void
829{
830 rb_strterm_t *strterm = (rb_strterm_t*)obj;
831 if (RBASIC(obj)->flags & STRTERM_HEREDOC) {
832 rb_strterm_heredoc_t *heredoc = &strterm->u.heredoc;
833 rb_gc_mark(heredoc->lastline);
834 }
835}
836#endif
837
838#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
839size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr);
840
841#define TOKEN2ID(tok) ( \
842 tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
843 tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
844 tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
845 tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
846 tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
847 tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
848 ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
849
850/****** Ripper *******/
851
852#ifdef RIPPER
853#define RIPPER_VERSION "0.1.0"
854
855static inline VALUE intern_sym(const char *name);
856
857#include "eventids1.c"
858#include "eventids2.c"
859
860static VALUE ripper_dispatch0(struct parser_params*,ID);
861static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
862static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
863static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
864static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
865static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
866static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
867static void ripper_error(struct parser_params *p);
868
869#define dispatch0(n) ripper_dispatch0(p, TOKEN_PASTE(ripper_id_, n))
870#define dispatch1(n,a) ripper_dispatch1(p, TOKEN_PASTE(ripper_id_, n), (a))
871#define dispatch2(n,a,b) ripper_dispatch2(p, TOKEN_PASTE(ripper_id_, n), (a), (b))
872#define dispatch3(n,a,b,c) ripper_dispatch3(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c))
873#define dispatch4(n,a,b,c,d) ripper_dispatch4(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d))
874#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(p, TOKEN_PASTE(ripper_id_, n), (a), (b), (c), (d), (e))
875#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))
876
877#define yyparse ripper_yyparse
878
879#define ID2VAL(id) STATIC_ID2SYM(id)
880#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
881#define KWD2EID(t, v) ripper_new_yylval(p, keyword_##t, get_value(v), 0)
882
883#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
884 dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
885
886#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
887
888static inline VALUE
889new_args(struct parser_params *p, VALUE pre_args, VALUE opt_args, VALUE rest_arg, VALUE post_args, VALUE tail, YYLTYPE *loc)
890{
891 NODE *t = (NODE *)tail;
892 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value, block = t->u3.value;
893 return params_new(pre_args, opt_args, rest_arg, post_args, kw_args, kw_rest_arg, escape_Qundef(block));
894}
895
896static inline VALUE
897new_args_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, VALUE block, YYLTYPE *loc)
898{
899 NODE *t = rb_node_newnode(NODE_ARGS_AUX, kw_args, kw_rest_arg, block, &NULL_LOC);
900 add_mark_object(p, kw_args);
901 add_mark_object(p, kw_rest_arg);
902 add_mark_object(p, block);
903 return (VALUE)t;
904}
905
906static inline VALUE
907args_with_numbered(struct parser_params *p, VALUE args, int max_numparam)
908{
909 return args;
910}
911
912static VALUE
913new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE aryptn, const YYLTYPE *loc)
914{
915 NODE *t = (NODE *)aryptn;
916 VALUE pre_args = t->u1.value, rest_arg = t->u2.value, post_args = t->u3.value;
917
918 if (!NIL_P(pre_arg)) {
919 if (!NIL_P(pre_args)) {
920 rb_ary_unshift(pre_args, pre_arg);
921 }
922 else {
923 pre_args = rb_ary_new_from_args(1, pre_arg);
924 }
925 }
926 return dispatch4(aryptn, constant, pre_args, rest_arg, post_args);
927}
928
929static VALUE
930new_array_pattern_tail(struct parser_params *p, VALUE pre_args, VALUE has_rest, VALUE rest_arg, VALUE post_args, const YYLTYPE *loc)
931{
932 NODE *t;
933
934 if (has_rest) {
935 rest_arg = dispatch1(var_field, rest_arg ? rest_arg : Qnil);
936 }
937 else {
938 rest_arg = Qnil;
939 }
940
941 t = rb_node_newnode(NODE_ARYPTN, pre_args, rest_arg, post_args, &NULL_LOC);
942 add_mark_object(p, pre_args);
943 add_mark_object(p, rest_arg);
944 add_mark_object(p, post_args);
945 return (VALUE)t;
946}
947
948static VALUE
949new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YYLTYPE *loc)
950{
951 NODE *t = (NODE *)fndptn;
952 VALUE pre_rest_arg = t->u1.value, args = t->u2.value, post_rest_arg = t->u3.value;
953
954 return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg);
955}
956
957static VALUE
958new_find_pattern_tail(struct parser_params *p, VALUE pre_rest_arg, VALUE args, VALUE post_rest_arg, const YYLTYPE *loc)
959{
960 NODE *t;
961
962 pre_rest_arg = dispatch1(var_field, pre_rest_arg ? pre_rest_arg : Qnil);
963 post_rest_arg = dispatch1(var_field, post_rest_arg ? post_rest_arg : Qnil);
964
965 t = rb_node_newnode(NODE_FNDPTN, pre_rest_arg, args, post_rest_arg, &NULL_LOC);
966 add_mark_object(p, pre_rest_arg);
967 add_mark_object(p, args);
968 add_mark_object(p, post_rest_arg);
969 return (VALUE)t;
970}
971
972#define new_hash(p,h,l) rb_ary_new_from_args(0)
973
974static VALUE
975new_unique_key_hash(struct parser_params *p, VALUE ary, const YYLTYPE *loc)
976{
977 return ary;
978}
979
980static VALUE
981new_hash_pattern(struct parser_params *p, VALUE constant, VALUE hshptn, const YYLTYPE *loc)
982{
983 NODE *t = (NODE *)hshptn;
984 VALUE kw_args = t->u1.value, kw_rest_arg = t->u2.value;
985 return dispatch3(hshptn, constant, kw_args, kw_rest_arg);
986}
987
988static VALUE
989new_hash_pattern_tail(struct parser_params *p, VALUE kw_args, VALUE kw_rest_arg, const YYLTYPE *loc)
990{
991 NODE *t;
992 if (kw_rest_arg) {
993 kw_rest_arg = dispatch1(var_field, kw_rest_arg);
994 }
995 else {
996 kw_rest_arg = Qnil;
997 }
998 t = rb_node_newnode(NODE_HSHPTN, kw_args, kw_rest_arg, 0, &NULL_LOC);
999
1000 add_mark_object(p, kw_args);
1001 add_mark_object(p, kw_rest_arg);
1002 return (VALUE)t;
1003}
1004
1005#define new_defined(p,expr,loc) dispatch1(defined, (expr))
1006
1007static VALUE heredoc_dedent(struct parser_params*,VALUE);
1008
1009#else
1010#define ID2VAL(id) (id)
1011#define TOKEN2VAL(t) ID2VAL(t)
1012#define KWD2EID(t, v) keyword_##t
1013
1014static NODE *
1015set_defun_body(struct parser_params *p, NODE *n, NODE *args, NODE *body, const YYLTYPE *loc)
1016{
1017 body = remove_begin(body);
1018 reduce_nodes(p, &body);
1019 n->nd_defn = NEW_SCOPE(args, body, loc);
1020 n->nd_loc = *loc;
1021 nd_set_line(n->nd_defn, loc->end_pos.lineno);
1022 set_line_body(body, loc->beg_pos.lineno);
1023 return n;
1024}
1025
1026static NODE *
1027rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1028 const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1029{
1030 YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1031 rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1032 loc.beg_pos = arg_loc->beg_pos;
1033 return NEW_RESCUE(arg, rescue, 0, &loc);
1034}
1035
1036#endif /* RIPPER */
1037
1038static void
1039restore_defun(struct parser_params *p, NODE *name)
1040{
1041 YYSTYPE c = {.val = name->nd_cval};
1042 p->cur_arg = name->nd_vid;
1043 p->ctxt.in_def = c.ctxt.in_def;
1044 p->ctxt.shareable_constant_value = c.ctxt.shareable_constant_value;
1045}
1046
1047static void
1048endless_method_name(struct parser_params *p, NODE *defn, const YYLTYPE *loc)
1049{
1050#ifdef RIPPER
1051 defn = defn->nd_defn;
1052#endif
1053 ID mid = defn->nd_mid;
1054 if (is_attrset_id(mid)) {
1055 yyerror1(loc, "setter method cannot be defined in an endless method definition");
1056 }
1057 token_info_drop(p, "def", loc->beg_pos);
1058}
1059
1060#ifndef RIPPER
1061# define Qnone 0
1062# define Qnull 0
1063# define ifndef_ripper(x) (x)
1064#else
1065# define Qnone Qnil
1066# define Qnull Qundef
1067# define ifndef_ripper(x)
1068#endif
1069
1070# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
1071# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
1072# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
1073# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
1074# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
1075# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
1076# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
1077# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
1078# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
1079# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
1080# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1081# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
1082# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
1083# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
1084# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1085# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
1086# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
1087# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
1088# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
1089# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
1090#ifdef RIPPER
1091static ID id_warn, id_warning, id_gets, id_assoc;
1092# define ERR_MESG() STR_NEW2(mesg) /* to bypass Ripper DSL */
1093# define WARN_S_L(s,l) STR_NEW(s,l)
1094# define WARN_S(s) STR_NEW2(s)
1095# define WARN_I(i) INT2NUM(i)
1096# define WARN_ID(i) rb_id2str(i)
1097# define WARN_IVAL(i) i
1098# define PRIsWARN "s"
1099# define rb_warn0L_experimental(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
1100# define WARN_ARGS(fmt,n) p->value, id_warn, n, rb_usascii_str_new_lit(fmt)
1101# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
1102# ifdef HAVE_VA_ARGS_MACRO
1103# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
1104# else
1105# define WARN_CALL rb_funcall
1106# endif
1107# define WARNING_ARGS(fmt,n) p->value, id_warning, n, rb_usascii_str_new_lit(fmt)
1108# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
1109# ifdef HAVE_VA_ARGS_MACRO
1110# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
1111# else
1112# define WARNING_CALL rb_funcall
1113# endif
1114PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1115# define compile_error ripper_compile_error
1116#else
1117# define WARN_S_L(s,l) s
1118# define WARN_S(s) s
1119# define WARN_I(i) i
1120# define WARN_ID(i) rb_id2name(i)
1121# define WARN_IVAL(i) NUM2INT(i)
1122# define PRIsWARN PRIsVALUE
1123# define WARN_ARGS(fmt,n) WARN_ARGS_L(p->ruby_sourceline,fmt,n)
1124# define WARN_ARGS_L(l,fmt,n) p->ruby_sourcefile, (l), (fmt)
1125# define WARN_CALL rb_compile_warn
1126# define rb_warn0L_experimental(l,fmt) rb_category_compile_warn(RB_WARN_CATEGORY_EXPERIMENTAL, WARN_ARGS_L(l, fmt, 1))
1127# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
1128# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
1129# define WARNING_CALL rb_compile_warning
1130PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
1131# define compile_error parser_compile_error
1132#endif
1133
1134#define WARN_EOL(tok) \
1135 (looking_at_eol_p(p) ? \
1136 (void)rb_warning0("`" tok "' at the end of line without an expression") : \
1137 (void)0)
1138static int looking_at_eol_p(struct parser_params *p);
1139
1140#line 1141 "parse.c"
1141
1142# ifndef YY_CAST
1143# ifdef __cplusplus
1144# define YY_CAST(Type, Val) static_cast<Type> (Val)
1145# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
1146# else
1147# define YY_CAST(Type, Val) ((Type) (Val))
1148# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
1149# endif
1150# endif
1151# ifndef YY_NULLPTR
1152# if defined __cplusplus
1153# if 201103L <= __cplusplus
1154# define YY_NULLPTR nullptr
1155# else
1156# define YY_NULLPTR 0
1157# endif
1158# else
1159# define YY_NULLPTR ((void*)0)
1160# endif
1161# endif
1162
1163/* Use api.header.include to #include this header
1164 instead of duplicating it here. */
1165#ifndef YY_YY_Y_TAB_H_INCLUDED
1166# define YY_YY_Y_TAB_H_INCLUDED
1167/* Debug traces. */
1168#ifndef YYDEBUG
1169# define YYDEBUG 0
1170#endif
1171#if YYDEBUG
1172#ifndef yydebug
1173extern int yydebug;
1174#endif
1175#endif
1176
1177/* Token kinds. */
1178#ifndef YYTOKENTYPE
1179# define YYTOKENTYPE
1180 enum yytokentype
1181 {
1182 YYEMPTY = -2,
1183 END_OF_INPUT = 0, /* "end-of-input" */
1184 YYerror = 256, /* error */
1185 YYUNDEF = 257, /* "invalid token" */
1186 keyword_class = 258, /* "`class'" */
1187 keyword_module = 259, /* "`module'" */
1188 keyword_def = 260, /* "`def'" */
1189 keyword_undef = 261, /* "`undef'" */
1190 keyword_begin = 262, /* "`begin'" */
1191 keyword_rescue = 263, /* "`rescue'" */
1192 keyword_ensure = 264, /* "`ensure'" */
1193 keyword_end = 265, /* "`end'" */
1194 keyword_if = 266, /* "`if'" */
1195 keyword_unless = 267, /* "`unless'" */
1196 keyword_then = 268, /* "`then'" */
1197 keyword_elsif = 269, /* "`elsif'" */
1198 keyword_else = 270, /* "`else'" */
1199 keyword_case = 271, /* "`case'" */
1200 keyword_when = 272, /* "`when'" */
1201 keyword_while = 273, /* "`while'" */
1202 keyword_until = 274, /* "`until'" */
1203 keyword_for = 275, /* "`for'" */
1204 keyword_break = 276, /* "`break'" */
1205 keyword_next = 277, /* "`next'" */
1206 keyword_redo = 278, /* "`redo'" */
1207 keyword_retry = 279, /* "`retry'" */
1208 keyword_in = 280, /* "`in'" */
1209 keyword_do = 281, /* "`do'" */
1210 keyword_do_cond = 282, /* "`do' for condition" */
1211 keyword_do_block = 283, /* "`do' for block" */
1212 keyword_do_LAMBDA = 284, /* "`do' for lambda" */
1213 keyword_return = 285, /* "`return'" */
1214 keyword_yield = 286, /* "`yield'" */
1215 keyword_super = 287, /* "`super'" */
1216 keyword_self = 288, /* "`self'" */
1217 keyword_nil = 289, /* "`nil'" */
1218 keyword_true = 290, /* "`true'" */
1219 keyword_false = 291, /* "`false'" */
1220 keyword_and = 292, /* "`and'" */
1221 keyword_or = 293, /* "`or'" */
1222 keyword_not = 294, /* "`not'" */
1223 modifier_if = 295, /* "`if' modifier" */
1224 modifier_unless = 296, /* "`unless' modifier" */
1225 modifier_while = 297, /* "`while' modifier" */
1226 modifier_until = 298, /* "`until' modifier" */
1227 modifier_rescue = 299, /* "`rescue' modifier" */
1228 keyword_alias = 300, /* "`alias'" */
1229 keyword_defined = 301, /* "`defined?'" */
1230 keyword_BEGIN = 302, /* "`BEGIN'" */
1231 keyword_END = 303, /* "`END'" */
1232 keyword__LINE__ = 304, /* "`__LINE__'" */
1233 keyword__FILE__ = 305, /* "`__FILE__'" */
1234 keyword__ENCODING__ = 306, /* "`__ENCODING__'" */
1235 tIDENTIFIER = 307, /* "local variable or method" */
1236 tFID = 308, /* "method" */
1237 tGVAR = 309, /* "global variable" */
1238 tIVAR = 310, /* "instance variable" */
1239 tCONSTANT = 311, /* "constant" */
1240 tCVAR = 312, /* "class variable" */
1241 tLABEL = 313, /* "label" */
1242 tINTEGER = 314, /* "integer literal" */
1243 tFLOAT = 315, /* "float literal" */
1244 tRATIONAL = 316, /* "rational literal" */
1245 tIMAGINARY = 317, /* "imaginary literal" */
1246 tCHAR = 318, /* "char literal" */
1247 tNTH_REF = 319, /* "numbered reference" */
1248 tBACK_REF = 320, /* "back reference" */
1249 tSTRING_CONTENT = 321, /* "literal content" */
1250 tREGEXP_END = 322, /* tREGEXP_END */
1251 tSP = 323, /* "escaped space" */
1252 tUPLUS = 132, /* "unary+" */
1253 tUMINUS = 133, /* "unary-" */
1254 tPOW = 134, /* "**" */
1255 tCMP = 135, /* "<=>" */
1256 tEQ = 140, /* "==" */
1257 tEQQ = 141, /* "===" */
1258 tNEQ = 142, /* "!=" */
1259 tGEQ = 139, /* ">=" */
1260 tLEQ = 138, /* "<=" */
1261 tANDOP = 148, /* "&&" */
1262 tOROP = 149, /* "||" */
1263 tMATCH = 143, /* "=~" */
1264 tNMATCH = 144, /* "!~" */
1265 tDOT2 = 128, /* ".." */
1266 tDOT3 = 129, /* "..." */
1267 tBDOT2 = 130, /* "(.." */
1268 tBDOT3 = 131, /* "(..." */
1269 tAREF = 145, /* "[]" */
1270 tASET = 146, /* "[]=" */
1271 tLSHFT = 136, /* "<<" */
1272 tRSHFT = 137, /* ">>" */
1273 tANDDOT = 150, /* "&." */
1274 tCOLON2 = 147, /* "::" */
1275 tCOLON3 = 324, /* ":: at EXPR_BEG" */
1276 tOP_ASGN = 325, /* "operator-assignment" */
1277 tASSOC = 326, /* "=>" */
1278 tLPAREN = 327, /* "(" */
1279 tLPAREN_ARG = 328, /* "( arg" */
1280 tRPAREN = 329, /* ")" */
1281 tLBRACK = 330, /* "[" */
1282 tLBRACE = 331, /* "{" */
1283 tLBRACE_ARG = 332, /* "{ arg" */
1284 tSTAR = 333, /* "*" */
1285 tDSTAR = 334, /* "**arg" */
1286 tAMPER = 335, /* "&" */
1287 tLAMBDA = 336, /* "->" */
1288 tSYMBEG = 337, /* "symbol literal" */
1289 tSTRING_BEG = 338, /* "string literal" */
1290 tXSTRING_BEG = 339, /* "backtick literal" */
1291 tREGEXP_BEG = 340, /* "regexp literal" */
1292 tWORDS_BEG = 341, /* "word list" */
1293 tQWORDS_BEG = 342, /* "verbatim word list" */
1294 tSYMBOLS_BEG = 343, /* "symbol list" */
1295 tQSYMBOLS_BEG = 344, /* "verbatim symbol list" */
1296 tSTRING_END = 345, /* "terminator" */
1297 tSTRING_DEND = 346, /* "'}'" */
1298 tSTRING_DBEG = 347, /* tSTRING_DBEG */
1299 tSTRING_DVAR = 348, /* tSTRING_DVAR */
1300 tLAMBEG = 349, /* tLAMBEG */
1301 tLABEL_END = 350, /* tLABEL_END */
1302 tLOWEST = 351, /* tLOWEST */
1303 tUMINUS_NUM = 352, /* tUMINUS_NUM */
1304 tLAST_TOKEN = 353 /* tLAST_TOKEN */
1305 };
1306 typedef enum yytokentype yytoken_kind_t;
1307#endif
1308
1309/* Value type. */
1310#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1311union YYSTYPE
1312{
1313#line 1121 "parse.y"
1314
1315 VALUE val;
1316 NODE *node;
1317 ID id;
1318 int num;
1319 st_table *tbl;
1320 const struct vtable *vars;
1321 struct rb_strterm_struct *strterm;
1322 struct lex_context ctxt;
1323
1324#line 1323 "parse.c"
1325
1326};
1327typedef union YYSTYPE YYSTYPE;
1328# define YYSTYPE_IS_TRIVIAL 1
1329# define YYSTYPE_IS_DECLARED 1
1330#endif
1331
1332/* Location type. */
1333#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
1334typedef struct YYLTYPE YYLTYPE;
1335struct YYLTYPE
1336{
1337 int first_line;
1338 int first_column;
1339 int last_line;
1340 int last_column;
1341};
1342# define YYLTYPE_IS_DECLARED 1
1343# define YYLTYPE_IS_TRIVIAL 1
1344#endif
1345
1346
1347
1348
1349int yyparse (struct parser_params *p);
1350
1351
1352#endif /* !YY_YY_Y_TAB_H_INCLUDED */
1353/* Symbol kind. */
1355{
1357 YYSYMBOL_YYEOF = 0, /* "end-of-input" */
1358 YYSYMBOL_YYerror = 1, /* error */
1359 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
1360 YYSYMBOL_keyword_class = 3, /* "`class'" */
1361 YYSYMBOL_keyword_module = 4, /* "`module'" */
1362 YYSYMBOL_keyword_def = 5, /* "`def'" */
1363 YYSYMBOL_keyword_undef = 6, /* "`undef'" */
1364 YYSYMBOL_keyword_begin = 7, /* "`begin'" */
1365 YYSYMBOL_keyword_rescue = 8, /* "`rescue'" */
1366 YYSYMBOL_keyword_ensure = 9, /* "`ensure'" */
1367 YYSYMBOL_keyword_end = 10, /* "`end'" */
1368 YYSYMBOL_keyword_if = 11, /* "`if'" */
1369 YYSYMBOL_keyword_unless = 12, /* "`unless'" */
1370 YYSYMBOL_keyword_then = 13, /* "`then'" */
1371 YYSYMBOL_keyword_elsif = 14, /* "`elsif'" */
1372 YYSYMBOL_keyword_else = 15, /* "`else'" */
1373 YYSYMBOL_keyword_case = 16, /* "`case'" */
1374 YYSYMBOL_keyword_when = 17, /* "`when'" */
1375 YYSYMBOL_keyword_while = 18, /* "`while'" */
1376 YYSYMBOL_keyword_until = 19, /* "`until'" */
1377 YYSYMBOL_keyword_for = 20, /* "`for'" */
1378 YYSYMBOL_keyword_break = 21, /* "`break'" */
1379 YYSYMBOL_keyword_next = 22, /* "`next'" */
1380 YYSYMBOL_keyword_redo = 23, /* "`redo'" */
1381 YYSYMBOL_keyword_retry = 24, /* "`retry'" */
1382 YYSYMBOL_keyword_in = 25, /* "`in'" */
1383 YYSYMBOL_keyword_do = 26, /* "`do'" */
1384 YYSYMBOL_keyword_do_cond = 27, /* "`do' for condition" */
1385 YYSYMBOL_keyword_do_block = 28, /* "`do' for block" */
1386 YYSYMBOL_keyword_do_LAMBDA = 29, /* "`do' for lambda" */
1387 YYSYMBOL_keyword_return = 30, /* "`return'" */
1388 YYSYMBOL_keyword_yield = 31, /* "`yield'" */
1389 YYSYMBOL_keyword_super = 32, /* "`super'" */
1390 YYSYMBOL_keyword_self = 33, /* "`self'" */
1391 YYSYMBOL_keyword_nil = 34, /* "`nil'" */
1392 YYSYMBOL_keyword_true = 35, /* "`true'" */
1393 YYSYMBOL_keyword_false = 36, /* "`false'" */
1394 YYSYMBOL_keyword_and = 37, /* "`and'" */
1395 YYSYMBOL_keyword_or = 38, /* "`or'" */
1396 YYSYMBOL_keyword_not = 39, /* "`not'" */
1397 YYSYMBOL_modifier_if = 40, /* "`if' modifier" */
1398 YYSYMBOL_modifier_unless = 41, /* "`unless' modifier" */
1399 YYSYMBOL_modifier_while = 42, /* "`while' modifier" */
1400 YYSYMBOL_modifier_until = 43, /* "`until' modifier" */
1401 YYSYMBOL_modifier_rescue = 44, /* "`rescue' modifier" */
1402 YYSYMBOL_keyword_alias = 45, /* "`alias'" */
1403 YYSYMBOL_keyword_defined = 46, /* "`defined?'" */
1404 YYSYMBOL_keyword_BEGIN = 47, /* "`BEGIN'" */
1405 YYSYMBOL_keyword_END = 48, /* "`END'" */
1406 YYSYMBOL_keyword__LINE__ = 49, /* "`__LINE__'" */
1407 YYSYMBOL_keyword__FILE__ = 50, /* "`__FILE__'" */
1408 YYSYMBOL_keyword__ENCODING__ = 51, /* "`__ENCODING__'" */
1409 YYSYMBOL_tIDENTIFIER = 52, /* "local variable or method" */
1410 YYSYMBOL_tFID = 53, /* "method" */
1411 YYSYMBOL_tGVAR = 54, /* "global variable" */
1412 YYSYMBOL_tIVAR = 55, /* "instance variable" */
1413 YYSYMBOL_tCONSTANT = 56, /* "constant" */
1414 YYSYMBOL_tCVAR = 57, /* "class variable" */
1415 YYSYMBOL_tLABEL = 58, /* "label" */
1416 YYSYMBOL_tINTEGER = 59, /* "integer literal" */
1417 YYSYMBOL_tFLOAT = 60, /* "float literal" */
1418 YYSYMBOL_tRATIONAL = 61, /* "rational literal" */
1419 YYSYMBOL_tIMAGINARY = 62, /* "imaginary literal" */
1420 YYSYMBOL_tCHAR = 63, /* "char literal" */
1421 YYSYMBOL_tNTH_REF = 64, /* "numbered reference" */
1422 YYSYMBOL_tBACK_REF = 65, /* "back reference" */
1423 YYSYMBOL_tSTRING_CONTENT = 66, /* "literal content" */
1424 YYSYMBOL_tREGEXP_END = 67, /* tREGEXP_END */
1425 YYSYMBOL_68_ = 68, /* '.' */
1426 YYSYMBOL_69_backslash_ = 69, /* "backslash" */
1427 YYSYMBOL_tSP = 70, /* "escaped space" */
1428 YYSYMBOL_71_escaped_horizontal_tab_ = 71, /* "escaped horizontal tab" */
1429 YYSYMBOL_72_escaped_form_feed_ = 72, /* "escaped form feed" */
1430 YYSYMBOL_73_escaped_carriage_return_ = 73, /* "escaped carriage return" */
1431 YYSYMBOL_74_escaped_vertical_tab_ = 74, /* "escaped vertical tab" */
1432 YYSYMBOL_tUPLUS = 75, /* "unary+" */
1433 YYSYMBOL_tUMINUS = 76, /* "unary-" */
1434 YYSYMBOL_tPOW = 77, /* "**" */
1435 YYSYMBOL_tCMP = 78, /* "<=>" */
1436 YYSYMBOL_tEQ = 79, /* "==" */
1437 YYSYMBOL_tEQQ = 80, /* "===" */
1438 YYSYMBOL_tNEQ = 81, /* "!=" */
1439 YYSYMBOL_tGEQ = 82, /* ">=" */
1440 YYSYMBOL_tLEQ = 83, /* "<=" */
1441 YYSYMBOL_tANDOP = 84, /* "&&" */
1442 YYSYMBOL_tOROP = 85, /* "||" */
1443 YYSYMBOL_tMATCH = 86, /* "=~" */
1444 YYSYMBOL_tNMATCH = 87, /* "!~" */
1445 YYSYMBOL_tDOT2 = 88, /* ".." */
1446 YYSYMBOL_tDOT3 = 89, /* "..." */
1447 YYSYMBOL_tBDOT2 = 90, /* "(.." */
1448 YYSYMBOL_tBDOT3 = 91, /* "(..." */
1449 YYSYMBOL_tAREF = 92, /* "[]" */
1450 YYSYMBOL_tASET = 93, /* "[]=" */
1451 YYSYMBOL_tLSHFT = 94, /* "<<" */
1452 YYSYMBOL_tRSHFT = 95, /* ">>" */
1453 YYSYMBOL_tANDDOT = 96, /* "&." */
1454 YYSYMBOL_tCOLON2 = 97, /* "::" */
1455 YYSYMBOL_tCOLON3 = 98, /* ":: at EXPR_BEG" */
1456 YYSYMBOL_tOP_ASGN = 99, /* "operator-assignment" */
1457 YYSYMBOL_tASSOC = 100, /* "=>" */
1458 YYSYMBOL_tLPAREN = 101, /* "(" */
1459 YYSYMBOL_tLPAREN_ARG = 102, /* "( arg" */
1460 YYSYMBOL_tRPAREN = 103, /* ")" */
1461 YYSYMBOL_tLBRACK = 104, /* "[" */
1462 YYSYMBOL_tLBRACE = 105, /* "{" */
1463 YYSYMBOL_tLBRACE_ARG = 106, /* "{ arg" */
1464 YYSYMBOL_tSTAR = 107, /* "*" */
1465 YYSYMBOL_tDSTAR = 108, /* "**arg" */
1466 YYSYMBOL_tAMPER = 109, /* "&" */
1467 YYSYMBOL_tLAMBDA = 110, /* "->" */
1468 YYSYMBOL_tSYMBEG = 111, /* "symbol literal" */
1469 YYSYMBOL_tSTRING_BEG = 112, /* "string literal" */
1470 YYSYMBOL_tXSTRING_BEG = 113, /* "backtick literal" */
1471 YYSYMBOL_tREGEXP_BEG = 114, /* "regexp literal" */
1472 YYSYMBOL_tWORDS_BEG = 115, /* "word list" */
1473 YYSYMBOL_tQWORDS_BEG = 116, /* "verbatim word list" */
1474 YYSYMBOL_tSYMBOLS_BEG = 117, /* "symbol list" */
1475 YYSYMBOL_tQSYMBOLS_BEG = 118, /* "verbatim symbol list" */
1476 YYSYMBOL_tSTRING_END = 119, /* "terminator" */
1477 YYSYMBOL_tSTRING_DEND = 120, /* "'}'" */
1478 YYSYMBOL_tSTRING_DBEG = 121, /* tSTRING_DBEG */
1479 YYSYMBOL_tSTRING_DVAR = 122, /* tSTRING_DVAR */
1480 YYSYMBOL_tLAMBEG = 123, /* tLAMBEG */
1481 YYSYMBOL_tLABEL_END = 124, /* tLABEL_END */
1482 YYSYMBOL_tLOWEST = 125, /* tLOWEST */
1483 YYSYMBOL_126_ = 126, /* '=' */
1484 YYSYMBOL_127_ = 127, /* '?' */
1485 YYSYMBOL_128_ = 128, /* ':' */
1486 YYSYMBOL_129_ = 129, /* '>' */
1487 YYSYMBOL_130_ = 130, /* '<' */
1488 YYSYMBOL_131_ = 131, /* '|' */
1489 YYSYMBOL_132_ = 132, /* '^' */
1490 YYSYMBOL_133_ = 133, /* '&' */
1491 YYSYMBOL_134_ = 134, /* '+' */
1492 YYSYMBOL_135_ = 135, /* '-' */
1493 YYSYMBOL_136_ = 136, /* '*' */
1494 YYSYMBOL_137_ = 137, /* '/' */
1495 YYSYMBOL_138_ = 138, /* '%' */
1496 YYSYMBOL_tUMINUS_NUM = 139, /* tUMINUS_NUM */
1497 YYSYMBOL_140_ = 140, /* '!' */
1498 YYSYMBOL_141_ = 141, /* '~' */
1499 YYSYMBOL_tLAST_TOKEN = 142, /* tLAST_TOKEN */
1500 YYSYMBOL_143_ = 143, /* '{' */
1501 YYSYMBOL_144_ = 144, /* '}' */
1502 YYSYMBOL_145_ = 145, /* '[' */
1503 YYSYMBOL_146_ = 146, /* ',' */
1504 YYSYMBOL_147_ = 147, /* '`' */
1505 YYSYMBOL_148_ = 148, /* '(' */
1506 YYSYMBOL_149_ = 149, /* ')' */
1507 YYSYMBOL_150_ = 150, /* ']' */
1508 YYSYMBOL_151_ = 151, /* ';' */
1509 YYSYMBOL_152_ = 152, /* ' ' */
1510 YYSYMBOL_153_n_ = 153, /* '\n' */
1511 YYSYMBOL_YYACCEPT = 154, /* $accept */
1512 YYSYMBOL_program = 155, /* program */
1513 YYSYMBOL_156_1 = 156, /* $@1 */
1514 YYSYMBOL_top_compstmt = 157, /* top_compstmt */
1515 YYSYMBOL_top_stmts = 158, /* top_stmts */
1516 YYSYMBOL_top_stmt = 159, /* top_stmt */
1517 YYSYMBOL_begin_block = 160, /* begin_block */
1518 YYSYMBOL_bodystmt = 161, /* bodystmt */
1519 YYSYMBOL_162_2 = 162, /* $@2 */
1520 YYSYMBOL_compstmt = 163, /* compstmt */
1521 YYSYMBOL_stmts = 164, /* stmts */
1522 YYSYMBOL_stmt_or_begin = 165, /* stmt_or_begin */
1523 YYSYMBOL_166_3 = 166, /* $@3 */
1524 YYSYMBOL_stmt = 167, /* stmt */
1525 YYSYMBOL_168_4 = 168, /* $@4 */
1526 YYSYMBOL_command_asgn = 169, /* command_asgn */
1527 YYSYMBOL_command_rhs = 170, /* command_rhs */
1528 YYSYMBOL_expr = 171, /* expr */
1529 YYSYMBOL_172_5 = 172, /* @5 */
1530 YYSYMBOL_173_6 = 173, /* @6 */
1531 YYSYMBOL_174_7 = 174, /* $@7 */
1532 YYSYMBOL_175_8 = 175, /* @8 */
1533 YYSYMBOL_176_9 = 176, /* @9 */
1534 YYSYMBOL_177_10 = 177, /* $@10 */
1535 YYSYMBOL_def_name = 178, /* def_name */
1536 YYSYMBOL_defn_head = 179, /* defn_head */
1537 YYSYMBOL_defs_head = 180, /* defs_head */
1538 YYSYMBOL_181_11 = 181, /* $@11 */
1539 YYSYMBOL_expr_value = 182, /* expr_value */
1540 YYSYMBOL_expr_value_do = 183, /* expr_value_do */
1541 YYSYMBOL_184_12 = 184, /* $@12 */
1542 YYSYMBOL_185_13 = 185, /* $@13 */
1543 YYSYMBOL_command_call = 186, /* command_call */
1544 YYSYMBOL_block_command = 187, /* block_command */
1545 YYSYMBOL_cmd_brace_block = 188, /* cmd_brace_block */
1546 YYSYMBOL_fcall = 189, /* fcall */
1547 YYSYMBOL_command = 190, /* command */
1548 YYSYMBOL_mlhs = 191, /* mlhs */
1549 YYSYMBOL_mlhs_inner = 192, /* mlhs_inner */
1550 YYSYMBOL_mlhs_basic = 193, /* mlhs_basic */
1551 YYSYMBOL_mlhs_item = 194, /* mlhs_item */
1552 YYSYMBOL_mlhs_head = 195, /* mlhs_head */
1553 YYSYMBOL_mlhs_post = 196, /* mlhs_post */
1554 YYSYMBOL_mlhs_node = 197, /* mlhs_node */
1555 YYSYMBOL_lhs = 198, /* lhs */
1556 YYSYMBOL_cname = 199, /* cname */
1557 YYSYMBOL_cpath = 200, /* cpath */
1558 YYSYMBOL_fname = 201, /* fname */
1559 YYSYMBOL_fitem = 202, /* fitem */
1560 YYSYMBOL_undef_list = 203, /* undef_list */
1561 YYSYMBOL_204_14 = 204, /* $@14 */
1562 YYSYMBOL_op = 205, /* op */
1563 YYSYMBOL_reswords = 206, /* reswords */
1564 YYSYMBOL_arg = 207, /* arg */
1565 YYSYMBOL_208_15 = 208, /* $@15 */
1566 YYSYMBOL_relop = 209, /* relop */
1567 YYSYMBOL_rel_expr = 210, /* rel_expr */
1568 YYSYMBOL_lex_ctxt = 211, /* lex_ctxt */
1569 YYSYMBOL_arg_value = 212, /* arg_value */
1570 YYSYMBOL_aref_args = 213, /* aref_args */
1571 YYSYMBOL_arg_rhs = 214, /* arg_rhs */
1572 YYSYMBOL_paren_args = 215, /* paren_args */
1573 YYSYMBOL_opt_paren_args = 216, /* opt_paren_args */
1574 YYSYMBOL_opt_call_args = 217, /* opt_call_args */
1575 YYSYMBOL_call_args = 218, /* call_args */
1576 YYSYMBOL_command_args = 219, /* command_args */
1577 YYSYMBOL_220_16 = 220, /* $@16 */
1578 YYSYMBOL_block_arg = 221, /* block_arg */
1579 YYSYMBOL_opt_block_arg = 222, /* opt_block_arg */
1580 YYSYMBOL_args = 223, /* args */
1581 YYSYMBOL_mrhs_arg = 224, /* mrhs_arg */
1582 YYSYMBOL_mrhs = 225, /* mrhs */
1583 YYSYMBOL_primary = 226, /* primary */
1584 YYSYMBOL_227_17 = 227, /* $@17 */
1585 YYSYMBOL_228_18 = 228, /* $@18 */
1586 YYSYMBOL_229_19 = 229, /* $@19 */
1587 YYSYMBOL_230_20 = 230, /* $@20 */
1588 YYSYMBOL_231_21 = 231, /* @21 */
1589 YYSYMBOL_232_22 = 232, /* @22 */
1590 YYSYMBOL_233_23 = 233, /* $@23 */
1591 YYSYMBOL_234_24 = 234, /* $@24 */
1592 YYSYMBOL_235_25 = 235, /* $@25 */
1593 YYSYMBOL_primary_value = 236, /* primary_value */
1594 YYSYMBOL_k_begin = 237, /* k_begin */
1595 YYSYMBOL_k_if = 238, /* k_if */
1596 YYSYMBOL_k_unless = 239, /* k_unless */
1597 YYSYMBOL_k_while = 240, /* k_while */
1598 YYSYMBOL_k_until = 241, /* k_until */
1599 YYSYMBOL_k_case = 242, /* k_case */
1600 YYSYMBOL_k_for = 243, /* k_for */
1601 YYSYMBOL_k_class = 244, /* k_class */
1602 YYSYMBOL_k_module = 245, /* k_module */
1603 YYSYMBOL_k_def = 246, /* k_def */
1604 YYSYMBOL_k_do = 247, /* k_do */
1605 YYSYMBOL_k_do_block = 248, /* k_do_block */
1606 YYSYMBOL_k_rescue = 249, /* k_rescue */
1607 YYSYMBOL_k_ensure = 250, /* k_ensure */
1608 YYSYMBOL_k_when = 251, /* k_when */
1609 YYSYMBOL_k_else = 252, /* k_else */
1610 YYSYMBOL_k_elsif = 253, /* k_elsif */
1611 YYSYMBOL_k_end = 254, /* k_end */
1612 YYSYMBOL_k_return = 255, /* k_return */
1613 YYSYMBOL_then = 256, /* then */
1614 YYSYMBOL_do = 257, /* do */
1615 YYSYMBOL_if_tail = 258, /* if_tail */
1616 YYSYMBOL_opt_else = 259, /* opt_else */
1617 YYSYMBOL_for_var = 260, /* for_var */
1618 YYSYMBOL_f_marg = 261, /* f_marg */
1619 YYSYMBOL_f_marg_list = 262, /* f_marg_list */
1620 YYSYMBOL_f_margs = 263, /* f_margs */
1621 YYSYMBOL_f_rest_marg = 264, /* f_rest_marg */
1622 YYSYMBOL_f_any_kwrest = 265, /* f_any_kwrest */
1623 YYSYMBOL_block_args_tail = 266, /* block_args_tail */
1624 YYSYMBOL_opt_block_args_tail = 267, /* opt_block_args_tail */
1625 YYSYMBOL_excessed_comma = 268, /* excessed_comma */
1626 YYSYMBOL_block_param = 269, /* block_param */
1627 YYSYMBOL_opt_block_param = 270, /* opt_block_param */
1628 YYSYMBOL_block_param_def = 271, /* block_param_def */
1629 YYSYMBOL_opt_bv_decl = 272, /* opt_bv_decl */
1630 YYSYMBOL_bv_decls = 273, /* bv_decls */
1631 YYSYMBOL_bvar = 274, /* bvar */
1632 YYSYMBOL_lambda = 275, /* lambda */
1633 YYSYMBOL_276_26 = 276, /* @26 */
1634 YYSYMBOL_277_27 = 277, /* @27 */
1635 YYSYMBOL_278_28 = 278, /* @28 */
1636 YYSYMBOL_279_29 = 279, /* $@29 */
1637 YYSYMBOL_f_larglist = 280, /* f_larglist */
1638 YYSYMBOL_lambda_body = 281, /* lambda_body */
1639 YYSYMBOL_do_block = 282, /* do_block */
1640 YYSYMBOL_block_call = 283, /* block_call */
1641 YYSYMBOL_method_call = 284, /* method_call */
1642 YYSYMBOL_brace_block = 285, /* brace_block */
1643 YYSYMBOL_brace_body = 286, /* brace_body */
1644 YYSYMBOL_287_30 = 287, /* @30 */
1645 YYSYMBOL_288_31 = 288, /* @31 */
1646 YYSYMBOL_289_32 = 289, /* @32 */
1647 YYSYMBOL_do_body = 290, /* do_body */
1648 YYSYMBOL_291_33 = 291, /* @33 */
1649 YYSYMBOL_292_34 = 292, /* @34 */
1650 YYSYMBOL_293_35 = 293, /* @35 */
1651 YYSYMBOL_case_args = 294, /* case_args */
1652 YYSYMBOL_case_body = 295, /* case_body */
1653 YYSYMBOL_cases = 296, /* cases */
1654 YYSYMBOL_p_case_body = 297, /* p_case_body */
1655 YYSYMBOL_298_36 = 298, /* @36 */
1656 YYSYMBOL_299_37 = 299, /* @37 */
1657 YYSYMBOL_300_38 = 300, /* $@38 */
1658 YYSYMBOL_p_cases = 301, /* p_cases */
1659 YYSYMBOL_p_top_expr = 302, /* p_top_expr */
1660 YYSYMBOL_p_top_expr_body = 303, /* p_top_expr_body */
1661 YYSYMBOL_p_expr = 304, /* p_expr */
1662 YYSYMBOL_p_as = 305, /* p_as */
1663 YYSYMBOL_p_alt = 306, /* p_alt */
1664 YYSYMBOL_p_lparen = 307, /* p_lparen */
1665 YYSYMBOL_p_lbracket = 308, /* p_lbracket */
1666 YYSYMBOL_p_expr_basic = 309, /* p_expr_basic */
1667 YYSYMBOL_310_39 = 310, /* @39 */
1668 YYSYMBOL_311_40 = 311, /* @40 */
1669 YYSYMBOL_p_args = 312, /* p_args */
1670 YYSYMBOL_p_args_head = 313, /* p_args_head */
1671 YYSYMBOL_p_args_tail = 314, /* p_args_tail */
1672 YYSYMBOL_p_find = 315, /* p_find */
1673 YYSYMBOL_p_rest = 316, /* p_rest */
1674 YYSYMBOL_p_args_post = 317, /* p_args_post */
1675 YYSYMBOL_p_arg = 318, /* p_arg */
1676 YYSYMBOL_p_kwargs = 319, /* p_kwargs */
1677 YYSYMBOL_p_kwarg = 320, /* p_kwarg */
1678 YYSYMBOL_p_kw = 321, /* p_kw */
1679 YYSYMBOL_p_kw_label = 322, /* p_kw_label */
1680 YYSYMBOL_p_kwrest = 323, /* p_kwrest */
1681 YYSYMBOL_p_kwnorest = 324, /* p_kwnorest */
1682 YYSYMBOL_p_any_kwrest = 325, /* p_any_kwrest */
1683 YYSYMBOL_p_value = 326, /* p_value */
1684 YYSYMBOL_p_primitive = 327, /* p_primitive */
1685 YYSYMBOL_p_variable = 328, /* p_variable */
1686 YYSYMBOL_p_var_ref = 329, /* p_var_ref */
1687 YYSYMBOL_p_const = 330, /* p_const */
1688 YYSYMBOL_opt_rescue = 331, /* opt_rescue */
1689 YYSYMBOL_exc_list = 332, /* exc_list */
1690 YYSYMBOL_exc_var = 333, /* exc_var */
1691 YYSYMBOL_opt_ensure = 334, /* opt_ensure */
1692 YYSYMBOL_literal = 335, /* literal */
1693 YYSYMBOL_strings = 336, /* strings */
1694 YYSYMBOL_string = 337, /* string */
1695 YYSYMBOL_string1 = 338, /* string1 */
1696 YYSYMBOL_xstring = 339, /* xstring */
1697 YYSYMBOL_regexp = 340, /* regexp */
1698 YYSYMBOL_words = 341, /* words */
1699 YYSYMBOL_word_list = 342, /* word_list */
1700 YYSYMBOL_word = 343, /* word */
1701 YYSYMBOL_symbols = 344, /* symbols */
1702 YYSYMBOL_symbol_list = 345, /* symbol_list */
1703 YYSYMBOL_qwords = 346, /* qwords */
1704 YYSYMBOL_qsymbols = 347, /* qsymbols */
1705 YYSYMBOL_qword_list = 348, /* qword_list */
1706 YYSYMBOL_qsym_list = 349, /* qsym_list */
1707 YYSYMBOL_string_contents = 350, /* string_contents */
1708 YYSYMBOL_xstring_contents = 351, /* xstring_contents */
1709 YYSYMBOL_regexp_contents = 352, /* regexp_contents */
1710 YYSYMBOL_string_content = 353, /* string_content */
1711 YYSYMBOL_354_41 = 354, /* @41 */
1712 YYSYMBOL_355_42 = 355, /* $@42 */
1713 YYSYMBOL_356_43 = 356, /* @43 */
1714 YYSYMBOL_357_44 = 357, /* @44 */
1715 YYSYMBOL_358_45 = 358, /* @45 */
1716 YYSYMBOL_359_46 = 359, /* @46 */
1717 YYSYMBOL_string_dvar = 360, /* string_dvar */
1718 YYSYMBOL_symbol = 361, /* symbol */
1719 YYSYMBOL_ssym = 362, /* ssym */
1720 YYSYMBOL_sym = 363, /* sym */
1721 YYSYMBOL_dsym = 364, /* dsym */
1722 YYSYMBOL_numeric = 365, /* numeric */
1723 YYSYMBOL_simple_numeric = 366, /* simple_numeric */
1724 YYSYMBOL_user_variable = 367, /* user_variable */
1725 YYSYMBOL_keyword_variable = 368, /* keyword_variable */
1726 YYSYMBOL_var_ref = 369, /* var_ref */
1727 YYSYMBOL_var_lhs = 370, /* var_lhs */
1728 YYSYMBOL_backref = 371, /* backref */
1729 YYSYMBOL_superclass = 372, /* superclass */
1730 YYSYMBOL_373_47 = 373, /* $@47 */
1731 YYSYMBOL_f_opt_paren_args = 374, /* f_opt_paren_args */
1732 YYSYMBOL_f_paren_args = 375, /* f_paren_args */
1733 YYSYMBOL_f_arglist = 376, /* f_arglist */
1734 YYSYMBOL_377_48 = 377, /* @48 */
1735 YYSYMBOL_args_tail = 378, /* args_tail */
1736 YYSYMBOL_opt_args_tail = 379, /* opt_args_tail */
1737 YYSYMBOL_f_args = 380, /* f_args */
1738 YYSYMBOL_args_forward = 381, /* args_forward */
1739 YYSYMBOL_f_bad_arg = 382, /* f_bad_arg */
1740 YYSYMBOL_f_norm_arg = 383, /* f_norm_arg */
1741 YYSYMBOL_f_arg_asgn = 384, /* f_arg_asgn */
1742 YYSYMBOL_f_arg_item = 385, /* f_arg_item */
1743 YYSYMBOL_f_arg = 386, /* f_arg */
1744 YYSYMBOL_f_label = 387, /* f_label */
1745 YYSYMBOL_f_kw = 388, /* f_kw */
1746 YYSYMBOL_f_block_kw = 389, /* f_block_kw */
1747 YYSYMBOL_f_block_kwarg = 390, /* f_block_kwarg */
1748 YYSYMBOL_f_kwarg = 391, /* f_kwarg */
1749 YYSYMBOL_kwrest_mark = 392, /* kwrest_mark */
1750 YYSYMBOL_f_no_kwarg = 393, /* f_no_kwarg */
1751 YYSYMBOL_f_kwrest = 394, /* f_kwrest */
1752 YYSYMBOL_f_opt = 395, /* f_opt */
1753 YYSYMBOL_f_block_opt = 396, /* f_block_opt */
1754 YYSYMBOL_f_block_optarg = 397, /* f_block_optarg */
1755 YYSYMBOL_f_optarg = 398, /* f_optarg */
1756 YYSYMBOL_restarg_mark = 399, /* restarg_mark */
1757 YYSYMBOL_f_rest_arg = 400, /* f_rest_arg */
1758 YYSYMBOL_blkarg_mark = 401, /* blkarg_mark */
1759 YYSYMBOL_f_block_arg = 402, /* f_block_arg */
1760 YYSYMBOL_opt_f_block_arg = 403, /* opt_f_block_arg */
1761 YYSYMBOL_singleton = 404, /* singleton */
1762 YYSYMBOL_405_49 = 405, /* $@49 */
1763 YYSYMBOL_assoc_list = 406, /* assoc_list */
1764 YYSYMBOL_assocs = 407, /* assocs */
1765 YYSYMBOL_assoc = 408, /* assoc */
1766 YYSYMBOL_operation = 409, /* operation */
1767 YYSYMBOL_operation2 = 410, /* operation2 */
1768 YYSYMBOL_operation3 = 411, /* operation3 */
1769 YYSYMBOL_dot_or_colon = 412, /* dot_or_colon */
1770 YYSYMBOL_call_op = 413, /* call_op */
1771 YYSYMBOL_call_op2 = 414, /* call_op2 */
1772 YYSYMBOL_opt_terms = 415, /* opt_terms */
1773 YYSYMBOL_opt_nl = 416, /* opt_nl */
1774 YYSYMBOL_rparen = 417, /* rparen */
1775 YYSYMBOL_rbracket = 418, /* rbracket */
1776 YYSYMBOL_rbrace = 419, /* rbrace */
1777 YYSYMBOL_trailer = 420, /* trailer */
1778 YYSYMBOL_term = 421, /* term */
1779 YYSYMBOL_terms = 422, /* terms */
1780 YYSYMBOL_none = 423 /* none */
1783
1784
1785
1786
1787#ifdef short
1788# undef short
1789#endif
1790
1791/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
1792 <limits.h> and (if available) <stdint.h> are included
1793 so that the code can choose integer types of a good width. */
1794
1795#ifndef __PTRDIFF_MAX__
1796# include <limits.h> /* INFRINGES ON USER NAME SPACE */
1797# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
1798# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
1799# define YY_STDINT_H
1800# endif
1801#endif
1802
1803/* Narrow types that promote to a signed type and that can represent a
1804 signed or unsigned integer of at least N bits. In tables they can
1805 save space and decrease cache pressure. Promoting to a signed type
1806 helps avoid bugs in integer arithmetic. */
1807
1808#ifdef __INT_LEAST8_MAX__
1809typedef __INT_LEAST8_TYPE__ yytype_int8;
1810#elif defined YY_STDINT_H
1811typedef int_least8_t yytype_int8;
1812#else
1813typedef signed char yytype_int8;
1814#endif
1815
1816#ifdef __INT_LEAST16_MAX__
1817typedef __INT_LEAST16_TYPE__ yytype_int16;
1818#elif defined YY_STDINT_H
1819typedef int_least16_t yytype_int16;
1820#else
1821typedef short yytype_int16;
1822#endif
1823
1824/* Work around bug in HP-UX 11.23, which defines these macros
1825 incorrectly for preprocessor constants. This workaround can likely
1826 be removed in 2023, as HPE has promised support for HP-UX 11.23
1827 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
1828 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
1829#ifdef __hpux
1830# undef UINT_LEAST8_MAX
1831# undef UINT_LEAST16_MAX
1832# define UINT_LEAST8_MAX 255
1833# define UINT_LEAST16_MAX 65535
1834#endif
1835
1836#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
1837typedef __UINT_LEAST8_TYPE__ yytype_uint8;
1838#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
1839 && UINT_LEAST8_MAX <= INT_MAX)
1840typedef uint_least8_t yytype_uint8;
1841#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
1842typedef unsigned char yytype_uint8;
1843#else
1844typedef short yytype_uint8;
1845#endif
1846
1847#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
1848typedef __UINT_LEAST16_TYPE__ yytype_uint16;
1849#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
1850 && UINT_LEAST16_MAX <= INT_MAX)
1851typedef uint_least16_t yytype_uint16;
1852#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
1853typedef unsigned short yytype_uint16;
1854#else
1855typedef int yytype_uint16;
1856#endif
1857
1858#ifndef YYPTRDIFF_T
1859# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
1860# define YYPTRDIFF_T __PTRDIFF_TYPE__
1861# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
1862# elif defined PTRDIFF_MAX
1863# ifndef ptrdiff_t
1864# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1865# endif
1866# define YYPTRDIFF_T ptrdiff_t
1867# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
1868# else
1869# define YYPTRDIFF_T long
1870# define YYPTRDIFF_MAXIMUM LONG_MAX
1871# endif
1872#endif
1873
1874#ifndef YYSIZE_T
1875# ifdef __SIZE_TYPE__
1876# define YYSIZE_T __SIZE_TYPE__
1877# elif defined size_t
1878# define YYSIZE_T size_t
1879# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
1880# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1881# define YYSIZE_T size_t
1882# else
1883# define YYSIZE_T unsigned
1884# endif
1885#endif
1886
1887#define YYSIZE_MAXIMUM \
1888 YY_CAST (YYPTRDIFF_T, \
1889 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
1890 ? YYPTRDIFF_MAXIMUM \
1891 : YY_CAST (YYSIZE_T, -1)))
1892
1893#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
1894
1895
1896/* Stored state numbers (used for stacks). */
1898
1899/* State numbers in computations. */
1901
1902#ifndef YY_
1903# if defined YYENABLE_NLS && YYENABLE_NLS
1904# if ENABLE_NLS
1905# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1906# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
1907# endif
1908# endif
1909# ifndef YY_
1910# define YY_(Msgid) Msgid
1911# endif
1912#endif
1913
1914
1915#ifndef YY_ATTRIBUTE_PURE
1916# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
1917# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
1918# else
1919# define YY_ATTRIBUTE_PURE
1920# endif
1921#endif
1922
1923#ifndef YY_ATTRIBUTE_UNUSED
1924# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
1925# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
1926# else
1927# define YY_ATTRIBUTE_UNUSED
1928# endif
1929#endif
1930
1931/* Suppress unused-variable warnings by "using" E. */
1932#if ! defined lint || defined __GNUC__
1933# define YY_USE(E) ((void) (E))
1934#else
1935# define YY_USE(E) /* empty */
1936#endif
1937
1938/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1939#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
1940# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
1941# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1942 _Pragma ("GCC diagnostic push") \
1943 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
1944# else
1945# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1946 _Pragma ("GCC diagnostic push") \
1947 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
1948 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1949# endif
1950# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1951 _Pragma ("GCC diagnostic pop")
1952#else
1953# define YY_INITIAL_VALUE(Value) Value
1954#endif
1955#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1956# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1957# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1958#endif
1959#ifndef YY_INITIAL_VALUE
1960# define YY_INITIAL_VALUE(Value) /* Nothing. */
1961#endif
1962
1963#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
1964# define YY_IGNORE_USELESS_CAST_BEGIN \
1965 _Pragma ("GCC diagnostic push") \
1966 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
1967# define YY_IGNORE_USELESS_CAST_END \
1968 _Pragma ("GCC diagnostic pop")
1969#endif
1970#ifndef YY_IGNORE_USELESS_CAST_BEGIN
1971# define YY_IGNORE_USELESS_CAST_BEGIN
1972# define YY_IGNORE_USELESS_CAST_END
1973#endif
1974
1975
1976#define YY_ASSERT(E) ((void) (0 && (E)))
1977
1978#if 1
1979
1980/* The parser invokes alloca or malloc; define the necessary symbols. */
1981
1982# ifdef YYSTACK_USE_ALLOCA
1983# if YYSTACK_USE_ALLOCA
1984# ifdef __GNUC__
1985# define YYSTACK_ALLOC __builtin_alloca
1986# elif defined __BUILTIN_VA_ARG_INCR
1987# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1988# elif defined _AIX
1989# define YYSTACK_ALLOC __alloca
1990# elif defined _MSC_VER
1991# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1992# define alloca _alloca
1993# else
1994# define YYSTACK_ALLOC alloca
1995# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
1996# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1997 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
1998# ifndef EXIT_SUCCESS
1999# define EXIT_SUCCESS 0
2000# endif
2001# endif
2002# endif
2003# endif
2004# endif
2005
2006# ifdef YYSTACK_ALLOC
2007 /* Pacify GCC's 'empty if-body' warning. */
2008# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
2009# ifndef YYSTACK_ALLOC_MAXIMUM
2010 /* The OS might guarantee only one guard page at the bottom of the stack,
2011 and a page size can be as small as 4096 bytes. So we cannot safely
2012 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2013 to allow for a few compiler-allocated temporary stack slots. */
2014# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2015# endif
2016# else
2017# define YYSTACK_ALLOC YYMALLOC
2018# define YYSTACK_FREE YYFREE
2019# ifndef YYSTACK_ALLOC_MAXIMUM
2020# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2021# endif
2022# if (defined __cplusplus && ! defined EXIT_SUCCESS \
2023 && ! ((defined YYMALLOC || defined malloc) \
2024 && (defined YYFREE || defined free)))
2025# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2026# ifndef EXIT_SUCCESS
2027# define EXIT_SUCCESS 0
2028# endif
2029# endif
2030# ifndef YYMALLOC
2031# define YYMALLOC malloc
2032# if ! defined malloc && ! defined EXIT_SUCCESS
2033void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2034# endif
2035# endif
2036# ifndef YYFREE
2037# define YYFREE free
2038# if ! defined free && ! defined EXIT_SUCCESS
2039void free (void *); /* INFRINGES ON USER NAME SPACE */
2040# endif
2041# endif
2042# endif
2043#endif /* 1 */
2044
2045#if (! defined yyoverflow \
2046 && (! defined __cplusplus \
2047 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
2048 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2049
2050/* A type that is properly aligned for any stack member. */
2051union yyalloc
2052{
2053 yy_state_t yyss_alloc;
2054 YYSTYPE yyvs_alloc;
2055 YYLTYPE yyls_alloc;
2056};
2057
2058/* The size of the maximum gap between one aligned stack and the next. */
2059# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
2060
2061/* The size of an array large to enough to hold all stacks, each with
2062 N elements. */
2063# define YYSTACK_BYTES(N) \
2064 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
2065 + YYSIZEOF (YYLTYPE)) \
2066 + 2 * YYSTACK_GAP_MAXIMUM)
2067
2068# define YYCOPY_NEEDED 1
2069
2070/* Relocate STACK from its old location to the new one. The
2071 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2072 elements in the stack, and YYPTR gives the new location of the
2073 stack. Advance YYPTR to a properly aligned location for the next
2074 stack. */
2075# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2076 do \
2077 { \
2078 YYPTRDIFF_T yynewbytes; \
2079 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2080 Stack = &yyptr->Stack_alloc; \
2081 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
2082 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
2083 } \
2084 while (0)
2085
2086#endif
2087
2088#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
2089/* Copy COUNT objects from SRC to DST. The source and destination do
2090 not overlap. */
2091# ifndef YYCOPY
2092# if defined __GNUC__ && 1 < __GNUC__
2093# define YYCOPY(Dst, Src, Count) \
2094 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
2095# else
2096# define YYCOPY(Dst, Src, Count) \
2097 do \
2098 { \
2099 YYPTRDIFF_T yyi; \
2100 for (yyi = 0; yyi < (Count); yyi++) \
2101 (Dst)[yyi] = (Src)[yyi]; \
2102 } \
2103 while (0)
2104# endif
2105# endif
2106#endif /* !YYCOPY_NEEDED */
2107
2108/* YYFINAL -- State number of the termination state. */
2109#define YYFINAL 3
2110/* YYLAST -- Last index in YYTABLE. */
2111#define YYLAST 14332
2112
2113/* YYNTOKENS -- Number of terminals. */
2114#define YYNTOKENS 154
2115/* YYNNTS -- Number of nonterminals. */
2116#define YYNNTS 270
2117/* YYNRULES -- Number of rules. */
2118#define YYNRULES 773
2119/* YYNSTATES -- Number of states. */
2120#define YYNSTATES 1294
2121
2122/* YYMAXUTOK -- Last valid token kind. */
2123#define YYMAXUTOK 353
2124
2125
2126/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
2127 as returned by yylex, with out-of-bounds checking. */
2128#define YYTRANSLATE(YYX) \
2129 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
2130 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
2131 : YYSYMBOL_YYUNDEF)
2132
2133/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
2134 as returned by yylex. */
2135static const yytype_uint8 yytranslate[] =
2136{
2137 0, 2, 2, 2, 2, 2, 2, 2, 2, 71,
2138 153, 74, 72, 73, 2, 2, 2, 2, 2, 2,
2139 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2140 2, 2, 152, 140, 2, 2, 2, 138, 133, 2,
2141 148, 149, 136, 134, 146, 135, 68, 137, 2, 2,
2142 2, 2, 2, 2, 2, 2, 2, 2, 128, 151,
2143 130, 126, 129, 127, 2, 2, 2, 2, 2, 2,
2144 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2145 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2146 2, 145, 69, 150, 132, 2, 147, 2, 2, 2,
2147 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2148 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2149 2, 2, 2, 143, 131, 144, 141, 2, 88, 89,
2150 90, 91, 75, 76, 77, 78, 94, 95, 83, 82,
2151 79, 80, 81, 86, 87, 92, 93, 97, 84, 85,
2152 96, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2153 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2154 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2155 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2156 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2157 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2158 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2159 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2160 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2161 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2162 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2163 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2164 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2165 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2166 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2167 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2168 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2169 65, 66, 67, 70, 98, 99, 100, 101, 102, 103,
2170 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2171 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
2172 124, 125, 139, 142
2173};
2174
2175#if YYDEBUG
2176/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
2177static const yytype_int16 yyrline[] =
2178{
2179 0, 1322, 1322, 1322, 1348, 1354, 1361, 1368, 1375, 1381,
2180 1382, 1388, 1401, 1399, 1410, 1421, 1427, 1434, 1441, 1448,
2181 1454, 1459, 1458, 1468, 1468, 1475, 1482, 1492, 1501, 1508,
2182 1516, 1524, 1536, 1548, 1558, 1572, 1573, 1581, 1589, 1598,
2183 1605, 1608, 1615, 1622, 1630, 1637, 1644, 1652, 1659, 1669,
2184 1674, 1683, 1686, 1687, 1691, 1695, 1699, 1704, 1711, 1713,
2185 1703, 1723, 1730, 1732, 1722, 1741, 1744, 1761, 1770, 1770,
2186 1784, 1791, 1791, 1791, 1797, 1798, 1801, 1802, 1811, 1821,
2187 1831, 1840, 1851, 1858, 1865, 1872, 1879, 1887, 1895, 1902,
2188 1909, 1918, 1919, 1928, 1929, 1938, 1945, 1952, 1959, 1966,
2189 1973, 1980, 1987, 1994, 2001, 2010, 2011, 2020, 2027, 2036,
2190 2043, 2052, 2059, 2066, 2073, 2083, 2090, 2100, 2107, 2114,
2191 2124, 2131, 2138, 2145, 2152, 2159, 2166, 2173, 2180, 2190,
2192 2198, 2201, 2208, 2215, 2224, 2225, 2226, 2227, 2232, 2235,
2193 2242, 2245, 2252, 2252, 2262, 2263, 2264, 2265, 2266, 2267,
2194 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277,
2195 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 2287,
2196 2288, 2289, 2290, 2291, 2294, 2294, 2294, 2295, 2295, 2296,
2197 2296, 2296, 2297, 2297, 2297, 2297, 2298, 2298, 2298, 2298,
2198 2299, 2299, 2299, 2300, 2300, 2300, 2300, 2301, 2301, 2301,
2199 2301, 2302, 2302, 2302, 2302, 2303, 2303, 2303, 2303, 2304,
2200 2304, 2304, 2304, 2305, 2305, 2308, 2315, 2322, 2329, 2336,
2201 2343, 2350, 2358, 2365, 2373, 2382, 2391, 2399, 2407, 2415,
2202 2423, 2427, 2431, 2435, 2439, 2443, 2447, 2451, 2455, 2459,
2203 2463, 2467, 2471, 2475, 2476, 2480, 2484, 2488, 2492, 2496,
2204 2500, 2504, 2508, 2512, 2516, 2520, 2520, 2525, 2534, 2544,
2205 2555, 2567, 2580, 2586, 2587, 2588, 2589, 2592, 2596, 2603,
2206 2607, 2613, 2620, 2621, 2625, 2632, 2641, 2646, 2656, 2663,
2207 2675, 2689, 2690, 2693, 2694, 2695, 2699, 2706, 2715, 2723,
2208 2730, 2738, 2746, 2750, 2750, 2787, 2796, 2800, 2806, 2813,
2209 2820, 2827, 2836, 2837, 2840, 2847, 2854, 2863, 2864, 2865,
2210 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2881, 2880,
2211 2895, 2895, 2902, 2902, 2910, 2918, 2925, 2932, 2939, 2947,
2212 2954, 2961, 2968, 2975, 2975, 2980, 2984, 2988, 2995, 2996,
2213 3004, 3005, 3016, 3027, 3037, 3048, 3047, 3064, 3063, 3078,
2214 3087, 3132, 3131, 3155, 3154, 3177, 3176, 3199, 3211, 3225,
2215 3232, 3239, 3246, 3255, 3262, 3268, 3285, 3291, 3297, 3303,
2216 3309, 3315, 3322, 3329, 3335, 3341, 3347, 3353, 3359, 3365,
2217 3380, 3387, 3393, 3400, 3401, 3402, 3405, 3406, 3409, 3410,
2218 3422, 3423, 3432, 3433, 3436, 3444, 3453, 3460, 3469, 3476,
2219 3483, 3490, 3497, 3506, 3514, 3523, 3524, 3527, 3531, 3535,
2220 3539, 3545, 3550, 3555, 3565, 3569, 3573, 3577, 3581, 3585,
2221 3590, 3594, 3598, 3602, 3606, 3610, 3614, 3618, 3622, 3628,
2222 3629, 3635, 3644, 3656, 3660, 3669, 3671, 3675, 3680, 3687,
2223 3693, 3697, 3701, 3686, 3726, 3734, 3744, 3749, 3755, 3765,
2224 3779, 3786, 3793, 3802, 3811, 3819, 3827, 3834, 3842, 3850,
2225 3857, 3864, 3877, 3885, 3895, 3896, 3900, 3895, 3917, 3918,
2226 3922, 3917, 3941, 3949, 3956, 3964, 3973, 3985, 3986, 3990,
2227 3997, 4001, 3989, 4016, 4017, 4020, 4021, 4029, 4039, 4040,
2228 4045, 4053, 4057, 4061, 4067, 4070, 4079, 4082, 4089, 4092,
2229 4093, 4095, 4096, 4105, 4114, 4123, 4128, 4137, 4146, 4155,
2230 4160, 4164, 4168, 4174, 4173, 4185, 4190, 4190, 4197, 4206,
2231 4210, 4219, 4223, 4227, 4231, 4235, 4238, 4242, 4251, 4255,
2232 4261, 4271, 4275, 4281, 4282, 4291, 4300, 4304, 4308, 4312,
2233 4318, 4320, 4329, 4337, 4351, 4352, 4375, 4379, 4385, 4391,
2234 4392, 4395, 4396, 4405, 4414, 4422, 4430, 4431, 4432, 4433,
2235 4441, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459,
2236 4466, 4469, 4479, 4492, 4499, 4506, 4515, 4527, 4530, 4537,
2237 4544, 4547, 4551, 4554, 4561, 4564, 4565, 4568, 4585, 4586,
2238 4587, 4596, 4606, 4615, 4621, 4631, 4637, 4646, 4648, 4657,
2239 4667, 4673, 4682, 4691, 4701, 4707, 4717, 4723, 4733, 4743,
2240 4762, 4768, 4778, 4788, 4829, 4832, 4831, 4848, 4852, 4857,
2241 4861, 4865, 4847, 4886, 4893, 4900, 4907, 4910, 4911, 4914,
2242 4924, 4925, 4926, 4927, 4930, 4940, 4941, 4951, 4952, 4953,
2243 4954, 4957, 4958, 4959, 4960, 4961, 4964, 4965, 4966, 4967,
2244 4968, 4969, 4970, 4973, 4986, 4995, 5002, 5011, 5012, 5016,
2245 5015, 5025, 5033, 5033, 5035, 5044, 5054, 5066, 5067, 5067,
2246 5081, 5085, 5089, 5093, 5099, 5104, 5109, 5113, 5117, 5121,
2247 5125, 5129, 5133, 5137, 5141, 5145, 5149, 5153, 5157, 5161,
2248 5166, 5172, 5181, 5190, 5199, 5208, 5219, 5220, 5228, 5237,
2249 5245, 5266, 5268, 5281, 5290, 5298, 5308, 5315, 5324, 5331,
2250 5341, 5348, 5357, 5358, 5361, 5369, 5377, 5387, 5397, 5407,
2251 5414, 5423, 5430, 5439, 5440, 5443, 5451, 5461, 5462, 5465,
2252 5475, 5479, 5485, 5490, 5490, 5514, 5515, 5524, 5526, 5549,
2253 5560, 5567, 5575, 5594, 5595, 5596, 5599, 5600, 5601, 5602,
2254 5605, 5606, 5607, 5610, 5611, 5614, 5615, 5618, 5619, 5622,
2255 5623, 5626, 5627, 5630, 5633, 5636, 5639, 5640, 5641, 5644,
2256 5645, 5648, 5649, 5653
2257};
2258#endif
2259
2261#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
2262
2263#if 1
2264/* The user-facing name of the symbol whose (internal) number is
2265 YYSYMBOL. No bounds checking. */
2266static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
2267
2268/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2269 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2270static const char *const yytname[] =
2271{
2272 "\"end-of-input\"", "error", "\"invalid token\"", "\"`class'\"",
2273 "\"`module'\"", "\"`def'\"", "\"`undef'\"", "\"`begin'\"",
2274 "\"`rescue'\"", "\"`ensure'\"", "\"`end'\"", "\"`if'\"", "\"`unless'\"",
2275 "\"`then'\"", "\"`elsif'\"", "\"`else'\"", "\"`case'\"", "\"`when'\"",
2276 "\"`while'\"", "\"`until'\"", "\"`for'\"", "\"`break'\"", "\"`next'\"",
2277 "\"`redo'\"", "\"`retry'\"", "\"`in'\"", "\"`do'\"",
2278 "\"`do' for condition\"", "\"`do' for block\"", "\"`do' for lambda\"",
2279 "\"`return'\"", "\"`yield'\"", "\"`super'\"", "\"`self'\"", "\"`nil'\"",
2280 "\"`true'\"", "\"`false'\"", "\"`and'\"", "\"`or'\"", "\"`not'\"",
2281 "\"`if' modifier\"", "\"`unless' modifier\"", "\"`while' modifier\"",
2282 "\"`until' modifier\"", "\"`rescue' modifier\"", "\"`alias'\"",
2283 "\"`defined?'\"", "\"`BEGIN'\"", "\"`END'\"", "\"`__LINE__'\"",
2284 "\"`__FILE__'\"", "\"`__ENCODING__'\"", "\"local variable or method\"",
2285 "\"method\"", "\"global variable\"", "\"instance variable\"",
2286 "\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
2287 "\"float literal\"", "\"rational literal\"", "\"imaginary literal\"",
2288 "\"char literal\"", "\"numbered reference\"", "\"back reference\"",
2289 "\"literal content\"", "tREGEXP_END", "'.'", "\"backslash\"",
2290 "\"escaped space\"", "\"escaped horizontal tab\"",
2291 "\"escaped form feed\"", "\"escaped carriage return\"",
2292 "\"escaped vertical tab\"", "\"unary+\"", "\"unary-\"", "\"**\"",
2293 "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"", "\"<=\"", "\"&&\"",
2294 "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"", "\"(..\"", "\"(...\"",
2295 "\"[]\"", "\"[]=\"", "\"<<\"", "\">>\"", "\"&.\"", "\"::\"",
2296 "\":: at EXPR_BEG\"", "\"operator-assignment\"", "\"=>\"", "\"(\"",
2297 "\"( arg\"", "\")\"", "\"[\"", "\"{\"", "\"{ arg\"", "\"*\"",
2298 "\"**arg\"", "\"&\"", "\"->\"", "\"symbol literal\"",
2299 "\"string literal\"", "\"backtick literal\"", "\"regexp literal\"",
2300 "\"word list\"", "\"verbatim word list\"", "\"symbol list\"",
2301 "\"verbatim symbol list\"", "\"terminator\"", "\"'}'\"", "tSTRING_DBEG",
2302 "tSTRING_DVAR", "tLAMBEG", "tLABEL_END", "tLOWEST", "'='", "'?'", "':'",
2303 "'>'", "'<'", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'",
2304 "tUMINUS_NUM", "'!'", "'~'", "tLAST_TOKEN", "'{'", "'}'", "'['", "','",
2305 "'`'", "'('", "')'", "']'", "';'", "' '", "'\\n'", "$accept", "program",
2306 "$@1", "top_compstmt", "top_stmts", "top_stmt", "begin_block",
2307 "bodystmt", "$@2", "compstmt", "stmts", "stmt_or_begin", "$@3", "stmt",
2308 "$@4", "command_asgn", "command_rhs", "expr", "@5", "@6", "$@7", "@8",
2309 "@9", "$@10", "def_name", "defn_head", "defs_head", "$@11", "expr_value",
2310 "expr_value_do", "$@12", "$@13", "command_call", "block_command",
2311 "cmd_brace_block", "fcall", "command", "mlhs", "mlhs_inner",
2312 "mlhs_basic", "mlhs_item", "mlhs_head", "mlhs_post", "mlhs_node", "lhs",
2313 "cname", "cpath", "fname", "fitem", "undef_list", "$@14", "op",
2314 "reswords", "arg", "$@15", "relop", "rel_expr", "lex_ctxt", "arg_value",
2315 "aref_args", "arg_rhs", "paren_args", "opt_paren_args", "opt_call_args",
2316 "call_args", "command_args", "$@16", "block_arg", "opt_block_arg",
2317 "args", "mrhs_arg", "mrhs", "primary", "$@17", "$@18", "$@19", "$@20",
2318 "@21", "@22", "$@23", "$@24", "$@25", "primary_value", "k_begin", "k_if",
2319 "k_unless", "k_while", "k_until", "k_case", "k_for", "k_class",
2320 "k_module", "k_def", "k_do", "k_do_block", "k_rescue", "k_ensure",
2321 "k_when", "k_else", "k_elsif", "k_end", "k_return", "then", "do",
2322 "if_tail", "opt_else", "for_var", "f_marg", "f_marg_list", "f_margs",
2323 "f_rest_marg", "f_any_kwrest", "block_args_tail", "opt_block_args_tail",
2324 "excessed_comma", "block_param", "opt_block_param", "block_param_def",
2325 "opt_bv_decl", "bv_decls", "bvar", "lambda", "@26", "@27", "@28", "$@29",
2326 "f_larglist", "lambda_body", "do_block", "block_call", "method_call",
2327 "brace_block", "brace_body", "@30", "@31", "@32", "do_body", "@33",
2328 "@34", "@35", "case_args", "case_body", "cases", "p_case_body", "@36",
2329 "@37", "$@38", "p_cases", "p_top_expr", "p_top_expr_body", "p_expr",
2330 "p_as", "p_alt", "p_lparen", "p_lbracket", "p_expr_basic", "@39", "@40",
2331 "p_args", "p_args_head", "p_args_tail", "p_find", "p_rest",
2332 "p_args_post", "p_arg", "p_kwargs", "p_kwarg", "p_kw", "p_kw_label",
2333 "p_kwrest", "p_kwnorest", "p_any_kwrest", "p_value", "p_primitive",
2334 "p_variable", "p_var_ref", "p_const", "opt_rescue", "exc_list",
2335 "exc_var", "opt_ensure", "literal", "strings", "string", "string1",
2336 "xstring", "regexp", "words", "word_list", "word", "symbols",
2337 "symbol_list", "qwords", "qsymbols", "qword_list", "qsym_list",
2338 "string_contents", "xstring_contents", "regexp_contents",
2339 "string_content", "@41", "$@42", "@43", "@44", "@45", "@46",
2340 "string_dvar", "symbol", "ssym", "sym", "dsym", "numeric",
2341 "simple_numeric", "user_variable", "keyword_variable", "var_ref",
2342 "var_lhs", "backref", "superclass", "$@47", "f_opt_paren_args",
2343 "f_paren_args", "f_arglist", "@48", "args_tail", "opt_args_tail",
2344 "f_args", "args_forward", "f_bad_arg", "f_norm_arg", "f_arg_asgn",
2345 "f_arg_item", "f_arg", "f_label", "f_kw", "f_block_kw", "f_block_kwarg",
2346 "f_kwarg", "kwrest_mark", "f_no_kwarg", "f_kwrest", "f_opt",
2347 "f_block_opt", "f_block_optarg", "f_optarg", "restarg_mark",
2348 "f_rest_arg", "blkarg_mark", "f_block_arg", "opt_f_block_arg",
2349 "singleton", "$@49", "assoc_list", "assocs", "assoc", "operation",
2350 "operation2", "operation3", "dot_or_colon", "call_op", "call_op2",
2351 "opt_terms", "opt_nl", "rparen", "rbracket", "rbrace", "trailer", "term",
2352 "terms", "none", YY_NULLPTR
2353};
2354
2355static const char *
2356yysymbol_name (yysymbol_kind_t yysymbol)
2357{
2358 return yytname[yysymbol];
2359}
2360#endif
2361
2362#define YYPACT_NINF (-1080)
2363
2364#define yypact_value_is_default(Yyn) \
2365 ((Yyn) == YYPACT_NINF)
2366
2367#define YYTABLE_NINF (-774)
2368
2369#define yytable_value_is_error(Yyn) \
2370 ((Yyn) == YYTABLE_NINF)
2371
2372/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2373 STATE-NUM. */
2374static const yytype_int16 yypact[] =
2375{
2376 -1080, 155, 4053, -1080, 9649, -1080, -1080, -1080, 9107, -1080,
2377 -1080, -1080, -1080, -1080, -1080, -1080, 9775, 9775, -1080, -1080,
2378 -1080, 5567, 5126, -1080, -1080, -1080, -1080, 353, 8962, 127,
2379 41, 83, -1080, -1080, -1080, 4391, 5273, -1080, -1080, 4538,
2380 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, 11539, 11539,
2381 11539, 11539, 112, 7162, 9901, 10405, 10783, 9391, -1080, 8817,
2382 -1080, -1080, -1080, 164, 217, 257, 289, 1108, 11665, 11539,
2383 -1080, 512, -1080, 1512, -1080, 728, 227, 227, -1080, -1080,
2384 66, 425, 347, -1080, 341, 11917, -1080, 377, 2218, 632,
2385 499, 745, -1080, 11791, 11791, -1080, -1080, 8144, 12039, 12161,
2386 12283, 8671, 9775, -1080, 444, 81, -1080, -1080, 491, -1080,
2387 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2388 -1080, 316, 445, -1080, 558, 451, -1080, -1080, -1080, -1080,
2389 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2390 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2391 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2392 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2393 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2394 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2395 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2396 -1080, -1080, -1080, -1080, -1080, 520, -1080, -1080, -1080, 539,
2397 11539, 642, 7313, 11539, 11539, 11539, -1080, 11539, -1080, 586,
2398 4957, 617, -1080, -1080, 597, 770, 30, 31, 647, 350,
2399 611, -1080, -1080, 8018, -1080, 9775, 10027, -1080, -1080, 8270,
2400 -1080, 11791, 613, -1080, 619, 7464, -1080, 7615, -1080, -1080,
2401 631, 633, 66, -1080, 788, -1080, 755, 5104, 5104, 453,
2402 9901, -1080, 7162, 654, 512, -1080, 1512, 127, 694, -1080,
2403 1512, 127, 690, 244, 708, -1080, 617, 706, 708, -1080,
2404 127, 778, 1108, 12405, 704, 704, 709, -1080, 827, 900,
2405 926, 932, -1080, -1080, -1080, -1080, -1080, 61, -1080, 400,
2406 629, 509, -1080, -1080, -1080, -1080, 781, -1080, -1080, -1080,
2407 -1080, -1080, -1080, -1080, 8396, 11791, 11791, 11791, 11791, 9901,
2408 11791, 11791, 1279, 737, 754, 6306, 1694, -1080, 765, 6306,
2409 -1080, -1080, -1080, 791, -1080, -1080, -1080, -1080, -1080, 834,
2410 -1080, 7162, 9520, 768, 834, -1080, 11539, 11539, 11539, 11539,
2411 11539, -1080, -1080, 11539, 11539, 11539, 11539, 11539, 11539, 11539,
2412 11539, -1080, 11539, -1080, -1080, 11539, 11539, 11539, 11539, 11539,
2413 11539, 11539, 11539, 11539, 11539, -1080, -1080, 12835, 9775, 12925,
2414 6306, 728, 96, 96, 7766, 11791, 7766, 512, -1080, 775,
2415 880, -1080, -1080, 956, 929, 90, 93, 106, 726, 861,
2416 11791, 473, -1080, 826, 990, -1080, -1080, -1080, -1080, 45,
2417 64, 382, 465, 493, 514, 537, 545, 573, -1080, -1080,
2418 -1080, -1080, 637, -1080, -1080, -1080, 14185, -1080, -1080, 834,
2419 834, -1080, -1080, 362, -1080, -1080, -1080, 751, 834, 11539,
2420 10153, -1080, -1080, 13015, 9775, 13105, 834, 834, 10531, -1080,
2421 127, 814, -1080, -1080, 11539, 127, -1080, 820, 127, 832,
2422 -1080, 137, -1080, -1080, -1080, -1080, -1080, 9107, -1080, 11539,
2423 845, 847, 13015, 13105, 834, 1512, 41, 127, -1080, -1080,
2424 8522, 852, 127, -1080, -1080, 10657, -1080, -1080, 10783, -1080,
2425 -1080, -1080, 619, 995, -1080, -1080, 865, -1080, 12405, 13195,
2426 9775, 13285, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2427 -1080, -1080, -1080, 743, 110, 946, 191, 11539, -1080, -1080,
2428 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2429 -1080, -1080, -1080, -1080, -1080, 1307, -1080, -1080, -1080, -1080,
2430 -1080, 868, -1080, 127, 127, -1080, -1080, 867, -1080, 881,
2431 11539, -1080, 888, 391, -1080, -1080, -1080, 890, 989, 896,
2432 999, -1080, 11539, 1037, 1046, 512, 909, 11539, 1037, 917,
2433 -1080, -1080, -1080, 1037, -1080, 1037, -1080, 10909, -1080, 127,
2434 12405, 923, -1080, 10909, -1080, 755, 3708, 3708, 3708, 3708,
2435 5251, 2121, 3708, 3708, 5104, 5104, 592, 592, -1080, 5689,
2436 1165, 1165, 1456, 447, 447, 755, 755, 755, 1451, 1451,
2437 5714, 4685, 6008, 4832, -1080, 633, -1080, 127, 924, 489,
2438 -1080, 623, -1080, -1080, 5420, 1037, -1080, 6457, 1062, 6910,
2439 1037, 38, 1037, 1053, 1066, 118, 13375, 9775, 13465, -1080,
2440 728, -1080, 995, -1080, -1080, -1080, 13555, 9775, 13645, 6306,
2441 11791, -1080, -1080, -1080, -1080, -1080, 3013, 11665, 11665, 9107,
2442 11539, 11539, -1080, 11539, 617, -1080, 611, 4239, 4979, 127,
2443 481, 648, 11539, 11539, -1080, -1080, -1080, -1080, 10279, -1080,
2444 10531, -1080, -1080, 11791, 4957, -1080, -1080, 633, 633, 11539,
2445 -1080, 285, -1080, -1080, 708, 12405, 865, 280, 763, 127,
2446 587, 672, 1622, -1080, 953, -1080, 296, -1080, 938, -1080,
2447 -1080, 299, 941, -1080, 755, 1307, 930, -1080, 951, 127,
2448 952, -1080, 37, -1080, -1080, -1080, -1080, 11539, 1279, -1080,
2449 -1080, 630, -1080, -1080, -1080, 1694, -1080, -1080, 1440, -1080,
2450 -1080, 4516, -1080, -1080, -1080, 11035, 583, -1080, -1080, 1694,
2451 4663, -1080, -1080, -1080, 940, -1080, -1080, -1080, 11539, -1080,
2452 957, 958, 1058, -1080, -1080, 865, 12405, -1080, -1080, 1065,
2453 980, 4369, -1080, -1080, -1080, 1089, 656, 2593, 2593, 987,
2454 834, 834, -1080, 791, 967, 646, 10153, 834, 834, -1080,
2455 -1080, 791, -1080, -1080, 862, -1080, 1104, -1080, -1080, -1080,
2456 -1080, -1080, -1080, 1066, 1037, -1080, 11161, 1037, 87, 284,
2457 127, 133, 156, 7766, 512, 11791, 6306, 1085, 763, -1080,
2458 127, 1037, 137, 9252, 81, 425, -1080, 4810, -1080, -1080,
2459 -1080, -1080, -1080, -1080, -1080, 834, 834, 661, 834, 834,
2460 127, 977, 137, -1080, -1080, -1080, 684, 1694, -1080, -1080,
2461 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2462 -1080, 127, -1080, 1307, -1080, 1392, -1080, -1080, -1080, 127,
2463 -1080, 979, 984, -1080, 1074, 868, 992, -1080, 996, -1080,
2464 992, 11539, 957, -1080, 1033, -1080, -1080, -1080, 7766, -1080,
2465 -1080, -1080, 11539, 1005, -1080, 1005, 998, 11287, 9901, 865,
2466 9901, 834, 11539, 13735, 9775, 13825, -1080, -1080, 2007, 2007,
2467 568, -1080, 3718, 470, 1096, -1080, 1041, -1080, 1014, -1080,
2468 -1080, 800, -1080, -1080, 231, -1080, -1080, -1080, -1080, -1080,
2469 -1080, -1080, -1080, -1080, 1041, 11539, 11665, 11665, -1080, -1080,
2470 834, 11665, 11665, -1080, -1080, 7766, 11791, 1037, -1080, -1080,
2471 1037, -1080, -1080, 1037, -1080, 11539, -1080, 67, -1080, 179,
2472 1037, 6306, 512, 1037, -1080, -1080, -1080, -1080, -1080, -1080,
2473 11539, 11539, 834, 11539, 11539, -1080, 10531, -1080, 127, 170,
2474 -1080, -1080, -1080, 1003, 1009, -1080, 1694, -1080, 1440, -1080,
2475 -1080, 1440, -1080, 1440, -1080, -1080, 4957, 12527, 96, -1080,
2476 -1080, 7036, 4957, 1808, 7615, -1080, -1080, 6306, 11539, 1010,
2477 -1080, -1080, 11665, 4957, 5861, 6155, 127, 679, 725, -1080,
2478 -1080, -1080, -1080, 2593, 1107, 165, 127, 12682, -1080, 127,
2479 1017, 1018, -1080, 387, 1029, -1080, -1080, 1124, -1080, 2593,
2480 2007, 2007, 568, 180, 526, 3895, 3895, -1080, 4957, -1080,
2481 -1080, -1080, -1080, 11665, -1080, -1080, -1080, -1080, -1080, 96,
2482 -1080, -1080, 3895, -1080, -1080, 11413, 6608, -1080, 1037, -1080,
2483 -1080, 11539, 1038, 1027, 6306, 7615, -1080, -1080, 1392, 1392,
2484 992, 1054, 992, 992, 1143, -1080, 1093, 103, 132, 173,
2485 6306, 1192, 868, -1080, 127, 1072, 1079, 1071, 12649, -1080,
2486 1076, -1080, 1077, 1080, -1080, -1080, -1080, 1081, 727, 62,
2487 -1080, -1080, 73, 1041, 1083, -1080, 2593, -1080, -1080, -1080,
2488 127, 1094, -1080, 2593, -1080, -1080, -1080, 639, -1080, -1080,
2489 -1080, -1080, -1080, -1080, -1080, -1080, -1080, 127, 127, 127,
2490 127, 127, 127, -1080, -1080, 6457, 96, 901, 243, -1080,
2491 -1080, -1080, 11539, -1080, 720, -1080, -1080, 1317, 1037, 1064,
2492 7892, 1009, -1080, 1440, -1080, -1080, -1080, 183, 13915, 9775,
2493 14005, 1046, -1080, -1080, 1116, -1080, 12649, 1694, -1080, -1080,
2494 1155, 1148, 630, -1080, 1694, -1080, 1440, -1080, -1080, 1103,
2495 2593, -1080, 1110, -1080, 415, -1080, 387, 1041, -1080, -1080,
2496 816, -1080, -1080, -1080, -1080, -1080, -1080, 862, -1080, 11791,
2497 11791, 12768, -1080, -1080, -1080, -1080, -1080, 767, -1080, -1080,
2498 -1080, -1080, 1092, 992, 77, 89, 127, 198, 210, -1080,
2499 -1080, 1148, -1080, 1112, 1118, -1080, 14095, -1080, 868, 1120,
2500 -1080, 1121, 1120, 2593, 1122, 12768, -1080, -1080, -1080, -1080,
2501 6759, -1080, -1080, -1080, 1126, 1317, -1080, -1080, -1080, 221,
2502 1694, -1080, 1440, -1080, 1102, 1105, -1080, 1440, -1080, 1440,
2503 -1080, -1080, 1122, 2593, -1080, -1080, 370, 2593, -1080, 1120,
2504 1127, 1120, 1120, -1080, -1080, -1080, 1122, -1080, 1440, -1080,
2505 -1080, -1080, 1120, -1080
2506};
2507
2508/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2509 Performed when YYTABLE does not specify something else to do. Zero
2510 means the default is an error. */
2511static const yytype_int16 yydefact[] =
2512{
2513 2, 0, 0, 1, 0, 371, 372, 373, 0, 364,
2514 365, 366, 369, 367, 368, 370, 359, 360, 361, 362,
2515 382, 293, 293, 647, 646, 648, 649, 761, 0, 761,
2516 0, 0, 651, 650, 652, 743, 745, 643, 642, 744,
2517 645, 637, 638, 639, 640, 588, 657, 658, 0, 0,
2518 0, 0, 0, 0, 320, 773, 773, 103, 439, 608,
2519 608, 610, 612, 0, 0, 0, 0, 0, 0, 0,
2520 3, 759, 6, 9, 35, 40, 668, 668, 52, 75,
2521 293, 74, 0, 91, 0, 95, 105, 0, 65, 243,
2522 262, 0, 318, 0, 0, 71, 71, 759, 0, 0,
2523 0, 0, 329, 340, 76, 338, 307, 308, 587, 589,
2524 309, 310, 311, 313, 312, 314, 586, 627, 628, 585,
2525 635, 653, 654, 315, 0, 316, 79, 5, 8, 184,
2526 195, 185, 208, 181, 201, 191, 190, 211, 212, 206,
2527 189, 188, 183, 209, 213, 214, 193, 182, 196, 200,
2528 202, 194, 187, 203, 210, 205, 204, 197, 207, 192,
2529 180, 199, 198, 179, 186, 177, 178, 174, 175, 176,
2530 134, 136, 135, 169, 170, 165, 147, 148, 149, 156,
2531 153, 155, 150, 151, 171, 172, 157, 158, 162, 166,
2532 152, 154, 144, 145, 146, 159, 160, 161, 163, 164,
2533 167, 168, 173, 139, 141, 28, 137, 138, 140, 0,
2534 0, 0, 0, 0, 0, 0, 608, 0, 288, 0,
2535 271, 298, 89, 292, 773, 0, 653, 654, 0, 316,
2536 773, 737, 90, 761, 87, 0, 773, 459, 86, 761,
2537 762, 0, 0, 23, 255, 0, 10, 0, 359, 360,
2538 332, 460, 0, 237, 0, 329, 238, 228, 229, 326,
2539 0, 21, 0, 0, 759, 17, 20, 761, 93, 16,
2540 322, 761, 0, 766, 766, 272, 0, 0, 766, 735,
2541 761, 0, 0, 0, 668, 668, 101, 363, 0, 111,
2542 112, 119, 440, 632, 631, 633, 630, 0, 629, 0,
2543 0, 0, 595, 604, 600, 606, 636, 56, 249, 250,
2544 769, 770, 4, 771, 760, 0, 0, 0, 0, 0,
2545 0, 0, 690, 0, 667, 0, 690, 663, 0, 0,
2546 374, 464, 453, 80, 468, 337, 375, 468, 449, 773,
2547 107, 0, 99, 96, 773, 61, 0, 0, 0, 0,
2548 0, 265, 266, 0, 0, 0, 0, 226, 227, 0,
2549 0, 57, 0, 263, 264, 0, 0, 0, 0, 0,
2550 0, 0, 0, 0, 0, 755, 756, 0, 773, 0,
2551 0, 70, 0, 0, 0, 0, 0, 759, 347, 760,
2552 0, 393, 392, 0, 0, 653, 654, 316, 129, 130,
2553 0, 0, 132, 661, 0, 653, 654, 316, 355, 204,
2554 197, 207, 192, 174, 175, 176, 134, 135, 733, 67,
2555 66, 732, 0, 88, 758, 757, 0, 339, 590, 773,
2556 773, 142, 740, 326, 299, 742, 295, 0, 773, 0,
2557 0, 289, 297, 0, 773, 0, 773, 773, 0, 290,
2558 761, 0, 331, 294, 691, 761, 284, 773, 761, 773,
2559 283, 761, 336, 55, 25, 27, 26, 0, 333, 0,
2560 0, 0, 0, 0, 773, 19, 0, 761, 324, 15,
2561 760, 92, 761, 321, 327, 768, 767, 273, 768, 275,
2562 328, 736, 0, 118, 636, 109, 104, 667, 0, 0,
2563 773, 0, 441, 614, 634, 617, 615, 609, 591, 592,
2564 611, 593, 613, 0, 0, 0, 0, 0, 772, 7,
2565 29, 30, 31, 32, 33, 53, 54, 697, 694, 693,
2566 692, 695, 703, 712, 691, 0, 724, 713, 728, 727,
2567 723, 773, 689, 761, 761, 696, 698, 699, 701, 675,
2568 705, 710, 773, 716, 406, 405, 721, 675, 726, 675,
2569 0, 673, 0, 0, 773, 0, 675, 0, 0, 0,
2570 465, 464, 81, 0, 469, 0, 269, 0, 270, 761,
2571 0, 97, 108, 0, 62, 235, 242, 244, 245, 246,
2572 253, 254, 247, 248, 224, 225, 251, 252, 58, 761,
2573 239, 240, 241, 230, 231, 232, 233, 234, 267, 268,
2574 746, 748, 747, 749, 458, 293, 456, 761, 773, 746,
2575 748, 747, 749, 457, 293, 0, 384, 0, 383, 0,
2576 0, 0, 0, 345, 0, 326, 0, 773, 0, 71,
2577 353, 129, 130, 131, 659, 351, 0, 773, 0, 0,
2578 0, 753, 754, 68, 746, 747, 293, 0, 0, 0,
2579 0, 0, 739, 0, 300, 296, 773, 746, 747, 761,
2580 746, 747, 0, 0, 738, 330, 763, 278, 285, 280,
2581 287, 335, 24, 0, 256, 11, 34, 0, 773, 0,
2582 22, 94, 18, 323, 766, 0, 102, 750, 117, 761,
2583 746, 747, 690, 618, 0, 594, 0, 597, 0, 602,
2584 599, 0, 0, 603, 236, 0, 404, 396, 398, 761,
2585 401, 394, 0, 672, 731, 664, 666, 0, 0, 682,
2586 704, 0, 671, 714, 715, 0, 685, 725, 0, 687,
2587 729, 258, 381, 357, 376, 773, 773, 577, 669, 0,
2588 260, 358, 462, 466, 0, 463, 470, 448, 0, 36,
2589 303, 0, 39, 302, 106, 100, 0, 51, 41, 49,
2590 0, 276, 298, 215, 37, 0, 316, 0, 0, 0,
2591 773, 773, 455, 84, 0, 461, 285, 773, 773, 282,
2592 454, 82, 281, 319, 773, 385, 773, 343, 387, 72,
2593 386, 344, 479, 0, 0, 378, 0, 0, 750, 325,
2594 761, 746, 747, 0, 0, 0, 0, 129, 130, 133,
2595 761, 0, 761, 0, 450, 77, 42, 276, 216, 48,
2596 223, 143, 741, 301, 291, 773, 773, 461, 773, 773,
2597 761, 773, 761, 222, 274, 110, 461, 690, 442, 445,
2598 619, 623, 624, 625, 616, 626, 596, 598, 605, 601,
2599 607, 761, 403, 0, 700, 0, 730, 717, 674, 761,
2600 702, 675, 675, 711, 716, 773, 675, 722, 675, 699,
2601 675, 0, 578, 579, 773, 580, 377, 379, 0, 12,
2602 14, 584, 0, 773, 78, 773, 306, 0, 0, 98,
2603 0, 773, 0, 0, 773, 0, 571, 575, 0, 0,
2604 0, 516, 761, 513, 0, 570, 63, 494, 496, 498,
2605 501, 551, 556, 557, 558, 561, 562, 563, 564, 565,
2606 567, 566, 568, 569, 59, 0, 0, 0, 85, 764,
2607 773, 0, 0, 83, 380, 0, 0, 0, 388, 390,
2608 0, 73, 480, 0, 349, 0, 472, 0, 348, 461,
2609 0, 0, 0, 0, 461, 356, 734, 69, 451, 452,
2610 0, 0, 773, 0, 0, 279, 286, 334, 761, 0,
2611 620, 395, 397, 399, 402, 665, 0, 678, 0, 680,
2612 670, 0, 686, 0, 683, 688, 259, 0, 0, 582,
2613 583, 0, 261, 761, 0, 430, 429, 0, 0, 304,
2614 38, 50, 0, 277, 746, 747, 761, 746, 747, 559,
2615 560, 130, 573, 0, 532, 518, 761, 519, 525, 761,
2616 528, 0, 512, 0, 0, 515, 572, 0, 64, 0,
2617 554, 555, 0, 500, 499, 0, 0, 60, 257, 47,
2618 220, 46, 221, 0, 44, 218, 45, 219, 391, 0,
2619 341, 342, 0, 346, 473, 0, 0, 350, 0, 660,
2620 352, 0, 0, 433, 0, 0, 443, 621, 0, 0,
2621 675, 675, 675, 675, 0, 581, 0, 653, 654, 316,
2622 0, 773, 773, 428, 761, 0, 699, 412, 707, 708,
2623 773, 719, 412, 412, 410, 467, 471, 305, 461, 761,
2624 531, 510, 523, 535, 520, 511, 0, 526, 544, 608,
2625 761, 537, 540, 543, 549, 550, 539, 547, 765, 495,
2626 497, 552, 553, 574, 509, 505, 608, 761, 761, 761,
2627 761, 761, 761, 43, 217, 0, 0, 485, 488, 492,
2628 491, 493, 0, 474, 773, 354, 444, 0, 0, 0,
2629 0, 400, 679, 0, 676, 681, 684, 326, 0, 773,
2630 0, 773, 13, 409, 0, 431, 0, 413, 421, 419,
2631 0, 706, 0, 408, 0, 424, 0, 426, 517, 521,
2632 0, 527, 529, 533, 0, 514, 538, 542, 548, 546,
2633 0, 502, 503, 504, 506, 507, 508, 773, 481, 0,
2634 0, 489, 475, 477, 478, 476, 437, 761, 435, 438,
2635 447, 446, 0, 675, 750, 325, 761, 746, 747, 576,
2636 432, 718, 411, 412, 412, 326, 0, 709, 773, 412,
2637 720, 412, 412, 0, 524, 0, 545, 541, 536, 389,
2638 0, 486, 487, 490, 528, 0, 434, 622, 677, 461,
2639 0, 416, 0, 418, 750, 325, 407, 0, 425, 0,
2640 422, 427, 522, 0, 530, 534, 773, 0, 436, 412,
2641 412, 412, 412, 483, 484, 482, 529, 417, 0, 414,
2642 420, 423, 412, 415
2643};
2644
2645/* YYPGOTO[NTERM-NUM]. */
2646static const yytype_int16 yypgoto[] =
2647{
2648 -1080, -1080, -1080, 1025, -1080, 23, 748, -318, -1080, -40,
2649 -1080, 774, -1080, 69, -1080, 295, -537, -44, -1080, -1080,
2650 -1080, -1080, -1080, -1080, 455, -42, -24, -1080, 42, -88,
2651 -1080, -1080, -20, -1080, -298, 1078, 15, 1176, -140, 36,
2652 -62, -1080, -428, -27, 2306, -384, 1179, -55, -23, -1080,
2653 -1080, 13, -1080, 3243, -1080, 1187, -1080, 602, 2959, -1080,
2654 671, 44, 624, -350, 189, 25, -1080, -277, -191, 71,
2655 -1080, -514, 49, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2656 -1080, -1080, 877, -1080, -1080, -1080, -1080, -1080, -1080, -1080,
2657 -1080, -1080, -1080, -1080, -1080, -1080, -1080, -1080, 540, -1080,
2658 -440, 1527, -376, -1080, 78, -784, -1080, -804, -786, 574,
2659 428, -714, 291, 194, -1080, -1080, 397, -1080, -795, -1080,
2660 40, 242, -1080, -1080, -1080, -1080, -1080, -1080, 480, -1080,
2661 -1080, -104, 735, -1080, -1080, -1080, 971, -1080, -1080, -1080,
2662 -1080, -767, -1080, 33, -1080, -1080, -1080, -1080, -1080, -1080,
2663 -343, -1080, -1080, -1080, -1080, 271, -1080, -1080, -945, -1080,
2664 250, -217, -1051, -1079, -743, -118, -1080, 119, -1080, -1080,
2665 -1080, 120, -1080, -721, 281, -1080, -1080, 149, -1080, -1080,
2666 233, 443, 759, -1080, 1214, 1373, 1700, 1769, -1080, 811,
2667 2085, -1080, 2192, 2445, -1080, -1080, -57, -1080, -1080, -147,
2668 -1080, -1080, -1080, -1080, -1080, -1080, -1080, 1, -1080, -1080,
2669 -1080, -1080, 0, 2191, -2, 1226, 2488, 1900, -1080, -1080,
2670 1253, 666, 9, -1080, -304, -464, -289, -268, -1053, -394,
2671 -245, -646, -203, -461, 601, 157, -1080, -1080, -691, -1080,
2672 -705, -700, -991, 168, -549, -1080, -584, -1080, -476, -527,
2673 -1080, -1080, -1080, 161, -410, -1080, -335, -1080, -1080, -85,
2674 -1080, -52, -13, 968, -532, 222, -254, -37, -3, 8
2675};
2676
2677/* YYDEFGOTO[NTERM-NUM]. */
2678static const yytype_int16 yydefgoto[] =
2679{
2680 0, 1, 2, 70, 71, 72, 246, 563, 1001, 564,
2681 264, 265, 476, 266, 467, 74, 768, 75, 598, 778,
2682 1047, 584, 777, 1038, 419, 76, 77, 823, 382, 384,
2683 385, 951, 78, 79, 572, 252, 81, 82, 267, 83,
2684 84, 85, 496, 86, 219, 402, 403, 203, 204, 205,
2685 659, 613, 207, 88, 469, 373, 89, 577, 221, 272,
2686 773, 614, 790, 455, 456, 234, 235, 223, 441, 618,
2687 762, 763, 90, 380, 271, 482, 683, 803, 634, 816,
2688 814, 649, 254, 92, 93, 94, 95, 96, 97, 98,
2689 99, 100, 101, 334, 337, 745, 888, 806, 945, 946,
2690 743, 255, 627, 799, 947, 948, 394, 717, 718, 719,
2691 720, 541, 1232, 1178, 1179, 1094, 1004, 1005, 1072, 1217,
2692 1218, 103, 292, 502, 702, 979, 848, 1076, 338, 104,
2693 105, 335, 569, 570, 753, 893, 573, 574, 756, 895,
2694 957, 807, 1215, 804, 952, 1062, 1250, 1285, 1146, 1147,
2695 1113, 917, 918, 1045, 1046, 919, 1033, 1023, 1026, 1027,
2696 1028, 1029, 1030, 1192, 1031, 1120, 1121, 1122, 1123, 1124,
2697 1125, 1126, 920, 921, 922, 923, 924, 746, 884, 998,
2698 890, 106, 107, 108, 109, 110, 111, 112, 513, 706,
2699 113, 515, 114, 115, 514, 516, 297, 300, 301, 507,
2700 704, 703, 850, 980, 1077, 1160, 854, 116, 117, 298,
2701 118, 119, 120, 226, 227, 123, 228, 229, 645, 815,
2702 323, 324, 325, 326, 868, 729, 543, 458, 545, 546,
2703 879, 548, 566, 550, 551, 1099, 1100, 552, 553, 554,
2704 555, 556, 1101, 1102, 557, 558, 559, 560, 561, 723,
2705 422, 650, 277, 459, 231, 126, 687, 616, 653, 648,
2706 426, 312, 451, 452, 785, 1035, 487, 628, 389, 269
2707};
2708
2709/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2710 positive, shift that token. If negative, reduce the rule whose
2711 number is the opposite. If YYTABLE_NINF, syntax error. */
2712static const yytype_int16 yytable[] =
2713{
2714 122, 427, 122, 299, 296, 243, 379, 629, 386, 208,
2715 127, 568, 950, 263, 241, 284, 244, 643, 542, 425,
2716 489, 206, 542, 343, 491, 732, 875, 128, 617, 208,
2717 286, 218, 218, 285, 313, 877, 953, 565, 674, 449,
2718 874, 206, 615, 284, 624, 388, 420, 238, 307, 381,
2719 381, 122, 122, 381, 544, 290, 284, 284, 284, 982,
2720 313, 285, 625, 275, 279, 798, 237, 306, 314, 774,
2721 696, 73, 206, 73, 285, 285, 285, 547, 674, 984,
2722 626, 547, 870, 290, 327, 327, 329, 224, 224, 268,
2723 -124, 656, 330, 736, 669, 739, 396, 406, 406, 406,
2724 1137, 1140, -126, 870, 1219, 333, 287, 330, 615, 626,
2725 624, 1244, -124, -647, 206, -120, -120, 218, -121, 549,
2726 826, 829, 477, 270, 332, 1189, 273, 503, 751, -655,
2727 -656, -128, -646, 755, 287, 757, 383, 837, 688, 387,
2728 445, 721, -647, -127, 872, -121, 538, 287, 287, 287,
2729 699, 878, 765, 510, 512, 3, -120, -121, -123, 437,
2730 1254, -646, 1037, 665, 1272, 872, 688, 846, 259, 473,
2731 539, 665, 263, 224, 320, 321, 708, 230, 230, 871,
2732 504, -125, 505, 506, 245, 793, -128, 1019, 1020, 310,
2733 797, 311, 801, 1240, 1274, 461, -127, 463, 1286, 1074,
2734 871, 579, 1219, 501, -122, 222, 232, 471, 1095, 331,
2735 122, -123, 479, 1065, 236, 240, 274, 278, 310, 1190,
2736 311, 495, 263, -125, 331, -746, 247, 313, -124, 709,
2737 -124, 883, 442, -115, -122, -746, -111, -747, 442, -112,
2738 -126, 284, -126, 122, 460, 122, 866, 310, 218, 311,
2739 218, 218, -119, 127, -120, 866, -120, 712, 122, 285,
2740 122, 480, 819, 230, -118, 1037, 1253, 492, 449, 1240,
2741 674, 381, 381, 381, 381, 982, 525, 526, 959, -114,
2742 240, 290, 494, -121, 1114, -121, 877, 810, 964, 1092,
2743 240, 423, 1161, 1075, 329, 237, 332, 820, 268, 1174,
2744 284, 263, -116, 688, 224, -115, 224, 457, 638, -126,
2745 713, -535, 122, 688, 73, 581, 302, 122, 285, 1131,
2746 1132, 721, 862, 122, -128, -113, -128, 122, 1042, 475,
2747 -761, 821, 287, 240, -127, 633, -127, 519, 899, 122,
2748 290, 381, 1127, 1037, 630, 870, 632, 578, 990, -123,
2749 313, -123, 578, -773, 1127, 1127, 640, 520, 521, 522,
2750 523, -125, 503, -125, 954, 503, 707, 958, 707, 303,
2751 1213, 1127, -122, 1193, -122, 322, 1043, 268, 122, 1044,
2752 1032, 965, 122, 73, 122, 887, 460, 1214, 524, 1211,
2753 485, 287, 622, 218, 230, 802, 230, 486, 542, 1049,
2754 1051, 665, 1081, 665, 1054, 1056, -115, 987, 989, 304,
2755 840, -92, 992, 849, 994, -655, 995, 505, 506, 1103,
2756 505, 506, 450, 623, 453, 733, -115, 631, -746, -115,
2757 -117, -106, -747, -115, 916, 934, 495, 578, 578, 622,
2758 844, 305, -120, 734, 682, 1118, 578, 1193, 856, 447,
2759 -648, 859, 460, 336, 578, 578, 284, 547, 622, 218,
2760 869, 474, -111, 1092, 533, 442, 503, 442, 208, 721,
2761 1092, 721, 1092, 339, 285, 834, -128, 1238, 122, -648,
2762 206, 503, 578, 547, 1108, 938, 622, 340, -127, 623,
2763 547, 874, 1283, 943, 1111, 537, 290, 1115, 963, 1119,
2764 1193, 239, 1275, 344, 547, 1127, 240, 1060, 460, 665,
2765 1061, 1134, 375, 1063, 622, 218, 1143, 623, 495, 508,
2766 1067, 505, 506, 1070, 346, 641, 1022, 1104, 748, 642,
2767 1275, 870, 876, -649, 1193, 880, 505, 506, 284, 1246,
2768 376, 424, 1098, 542, -656, 623, 1092, 287, 1092, 724,
2769 430, 813, 474, 1092, 1016, 1092, 285, 759, 978, 857,
2770 724, -651, -649, 769, 857, 1173, 674, -363, 615, 1025,
2771 624, -121, 747, 1183, 1092, 503, 511, -128, 290, -127,
2772 838, 1066, -650, 370, 371, 372, 779, 794, 787, 796,
2773 -651, -112, 886, 1234, 800, -363, -363, -119, 887, -118,
2774 1241, 666, 547, 60, 784, -652, 822, -123, 1204, 1205,
2775 1206, -650, -114, -641, -761, -123, 1162, 1164, 1165, 1166,
2776 641, 870, 1090, 240, 1021, 122, 442, 122, 1155, 287,
2777 505, 506, 792, 845, -652, -114, 831, 769, 769, 842,
2778 783, -644, -641, 1068, -363, 460, 694, 122, 761, 791,
2779 834, 622, 218, 284, 761, 460, 784, 429, 1133, 782,
2780 208, 622, 218, 310, 792, 311, 431, 464, 789, 346,
2781 -644, 285, 206, 1198, 442, -761, 1280, 465, 466, 240,
2782 1109, 825, 623, 1145, 721, 721, 784, 239, 532, 1106,
2783 905, 1199, 623, 290, 1259, 503, 792, -116, 433, 665,
2784 789, 1104, 1025, 1025, 495, 651, 866, 533, 1104, -113,
2785 1104, 1266, 438, -114, 351, 352, 1098, 439, 1220, 1148,
2786 968, 1098, 788, 1098, 284, 1098, 368, 369, 370, 371,
2787 372, 782, 789, -114, 652, 887, -114, 805, 537, 538,
2788 -114, 547, 285, 440, 287, 940, 446, 839, 509, -125,
2789 505, 506, -743, 885, 891, 430, 1158, 448, 1096, 1258,
2790 972, 363, 364, 539, 290, 320, 321, 468, 420, -116,
2791 1208, 381, -122, 960, -125, 933, 933, 961, 787, 233,
2792 1197, 236, -128, 1080, 1104, 1082, 1104, -122, 578, 578,
2793 1083, 1104, -113, 1104, -641, 578, 578, 784, -116, 1098,
2794 1097, 1098, 949, 478, 949, -123, 1098, 784, 1098, 503,
2795 -113, 122, 1104, 375, 122, 287, 761, 503, -116, 1226,
2796 -91, -116, -641, -641, 788, -116, 940, 1098, 1138, 1141,
2797 -113, -325, 346, -113, 493, 688, 206, -113, 375, 841,
2798 484, 376, 377, 578, 578, 1150, 578, 578, 1000, 442,
2799 490, -125, 322, -122, 488, 498, 375, 962, 517, -325,
2800 -325, 486, 705, 562, 505, 506, 376, 443, 1025, -743,
2801 508, -641, 505, 506, -743, 660, 944, 887, 767, 91,
2802 -662, 91, 503, 724, 376, 472, 122, -744, 1040, 1041,
2803 378, 567, 999, 225, 225, 375, 122, 571, 122, 784,
2804 1034, 1006, 381, 1006, 576, 1058, 933, 933, -325, 578,
2805 933, -747, 460, 1255, 582, 444, 769, 769, 622, 218,
2806 240, 769, 769, 376, 499, 1069, 518, 1139, 1142, -644,
2807 91, 91, 1096, 444, 288, 508, 635, 505, 506, 1096,
2808 1246, 1209, 1210, 122, 1151, 225, 583, 841, 578, 623,
2809 497, 497, 767, 767, 639, 284, 644, -644, -644, 122,
2810 1223, 1091, 288, 676, 1105, 1073, 678, 1010, -653, 1011,
2811 225, 225, 500, 285, 225, 393, 404, 404, 680, 225,
2812 578, 1239, 527, 1242, 528, 529, 530, 531, 1059, 685,
2813 1073, 686, 769, 727, -654, 1088, -653, -653, -106, 122,
2814 -316, 1170, 122, 784, -744, 122, -644, 851, 852, -744,
2815 853, 695, 503, 784, 722, 1096, 784, 46, 47, 915,
2816 915, 933, -654, -654, 375, 933, 1154, 728, -316, -316,
2817 784, 657, 658, 769, 731, 1159, 735, 933, 933, 933,
2818 661, 737, 738, 933, 933, -653, 287, 742, 672, 673,
2819 1171, 740, 376, 636, 744, 749, 284, 1279, 375, 1281,
2820 933, 752, 1194, -326, 122, 710, 1282, 505, 506, 766,
2821 786, -654, 122, 122, 285, 795, 689, -316, 802, 1200,
2822 80, 1073, 80, 805, 894, 1292, 376, 646, 122, 91,
2823 858, -326, -326, 860, 80, 80, 406, 863, 865, 891,
2824 724, 637, 898, -298, 897, 1207, 901, 1034, 724, 900,
2825 225, -750, 225, 225, 933, 935, 225, 939, 225, 887,
2826 1222, 933, 91, 976, 91, 986, 734, 784, 784, 784,
2827 988, 80, 80, 997, 284, 647, 1003, 91, 991, 91,
2828 -326, 1037, 993, 122, -299, 1039, 80, 287, 1036, 1078,
2829 915, 915, 285, -750, 915, 1079, -300, 375, 122, 1110,
2830 288, 375, 949, 1116, 1117, 381, 381, 41, 42, 43,
2831 44, 80, 80, 1128, 406, 80, 906, 460, 1157, 747,
2832 80, -750, -750, 622, 218, 376, 903, 1156, 933, 376,
2833 1168, 91, 225, 225, 225, 225, 91, 225, 225, 1167,
2834 1163, 886, 91, 1175, 1256, 1176, 91, 462, 1221, 933,
2835 1276, 1235, 1257, 784, 623, 949, 375, 1177, 91, 288,
2836 925, 925, 1182, 1184, 690, 287, 1186, -301, -750, 1191,
2837 -750, 767, 767, -746, 904, 481, 767, 767, 1169, 483,
2838 1196, 933, 346, 933, 376, 1236, 724, 1230, 122, 1243,
2839 -746, 1251, 1252, -747, 692, 225, 1245, 91, 1260, 359,
2840 360, 91, 225, 91, 1262, 915, 1267, 1269, 1273, 915,
2841 470, 933, 1277, 1288, 391, 933, 374, 225, 967, 408,
2842 824, 915, 915, 915, 949, 1249, 889, 915, 915, 861,
2843 80, 983, 1007, 647, 1093, 1278, 1185, 1187, 367, 368,
2844 369, 370, 371, 372, 915, 969, 754, 767, 575, 1284,
2845 1130, 80, 1149, 80, 80, 1247, 1248, 80, 1129, 80,
2846 1229, 225, 428, 80, 1172, 80, 711, 421, 828, 830,
2847 328, 527, 873, 528, 529, 530, 531, 532, 80, 1237,
2848 80, 0, 1195, 828, 830, 1233, 0, 0, 767, 0,
2849 0, 925, 925, 0, 0, 925, 533, 91, 915, 527,
2850 843, 528, 529, 530, 531, 915, 0, 0, 0, 1216,
2851 534, 528, 529, 530, 531, 288, 0, 225, 0, 0,
2852 535, 0, 936, 937, 0, 0, 536, 537, 538, 941,
2853 942, 0, 80, 80, 80, 80, 80, 80, 80, 80,
2854 0, 0, 0, 80, 0, 0, 0, 80, 715, 0,
2855 0, 0, 539, 0, 716, 540, 0, 0, 675, 80,
2856 0, 0, 0, 677, 0, 0, 679, 1261, 1263, 681,
2857 0, 0, 915, 1268, 0, 1270, 1271, 970, 971, 0,
2858 973, 974, 0, 0, 527, 691, 528, 529, 530, 531,
2859 693, 0, 0, 915, 225, 0, 80, 288, 80, 0,
2860 775, 0, 80, 80, 80, 0, 925, 0, 0, 0,
2861 925, 0, 0, 1287, 1289, 1290, 1291, 0, 80, 0,
2862 0, 0, 925, 925, 925, 915, 1293, 915, 925, 925,
2863 0, 0, 527, 715, 528, 529, 530, 531, 532, 0,
2864 0, 0, 0, 1012, 91, 925, 91, 0, 0, 0,
2865 0, 725, 726, 0, 225, 915, 0, 533, 0, 915,
2866 0, 0, 80, 0, 225, 0, 91, 225, 346, 102,
2867 0, 102, 0, 346, 775, 775, 926, 926, 0, 0,
2868 0, 535, 1053, 102, 102, 359, 360, 764, 537, 538,
2869 359, 360, 315, 316, 317, 318, 319, 0, 80, 925,
2870 225, 0, 0, 0, 0, 0, 925, 0, 0, 0,
2871 0, 0, 288, 539, 1071, 0, 0, 0, 80, 0,
2872 102, 102, 365, 366, 367, 368, 369, 370, 371, 372,
2873 368, 369, 370, 371, 372, 102, 0, 0, 0, 0,
2874 0, 0, 0, 0, 0, 0, 0, 1050, 1052, 0,
2875 0, 0, 1055, 1057, 0, 0, 0, 0, 0, 0,
2876 102, 102, 0, 0, 102, 0, 0, 0, 0, 102,
2877 0, 0, 0, 925, 0, 0, 0, 0, 0, 0,
2878 0, 1050, 1052, 288, 1055, 1057, 0, 0, 0, 0,
2879 0, 0, 0, 0, 925, 80, 0, 0, 0, 0,
2880 0, 80, 0, 0, 0, 0, 0, 926, 926, 0,
2881 0, 926, 0, 0, 527, 0, 528, 529, 530, 531,
2882 532, 0, 0, 0, 0, 0, 925, 864, 925, 0,
2883 91, 0, 225, 91, 0, 0, 0, 0, 0, 533,
2884 0, 0, 0, 0, 0, 80, 0, 80, 0, 0,
2885 0, 0, 0, 0, 0, 80, 925, 0, 0, 0,
2886 925, 0, 0, 535, 1144, 80, 0, 80, 80, 536,
2887 537, 538, 0, 0, 0, 80, 80, 0, 0, 102,
2888 0, 0, 1144, 0, 0, 0, 527, 0, 528, 529,
2889 530, 531, 532, 0, 0, 539, 0, 0, 540, 0,
2890 102, 80, 102, 102, 0, 91, 102, 0, 102, 0,
2891 847, 533, 102, 0, 102, 91, 0, 91, 0, 0,
2892 0, 225, 926, 0, 0, 0, 926, 102, 0, 102,
2893 966, 0, 0, 0, 0, 535, 0, 0, 926, 926,
2894 926, 536, 537, 538, 926, 926, 0, 0, 975, 0,
2895 977, 0, 0, 775, 775, 0, 0, 0, 775, 775,
2896 0, 926, 91, 225, 0, 0, 0, 539, 0, 981,
2897 540, 0, 0, 0, 0, 0, 0, 985, 91, 0,
2898 0, 102, 102, 102, 102, 102, 102, 102, 102, 0,
2899 0, 0, 102, 0, 0, 0, 102, 0, 0, 0,
2900 527, 0, 528, 529, 530, 531, 532, 0, 102, 0,
2901 0, 0, 0, 0, 1086, 926, 0, 0, 91, 0,
2902 0, 91, 926, 0, 91, 533, 0, 0, 0, 775,
2903 0, 80, 0, 80, 80, 0, 0, 0, 0, 0,
2904 0, 0, 125, 0, 125, 102, 0, 102, 0, 535,
2905 0, 102, 102, 102, 0, 536, 537, 538, 0, 0,
2906 0, 0, 0, 0, 0, 0, 0, 102, 0, 0,
2907 775, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2908 0, 539, 0, 91, 540, 0, 0, 0, 0, 926,
2909 0, 91, 91, 125, 125, 0, 0, 291, 0, 0,
2910 0, 240, 0, 0, 0, 0, 80, 91, 0, 0,
2911 926, 102, 0, 0, 0, 1181, 80, 0, 80, 0,
2912 0, 0, 80, 0, 0, 291, 0, 0, 0, 0,
2913 0, 0, 0, 0, 0, 0, 0, 0, 397, 407,
2914 407, 0, 926, 0, 926, 0, 0, 102, 0, 0,
2915 0, 0, 1135, 0, 80, 80, 0, 0, 0, 80,
2916 80, 0, 91, 80, 80, 0, 0, 102, 0, 0,
2917 0, 0, 926, 0, 0, 0, 926, 91, 0, 80,
2918 23, 24, 25, 26, 0, 0, 225, 0, 0, 0,
2919 0, 0, 0, 1231, 0, 0, 32, 33, 34, 0,
2920 0, 0, 0, 0, 0, 0, 41, 42, 43, 44,
2921 45, 0, 0, 0, 0, 0, 0, 1188, 0, 80,
2922 0, 0, 80, 0, 0, 80, 225, 225, 0, 0,
2923 80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2924 0, 0, 0, 0, 102, 1201, 1202, 1203, 0, 0,
2925 102, 0, 125, 0, 0, 0, 0, 58, 59, 60,
2926 61, 62, 63, 64, 65, 66, 0, 91, 0, 0,
2927 0, 80, 0, 0, 0, 0, 0, 0, 0, 0,
2928 0, 0, 0, 0, 80, 125, 282, 125, 0, 0,
2929 927, 927, 80, 80, 102, 0, 102, 0, 0, 0,
2930 125, 0, 125, 0, 102, 0, 0, 0, 80, 0,
2931 0, 0, 0, 0, 102, 0, 102, 102, 0, 0,
2932 0, 0, 0, 291, 102, 102, 0, 0, 0, 0,
2933 0, 0, 0, 121, 0, 121, 0, 0, 346, 347,
2934 348, 349, 350, 351, 352, 353, 0, 355, 356, 0,
2935 102, 0, 0, 0, 125, 359, 360, 0, 0, 125,
2936 0, 0, 0, 80, 0, 125, 0, 0, 0, 125,
2937 0, 0, 0, 0, 0, 0, 0, 0, 80, 0,
2938 0, 125, 291, 345, 121, 121, 0, 80, 289, 0,
2939 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
2940 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2941 0, 0, 0, 0, 0, 0, 289, 0, 0, 0,
2942 125, 927, 927, 0, 125, 927, 125, 80, 80, 395,
2943 405, 405, 405, 0, 0, 346, 347, 348, 349, 350,
2944 351, 352, 353, 354, 355, 356, 357, 358, 87, 0,
2945 87, 0, 359, 360, 0, 0, 0, 0, 361, 0,
2946 0, 0, 0, 0, 0, 0, 0, 0, 80, 0,
2947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2948 102, 0, 102, 102, 0, 362, 0, 363, 364, 365,
2949 366, 367, 368, 369, 370, 371, 372, 0, 0, 87,
2950 87, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2951 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2952 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2953 0, 0, 0, 0, 0, 0, 927, 0, 291, 0,
2954 927, 0, 0, 121, 392, 0, 0, 0, 0, 0,
2955 0, 0, 927, 927, 927, 102, 0, 0, 927, 927,
2956 0, 0, 0, 0, 0, 102, 0, 102, 0, 0,
2957 0, 102, 0, 0, 0, 927, 121, 0, 121, 0,
2958 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2959 0, 121, 0, 121, 0, 0, 0, 0, 0, 0,
2960 0, 0, 0, 102, 102, 0, 0, 0, 102, 102,
2961 0, 0, 102, 102, 289, 0, 0, 928, 928, 0,
2962 291, 0, 0, 776, 0, 0, 0, 0, 102, 927,
2963 124, 0, 124, 0, 0, 0, 927, 0, 0, 0,
2964 0, 0, 0, 0, 0, 121, 0, 0, 0, 0,
2965 121, 0, 0, 0, 0, 0, 121, 0, 87, 0,
2966 121, 0, 0, 0, 0, 0, 0, 125, 102, 125,
2967 0, 102, 121, 289, 102, 0, 0, 0, 0, 102,
2968 0, 124, 124, 0, 0, 0, 929, 929, 0, 125,
2969 0, 87, 0, 87, 0, 0, 0, 776, 776, 0,
2970 0, 0, 0, 927, 0, 0, 87, 0, 87, 0,
2971 0, 121, 0, 0, 0, 121, 0, 121, 0, 0,
2972 102, 0, 0, 0, 927, 0, 0, 0, 0, 0,
2973 0, 0, 0, 102, 0, 291, 0, 0, 0, 0,
2974 0, 102, 102, 0, 855, 0, 0, 0, 928, 928,
2975 0, 0, 928, 0, 0, 0, 927, 102, 927, 0,
2976 87, 0, 0, 0, 0, 87, 23, 24, 25, 26,
2977 0, 87, 0, 0, 0, 87, 0, 0, 0, 0,
2978 0, 0, 32, 33, 34, 906, 927, 87, 0, 907,
2979 927, 0, 41, 42, 43, 44, 45, 0, 0, 0,
2980 0, 0, 0, 0, 0, 0, 291, 0, 0, 0,
2981 0, 121, 102, 0, 0, 0, 0, 929, 929, 0,
2982 0, 929, 0, 908, 909, 0, 87, 102, 0, 289,
2983 87, 910, 87, 0, 911, 0, 102, 912, 913, 0,
2984 124, 0, 0, 58, 59, 60, 61, 62, 63, 64,
2985 65, 66, 0, 125, 0, 0, 125, 0, 0, 0,
2986 0, 0, 0, 928, 0, 914, 0, 928, 0, 0,
2987 0, 0, 282, 124, 0, 124, 102, 102, 0, 928,
2988 928, 928, 0, 0, 0, 928, 928, 0, 124, 0,
2989 124, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2990 0, 0, 928, 0, 0, 0, 0, 0, 0, 0,
2991 0, 289, 0, 0, 0, 0, 0, 102, 0, 0,
2992 0, 0, 0, 0, 0, 0, 87, 0, 125, 0,
2993 0, 0, 929, 0, 0, 0, 929, 0, 125, 0,
2994 125, 0, 124, 0, 0, 0, 0, 124, 929, 929,
2995 929, 0, 0, 124, 929, 929, 928, 124, 121, 0,
2996 121, 0, 0, 928, 0, 0, 0, 0, 0, 124,
2997 0, 929, 0, 0, 0, 0, 776, 776, 0, 0,
2998 121, 776, 776, 0, 0, 125, 0, 0, 0, 0,
2999 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3000 0, 125, 930, 930, 0, 0, 0, 0, 124, 0,
3001 0, 0, 124, 0, 124, 0, 0, 0, 0, 0,
3002 0, 0, 0, 0, 0, 929, 289, 0, 0, 770,
3003 928, 0, 929, 0, 0, 0, 0, 1089, 0, 0,
3004 0, 125, 0, 0, 125, 0, 0, 125, 0, 0,
3005 0, 928, 776, 0, 0, 0, 0, 0, 0, 0,
3006 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3007 0, 0, 0, 87, 0, 87, 0, 0, 0, 0,
3008 0, 0, 0, 928, 0, 928, 0, 0, 0, 0,
3009 0, 0, 0, 776, 0, 87, 0, 289, 0, 929,
3010 0, 0, 0, 770, 770, 0, 125, 0, 124, 931,
3011 931, 0, 0, 928, 125, 125, 0, 928, 0, 0,
3012 929, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3013 125, 0, 0, 930, 930, 0, 0, 930, 407, 0,
3014 0, 0, 0, 0, 121, 0, 0, 121, 0, 0,
3015 0, 0, 929, -773, 929, 276, 0, 0, 0, 0,
3016 0, -773, -773, -773, 0, 0, -773, -773, -773, 0,
3017 -773, 0, 0, 0, 0, 0, 0, 0, -773, -773,
3018 -773, 0, 929, 0, 0, 125, 929, 0, 0, 0,
3019 -773, -773, 0, -773, -773, -773, -773, -773, 0, 0,
3020 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3021 0, 124, 0, 0, 0, 0, 407, 0, 0, 121,
3022 0, -773, 0, 0, 0, 0, 0, 0, 0, 121,
3023 0, 121, 0, 0, 0, 0, 0, 0, 0, 0,
3024 931, 931, 0, 0, 931, 0, 0, 0, 930, -773,
3025 -773, 0, 930, 0, 0, 124, 0, 124, 0, 87,
3026 0, 0, 87, 0, 930, 930, 930, 0, 0, 0,
3027 930, 930, 0, -773, 0, 0, 121, 124, 0, 0,
3028 0, 0, 0, 0, 0, 124, 124, 930, 0, 0,
3029 125, 0, 121, 0, 0, 0, -773, -773, 0, 0,
3030 0, 236, -773, 0, -773, 0, -773, 0, 0, 432,
3031 0, 0, 434, 435, 436, 0, 0, 0, 0, 0,
3032 0, 0, 0, 0, 0, 0, 0, 0, 1087, 0,
3033 0, 0, 121, 0, 87, 121, 0, 0, 121, 0,
3034 0, 930, 0, 0, 87, 0, 87, 0, 930, 0,
3035 0, 0, 0, 0, 0, 931, 0, 0, 0, 931,
3036 0, 0, 932, 932, 0, 0, 0, 0, 0, 0,
3037 0, 931, 931, 931, 0, 0, 0, 931, 931, 0,
3038 0, 0, 770, 770, 0, 0, 0, 770, 770, 0,
3039 0, 87, 0, 0, 931, 0, 0, 121, 0, 220,
3040 220, 0, 0, 0, 0, 121, 121, 87, 0, 0,
3041 0, 0, 0, 0, 0, 930, 0, 0, 0, 0,
3042 0, 121, 0, 0, 0, 0, 0, 0, 0, 405,
3043 0, 253, 256, 257, 258, 0, 930, 0, 220, 220,
3044 0, 124, 0, 1085, 124, 0, 0, 87, 931, 0,
3045 87, 308, 309, 87, 0, 931, 0, 0, 770, 0,
3046 0, 0, 0, 0, 0, 0, 0, 0, 930, 0,
3047 930, 0, 0, 0, 0, 0, 121, 0, 0, 0,
3048 0, 0, 0, 0, 0, 220, 0, 0, 0, 0,
3049 0, 121, 0, 932, 932, 0, 0, 932, 930, 770,
3050 0, 0, 930, 0, 0, 0, 0, 405, 0, 0,
3051 0, 0, 87, 0, 0, 0, 124, 0, 0, 0,
3052 87, 87, 931, 0, 0, 0, 124, 0, 124, 0,
3053 0, 0, 0, 0, 0, 0, 87, 0, 662, 664,
3054 0, 0, 0, 931, 0, 0, 0, 276, 0, 0,
3055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3056 0, 0, 0, 0, 124, 124, 0, 0, 0, 124,
3057 124, 0, 0, 124, 0, 931, 0, 931, 0, 0,
3058 0, 121, 0, 0, 664, 0, 0, 276, 0, 124,
3059 0, 87, 0, 220, 0, 0, 220, 220, 220, 0,
3060 308, 0, 0, 0, 0, 931, 87, 0, 932, 931,
3061 0, 0, 932, 0, 0, 0, 220, 0, 220, 220,
3062 0, 0, 0, 0, 932, 932, 932, 0, 0, 124,
3063 932, 932, 124, 0, 0, 124, 0, 0, 0, 0,
3064 124, 0, 0, 0, 0, 0, 0, 932, 0, 730,
3065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3066 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3067 0, 0, 0, 0, 0, 0, 760, 0, 0, 0,
3068 0, 124, 772, 0, 0, 0, 0, 0, 0, 0,
3069 0, 0, 0, 0, 124, 0, 87, 0, 0, 0,
3070 0, 932, 124, 124, 0, 0, 0, 0, 932, 0,
3071 0, 0, 0, 0, 0, 0, 0, 0, 124, 0,
3072 0, 0, 0, 0, 0, 0, 0, 0, 0, 585,
3073 586, 587, 588, 589, 0, 0, 590, 591, 592, 593,
3074 594, 595, 596, 597, 0, 599, 0, 0, 600, 601,
3075 602, 603, 604, 605, 606, 607, 608, 609, 0, 832,
3076 0, 220, 833, 0, 0, 0, 0, 0, 0, 0,
3077 0, 0, 0, 124, 0, 932, 0, 664, 0, 276,
3078 0, 0, 0, 0, 0, 0, 0, 0, 124, 0,
3079 0, 0, 0, 0, 0, 0, 932, 0, 0, 0,
3080 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3081 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3082 0, 0, 220, 220, 0, 0, 867, 220, 932, 0,
3083 932, 220, 0, 0, 0, 0, 0, 258, 0, 0,
3084 0, 0, 0, 0, 882, 0, 0, 0, 0, 0,
3085 0, 0, 684, 0, 0, 0, 0, 896, 932, 0,
3086 0, 0, 932, 0, 0, 0, 0, 0, 220, 0,
3087 0, 220, 0, 0, 0, 0, 0, 0, 124, 0,
3088 0, 0, 0, 220, 0, 664, 0, 0, 0, 0,
3089 0, 23, 24, 25, 26, 0, 0, 0, 0, 0,
3090 714, 0, 0, 0, 0, 956, 0, 32, 33, 34,
3091 906, 0, 0, 0, 907, 0, 0, 41, 42, 43,
3092 44, 45, 0, 0, 0, 346, -774, -774, -774, -774,
3093 351, 352, 0, 220, -774, -774, 0, 0, 0, 0,
3094 0, 0, 359, 360, 0, 741, 0, 0, 908, 909,
3095 750, 0, 0, 0, 0, 0, 910, 0, 0, 911,
3096 220, 0, 912, 913, 0, 1024, 771, 0, 58, 59,
3097 60, 61, 62, 63, 64, 65, 66, 363, 364, 365,
3098 366, 367, 368, 369, 370, 371, 372, 0, 0, 0,
3099 914, 0, 0, 0, 0, 0, 1009, 282, 0, 0,
3100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3101 0, 240, 0, 0, 0, 0, 0, 0, 0, 0,
3102 220, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3103 220, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3104 827, 827, 0, 220, 827, 0, 220, 0, 0, 0,
3105 0, 0, 0, 0, 1064, 827, 827, 0, 0, 0,
3106 0, 220, 0, 220, 0, 0, 0, 0, 23, 24,
3107 25, 26, 827, 0, 0, 276, 0, 0, 0, 0,
3108 0, 0, 0, 0, 32, 33, 34, 906, 0, 0,
3109 0, 907, 0, 1118, 41, 42, 43, 44, 45, 0,
3110 0, 0, 0, 0, 0, 0, 0, 1107, 0, 0,
3111 220, 0, 533, 0, 0, 0, 0, 0, 0, 0,
3112 0, 0, 0, 0, 0, 908, 909, 0, 220, 0,
3113 0, 0, 0, 910, 0, 0, 911, 0, 0, 912,
3114 913, 220, 1024, 537, 0, 58, 59, 1136, 61, 62,
3115 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3116 0, 0, 0, 0, 1153, 0, 0, 914, 0, 220,
3117 0, 0, 0, 0, 282, 0, 0, 0, 0, 0,
3118 0, 0, 0, 0, 0, 0, 0, 0, 0, 220,
3119 0, 0, 0, -773, 4, 0, 5, 6, 7, 8,
3120 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
3121 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3122 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3123 0, 0, 27, 0, 0, 0, 0, 0, 28, 29,
3124 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
3125 40, 1212, 41, 42, 43, 44, 45, 46, 47, 0,
3126 0, 0, 0, 0, 996, 0, 0, 0, 48, 49,
3127 0, 0, 0, 0, 0, 1002, 0, 0, 0, 0,
3128 220, 0, 0, 50, 51, 1013, 0, 220, 0, 0,
3129 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3130 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3131 65, 66, 0, 0, 0, 0, 0, 0, 1048, 827,
3132 827, 0, 0, 0, 827, 827, 0, 0, 0, 0,
3133 0, 0, 67, 68, 69, 0, 0, 0, 220, 0,
3134 0, 0, 0, 0, -773, 0, -773, 0, 0, 0,
3135 0, 0, 0, 827, 827, 0, 827, 827, 0, 220,
3136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3137 0, 0, 0, 0, 0, 0, 0, 0, 0, -750,
3138 0, 0, 0, 0, 0, 0, 0, -750, -750, -750,
3139 0, 220, -750, -750, -750, 827, -750, 0, 0, 0,
3140 0, 0, 0, 0, -750, -750, -750, -750, -750, 0,
3141 0, 0, 0, 0, 0, 0, -750, -750, 0, -750,
3142 -750, -750, -750, -750, 0, 0, 0, 0, 0, 0,
3143 0, 0, 0, 0, 0, 0, 827, 0, 0, 0,
3144 0, 0, 0, 0, 0, 0, 0, -750, 220, 0,
3145 0, 0, 0, 0, 827, 0, -750, -750, -750, -750,
3146 -750, -750, -750, -750, -750, -750, -750, -750, -750, 0,
3147 0, 0, 0, -750, -750, -750, -750, 0, 835, -750,
3148 0, 0, 0, 0, 0, -750, 0, 0, 0, 0,
3149 0, 0, 0, 0, 0, 0, 0, 0, 0, -750,
3150 0, 0, -750, 0, 0, -124, -750, -750, -750, -750,
3151 -750, -750, -750, -750, -750, -750, -750, -750, 0, 0,
3152 0, 0, -750, -750, -750, -750, 0, 0, -750, -750,
3153 -750, -641, -750, 0, 0, 220, 0, 0, 0, -641,
3154 -641, -641, 0, 0, -641, -641, -641, 0, -641, 0,
3155 0, 0, 220, 902, 0, 0, -641, 0, -641, -641,
3156 -641, 0, 0, 0, 0, 0, 0, 0, -641, -641,
3157 0, -641, -641, -641, -641, -641, 0, 0, 0, 0,
3158 0, 0, 0, 0, 0, 0, 346, 347, 348, 349,
3159 350, 351, 352, 353, 354, 355, 356, 357, 358, -641,
3160 0, 0, 0, 359, 360, 0, 0, 0, -641, -641,
3161 -641, -641, -641, -641, -641, -641, -641, -641, -641, -641,
3162 -641, 0, 0, 0, 0, -641, -641, -641, -641, 0,
3163 -641, -641, 0, 0, 0, 0, 362, -641, 363, 364,
3164 365, 366, 367, 368, 369, 370, 371, 372, 0, 0,
3165 0, -641, 0, 0, -641, -271, 0, -641, -641, -641,
3166 -641, -641, -641, -641, -641, -641, -641, -641, -641, -641,
3167 0, 0, 0, 0, 0, -641, -641, -641, -644, 0,
3168 -641, -641, -641, 0, -641, 0, -644, -644, -644, 0,
3169 0, -644, -644, -644, 0, -644, 0, 0, 0, 0,
3170 881, 0, 0, -644, 0, -644, -644, -644, 0, 0,
3171 0, 0, 0, 0, 0, -644, -644, 0, -644, -644,
3172 -644, -644, -644, 0, 0, 0, 0, 0, 0, 0,
3173 0, 0, 0, 346, 347, 348, 349, 350, 351, 352,
3174 353, 354, 355, 356, 357, 358, -644, 0, 0, 0,
3175 359, 360, 0, 0, 0, -644, -644, -644, -644, -644,
3176 -644, -644, -644, -644, -644, -644, -644, -644, 0, 0,
3177 0, 0, -644, -644, -644, -644, 0, -644, -644, 0,
3178 0, 0, 0, 362, -644, 363, 364, 365, 366, 367,
3179 368, 369, 370, 371, 372, 0, 0, 0, -644, 0,
3180 0, -644, 0, 0, -644, -644, -644, -644, -644, -644,
3181 -644, -644, -644, -644, -644, -644, -644, 0, 0, 0,
3182 0, 0, -644, -644, -644, -751, 0, -644, -644, -644,
3183 0, -644, 0, -751, -751, -751, 0, 0, -751, -751,
3184 -751, 0, -751, 0, 0, 0, 0, 892, 0, 0,
3185 -751, -751, -751, -751, -751, 0, 0, 0, 0, 0,
3186 0, 0, -751, -751, 0, -751, -751, -751, -751, -751,
3187 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3188 346, 347, 348, 349, 350, 351, 352, 353, 354, 355,
3189 356, 357, 358, -751, 0, 0, 0, 359, 360, 0,
3190 0, 0, -751, -751, -751, -751, -751, -751, -751, -751,
3191 -751, -751, -751, -751, -751, 0, 0, 0, 0, -751,
3192 -751, -751, -751, 0, 0, -751, 0, 0, 0, 0,
3193 362, -751, 363, 364, 365, 366, 367, 368, 369, 370,
3194 371, 372, 0, 0, 0, -751, 0, 0, -751, 0,
3195 0, 0, -751, -751, -751, -751, -751, -751, -751, -751,
3196 -751, -751, -751, -751, 0, 0, 0, 0, -751, -751,
3197 -751, -751, -752, 0, -751, -751, -751, 0, -751, 0,
3198 -752, -752, -752, 0, 0, -752, -752, -752, 0, -752,
3199 0, 0, 0, 0, 902, 0, 0, -752, -752, -752,
3200 -752, -752, 0, 0, 0, 0, 0, 0, 0, -752,
3201 -752, 0, -752, -752, -752, -752, -752, 0, 0, 0,
3202 0, 0, 0, 0, 0, 0, 0, 346, 347, 348,
3203 349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
3204 -752, 0, 0, 0, 359, 360, 0, 0, 0, -752,
3205 -752, -752, -752, -752, -752, -752, -752, -752, -752, -752,
3206 -752, -752, 0, 0, 0, 0, -752, -752, -752, -752,
3207 0, 0, -752, 0, 0, 0, 0, 362, -752, 363,
3208 364, 365, 366, 367, 368, 369, 370, 371, 372, 0,
3209 0, 0, -752, 0, 0, -752, 0, 0, 0, -752,
3210 -752, -752, -752, -752, -752, -752, -752, -752, -752, -752,
3211 -752, 0, 0, 0, 0, -752, -752, -752, -752, -325,
3212 0, -752, -752, -752, 0, -752, 0, -325, -325, -325,
3213 0, 0, -325, -325, -325, 0, -325, 0, 0, 0,
3214 0, 0, 0, 0, -325, 0, -325, -325, -325, 0,
3215 0, 0, 0, 0, 0, 0, -325, -325, 0, -325,
3216 -325, -325, -325, -325, 0, 0, 0, 0, 0, 0,
3217 0, 0, 0, 0, 346, 347, 348, 349, 350, 351,
3218 352, 353, 354, 355, 356, 357, 358, -325, 0, 0,
3219 0, 359, 360, 0, 0, 0, -325, -325, -325, -325,
3220 -325, -325, -325, -325, -325, -325, -325, -325, -325, 0,
3221 0, 0, 0, -325, -325, -325, -325, 0, 836, -325,
3222 0, 0, 0, 0, 362, -325, 363, 364, 365, 366,
3223 367, 368, 369, 370, 371, 372, 0, 0, 0, -325,
3224 0, 0, -325, 0, 0, -126, -325, -325, -325, -325,
3225 -325, -325, -325, -325, -325, -325, -325, -325, 0, 0,
3226 0, 0, 0, -325, -325, -325, -460, 0, -325, -325,
3227 -325, 0, -325, 0, -460, -460, -460, 0, 0, -460,
3228 -460, -460, 0, -460, 0, 0, 0, 0, 0, 0,
3229 0, -460, -460, -460, -460, 0, 0, 0, 0, 0,
3230 0, 0, 0, -460, -460, 0, -460, -460, -460, -460,
3231 -460, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3232 0, 346, 347, 348, 349, 350, 351, 352, 353, 354,
3233 355, 356, -774, -774, -460, 0, 0, 0, 359, 360,
3234 0, 0, 0, -460, -460, -460, -460, -460, -460, -460,
3235 -460, -460, -460, -460, -460, -460, 0, 0, 0, 0,
3236 -460, -460, -460, -460, 0, 0, -460, 0, 0, 0,
3237 0, 0, -460, 363, 364, 365, 366, 367, 368, 369,
3238 370, 371, 372, 0, 0, 0, -460, 0, 0, 0,
3239 0, 0, 0, -460, 0, -460, -460, -460, -460, -460,
3240 -460, -460, -460, -460, -460, 0, 0, 0, 0, -460,
3241 -460, -460, -460, -317, 236, -460, -460, -460, 0, -460,
3242 0, -317, -317, -317, 0, 0, -317, -317, -317, 0,
3243 -317, 0, 0, 0, 0, 0, 0, 0, -317, 0,
3244 -317, -317, -317, 0, 0, 0, 0, 0, 0, 0,
3245 -317, -317, 0, -317, -317, -317, -317, -317, 0, 0,
3246 0, 0, 0, 0, 0, 0, 0, 0, 346, 347,
3247 348, 349, 350, 351, 352, 0, 0, 355, 356, 0,
3248 0, -317, 0, 0, 0, 359, 360, 0, 0, 0,
3249 -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
3250 -317, -317, -317, 0, 0, 0, 0, -317, -317, -317,
3251 -317, 0, 0, -317, 0, 0, 0, 0, 0, -317,
3252 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
3253 0, 0, 0, -317, 0, 0, -317, 0, 0, 0,
3254 -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
3255 -317, -317, 0, 0, 0, 0, 0, -317, -317, -317,
3256 -773, 0, -317, -317, -317, 0, -317, 0, -773, -773,
3257 -773, 0, 0, -773, -773, -773, 0, -773, 0, 0,
3258 0, 0, 0, 0, 0, -773, -773, -773, -773, 0,
3259 0, 0, 0, 0, 0, 0, 0, -773, -773, 0,
3260 -773, -773, -773, -773, -773, 0, 0, 0, 0, 0,
3261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3262 0, 0, 0, 0, 0, 0, 0, 0, -773, 0,
3263 0, 0, 0, 0, 0, 0, 0, -773, -773, -773,
3264 -773, -773, -773, -773, -773, -773, -773, -773, -773, -773,
3265 0, 0, 0, 0, -773, -773, -773, -773, 0, 0,
3266 -773, 0, 0, 0, 0, 0, -773, 0, 0, 0,
3267 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3268 -773, 0, 0, 0, 0, 0, 0, -773, 0, -773,
3269 -773, -773, -773, -773, -773, -773, -773, -773, -773, 0,
3270 0, 0, 0, -773, -773, -773, -773, -332, 236, -773,
3271 -773, -773, 0, -773, 0, -332, -332, -332, 0, 0,
3272 -332, -332, -332, 0, -332, 0, 0, 0, 0, 0,
3273 0, 0, -332, 0, -332, -332, 0, 0, 0, 0,
3274 0, 0, 0, 0, -332, -332, 0, -332, -332, -332,
3275 -332, -332, 0, 0, 0, 0, 0, 0, 0, 0,
3276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3277 0, 0, 0, 0, 0, -332, 0, 0, 0, 0,
3278 0, 0, 0, 0, -332, -332, -332, -332, -332, -332,
3279 -332, -332, -332, -332, -332, -332, -332, 0, 0, 0,
3280 0, -332, -332, -332, -332, 0, 0, -332, 0, 0,
3281 0, 0, 0, -332, 0, 0, 0, 0, 0, 0,
3282 0, 0, 0, 0, 0, 0, 0, -332, 0, 0,
3283 0, 0, 0, 0, -332, 0, -332, -332, -332, -332,
3284 -332, -332, -332, -332, -332, -332, 0, 0, 0, 0,
3285 0, -332, -332, -332, -750, 233, -332, -332, -332, 0,
3286 -332, 0, -750, -750, -750, 0, 0, 0, -750, -750,
3287 0, -750, 0, 0, 0, 0, 0, 0, 0, -750,
3288 -750, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3289 0, -750, -750, 0, -750, -750, -750, -750, -750, 0,
3290 0, 0, 0, 0, 0, 0, 346, 347, 348, 349,
3291 350, 351, 352, 353, 354, 355, 356, 357, 358, 0,
3292 0, 0, -750, 359, 360, 0, 0, 0, 0, 0,
3293 0, -750, -750, -750, -750, -750, -750, -750, -750, -750,
3294 -750, -750, -750, -750, 0, 0, 0, 0, -750, -750,
3295 -750, -750, 0, 780, -750, 0, 362, 0, 363, 364,
3296 365, 366, 367, 368, 369, 370, 371, 372, 0, 0,
3297 0, 0, 0, 0, -750, 0, 0, 0, 0, 0,
3298 -124, -750, 240, -750, -750, -750, -750, -750, -750, -750,
3299 -750, -750, -750, 0, 0, 0, 0, -750, -750, -750,
3300 -115, -750, 0, -750, 0, -750, 0, -750, 0, -750,
3301 -750, -750, 0, 0, 0, -750, -750, 0, -750, 0,
3302 0, 0, 0, 0, 0, 0, -750, -750, 0, 0,
3303 0, 0, 0, 0, 0, 0, 0, 0, -750, -750,
3304 0, -750, -750, -750, -750, -750, 0, 0, 0, 0,
3305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3306 0, 0, 0, 0, 0, 0, 0, 0, 0, -750,
3307 0, 0, 0, 0, 0, 0, 0, 0, -750, -750,
3308 -750, -750, -750, -750, -750, -750, -750, -750, -750, -750,
3309 -750, 0, 0, 0, 0, -750, -750, -750, -750, 0,
3310 780, -750, 0, 0, 0, 0, 0, 0, 0, 0,
3311 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3312 0, -750, 0, 0, 0, 0, 0, -124, -750, 0,
3313 -750, -750, -750, -750, -750, -750, -750, -750, -750, -750,
3314 0, 0, 0, 0, -750, -750, -750, -750, -325, 0,
3315 -750, 0, -750, 0, -750, 0, -325, -325, -325, 0,
3316 0, 0, -325, -325, 0, -325, 0, 0, 0, 0,
3317 0, 0, 0, -325, 0, 0, 0, 0, 0, 0,
3318 0, 0, 0, 0, 0, -325, -325, 0, -325, -325,
3319 -325, -325, -325, 0, 0, 0, 0, 0, 0, 0,
3320 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3321 0, 0, 0, 0, 0, 0, -325, 0, 0, 0,
3322 0, 0, 0, 0, 0, -325, -325, -325, -325, -325,
3323 -325, -325, -325, -325, -325, -325, -325, -325, 0, 0,
3324 0, 0, -325, -325, -325, -325, 0, 781, -325, 0,
3325 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3326 0, 0, 0, 0, 0, 0, 0, 0, -325, 0,
3327 0, 0, 0, 0, -126, -325, 0, -325, -325, -325,
3328 -325, -325, -325, -325, -325, -325, -325, 0, 0, 0,
3329 0, 0, -325, -325, -117, -325, 0, -325, 0, -325,
3330 0, -325, 0, -325, -325, -325, 0, 0, 0, -325,
3331 -325, 0, -325, 0, 0, 0, 0, 0, 0, 0,
3332 -325, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3333 0, 0, -325, -325, 0, -325, -325, -325, -325, -325,
3334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3336 0, 0, 0, -325, 0, 0, 0, 0, 0, 0,
3337 0, 0, -325, -325, -325, -325, -325, -325, -325, -325,
3338 -325, -325, -325, -325, -325, 0, 0, 0, 0, -325,
3339 -325, -325, -325, 0, 781, -325, 0, 0, 0, 0,
3340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3341 0, 0, 0, 0, 0, -325, 0, 0, 0, 0,
3342 0, -126, -325, 0, -325, -325, -325, -325, -325, -325,
3343 -325, -325, -325, -325, 0, 0, 0, 0, 0, -325,
3344 -325, -325, 0, 0, -325, 0, -325, 260, -325, 5,
3345 6, 7, 8, 9, -773, -773, -773, 10, 11, 0,
3346 0, -773, 12, 0, 13, 14, 15, 16, 17, 18,
3347 19, 0, 0, 0, 0, 0, 20, 21, 22, 23,
3348 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3349 0, 28, 29, 261, 31, 32, 33, 34, 35, 36,
3350 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3351 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3352 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3353 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3354 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3355 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3356 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3358 0, 0, 0, 0, 0, 67, 68, 69, 0, 0,
3359 0, 0, 0, 0, 0, 0, 0, -773, 260, -773,
3360 5, 6, 7, 8, 9, 0, 0, -773, 10, 11,
3361 0, -773, -773, 12, 0, 13, 14, 15, 16, 17,
3362 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3363 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
3364 0, 0, 28, 29, 261, 31, 32, 33, 34, 35,
3365 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3366 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3367 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3368 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3369 0, 0, 0, 0, 0, 52, 0, 0, 53, 54,
3370 0, 55, 56, 0, 57, 0, 0, 58, 59, 60,
3371 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3372 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3373 0, 0, 0, 0, 0, 0, 67, 68, 69, 0,
3374 0, 0, 0, 0, 0, 0, 0, 0, -773, 260,
3375 -773, 5, 6, 7, 8, 9, 0, 0, -773, 10,
3376 11, 0, 0, -773, 12, -773, 13, 14, 15, 16,
3377 17, 18, 19, 0, 0, 0, 0, 0, 20, 21,
3378 22, 23, 24, 25, 26, 0, 0, 27, 0, 0,
3379 0, 0, 0, 28, 29, 261, 31, 32, 33, 34,
3380 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
3381 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3382 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3383 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3384 0, 0, 0, 0, 0, 0, 52, 0, 0, 53,
3385 54, 0, 55, 56, 0, 57, 0, 0, 58, 59,
3386 60, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3388 0, 0, 0, 0, 0, 0, 0, 67, 68, 69,
3389 0, 0, 0, 0, 0, 0, 0, 0, 0, -773,
3390 260, -773, 5, 6, 7, 8, 9, 0, 0, -773,
3391 10, 11, 0, 0, -773, 12, 0, 13, 14, 15,
3392 16, 17, 18, 19, -773, 0, 0, 0, 0, 20,
3393 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
3394 0, 0, 0, 0, 28, 29, 261, 31, 32, 33,
3395 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3396 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3397 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3398 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3399 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3400 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3401 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3402 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3403 0, 0, 0, 0, 0, 0, 0, 0, 67, 68,
3404 69, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3405 -773, 260, -773, 5, 6, 7, 8, 9, 0, 0,
3406 -773, 10, 11, 0, 0, -773, 12, 0, 13, 14,
3407 15, 16, 17, 18, 19, 0, 0, 0, 0, 0,
3408 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3409 0, 0, 0, 0, 0, 28, 29, 261, 31, 32,
3410 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3411 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3412 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3414 50, 51, 0, 0, 0, 0, 0, 0, 52, 0,
3415 0, 53, 54, 0, 55, 56, 0, 57, 0, 0,
3416 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3417 0, 0, 0, 0, 0, 0, 0, 260, 0, 5,
3418 6, 7, 8, 9, 0, -773, -773, 10, 11, 67,
3419 68, 69, 12, 0, 13, 14, 15, 16, 17, 18,
3420 19, -773, 0, -773, 0, 0, 20, 21, 22, 23,
3421 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3422 0, 28, 29, 261, 31, 32, 33, 34, 35, 36,
3423 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3424 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3425 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3426 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3427 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3428 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3429 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3430 0, 0, 0, 260, 0, 5, 6, 7, 8, 9,
3431 0, 0, 0, 10, 11, 67, 68, 69, 12, 0,
3432 13, 14, 15, 16, 17, 18, 19, -773, 0, -773,
3433 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3434 0, 27, 0, 0, 0, 0, 0, 28, 29, 261,
3435 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3436 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3437 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3439 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3440 52, 0, 0, 262, 54, 0, 55, 56, 0, 57,
3441 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3442 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3443 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3444 0, 67, 68, 69, 0, 0, 0, 0, 0, 0,
3445 0, -773, 0, -773, 260, -773, 5, 6, 7, 8,
3446 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
3447 0, 13, 14, 15, 16, 17, 18, 19, 0, 0,
3448 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
3449 0, 0, 27, 0, 0, 0, 0, 0, 28, 29,
3450 261, 31, 32, 33, 34, 35, 36, 37, 38, 39,
3451 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3452 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3454 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3455 0, 52, 0, 0, 53, 54, 0, 55, 56, 0,
3456 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3457 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3458 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3459 0, 0, 67, 68, 69, 0, 0, 0, 0, 0,
3460 0, 0, -773, 0, -773, 4, -773, 5, 6, 7,
3461 8, 9, 0, 0, 0, 10, 11, 0, 0, 0,
3462 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3463 0, 0, 0, 0, 20, 21, 22, 23, 24, 25,
3464 26, 0, 0, 27, 0, 0, 0, 0, 0, 28,
3465 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
3466 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3467 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3468 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3469 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3470 0, 0, 52, 0, 0, 53, 54, 0, 55, 56,
3471 0, 57, 0, 0, 58, 59, 60, 61, 62, 63,
3472 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3474 0, 0, 0, 67, 68, 69, 0, 0, -773, 0,
3475 0, 0, 0, 0, 0, -773, 260, -773, 5, 6,
3476 7, 8, 9, 0, 0, 0, 10, 11, 0, 0,
3477 0, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3478 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3479 25, 26, 0, 0, 27, 0, 0, 0, 0, 0,
3480 28, 29, 261, 31, 32, 33, 34, 35, 36, 37,
3481 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3482 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3483 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3484 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3485 0, 0, 0, 52, 0, 0, 53, 54, 0, 55,
3486 56, 0, 57, 0, 0, 58, 59, 60, 61, 62,
3487 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3488 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3489 0, 0, 0, 0, 67, 68, 69, 0, 0, -773,
3490 0, 0, 0, 0, 0, 0, -773, 260, -773, 5,
3491 6, 7, 8, 9, 0, 0, -773, 10, 11, 0,
3492 0, 0, 12, 0, 13, 14, 15, 16, 17, 18,
3493 19, 0, 0, 0, 0, 0, 20, 21, 22, 23,
3494 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3495 0, 28, 29, 261, 31, 32, 33, 34, 35, 36,
3496 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3497 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3498 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3499 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3500 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3501 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3502 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3503 0, 0, 0, 260, 0, 5, 6, 7, 8, 9,
3504 0, 0, 0, 10, 11, 67, 68, 69, 12, 0,
3505 13, 14, 15, 16, 17, 18, 19, -773, 0, -773,
3506 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3507 0, 27, 0, 0, 0, 0, 0, 28, 29, 261,
3508 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3509 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3510 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3511 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3512 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3513 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3514 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3515 66, 0, -773, 0, 0, 0, 0, 0, 0, 0,
3516 0, 5, 6, 7, 0, 9, 0, 0, 0, 10,
3517 11, 67, 68, 69, 12, 0, 13, 14, 15, 16,
3518 17, 18, 19, -773, 0, -773, 0, 0, 20, 21,
3519 22, 23, 24, 25, 26, 0, 0, 209, 0, 0,
3520 0, 0, 0, 0, 29, 0, 0, 32, 33, 34,
3521 35, 36, 37, 38, 39, 40, 210, 41, 42, 43,
3522 44, 45, 46, 47, 0, 0, 0, 0, 0, 0,
3523 0, 0, 0, 48, 49, 0, 0, 0, 0, 0,
3524 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
3525 0, 0, 0, 0, 0, 0, 211, 0, 0, 212,
3526 54, 0, 55, 56, 0, 213, 214, 215, 58, 59,
3527 216, 61, 62, 63, 64, 65, 66, 0, 0, 0,
3528 0, 0, 0, 0, 0, 0, 0, 5, 6, 7,
3529 0, 9, 0, 0, 0, 10, 11, 67, 217, 69,
3530 12, 0, 13, 14, 15, 16, 17, 18, 19, 0,
3531 0, 240, 0, 0, 20, 21, 22, 23, 24, 25,
3532 26, 0, 0, 27, 0, 0, 0, 0, 0, 0,
3533 29, 0, 0, 32, 33, 34, 35, 36, 37, 38,
3534 39, 40, 0, 41, 42, 43, 44, 45, 46, 47,
3535 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
3536 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3537 0, 0, 0, 0, 50, 51, 0, 0, 0, 0,
3538 0, 0, 211, 0, 0, 212, 54, 0, 55, 56,
3539 0, 0, 0, 0, 58, 59, 60, 61, 62, 63,
3540 64, 65, 66, 0, 0, 0, 0, 0, 0, 0,
3541 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
3542 0, 10, 11, 67, 68, 69, 12, 0, 13, 14,
3543 15, 16, 17, 18, 19, 310, 0, 311, 0, 0,
3544 20, 21, 22, 23, 24, 25, 26, 0, 0, 27,
3545 0, 0, 0, 0, 0, 0, 29, 0, 0, 32,
3546 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3547 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3548 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
3549 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3550 50, 51, 0, 0, 0, 0, 0, 0, 211, 0,
3551 0, 212, 54, 0, 55, 56, 0, 0, 0, 0,
3552 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3553 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
3554 6, 7, 8, 9, 0, 0, 0, 10, 11, 67,
3555 68, 69, 12, 0, 13, 14, 15, 16, 17, 18,
3556 19, 0, 0, 240, 0, 0, 20, 21, 22, 23,
3557 24, 25, 26, 0, 0, 27, 0, 0, 0, 0,
3558 0, 28, 29, 30, 31, 32, 33, 34, 35, 36,
3559 37, 38, 39, 40, 0, 41, 42, 43, 44, 45,
3560 46, 47, 0, 0, 0, 0, 0, 0, 0, 0,
3561 0, 48, 49, 0, 0, 0, 0, 0, 0, 0,
3562 0, 0, 0, 0, 0, 0, 50, 51, 0, 0,
3563 0, 0, 0, 0, 52, 0, 0, 53, 54, 0,
3564 55, 56, 0, 57, 0, 0, 58, 59, 60, 61,
3565 62, 63, 64, 65, 66, 0, 0, 0, 0, 0,
3566 0, 0, 0, 0, 0, 5, 6, 7, 8, 9,
3567 0, 0, 0, 10, 11, 67, 68, 69, 12, 0,
3568 13, 14, 15, 16, 17, 18, 19, 518, 0, 0,
3569 0, 0, 20, 21, 22, 23, 24, 25, 26, 0,
3570 0, 27, 0, 0, 0, 0, 0, 28, 29, 261,
3571 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
3572 0, 41, 42, 43, 44, 45, 46, 47, 0, 0,
3573 0, 0, 0, 0, 0, 0, 0, 48, 49, 0,
3574 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3575 0, 0, 50, 51, 0, 0, 0, 0, 0, 0,
3576 52, 0, 0, 53, 54, 0, 55, 56, 0, 57,
3577 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3578 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3580 0, 67, 68, 69, 0, 0, 0, 0, 0, 0,
3581 0, 0, 0, 518, 129, 130, 131, 132, 133, 134,
3582 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
3583 145, 146, 147, 148, 149, 150, 151, 152, 0, 0,
3584 0, 153, 154, 155, 409, 410, 411, 412, 160, 161,
3585 162, 0, 0, 0, 0, 0, 163, 164, 165, 166,
3586 413, 414, 415, 416, 171, 37, 38, 417, 40, 0,
3587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3588 0, 0, 0, 0, 0, 0, 173, 174, 175, 176,
3589 177, 178, 179, 180, 181, 0, 0, 182, 183, 0,
3590 0, 0, 0, 184, 185, 186, 187, 0, 0, 0,
3591 0, 0, 0, 0, 0, 0, 0, 0, 188, 189,
3592 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3594 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3595 0, 200, 201, 0, 0, 0, 0, 0, 202, 418,
3596 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
3597 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
3598 149, 150, 151, 152, 0, 0, 0, 153, 154, 155,
3599 156, 157, 158, 159, 160, 161, 162, 0, 0, 0,
3600 0, 0, 163, 164, 165, 166, 167, 168, 169, 170,
3601 171, 293, 294, 172, 295, 0, 0, 0, 0, 0,
3602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3603 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
3604 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
3605 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
3606 0, 0, 0, 0, 188, 189, 0, 0, 0, 0,
3607 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3608 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
3609 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
3610 0, 0, 0, 0, 202, 129, 130, 131, 132, 133,
3611 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
3612 144, 145, 146, 147, 148, 149, 150, 151, 152, 0,
3613 0, 0, 153, 154, 155, 156, 157, 158, 159, 160,
3614 161, 162, 0, 0, 0, 0, 0, 163, 164, 165,
3615 166, 167, 168, 169, 170, 171, 242, 0, 172, 0,
3616 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3617 0, 0, 0, 0, 0, 0, 0, 173, 174, 175,
3618 176, 177, 178, 179, 180, 181, 0, 0, 182, 183,
3619 0, 0, 0, 0, 184, 185, 186, 187, 0, 0,
3620 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
3621 189, 0, 0, 59, 0, 0, 0, 0, 0, 0,
3622 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3623 0, 190, 191, 192, 193, 194, 195, 196, 197, 198,
3624 199, 0, 200, 201, 0, 0, 0, 0, 0, 202,
3625 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
3626 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
3627 149, 150, 151, 152, 0, 0, 0, 153, 154, 155,
3628 156, 157, 158, 159, 160, 161, 162, 0, 0, 0,
3629 0, 0, 163, 164, 165, 166, 167, 168, 169, 170,
3630 171, 0, 0, 172, 0, 0, 0, 0, 0, 0,
3631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3632 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
3633 181, 0, 0, 182, 183, 0, 0, 0, 0, 184,
3634 185, 186, 187, 0, 0, 0, 0, 0, 0, 0,
3635 0, 0, 0, 0, 188, 189, 0, 0, 59, 0,
3636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3637 0, 0, 0, 0, 0, 0, 190, 191, 192, 193,
3638 194, 195, 196, 197, 198, 199, 0, 200, 201, 0,
3639 0, 0, 0, 0, 202, 129, 130, 131, 132, 133,
3640 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
3641 144, 145, 146, 147, 148, 149, 150, 151, 152, 0,
3642 0, 0, 153, 154, 155, 156, 157, 158, 159, 160,
3643 161, 162, 0, 0, 0, 0, 0, 163, 164, 165,
3644 166, 167, 168, 169, 170, 171, 0, 0, 172, 0,
3645 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3646 0, 0, 0, 0, 0, 0, 0, 173, 174, 175,
3647 176, 177, 178, 179, 180, 181, 0, 0, 182, 183,
3648 0, 0, 0, 0, 184, 185, 186, 187, 0, 0,
3649 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
3650 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3651 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3652 0, 190, 191, 192, 193, 194, 195, 196, 197, 198,
3653 199, 0, 200, 201, 5, 6, 7, 0, 9, 202,
3654 0, 0, 10, 11, 0, 0, 0, 12, 0, 13,
3655 14, 15, 248, 249, 18, 19, 0, 0, 0, 0,
3656 0, 20, 250, 251, 23, 24, 25, 26, 0, 0,
3657 209, 0, 0, 0, 0, 0, 0, 280, 0, 0,
3658 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3659 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3660 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3661 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3662 0, 0, 0, 0, 0, 0, 0, 0, 0, 281,
3663 0, 0, 212, 54, 0, 55, 56, 0, 0, 0,
3664 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3665 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3666 0, 0, 0, 5, 6, 7, 0, 9, 0, 0,
3667 282, 10, 11, 0, 0, 0, 12, 283, 13, 14,
3668 15, 248, 249, 18, 19, 0, 0, 0, 0, 0,
3669 20, 250, 251, 23, 24, 25, 26, 0, 0, 209,
3670 0, 0, 0, 0, 0, 0, 280, 0, 0, 32,
3671 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
3672 42, 43, 44, 45, 46, 47, 0, 0, 0, 0,
3673 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3674 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3675 0, 0, 0, 0, 0, 0, 0, 0, 281, 0,
3676 0, 212, 54, 0, 55, 56, 0, 0, 0, 0,
3677 58, 59, 60, 61, 62, 63, 64, 65, 66, 0,
3678 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3679 0, 0, 5, 6, 7, 8, 9, 0, 0, 282,
3680 10, 11, 0, 0, 0, 12, 580, 13, 14, 15,
3681 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
3682 21, 22, 23, 24, 25, 26, 0, 0, 27, 0,
3683 0, 0, 0, 0, 28, 29, 30, 31, 32, 33,
3684 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3685 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3686 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3687 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3688 51, 0, 0, 0, 0, 0, 0, 52, 0, 0,
3689 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3690 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3691 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3692 7, 0, 9, 0, 0, 0, 10, 11, 67, 68,
3693 69, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3694 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3695 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3696 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3697 38, 39, 40, 210, 41, 42, 43, 44, 45, 46,
3698 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3699 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3700 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3701 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3702 56, 0, 213, 214, 215, 58, 59, 216, 61, 62,
3703 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3704 0, 0, 0, 0, 5, 6, 7, 8, 9, 0,
3705 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3706 14, 15, 16, 17, 18, 19, 0, 0, 0, 0,
3707 0, 20, 21, 22, 23, 24, 25, 26, 0, 0,
3708 27, 0, 0, 0, 0, 0, 28, 29, 0, 31,
3709 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3710 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3711 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3712 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3713 0, 50, 51, 0, 0, 0, 0, 0, 0, 52,
3714 0, 0, 53, 54, 0, 55, 56, 0, 57, 0,
3715 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3716 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3717 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3718 67, 68, 69, 12, 0, 13, 14, 15, 16, 17,
3719 18, 19, 0, 0, 0, 0, 0, 20, 21, 22,
3720 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3721 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3722 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
3723 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3724 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3725 0, 0, 0, 0, 0, 0, 0, 50, 454, 0,
3726 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
3727 0, 55, 56, 0, 213, 214, 215, 58, 59, 216,
3728 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3729 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3730 9, 0, 0, 0, 10, 11, 67, 217, 69, 12,
3731 0, 13, 14, 15, 248, 249, 18, 19, 0, 0,
3732 0, 0, 0, 20, 250, 251, 23, 24, 25, 26,
3733 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
3734 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3735 40, 210, 41, 42, 43, 44, 45, 46, 47, 0,
3736 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3738 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3739 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
3740 663, 214, 215, 58, 59, 216, 61, 62, 63, 64,
3741 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3742 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3743 10, 11, 67, 217, 69, 12, 0, 13, 14, 15,
3744 248, 249, 18, 19, 0, 0, 0, 0, 0, 20,
3745 250, 251, 23, 24, 25, 26, 0, 0, 209, 0,
3746 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3747 34, 35, 36, 37, 38, 39, 40, 210, 41, 42,
3748 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3749 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3750 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3751 454, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3752 212, 54, 0, 55, 56, 0, 663, 214, 215, 58,
3753 59, 216, 61, 62, 63, 64, 65, 66, 0, 0,
3754 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3755 7, 0, 9, 0, 0, 0, 10, 11, 67, 217,
3756 69, 12, 0, 13, 14, 15, 248, 249, 18, 19,
3757 0, 0, 0, 0, 0, 20, 250, 251, 23, 24,
3758 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3759 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3760 38, 39, 40, 210, 41, 42, 43, 44, 45, 46,
3761 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3762 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3763 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3764 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3765 56, 0, 213, 214, 0, 58, 59, 216, 61, 62,
3766 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3767 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3768 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3769 14, 15, 248, 249, 18, 19, 0, 0, 0, 0,
3770 0, 20, 250, 251, 23, 24, 25, 26, 0, 0,
3771 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3772 32, 33, 34, 35, 36, 37, 38, 39, 40, 210,
3773 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3774 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3775 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3776 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3777 0, 0, 212, 54, 0, 55, 56, 0, 0, 214,
3778 215, 58, 59, 216, 61, 62, 63, 64, 65, 66,
3779 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3780 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3781 67, 217, 69, 12, 0, 13, 14, 15, 248, 249,
3782 18, 19, 0, 0, 0, 0, 0, 20, 250, 251,
3783 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3784 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3785 36, 37, 38, 39, 40, 210, 41, 42, 43, 44,
3786 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3787 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3788 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3789 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
3790 0, 55, 56, 0, 663, 214, 0, 58, 59, 216,
3791 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3792 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3793 9, 0, 0, 0, 10, 11, 67, 217, 69, 12,
3794 0, 13, 14, 15, 248, 249, 18, 19, 0, 0,
3795 0, 0, 0, 20, 250, 251, 23, 24, 25, 26,
3796 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
3797 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3798 40, 210, 41, 42, 43, 44, 45, 46, 47, 0,
3799 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3800 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3801 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3802 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
3803 0, 214, 0, 58, 59, 216, 61, 62, 63, 64,
3804 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3805 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3806 10, 11, 67, 217, 69, 12, 0, 13, 14, 15,
3807 16, 17, 18, 19, 0, 0, 0, 0, 0, 20,
3808 21, 22, 23, 24, 25, 26, 0, 0, 209, 0,
3809 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3810 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3811 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3812 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3813 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3814 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3815 212, 54, 0, 55, 56, 0, 758, 0, 0, 58,
3816 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3817 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3818 7, 0, 9, 0, 0, 0, 10, 11, 67, 217,
3819 69, 12, 0, 13, 14, 15, 248, 249, 18, 19,
3820 0, 0, 0, 0, 0, 20, 250, 251, 23, 24,
3821 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3822 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3823 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3824 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3825 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3826 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3827 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3828 56, 0, 758, 0, 0, 58, 59, 60, 61, 62,
3829 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3830 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3831 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3832 14, 15, 248, 249, 18, 19, 0, 0, 0, 0,
3833 0, 20, 250, 251, 23, 24, 25, 26, 0, 0,
3834 209, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3835 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3836 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3837 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3838 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3839 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3840 0, 0, 212, 54, 0, 55, 56, 0, 955, 0,
3841 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3843 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3844 67, 217, 69, 12, 0, 13, 14, 15, 248, 249,
3845 18, 19, 0, 0, 0, 0, 0, 20, 250, 251,
3846 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3847 0, 0, 0, 29, 0, 0, 32, 33, 34, 35,
3848 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3849 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3850 0, 0, 48, 49, 0, 0, 0, 0, 0, 0,
3851 0, 0, 0, 0, 0, 0, 0, 50, 51, 0,
3852 0, 0, 0, 0, 0, 211, 0, 0, 212, 54,
3853 0, 55, 56, 0, 1008, 0, 0, 58, 59, 60,
3854 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3855 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3856 9, 0, 0, 0, 10, 11, 67, 217, 69, 12,
3857 0, 13, 14, 15, 248, 249, 18, 19, 0, 0,
3858 0, 0, 0, 20, 250, 251, 23, 24, 25, 26,
3859 0, 0, 209, 0, 0, 0, 0, 0, 0, 29,
3860 0, 0, 32, 33, 34, 35, 36, 37, 38, 39,
3861 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3862 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,
3863 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3864 0, 0, 0, 50, 51, 0, 0, 0, 0, 0,
3865 0, 211, 0, 0, 212, 54, 0, 55, 56, 0,
3866 1152, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3867 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
3868 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3869 10, 11, 67, 217, 69, 12, 0, 13, 14, 15,
3870 248, 249, 18, 19, 0, 0, 0, 0, 0, 20,
3871 250, 251, 23, 24, 25, 26, 0, 0, 209, 0,
3872 0, 0, 0, 0, 0, 29, 0, 0, 32, 33,
3873 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3874 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3875 0, 0, 0, 0, 48, 49, 0, 0, 0, 0,
3876 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
3877 51, 0, 0, 0, 0, 0, 0, 211, 0, 0,
3878 212, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3879 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3880 0, 0, 0, 0, 0, 0, 0, 0, 5, 6,
3881 7, 0, 9, 0, 0, 0, 10, 11, 67, 217,
3882 69, 12, 0, 13, 14, 15, 16, 17, 18, 19,
3883 0, 0, 0, 0, 0, 20, 21, 22, 23, 24,
3884 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3885 0, 29, 0, 0, 32, 33, 34, 35, 36, 37,
3886 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3887 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3888 48, 49, 0, 0, 0, 0, 0, 0, 0, 0,
3889 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
3890 0, 0, 0, 211, 0, 0, 212, 54, 0, 55,
3891 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
3892 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3893 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3894 0, 0, 10, 11, 67, 217, 69, 12, 0, 13,
3895 14, 15, 16, 17, 18, 19, 0, 0, 0, 0,
3896 0, 20, 21, 22, 23, 24, 25, 26, 0, 0,
3897 27, 0, 0, 0, 0, 0, 0, 29, 0, 0,
3898 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
3899 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3900 0, 0, 0, 0, 0, 0, 48, 49, 0, 0,
3901 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3902 0, 50, 51, 0, 0, 0, 0, 0, 0, 211,
3903 0, 0, 212, 54, 0, 55, 56, 0, 0, 0,
3904 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3905 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3906 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3907 67, 68, 69, 12, 0, 13, 14, 15, 248, 249,
3908 18, 19, 0, 0, 0, 0, 0, 20, 250, 251,
3909 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3910 0, 0, 0, 280, 0, 0, 32, 33, 34, 35,
3911 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3912 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3913 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3914 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3915 0, 0, 0, 0, 0, 281, 0, 0, 341, 54,
3916 0, 55, 56, 0, 342, 0, 0, 58, 59, 60,
3917 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3918 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3919 10, 11, 0, 0, 0, 12, 282, 13, 14, 15,
3920 248, 249, 18, 19, 0, 0, 0, 0, 0, 20,
3921 250, 251, 23, 24, 25, 26, 0, 0, 209, 0,
3922 0, 0, 0, 0, 0, 280, 0, 0, 32, 33,
3923 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3924 43, 44, 45, 46, 47, 0, 0, 0, 0, 0,
3925 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3926 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3927 0, 0, 0, 0, 0, 0, 0, 390, 0, 0,
3928 53, 54, 0, 55, 56, 0, 57, 0, 0, 58,
3929 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3930 0, 0, 0, 0, 5, 6, 7, 0, 9, 0,
3931 0, 0, 10, 11, 0, 0, 0, 12, 282, 13,
3932 14, 15, 248, 249, 18, 19, 0, 0, 0, 0,
3933 0, 20, 250, 251, 23, 24, 25, 26, 0, 0,
3934 209, 0, 0, 0, 0, 0, 0, 280, 0, 0,
3935 32, 33, 34, 398, 36, 37, 38, 399, 40, 0,
3936 41, 42, 43, 44, 45, 46, 47, 0, 0, 0,
3937 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3938 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3939 0, 0, 0, 0, 0, 400, 0, 0, 0, 401,
3940 0, 0, 212, 54, 0, 55, 56, 0, 0, 0,
3941 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
3942 0, 0, 0, 0, 0, 0, 5, 6, 7, 0,
3943 9, 0, 0, 0, 10, 11, 0, 0, 0, 12,
3944 282, 13, 14, 15, 248, 249, 18, 19, 0, 0,
3945 0, 0, 0, 20, 250, 251, 23, 24, 25, 26,
3946 0, 0, 209, 0, 0, 0, 0, 0, 0, 280,
3947 0, 0, 32, 33, 34, 398, 36, 37, 38, 399,
3948 40, 0, 41, 42, 43, 44, 45, 46, 47, 0,
3949 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3950 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3951 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3952 0, 401, 0, 0, 212, 54, 0, 55, 56, 0,
3953 0, 0, 0, 58, 59, 60, 61, 62, 63, 64,
3954 65, 66, 0, 0, 0, 0, 0, 0, 5, 6,
3955 7, 0, 9, 0, 0, 0, 10, 11, 0, 0,
3956 0, 12, 282, 13, 14, 15, 248, 249, 18, 19,
3957 0, 0, 0, 0, 0, 20, 250, 251, 23, 24,
3958 25, 26, 0, 0, 209, 0, 0, 0, 0, 0,
3959 0, 280, 0, 0, 32, 33, 34, 35, 36, 37,
3960 38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
3961 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3962 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3963 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3964 0, 0, 0, 281, 0, 0, 341, 54, 0, 55,
3965 56, 0, 0, 0, 0, 58, 59, 60, 61, 62,
3966 63, 64, 65, 66, 0, 0, 0, 0, 0, 0,
3967 5, 6, 7, 0, 9, 0, 0, 0, 10, 11,
3968 0, 0, 0, 12, 282, 13, 14, 15, 248, 249,
3969 18, 19, 0, 0, 0, 0, 0, 20, 250, 251,
3970 23, 24, 25, 26, 0, 0, 209, 0, 0, 0,
3971 0, 0, 0, 280, 0, 0, 32, 33, 34, 35,
3972 36, 37, 38, 39, 40, 0, 41, 42, 43, 44,
3973 45, 46, 47, 0, 0, 0, 0, 0, 0, 0,
3974 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3975 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3976 0, 0, 0, 0, 0, 1084, 0, 0, 212, 54,
3977 0, 55, 56, 0, 0, 0, 0, 58, 59, 60,
3978 61, 62, 63, 64, 65, 66, 0, 0, 0, 0,
3979 0, 0, 5, 6, 7, 0, 9, 0, 0, 0,
3980 10, 11, 0, 0, 0, 12, 282, 13, 14, 15,
3981 248, 249, 18, 19, 0, 0, 0, 0, 0, 20,
3982 250, 251, 23, 24, 25, 26, 0, 0, 209, 0,
3983 0, 0, 0, 0, 0, 280, 0, 0, 32, 33,
3984 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
3985 43, 44, 45, 46, 47, 23, 24, 25, 26, 0,
3986 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3987 0, 32, 33, 34, 906, 0, 0, 0, 907, 0,
3988 0, 41, 42, 43, 44, 45, 0, 1180, 0, 0,
3989 212, 54, 0, 55, 56, 0, 0, 0, 0, 58,
3990 59, 60, 61, 62, 63, 64, 65, 66, 0, 0,
3991 0, 0, 908, 909, 0, 0, 0, 0, 0, 0,
3992 910, 0, 0, 911, 0, 0, 912, 913, 282, 1112,
3993 0, 0, 58, 59, 60, 61, 62, 63, 64, 65,
3994 66, 23, 24, 25, 26, 0, 0, 0, 0, 0,
3995 0, 0, 0, 0, 914, 0, 0, 32, 33, 34,
3996 906, 282, 0, 0, 907, 0, 0, 41, 42, 43,
3997 44, 45, 0, 0, 0, 0, 0, 0, 0, 0,
3998 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3999 0, 0, 0, 0, 0, 0, 0, 0, 908, 909,
4000 0, 0, 0, 0, 0, 0, 910, 0, 0, 911,
4001 0, 0, 912, 913, 0, 1024, 0, 0, 58, 59,
4002 60, 61, 62, 63, 64, 65, 66, 610, 611, 0,
4003 0, 612, 0, 0, 0, 0, 0, 0, 0, 0,
4004 914, 0, 0, 0, 0, 0, 0, 282, 0, 0,
4005 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4006 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4007 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4008 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4009 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4010 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4011 196, 197, 198, 199, 0, 200, 201, 619, 620, 0,
4012 0, 621, 202, 236, 0, 0, 0, 0, 0, 0,
4013 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4014 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4015 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4016 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4017 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4018 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4019 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4020 196, 197, 198, 199, 0, 200, 201, 667, 611, 0,
4021 0, 668, 202, 236, 0, 0, 0, 0, 0, 0,
4022 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4023 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4024 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4025 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4026 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4027 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4028 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4029 196, 197, 198, 199, 0, 200, 201, 670, 620, 0,
4030 0, 671, 202, 236, 0, 0, 0, 0, 0, 0,
4031 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4032 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4033 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4034 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4035 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4036 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4037 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4038 196, 197, 198, 199, 0, 200, 201, 697, 611, 0,
4039 0, 698, 202, 236, 0, 0, 0, 0, 0, 0,
4040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4041 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4042 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4043 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4044 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4045 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4046 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4047 196, 197, 198, 199, 0, 200, 201, 700, 620, 0,
4048 0, 701, 202, 236, 0, 0, 0, 0, 0, 0,
4049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4050 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4051 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4052 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4053 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4054 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4055 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4056 196, 197, 198, 199, 0, 200, 201, 808, 611, 0,
4057 0, 809, 202, 236, 0, 0, 0, 0, 0, 0,
4058 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4059 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4060 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4061 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4062 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4063 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4064 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4065 196, 197, 198, 199, 0, 200, 201, 811, 620, 0,
4066 0, 812, 202, 236, 0, 0, 0, 0, 0, 0,
4067 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4068 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4069 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4070 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4071 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4072 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4073 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4074 196, 197, 198, 199, 0, 200, 201, 817, 611, 0,
4075 0, 818, 202, 236, 0, 0, 0, 0, 0, 0,
4076 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4077 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4078 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4079 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4080 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4081 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4082 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4083 196, 197, 198, 199, 0, 200, 201, 654, 620, 0,
4084 0, 655, 202, 236, 0, 0, 0, 0, 0, 0,
4085 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4086 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4087 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4088 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4089 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4090 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4091 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4092 196, 197, 198, 199, 0, 200, 201, 1014, 611, 0,
4093 0, 1015, 202, 236, 0, 0, 0, 0, 0, 0,
4094 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4095 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4096 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4097 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4098 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4100 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4101 196, 197, 198, 199, 0, 200, 201, 1017, 620, 0,
4102 0, 1018, 202, 236, 0, 0, 0, 0, 0, 0,
4103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4104 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4105 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4106 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4107 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4109 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4110 196, 197, 198, 199, 0, 200, 201, 1224, 611, 0,
4111 0, 1225, 202, 236, 0, 0, 0, 0, 0, 0,
4112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4113 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4114 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4115 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4116 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4118 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4119 196, 197, 198, 199, 0, 200, 201, 1227, 620, 0,
4120 0, 1228, 202, 236, 0, 0, 0, 0, 0, 0,
4121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4122 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4123 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4124 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4125 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4127 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4128 196, 197, 198, 199, 0, 200, 201, 1264, 611, 0,
4129 0, 1265, 202, 236, 0, 0, 0, 0, 0, 0,
4130 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4131 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4132 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4133 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4134 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4136 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4137 196, 197, 198, 199, 0, 200, 201, 654, 620, 0,
4138 0, 655, 202, 236, 0, 0, 0, 0, 0, 0,
4139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4140 173, 174, 175, 176, 177, 178, 179, 180, 181, 0,
4141 0, 182, 183, 0, 0, 0, 0, 184, 185, 186,
4142 187, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4143 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
4144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4145 0, 0, 0, 0, 190, 191, 192, 193, 194, 195,
4146 196, 197, 198, 199, 0, 200, 201, 0, 0, 0,
4147 0, 0, 202
4148};
4149
4150static const yytype_int16 yycheck[] =
4151{
4152 2, 105, 4, 60, 59, 28, 91, 383, 96, 8,
4153 2, 329, 796, 53, 27, 57, 29, 401, 322, 104,
4154 274, 8, 326, 85, 278, 552, 731, 4, 378, 28,
4155 57, 16, 17, 57, 71, 735, 803, 326, 448, 230,
4156 731, 28, 377, 85, 379, 97, 101, 22, 68, 93,
4157 94, 53, 54, 97, 322, 57, 98, 99, 100, 863,
4158 97, 85, 380, 55, 56, 27, 22, 67, 71, 583,
4159 498, 2, 59, 4, 98, 99, 100, 322, 488, 865,
4160 13, 326, 728, 85, 76, 77, 77, 16, 17, 53,
4161 13, 426, 26, 557, 444, 559, 98, 99, 100, 101,
4162 1045, 1046, 13, 749, 1157, 80, 57, 26, 443, 13,
4163 445, 1190, 25, 68, 101, 25, 13, 102, 25, 322,
4164 657, 658, 262, 54, 80, 52, 55, 66, 568, 99,
4165 99, 25, 68, 573, 85, 575, 94, 669, 473, 97,
4166 225, 535, 97, 25, 728, 13, 109, 98, 99, 100,
4167 500, 735, 580, 300, 301, 0, 126, 126, 25, 216,
4168 1211, 97, 100, 440, 1243, 749, 501, 699, 56, 254,
4169 133, 448, 212, 102, 37, 38, 66, 16, 17, 728,
4170 119, 25, 121, 122, 143, 625, 13, 908, 909, 151,
4171 630, 153, 632, 1184, 1245, 239, 13, 241, 1277, 29,
4172 749, 341, 1255, 288, 25, 16, 17, 247, 1003, 143,
4173 212, 13, 264, 146, 148, 153, 55, 56, 151, 146,
4174 153, 283, 262, 13, 143, 148, 143, 264, 151, 119,
4175 153, 745, 224, 146, 13, 148, 146, 148, 230, 146,
4176 151, 283, 153, 245, 236, 247, 722, 151, 233, 153,
4177 235, 236, 146, 245, 151, 731, 153, 66, 260, 283,
4178 262, 264, 646, 102, 146, 100, 1211, 280, 459, 1260,
4179 680, 315, 316, 317, 318, 1079, 320, 321, 810, 146,
4180 153, 283, 282, 151, 1027, 153, 986, 637, 820, 1003,
4181 153, 102, 1078, 123, 285, 251, 252, 647, 262, 1094,
4182 342, 341, 146, 638, 233, 25, 235, 236, 393, 25,
4183 119, 146, 314, 648, 245, 342, 152, 319, 342, 1040,
4184 1041, 715, 716, 325, 151, 146, 153, 329, 97, 260,
4185 150, 649, 283, 153, 151, 387, 153, 314, 766, 341,
4186 342, 385, 1033, 100, 384, 991, 386, 339, 875, 151,
4187 387, 153, 344, 126, 1045, 1046, 400, 315, 316, 317,
4188 318, 151, 66, 153, 804, 66, 513, 807, 515, 152,
4189 1154, 1062, 151, 1116, 153, 148, 145, 341, 380, 148,
4190 912, 821, 384, 314, 386, 15, 378, 1154, 319, 146,
4191 146, 342, 379, 378, 233, 25, 235, 153, 702, 936,
4192 937, 678, 986, 680, 941, 942, 126, 871, 872, 152,
4193 678, 126, 876, 702, 878, 99, 880, 121, 122, 1003,
4194 121, 122, 233, 379, 235, 34, 146, 385, 148, 149,
4195 146, 146, 148, 153, 777, 778, 498, 429, 430, 426,
4196 694, 152, 126, 52, 467, 58, 438, 1190, 152, 99,
4197 68, 152, 444, 28, 446, 447, 498, 702, 445, 444,
4198 728, 99, 146, 1177, 77, 457, 66, 459, 467, 863,
4199 1184, 865, 1186, 126, 498, 666, 126, 1182, 480, 97,
4200 467, 66, 474, 728, 1016, 783, 473, 146, 126, 445,
4201 735, 1182, 1276, 791, 1026, 108, 498, 1029, 816, 112,
4202 1243, 148, 1245, 126, 749, 1196, 153, 947, 500, 786,
4203 950, 1043, 68, 953, 501, 500, 1053, 473, 580, 119,
4204 960, 121, 122, 963, 77, 52, 910, 1003, 565, 56,
4205 1273, 1177, 735, 68, 1277, 738, 121, 122, 580, 124,
4206 96, 97, 1003, 847, 99, 501, 1260, 498, 1262, 541,
4207 99, 639, 99, 1267, 904, 1269, 580, 577, 847, 706,
4208 552, 68, 97, 583, 711, 1092, 976, 68, 903, 912,
4209 905, 126, 564, 1100, 1288, 66, 67, 126, 580, 126,
4210 99, 957, 68, 136, 137, 138, 599, 627, 99, 629,
4211 97, 146, 9, 1177, 631, 96, 97, 146, 15, 146,
4212 1184, 440, 847, 112, 617, 68, 650, 126, 1140, 1141,
4213 1142, 97, 25, 68, 144, 126, 1080, 1081, 1082, 1083,
4214 52, 1267, 998, 153, 56, 627, 618, 629, 1068, 580,
4215 121, 122, 624, 695, 97, 146, 659, 657, 658, 683,
4216 615, 68, 97, 961, 145, 637, 485, 649, 577, 624,
4217 841, 638, 637, 695, 583, 647, 669, 99, 1042, 615,
4218 659, 648, 647, 151, 656, 153, 146, 54, 624, 77,
4219 97, 695, 659, 34, 666, 149, 1260, 64, 65, 153,
4220 1023, 656, 638, 1059, 1078, 1079, 699, 148, 58, 1007,
4221 775, 52, 648, 695, 1226, 66, 688, 25, 56, 976,
4222 656, 1177, 1045, 1046, 766, 68, 1182, 77, 1184, 25,
4223 1186, 1238, 126, 126, 82, 83, 1177, 100, 1158, 1062,
4224 824, 1182, 99, 1184, 766, 1186, 134, 135, 136, 137,
4225 138, 687, 688, 146, 97, 15, 149, 17, 108, 109,
4226 153, 986, 766, 146, 695, 99, 99, 99, 119, 126,
4227 121, 122, 26, 745, 746, 99, 1074, 146, 1003, 1223,
4228 99, 129, 130, 133, 766, 37, 38, 148, 823, 146,
4229 1146, 815, 126, 813, 126, 777, 778, 814, 99, 148,
4230 1123, 148, 126, 986, 1260, 988, 1262, 126, 780, 781,
4231 993, 1267, 146, 1269, 68, 787, 788, 810, 126, 1260,
4232 1003, 1262, 794, 149, 796, 126, 1267, 820, 1269, 66,
4233 126, 813, 1288, 68, 816, 766, 745, 66, 146, 1169,
4234 126, 149, 96, 97, 99, 153, 99, 1288, 1045, 1046,
4235 146, 68, 77, 149, 56, 1170, 823, 153, 68, 678,
4236 150, 96, 97, 835, 836, 1062, 838, 839, 888, 841,
4237 144, 126, 148, 126, 146, 146, 68, 815, 77, 96,
4238 97, 153, 119, 126, 121, 122, 96, 97, 1211, 143,
4239 119, 145, 121, 122, 148, 124, 14, 15, 583, 2,
4240 126, 4, 66, 875, 96, 97, 888, 26, 88, 89,
4241 145, 126, 884, 16, 17, 68, 898, 106, 900, 912,
4242 913, 893, 946, 895, 70, 945, 908, 909, 145, 901,
4243 912, 148, 904, 146, 146, 145, 936, 937, 905, 904,
4244 153, 941, 942, 96, 97, 962, 151, 1045, 1046, 68,
4245 53, 54, 1177, 145, 57, 119, 56, 121, 122, 1184,
4246 124, 40, 41, 945, 1062, 68, 344, 786, 940, 905,
4247 284, 285, 657, 658, 25, 997, 130, 96, 97, 961,
4248 1163, 1001, 85, 149, 1004, 978, 146, 898, 68, 900,
4249 93, 94, 145, 997, 97, 98, 99, 100, 146, 102,
4250 972, 1184, 52, 1186, 54, 55, 56, 57, 946, 144,
4251 1003, 144, 1012, 126, 68, 997, 96, 97, 146, 1001,
4252 68, 1086, 1004, 1016, 143, 1007, 145, 54, 55, 148,
4253 57, 146, 66, 1026, 146, 1260, 1029, 64, 65, 777,
4254 778, 1023, 96, 97, 68, 1027, 1066, 146, 96, 97,
4255 1043, 429, 430, 1053, 146, 1075, 146, 1039, 1040, 1041,
4256 438, 52, 146, 1045, 1046, 145, 997, 10, 446, 447,
4257 1090, 52, 96, 97, 8, 146, 1098, 1260, 68, 1262,
4258 1062, 144, 1119, 68, 1066, 119, 1269, 121, 122, 146,
4259 146, 145, 1074, 1075, 1098, 13, 474, 145, 25, 1136,
4260 2, 1094, 4, 17, 144, 1288, 96, 97, 1090, 212,
4261 152, 96, 97, 152, 16, 17, 1098, 146, 146, 1091,
4262 1092, 145, 44, 146, 146, 1145, 126, 1120, 1100, 44,
4263 233, 26, 235, 236, 1116, 128, 239, 150, 241, 15,
4264 1160, 1123, 245, 146, 247, 146, 52, 1140, 1141, 1142,
4265 146, 53, 54, 100, 1176, 145, 131, 260, 146, 262,
4266 145, 100, 146, 1145, 146, 131, 68, 1098, 52, 146,
4267 908, 909, 1176, 68, 912, 146, 146, 68, 1160, 52,
4268 283, 68, 1154, 146, 146, 1209, 1210, 59, 60, 61,
4269 62, 93, 94, 144, 1176, 97, 52, 1169, 151, 1171,
4270 102, 96, 97, 1170, 1169, 96, 97, 149, 1190, 96,
4271 97, 314, 315, 316, 317, 318, 319, 320, 321, 56,
4272 146, 9, 325, 131, 1217, 126, 329, 239, 144, 1211,
4273 1250, 56, 120, 1226, 1170, 1207, 68, 146, 341, 342,
4274 777, 778, 146, 146, 476, 1176, 146, 146, 143, 146,
4275 145, 936, 937, 148, 145, 267, 941, 942, 145, 271,
4276 146, 1243, 77, 1245, 96, 97, 1238, 131, 1250, 146,
4277 148, 1209, 1210, 148, 480, 378, 146, 380, 146, 94,
4278 95, 384, 385, 386, 146, 1023, 146, 146, 146, 1027,
4279 245, 1273, 146, 146, 98, 1277, 89, 400, 823, 100,
4280 656, 1039, 1040, 1041, 1276, 1207, 746, 1045, 1046, 715,
4281 212, 863, 895, 145, 1003, 1255, 1102, 1103, 133, 134,
4282 135, 136, 137, 138, 1062, 825, 571, 1012, 337, 1276,
4283 1039, 233, 1062, 235, 236, 1196, 1196, 239, 1037, 241,
4284 1171, 444, 108, 245, 1091, 247, 515, 101, 657, 658,
4285 77, 52, 731, 54, 55, 56, 57, 58, 260, 1182,
4286 262, -1, 1120, 672, 673, 1177, -1, -1, 1053, -1,
4287 -1, 908, 909, -1, -1, 912, 77, 480, 1116, 52,
4288 689, 54, 55, 56, 57, 1123, -1, -1, -1, 52,
4289 91, 54, 55, 56, 57, 498, -1, 500, -1, -1,
4290 101, -1, 780, 781, -1, -1, 107, 108, 109, 787,
4291 788, -1, 314, 315, 316, 317, 318, 319, 320, 321,
4292 -1, -1, -1, 325, -1, -1, -1, 329, 101, -1,
4293 -1, -1, 133, -1, 107, 136, -1, -1, 450, 341,
4294 -1, -1, -1, 455, -1, -1, 458, 1233, 1234, 461,
4295 -1, -1, 1190, 1239, -1, 1241, 1242, 835, 836, -1,
4296 838, 839, -1, -1, 52, 477, 54, 55, 56, 57,
4297 482, -1, -1, 1211, 577, -1, 378, 580, 380, -1,
4298 583, -1, 384, 385, 386, -1, 1023, -1, -1, -1,
4299 1027, -1, -1, 1279, 1280, 1281, 1282, -1, 400, -1,
4300 -1, -1, 1039, 1040, 1041, 1243, 1292, 1245, 1045, 1046,
4301 -1, -1, 52, 101, 54, 55, 56, 57, 58, -1,
4302 -1, -1, -1, 901, 627, 1062, 629, -1, -1, -1,
4303 -1, 543, 544, -1, 637, 1273, -1, 77, -1, 1277,
4304 -1, -1, 444, -1, 647, -1, 649, 650, 77, 2,
4305 -1, 4, -1, 77, 657, 658, 777, 778, -1, -1,
4306 -1, 101, 940, 16, 17, 94, 95, 579, 108, 109,
4307 94, 95, 40, 41, 42, 43, 44, -1, 480, 1116,
4308 683, -1, -1, -1, -1, -1, 1123, -1, -1, -1,
4309 -1, -1, 695, 133, 972, -1, -1, -1, 500, -1,
4310 53, 54, 131, 132, 133, 134, 135, 136, 137, 138,
4311 134, 135, 136, 137, 138, 68, -1, -1, -1, -1,
4312 -1, -1, -1, -1, -1, -1, -1, 936, 937, -1,
4313 -1, -1, 941, 942, -1, -1, -1, -1, -1, -1,
4314 93, 94, -1, -1, 97, -1, -1, -1, -1, 102,
4315 -1, -1, -1, 1190, -1, -1, -1, -1, -1, -1,
4316 -1, 970, 971, 766, 973, 974, -1, -1, -1, -1,
4317 -1, -1, -1, -1, 1211, 577, -1, -1, -1, -1,
4318 -1, 583, -1, -1, -1, -1, -1, 908, 909, -1,
4319 -1, 912, -1, -1, 52, -1, 54, 55, 56, 57,
4320 58, -1, -1, -1, -1, -1, 1243, 719, 1245, -1,
4321 813, -1, 815, 816, -1, -1, -1, -1, -1, 77,
4322 -1, -1, -1, -1, -1, 627, -1, 629, -1, -1,
4323 -1, -1, -1, -1, -1, 637, 1273, -1, -1, -1,
4324 1277, -1, -1, 101, 1053, 647, -1, 649, 650, 107,
4325 108, 109, -1, -1, -1, 657, 658, -1, -1, 212,
4326 -1, -1, 1071, -1, -1, -1, 52, -1, 54, 55,
4327 56, 57, 58, -1, -1, 133, -1, -1, 136, -1,
4328 233, 683, 235, 236, -1, 888, 239, -1, 241, -1,
4329 148, 77, 245, -1, 247, 898, -1, 900, -1, -1,
4330 -1, 904, 1023, -1, -1, -1, 1027, 260, -1, 262,
4331 822, -1, -1, -1, -1, 101, -1, -1, 1039, 1040,
4332 1041, 107, 108, 109, 1045, 1046, -1, -1, 840, -1,
4333 842, -1, -1, 936, 937, -1, -1, -1, 941, 942,
4334 -1, 1062, 945, 946, -1, -1, -1, 133, -1, 861,
4335 136, -1, -1, -1, -1, -1, -1, 869, 961, -1,
4336 -1, 314, 315, 316, 317, 318, 319, 320, 321, -1,
4337 -1, -1, 325, -1, -1, -1, 329, -1, -1, -1,
4338 52, -1, 54, 55, 56, 57, 58, -1, 341, -1,
4339 -1, -1, -1, -1, 997, 1116, -1, -1, 1001, -1,
4340 -1, 1004, 1123, -1, 1007, 77, -1, -1, -1, 1012,
4341 -1, 813, -1, 815, 816, -1, -1, -1, -1, -1,
4342 -1, -1, 2, -1, 4, 378, -1, 380, -1, 101,
4343 -1, 384, 385, 386, -1, 107, 108, 109, -1, -1,
4344 -1, -1, -1, -1, -1, -1, -1, 400, -1, -1,
4345 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4346 -1, 133, -1, 1066, 136, -1, -1, -1, -1, 1190,
4347 -1, 1074, 1075, 53, 54, -1, -1, 57, -1, -1,
4348 -1, 153, -1, -1, -1, -1, 888, 1090, -1, -1,
4349 1211, 444, -1, -1, -1, 1098, 898, -1, 900, -1,
4350 -1, -1, 904, -1, -1, 85, -1, -1, -1, -1,
4351 -1, -1, -1, -1, -1, -1, -1, -1, 98, 99,
4352 100, -1, 1243, -1, 1245, -1, -1, 480, -1, -1,
4353 -1, -1, 1044, -1, 936, 937, -1, -1, -1, 941,
4354 942, -1, 1145, 945, 946, -1, -1, 500, -1, -1,
4355 -1, -1, 1273, -1, -1, -1, 1277, 1160, -1, 961,
4356 33, 34, 35, 36, -1, -1, 1169, -1, -1, -1,
4357 -1, -1, -1, 1176, -1, -1, 49, 50, 51, -1,
4358 -1, -1, -1, -1, -1, -1, 59, 60, 61, 62,
4359 63, -1, -1, -1, -1, -1, -1, 1109, -1, 1001,
4360 -1, -1, 1004, -1, -1, 1007, 1209, 1210, -1, -1,
4361 1012, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4362 -1, -1, -1, -1, 577, 1137, 1138, 1139, -1, -1,
4363 583, -1, 212, -1, -1, -1, -1, 110, 111, 112,
4364 113, 114, 115, 116, 117, 118, -1, 1250, -1, -1,
4365 -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1,
4366 -1, -1, -1, -1, 1066, 245, 139, 247, -1, -1,
4367 777, 778, 1074, 1075, 627, -1, 629, -1, -1, -1,
4368 260, -1, 262, -1, 637, -1, -1, -1, 1090, -1,
4369 -1, -1, -1, -1, 647, -1, 649, 650, -1, -1,
4370 -1, -1, -1, 283, 657, 658, -1, -1, -1, -1,
4371 -1, -1, -1, 2, -1, 4, -1, -1, 77, 78,
4372 79, 80, 81, 82, 83, 84, -1, 86, 87, -1,
4373 683, -1, -1, -1, 314, 94, 95, -1, -1, 319,
4374 -1, -1, -1, 1145, -1, 325, -1, -1, -1, 329,
4375 -1, -1, -1, -1, -1, -1, -1, -1, 1160, -1,
4376 -1, 341, 342, 25, 53, 54, -1, 1169, 57, -1,
4377 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4378 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4379 -1, -1, -1, -1, -1, -1, 85, -1, -1, -1,
4380 380, 908, 909, -1, 384, 912, 386, 1209, 1210, 98,
4381 99, 100, 101, -1, -1, 77, 78, 79, 80, 81,
4382 82, 83, 84, 85, 86, 87, 88, 89, 2, -1,
4383 4, -1, 94, 95, -1, -1, -1, -1, 100, -1,
4384 -1, -1, -1, -1, -1, -1, -1, -1, 1250, -1,
4385 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4386 813, -1, 815, 816, -1, 127, -1, 129, 130, 131,
4387 132, 133, 134, 135, 136, 137, 138, -1, -1, 53,
4388 54, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4389 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4390 480, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4391 -1, -1, -1, -1, -1, -1, 1023, -1, 498, -1,
4392 1027, -1, -1, 212, 98, -1, -1, -1, -1, -1,
4393 -1, -1, 1039, 1040, 1041, 888, -1, -1, 1045, 1046,
4394 -1, -1, -1, -1, -1, 898, -1, 900, -1, -1,
4395 -1, 904, -1, -1, -1, 1062, 245, -1, 247, -1,
4396 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4397 -1, 260, -1, 262, -1, -1, -1, -1, -1, -1,
4398 -1, -1, -1, 936, 937, -1, -1, -1, 941, 942,
4399 -1, -1, 945, 946, 283, -1, -1, 777, 778, -1,
4400 580, -1, -1, 583, -1, -1, -1, -1, 961, 1116,
4401 2, -1, 4, -1, -1, -1, 1123, -1, -1, -1,
4402 -1, -1, -1, -1, -1, 314, -1, -1, -1, -1,
4403 319, -1, -1, -1, -1, -1, 325, -1, 212, -1,
4404 329, -1, -1, -1, -1, -1, -1, 627, 1001, 629,
4405 -1, 1004, 341, 342, 1007, -1, -1, -1, -1, 1012,
4406 -1, 53, 54, -1, -1, -1, 777, 778, -1, 649,
4407 -1, 245, -1, 247, -1, -1, -1, 657, 658, -1,
4408 -1, -1, -1, 1190, -1, -1, 260, -1, 262, -1,
4409 -1, 380, -1, -1, -1, 384, -1, 386, -1, -1,
4410 1053, -1, -1, -1, 1211, -1, -1, -1, -1, -1,
4411 -1, -1, -1, 1066, -1, 695, -1, -1, -1, -1,
4412 -1, 1074, 1075, -1, 704, -1, -1, -1, 908, 909,
4413 -1, -1, 912, -1, -1, -1, 1243, 1090, 1245, -1,
4414 314, -1, -1, -1, -1, 319, 33, 34, 35, 36,
4415 -1, 325, -1, -1, -1, 329, -1, -1, -1, -1,
4416 -1, -1, 49, 50, 51, 52, 1273, 341, -1, 56,
4417 1277, -1, 59, 60, 61, 62, 63, -1, -1, -1,
4418 -1, -1, -1, -1, -1, -1, 766, -1, -1, -1,
4419 -1, 480, 1145, -1, -1, -1, -1, 908, 909, -1,
4420 -1, 912, -1, 90, 91, -1, 380, 1160, -1, 498,
4421 384, 98, 386, -1, 101, -1, 1169, 104, 105, -1,
4422 212, -1, -1, 110, 111, 112, 113, 114, 115, 116,
4423 117, 118, -1, 813, -1, -1, 816, -1, -1, -1,
4424 -1, -1, -1, 1023, -1, 132, -1, 1027, -1, -1,
4425 -1, -1, 139, 245, -1, 247, 1209, 1210, -1, 1039,
4426 1040, 1041, -1, -1, -1, 1045, 1046, -1, 260, -1,
4427 262, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4428 -1, -1, 1062, -1, -1, -1, -1, -1, -1, -1,
4429 -1, 580, -1, -1, -1, -1, -1, 1250, -1, -1,
4430 -1, -1, -1, -1, -1, -1, 480, -1, 888, -1,
4431 -1, -1, 1023, -1, -1, -1, 1027, -1, 898, -1,
4432 900, -1, 314, -1, -1, -1, -1, 319, 1039, 1040,
4433 1041, -1, -1, 325, 1045, 1046, 1116, 329, 627, -1,
4434 629, -1, -1, 1123, -1, -1, -1, -1, -1, 341,
4435 -1, 1062, -1, -1, -1, -1, 936, 937, -1, -1,
4436 649, 941, 942, -1, -1, 945, -1, -1, -1, -1,
4437 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4438 -1, 961, 777, 778, -1, -1, -1, -1, 380, -1,
4439 -1, -1, 384, -1, 386, -1, -1, -1, -1, -1,
4440 -1, -1, -1, -1, -1, 1116, 695, -1, -1, 583,
4441 1190, -1, 1123, -1, -1, -1, -1, 997, -1, -1,
4442 -1, 1001, -1, -1, 1004, -1, -1, 1007, -1, -1,
4443 -1, 1211, 1012, -1, -1, -1, -1, -1, -1, -1,
4444 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4445 -1, -1, -1, 627, -1, 629, -1, -1, -1, -1,
4446 -1, -1, -1, 1243, -1, 1245, -1, -1, -1, -1,
4447 -1, -1, -1, 1053, -1, 649, -1, 766, -1, 1190,
4448 -1, -1, -1, 657, 658, -1, 1066, -1, 480, 777,
4449 778, -1, -1, 1273, 1074, 1075, -1, 1277, -1, -1,
4450 1211, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4451 1090, -1, -1, 908, 909, -1, -1, 912, 1098, -1,
4452 -1, -1, -1, -1, 813, -1, -1, 816, -1, -1,
4453 -1, -1, 1243, 0, 1245, 56, -1, -1, -1, -1,
4454 -1, 8, 9, 10, -1, -1, 13, 14, 15, -1,
4455 17, -1, -1, -1, -1, -1, -1, -1, 25, 26,
4456 27, -1, 1273, -1, -1, 1145, 1277, -1, -1, -1,
4457 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
4458 1160, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4459 -1, 583, -1, -1, -1, -1, 1176, -1, -1, 888,
4460 -1, 68, -1, -1, -1, -1, -1, -1, -1, 898,
4461 -1, 900, -1, -1, -1, -1, -1, -1, -1, -1,
4462 908, 909, -1, -1, 912, -1, -1, -1, 1023, 96,
4463 97, -1, 1027, -1, -1, 627, -1, 629, -1, 813,
4464 -1, -1, 816, -1, 1039, 1040, 1041, -1, -1, -1,
4465 1045, 1046, -1, 120, -1, -1, 945, 649, -1, -1,
4466 -1, -1, -1, -1, -1, 657, 658, 1062, -1, -1,
4467 1250, -1, 961, -1, -1, -1, 143, 144, -1, -1,
4468 -1, 148, 149, -1, 151, -1, 153, -1, -1, 210,
4469 -1, -1, 213, 214, 215, -1, -1, -1, -1, -1,
4470 -1, -1, -1, -1, -1, -1, -1, -1, 997, -1,
4471 -1, -1, 1001, -1, 888, 1004, -1, -1, 1007, -1,
4472 -1, 1116, -1, -1, 898, -1, 900, -1, 1123, -1,
4473 -1, -1, -1, -1, -1, 1023, -1, -1, -1, 1027,
4474 -1, -1, 777, 778, -1, -1, -1, -1, -1, -1,
4475 -1, 1039, 1040, 1041, -1, -1, -1, 1045, 1046, -1,
4476 -1, -1, 936, 937, -1, -1, -1, 941, 942, -1,
4477 -1, 945, -1, -1, 1062, -1, -1, 1066, -1, 16,
4478 17, -1, -1, -1, -1, 1074, 1075, 961, -1, -1,
4479 -1, -1, -1, -1, -1, 1190, -1, -1, -1, -1,
4480 -1, 1090, -1, -1, -1, -1, -1, -1, -1, 1098,
4481 -1, 48, 49, 50, 51, -1, 1211, -1, 55, 56,
4482 -1, 813, -1, 997, 816, -1, -1, 1001, 1116, -1,
4483 1004, 68, 69, 1007, -1, 1123, -1, -1, 1012, -1,
4484 -1, -1, -1, -1, -1, -1, -1, -1, 1243, -1,
4485 1245, -1, -1, -1, -1, -1, 1145, -1, -1, -1,
4486 -1, -1, -1, -1, -1, 102, -1, -1, -1, -1,
4487 -1, 1160, -1, 908, 909, -1, -1, 912, 1273, 1053,
4488 -1, -1, 1277, -1, -1, -1, -1, 1176, -1, -1,
4489 -1, -1, 1066, -1, -1, -1, 888, -1, -1, -1,
4490 1074, 1075, 1190, -1, -1, -1, 898, -1, 900, -1,
4491 -1, -1, -1, -1, -1, -1, 1090, -1, 439, 440,
4492 -1, -1, -1, 1211, -1, -1, -1, 448, -1, -1,
4493 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4494 -1, -1, -1, -1, 936, 937, -1, -1, -1, 941,
4495 942, -1, -1, 945, -1, 1243, -1, 1245, -1, -1,
4496 -1, 1250, -1, -1, 485, -1, -1, 488, -1, 961,
4497 -1, 1145, -1, 210, -1, -1, 213, 214, 215, -1,
4498 217, -1, -1, -1, -1, 1273, 1160, -1, 1023, 1277,
4499 -1, -1, 1027, -1, -1, -1, 233, -1, 235, 236,
4500 -1, -1, -1, -1, 1039, 1040, 1041, -1, -1, 1001,
4501 1045, 1046, 1004, -1, -1, 1007, -1, -1, -1, -1,
4502 1012, -1, -1, -1, -1, -1, -1, 1062, -1, 550,
4503 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4504 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4505 -1, -1, -1, -1, -1, -1, 577, -1, -1, -1,
4506 -1, 1053, 583, -1, -1, -1, -1, -1, -1, -1,
4507 -1, -1, -1, -1, 1066, -1, 1250, -1, -1, -1,
4508 -1, 1116, 1074, 1075, -1, -1, -1, -1, 1123, -1,
4509 -1, -1, -1, -1, -1, -1, -1, -1, 1090, -1,
4510 -1, -1, -1, -1, -1, -1, -1, -1, -1, 346,
4511 347, 348, 349, 350, -1, -1, 353, 354, 355, 356,
4512 357, 358, 359, 360, -1, 362, -1, -1, 365, 366,
4513 367, 368, 369, 370, 371, 372, 373, 374, -1, 660,
4514 -1, 378, 663, -1, -1, -1, -1, -1, -1, -1,
4515 -1, -1, -1, 1145, -1, 1190, -1, 678, -1, 680,
4516 -1, -1, -1, -1, -1, -1, -1, -1, 1160, -1,
4517 -1, -1, -1, -1, -1, -1, 1211, -1, -1, -1,
4518 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4519 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4520 -1, -1, 439, 440, -1, -1, 727, 444, 1243, -1,
4521 1245, 448, -1, -1, -1, -1, -1, 454, -1, -1,
4522 -1, -1, -1, -1, 745, -1, -1, -1, -1, -1,
4523 -1, -1, 469, -1, -1, -1, -1, 758, 1273, -1,
4524 -1, -1, 1277, -1, -1, -1, -1, -1, 485, -1,
4525 -1, 488, -1, -1, -1, -1, -1, -1, 1250, -1,
4526 -1, -1, -1, 500, -1, 786, -1, -1, -1, -1,
4527 -1, 33, 34, 35, 36, -1, -1, -1, -1, -1,
4528 517, -1, -1, -1, -1, 806, -1, 49, 50, 51,
4529 52, -1, -1, -1, 56, -1, -1, 59, 60, 61,
4530 62, 63, -1, -1, -1, 77, 78, 79, 80, 81,
4531 82, 83, -1, 550, 86, 87, -1, -1, -1, -1,
4532 -1, -1, 94, 95, -1, 562, -1, -1, 90, 91,
4533 567, -1, -1, -1, -1, -1, 98, -1, -1, 101,
4534 577, -1, 104, 105, -1, 107, 583, -1, 110, 111,
4535 112, 113, 114, 115, 116, 117, 118, 129, 130, 131,
4536 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4537 132, -1, -1, -1, -1, -1, 897, 139, -1, -1,
4538 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4539 -1, 153, -1, -1, -1, -1, -1, -1, -1, -1,
4540 637, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4541 647, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4542 657, 658, -1, 660, 661, -1, 663, -1, -1, -1,
4543 -1, -1, -1, -1, 955, 672, 673, -1, -1, -1,
4544 -1, 678, -1, 680, -1, -1, -1, -1, 33, 34,
4545 35, 36, 689, -1, -1, 976, -1, -1, -1, -1,
4546 -1, -1, -1, -1, 49, 50, 51, 52, -1, -1,
4547 -1, 56, -1, 58, 59, 60, 61, 62, 63, -1,
4548 -1, -1, -1, -1, -1, -1, -1, 1008, -1, -1,
4549 727, -1, 77, -1, -1, -1, -1, -1, -1, -1,
4550 -1, -1, -1, -1, -1, 90, 91, -1, 745, -1,
4551 -1, -1, -1, 98, -1, -1, 101, -1, -1, 104,
4552 105, 758, 107, 108, -1, 110, 111, 112, 113, 114,
4553 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
4554 -1, -1, -1, -1, 1065, -1, -1, 132, -1, 786,
4555 -1, -1, -1, -1, 139, -1, -1, -1, -1, -1,
4556 -1, -1, -1, -1, -1, -1, -1, -1, -1, 806,
4557 -1, -1, -1, 0, 1, -1, 3, 4, 5, 6,
4558 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
4559 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
4560 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
4561 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
4562 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
4563 57, 1152, 59, 60, 61, 62, 63, 64, 65, -1,
4564 -1, -1, -1, -1, 881, -1, -1, -1, 75, 76,
4565 -1, -1, -1, -1, -1, 892, -1, -1, -1, -1,
4566 897, -1, -1, 90, 91, 902, -1, 904, -1, -1,
4567 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
4568 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
4569 117, 118, -1, -1, -1, -1, -1, -1, 935, 936,
4570 937, -1, -1, -1, 941, 942, -1, -1, -1, -1,
4571 -1, -1, 139, 140, 141, -1, -1, -1, 955, -1,
4572 -1, -1, -1, -1, 151, -1, 153, -1, -1, -1,
4573 -1, -1, -1, 970, 971, -1, 973, 974, -1, 976,
4574 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4575 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
4576 -1, -1, -1, -1, -1, -1, -1, 8, 9, 10,
4577 -1, 1008, 13, 14, 15, 1012, 17, -1, -1, -1,
4578 -1, -1, -1, -1, 25, 26, 27, 28, 29, -1,
4579 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
4580 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4581 -1, -1, -1, -1, -1, -1, 1053, -1, -1, -1,
4582 -1, -1, -1, -1, -1, -1, -1, 68, 1065, -1,
4583 -1, -1, -1, -1, 1071, -1, 77, 78, 79, 80,
4584 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4585 -1, -1, -1, 94, 95, 96, 97, -1, 99, 100,
4586 -1, -1, -1, -1, -1, 106, -1, -1, -1, -1,
4587 -1, -1, -1, -1, -1, -1, -1, -1, -1, 120,
4588 -1, -1, 123, -1, -1, 126, 127, 128, 129, 130,
4589 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4590 -1, -1, 143, 144, 145, 146, -1, -1, 149, 150,
4591 151, 0, 153, -1, -1, 1152, -1, -1, -1, 8,
4592 9, 10, -1, -1, 13, 14, 15, -1, 17, -1,
4593 -1, -1, 1169, 44, -1, -1, 25, -1, 27, 28,
4594 29, -1, -1, -1, -1, -1, -1, -1, 37, 38,
4595 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
4596 -1, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4597 81, 82, 83, 84, 85, 86, 87, 88, 89, 68,
4598 -1, -1, -1, 94, 95, -1, -1, -1, 77, 78,
4599 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4600 89, -1, -1, -1, -1, 94, 95, 96, 97, -1,
4601 99, 100, -1, -1, -1, -1, 127, 106, 129, 130,
4602 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4603 -1, 120, -1, -1, 123, 146, -1, 126, 127, 128,
4604 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4605 -1, -1, -1, -1, -1, 144, 145, 146, 0, -1,
4606 149, 150, 151, -1, 153, -1, 8, 9, 10, -1,
4607 -1, 13, 14, 15, -1, 17, -1, -1, -1, -1,
4608 44, -1, -1, 25, -1, 27, 28, 29, -1, -1,
4609 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
4610 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
4611 -1, -1, -1, 77, 78, 79, 80, 81, 82, 83,
4612 84, 85, 86, 87, 88, 89, 68, -1, -1, -1,
4613 94, 95, -1, -1, -1, 77, 78, 79, 80, 81,
4614 82, 83, 84, 85, 86, 87, 88, 89, -1, -1,
4615 -1, -1, 94, 95, 96, 97, -1, 99, 100, -1,
4616 -1, -1, -1, 127, 106, 129, 130, 131, 132, 133,
4617 134, 135, 136, 137, 138, -1, -1, -1, 120, -1,
4618 -1, 123, -1, -1, 126, 127, 128, 129, 130, 131,
4619 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4620 -1, -1, 144, 145, 146, 0, -1, 149, 150, 151,
4621 -1, 153, -1, 8, 9, 10, -1, -1, 13, 14,
4622 15, -1, 17, -1, -1, -1, -1, 44, -1, -1,
4623 25, 26, 27, 28, 29, -1, -1, -1, -1, -1,
4624 -1, -1, 37, 38, -1, 40, 41, 42, 43, 44,
4625 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4626 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
4627 87, 88, 89, 68, -1, -1, -1, 94, 95, -1,
4628 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4629 85, 86, 87, 88, 89, -1, -1, -1, -1, 94,
4630 95, 96, 97, -1, -1, 100, -1, -1, -1, -1,
4631 127, 106, 129, 130, 131, 132, 133, 134, 135, 136,
4632 137, 138, -1, -1, -1, 120, -1, -1, 123, -1,
4633 -1, -1, 127, 128, 129, 130, 131, 132, 133, 134,
4634 135, 136, 137, 138, -1, -1, -1, -1, 143, 144,
4635 145, 146, 0, -1, 149, 150, 151, -1, 153, -1,
4636 8, 9, 10, -1, -1, 13, 14, 15, -1, 17,
4637 -1, -1, -1, -1, 44, -1, -1, 25, 26, 27,
4638 28, 29, -1, -1, -1, -1, -1, -1, -1, 37,
4639 38, -1, 40, 41, 42, 43, 44, -1, -1, -1,
4640 -1, -1, -1, -1, -1, -1, -1, 77, 78, 79,
4641 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4642 68, -1, -1, -1, 94, 95, -1, -1, -1, 77,
4643 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
4644 88, 89, -1, -1, -1, -1, 94, 95, 96, 97,
4645 -1, -1, 100, -1, -1, -1, -1, 127, 106, 129,
4646 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4647 -1, -1, 120, -1, -1, 123, -1, -1, -1, 127,
4648 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
4649 138, -1, -1, -1, -1, 143, 144, 145, 146, 0,
4650 -1, 149, 150, 151, -1, 153, -1, 8, 9, 10,
4651 -1, -1, 13, 14, 15, -1, 17, -1, -1, -1,
4652 -1, -1, -1, -1, 25, -1, 27, 28, 29, -1,
4653 -1, -1, -1, -1, -1, -1, 37, 38, -1, 40,
4654 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
4655 -1, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4656 83, 84, 85, 86, 87, 88, 89, 68, -1, -1,
4657 -1, 94, 95, -1, -1, -1, 77, 78, 79, 80,
4658 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4659 -1, -1, -1, 94, 95, 96, 97, -1, 99, 100,
4660 -1, -1, -1, -1, 127, 106, 129, 130, 131, 132,
4661 133, 134, 135, 136, 137, 138, -1, -1, -1, 120,
4662 -1, -1, 123, -1, -1, 126, 127, 128, 129, 130,
4663 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4664 -1, -1, -1, 144, 145, 146, 0, -1, 149, 150,
4665 151, -1, 153, -1, 8, 9, 10, -1, -1, 13,
4666 14, 15, -1, 17, -1, -1, -1, -1, -1, -1,
4667 -1, 25, 26, 27, 28, -1, -1, -1, -1, -1,
4668 -1, -1, -1, 37, 38, -1, 40, 41, 42, 43,
4669 44, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4670 -1, 77, 78, 79, 80, 81, 82, 83, 84, 85,
4671 86, 87, 88, 89, 68, -1, -1, -1, 94, 95,
4672 -1, -1, -1, 77, 78, 79, 80, 81, 82, 83,
4673 84, 85, 86, 87, 88, 89, -1, -1, -1, -1,
4674 94, 95, 96, 97, -1, -1, 100, -1, -1, -1,
4675 -1, -1, 106, 129, 130, 131, 132, 133, 134, 135,
4676 136, 137, 138, -1, -1, -1, 120, -1, -1, -1,
4677 -1, -1, -1, 127, -1, 129, 130, 131, 132, 133,
4678 134, 135, 136, 137, 138, -1, -1, -1, -1, 143,
4679 144, 145, 146, 0, 148, 149, 150, 151, -1, 153,
4680 -1, 8, 9, 10, -1, -1, 13, 14, 15, -1,
4681 17, -1, -1, -1, -1, -1, -1, -1, 25, -1,
4682 27, 28, 29, -1, -1, -1, -1, -1, -1, -1,
4683 37, 38, -1, 40, 41, 42, 43, 44, -1, -1,
4684 -1, -1, -1, -1, -1, -1, -1, -1, 77, 78,
4685 79, 80, 81, 82, 83, -1, -1, 86, 87, -1,
4686 -1, 68, -1, -1, -1, 94, 95, -1, -1, -1,
4687 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
4688 87, 88, 89, -1, -1, -1, -1, 94, 95, 96,
4689 97, -1, -1, 100, -1, -1, -1, -1, -1, 106,
4690 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4691 -1, -1, -1, 120, -1, -1, 123, -1, -1, -1,
4692 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
4693 137, 138, -1, -1, -1, -1, -1, 144, 145, 146,
4694 0, -1, 149, 150, 151, -1, 153, -1, 8, 9,
4695 10, -1, -1, 13, 14, 15, -1, 17, -1, -1,
4696 -1, -1, -1, -1, -1, 25, 26, 27, 28, -1,
4697 -1, -1, -1, -1, -1, -1, -1, 37, 38, -1,
4698 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
4699 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4700 -1, -1, -1, -1, -1, -1, -1, -1, 68, -1,
4701 -1, -1, -1, -1, -1, -1, -1, 77, 78, 79,
4702 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
4703 -1, -1, -1, -1, 94, 95, 96, 97, -1, -1,
4704 100, -1, -1, -1, -1, -1, 106, -1, -1, -1,
4705 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4706 120, -1, -1, -1, -1, -1, -1, 127, -1, 129,
4707 130, 131, 132, 133, 134, 135, 136, 137, 138, -1,
4708 -1, -1, -1, 143, 144, 145, 146, 0, 148, 149,
4709 150, 151, -1, 153, -1, 8, 9, 10, -1, -1,
4710 13, 14, 15, -1, 17, -1, -1, -1, -1, -1,
4711 -1, -1, 25, -1, 27, 28, -1, -1, -1, -1,
4712 -1, -1, -1, -1, 37, 38, -1, 40, 41, 42,
4713 43, 44, -1, -1, -1, -1, -1, -1, -1, -1,
4714 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4715 -1, -1, -1, -1, -1, 68, -1, -1, -1, -1,
4716 -1, -1, -1, -1, 77, 78, 79, 80, 81, 82,
4717 83, 84, 85, 86, 87, 88, 89, -1, -1, -1,
4718 -1, 94, 95, 96, 97, -1, -1, 100, -1, -1,
4719 -1, -1, -1, 106, -1, -1, -1, -1, -1, -1,
4720 -1, -1, -1, -1, -1, -1, -1, 120, -1, -1,
4721 -1, -1, -1, -1, 127, -1, 129, 130, 131, 132,
4722 133, 134, 135, 136, 137, 138, -1, -1, -1, -1,
4723 -1, 144, 145, 146, 0, 148, 149, 150, 151, -1,
4724 153, -1, 8, 9, 10, -1, -1, -1, 14, 15,
4725 -1, 17, -1, -1, -1, -1, -1, -1, -1, 25,
4726 26, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4727 -1, 37, 38, -1, 40, 41, 42, 43, 44, -1,
4728 -1, -1, -1, -1, -1, -1, 77, 78, 79, 80,
4729 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
4730 -1, -1, 68, 94, 95, -1, -1, -1, -1, -1,
4731 -1, 77, 78, 79, 80, 81, 82, 83, 84, 85,
4732 86, 87, 88, 89, -1, -1, -1, -1, 94, 95,
4733 96, 97, -1, 99, 100, -1, 127, -1, 129, 130,
4734 131, 132, 133, 134, 135, 136, 137, 138, -1, -1,
4735 -1, -1, -1, -1, 120, -1, -1, -1, -1, -1,
4736 126, 127, 153, 129, 130, 131, 132, 133, 134, 135,
4737 136, 137, 138, -1, -1, -1, -1, 143, 144, 145,
4738 146, 0, -1, 149, -1, 151, -1, 153, -1, 8,
4739 9, 10, -1, -1, -1, 14, 15, -1, 17, -1,
4740 -1, -1, -1, -1, -1, -1, 25, 26, -1, -1,
4741 -1, -1, -1, -1, -1, -1, -1, -1, 37, 38,
4742 -1, 40, 41, 42, 43, 44, -1, -1, -1, -1,
4743 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4744 -1, -1, -1, -1, -1, -1, -1, -1, -1, 68,
4745 -1, -1, -1, -1, -1, -1, -1, -1, 77, 78,
4746 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
4747 89, -1, -1, -1, -1, 94, 95, 96, 97, -1,
4748 99, 100, -1, -1, -1, -1, -1, -1, -1, -1,
4749 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4750 -1, 120, -1, -1, -1, -1, -1, 126, 127, -1,
4751 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
4752 -1, -1, -1, -1, 143, 144, 145, 146, 0, -1,
4753 149, -1, 151, -1, 153, -1, 8, 9, 10, -1,
4754 -1, -1, 14, 15, -1, 17, -1, -1, -1, -1,
4755 -1, -1, -1, 25, -1, -1, -1, -1, -1, -1,
4756 -1, -1, -1, -1, -1, 37, 38, -1, 40, 41,
4757 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
4758 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4759 -1, -1, -1, -1, -1, -1, 68, -1, -1, -1,
4760 -1, -1, -1, -1, -1, 77, 78, 79, 80, 81,
4761 82, 83, 84, 85, 86, 87, 88, 89, -1, -1,
4762 -1, -1, 94, 95, 96, 97, -1, 99, 100, -1,
4763 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4764 -1, -1, -1, -1, -1, -1, -1, -1, 120, -1,
4765 -1, -1, -1, -1, 126, 127, -1, 129, 130, 131,
4766 132, 133, 134, 135, 136, 137, 138, -1, -1, -1,
4767 -1, -1, 144, 145, 146, 0, -1, 149, -1, 151,
4768 -1, 153, -1, 8, 9, 10, -1, -1, -1, 14,
4769 15, -1, 17, -1, -1, -1, -1, -1, -1, -1,
4770 25, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4771 -1, -1, 37, 38, -1, 40, 41, 42, 43, 44,
4772 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4773 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4774 -1, -1, -1, 68, -1, -1, -1, -1, -1, -1,
4775 -1, -1, 77, 78, 79, 80, 81, 82, 83, 84,
4776 85, 86, 87, 88, 89, -1, -1, -1, -1, 94,
4777 95, 96, 97, -1, 99, 100, -1, -1, -1, -1,
4778 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4779 -1, -1, -1, -1, -1, 120, -1, -1, -1, -1,
4780 -1, 126, 127, -1, 129, 130, 131, 132, 133, 134,
4781 135, 136, 137, 138, -1, -1, -1, -1, -1, 144,
4782 145, 146, -1, -1, 149, -1, 151, 1, 153, 3,
4783 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
4784 -1, 15, 16, -1, 18, 19, 20, 21, 22, 23,
4785 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
4786 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
4787 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
4788 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
4789 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
4790 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
4791 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
4792 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
4793 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
4794 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
4795 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4796 -1, -1, -1, -1, -1, 139, 140, 141, -1, -1,
4797 -1, -1, -1, -1, -1, -1, -1, 151, 1, 153,
4798 3, 4, 5, 6, 7, -1, -1, 10, 11, 12,
4799 -1, 14, 15, 16, -1, 18, 19, 20, 21, 22,
4800 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
4801 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
4802 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
4803 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
4804 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
4805 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
4806 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
4807 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
4808 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
4809 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
4810 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4811 -1, -1, -1, -1, -1, -1, 139, 140, 141, -1,
4812 -1, -1, -1, -1, -1, -1, -1, -1, 151, 1,
4813 153, 3, 4, 5, 6, 7, -1, -1, 10, 11,
4814 12, -1, -1, 15, 16, 17, 18, 19, 20, 21,
4815 22, 23, 24, -1, -1, -1, -1, -1, 30, 31,
4816 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
4817 -1, -1, -1, 45, 46, 47, 48, 49, 50, 51,
4818 52, 53, 54, 55, 56, 57, -1, 59, 60, 61,
4819 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
4820 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
4821 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
4822 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
4823 102, -1, 104, 105, -1, 107, -1, -1, 110, 111,
4824 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
4825 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4826 -1, -1, -1, -1, -1, -1, -1, 139, 140, 141,
4827 -1, -1, -1, -1, -1, -1, -1, -1, -1, 151,
4828 1, 153, 3, 4, 5, 6, 7, -1, -1, 10,
4829 11, 12, -1, -1, 15, 16, -1, 18, 19, 20,
4830 21, 22, 23, 24, 25, -1, -1, -1, -1, 30,
4831 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
4832 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
4833 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
4834 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
4835 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
4836 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
4837 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
4838 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
4839 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
4840 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4841 -1, -1, -1, -1, -1, -1, -1, -1, 139, 140,
4842 141, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4843 151, 1, 153, 3, 4, 5, 6, 7, -1, -1,
4844 10, 11, 12, -1, -1, 15, 16, -1, 18, 19,
4845 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
4846 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
4847 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
4848 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
4849 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
4850 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
4851 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4852 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
4853 -1, 101, 102, -1, 104, 105, -1, 107, -1, -1,
4854 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4855 -1, -1, -1, -1, -1, -1, -1, 1, -1, 3,
4856 4, 5, 6, 7, -1, 9, 10, 11, 12, 139,
4857 140, 141, 16, -1, 18, 19, 20, 21, 22, 23,
4858 24, 151, -1, 153, -1, -1, 30, 31, 32, 33,
4859 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
4860 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
4861 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
4862 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
4863 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
4864 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
4865 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
4866 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
4867 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
4868 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
4869 -1, -1, -1, 11, 12, 139, 140, 141, 16, -1,
4870 18, 19, 20, 21, 22, 23, 24, 151, -1, 153,
4871 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
4872 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
4873 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
4874 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
4875 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
4876 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4877 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
4878 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
4879 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
4880 118, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4881 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4882 -1, 139, 140, 141, -1, -1, -1, -1, -1, -1,
4883 -1, 149, -1, 151, 1, 153, 3, 4, 5, 6,
4884 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
4885 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
4886 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
4887 -1, -1, 39, -1, -1, -1, -1, -1, 45, 46,
4888 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
4889 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
4890 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
4891 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4892 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
4893 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
4894 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
4895 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
4896 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4897 -1, -1, 139, 140, 141, -1, -1, -1, -1, -1,
4898 -1, -1, 149, -1, 151, 1, 153, 3, 4, 5,
4899 6, 7, -1, -1, -1, 11, 12, -1, -1, -1,
4900 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
4901 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
4902 36, -1, -1, 39, -1, -1, -1, -1, -1, 45,
4903 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
4904 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4905 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4906 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4907 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4908 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4909 -1, 107, -1, -1, 110, 111, 112, 113, 114, 115,
4910 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
4911 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4912 -1, -1, -1, 139, 140, 141, -1, -1, 144, -1,
4913 -1, -1, -1, -1, -1, 151, 1, 153, 3, 4,
4914 5, 6, 7, -1, -1, -1, 11, 12, -1, -1,
4915 -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
4916 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
4917 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
4918 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
4919 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
4920 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4921 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
4922 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
4923 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
4924 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
4925 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
4926 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4927 -1, -1, -1, -1, 139, 140, 141, -1, -1, 144,
4928 -1, -1, -1, -1, -1, -1, 151, 1, 153, 3,
4929 4, 5, 6, 7, -1, -1, 10, 11, 12, -1,
4930 -1, -1, 16, -1, 18, 19, 20, 21, 22, 23,
4931 24, -1, -1, -1, -1, -1, 30, 31, 32, 33,
4932 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
4933 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
4934 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
4935 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
4936 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
4937 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
4938 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
4939 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
4940 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
4941 -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
4942 -1, -1, -1, 11, 12, 139, 140, 141, 16, -1,
4943 18, 19, 20, 21, 22, 23, 24, 151, -1, 153,
4944 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
4945 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
4946 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
4947 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
4948 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
4949 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4950 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
4951 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
4952 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
4953 118, -1, 120, -1, -1, -1, -1, -1, -1, -1,
4954 -1, 3, 4, 5, -1, 7, -1, -1, -1, 11,
4955 12, 139, 140, 141, 16, -1, 18, 19, 20, 21,
4956 22, 23, 24, 151, -1, 153, -1, -1, 30, 31,
4957 32, 33, 34, 35, 36, -1, -1, 39, -1, -1,
4958 -1, -1, -1, -1, 46, -1, -1, 49, 50, 51,
4959 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
4960 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
4961 -1, -1, -1, 75, 76, -1, -1, -1, -1, -1,
4962 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
4963 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
4964 102, -1, 104, 105, -1, 107, 108, 109, 110, 111,
4965 112, 113, 114, 115, 116, 117, 118, -1, -1, -1,
4966 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
4967 -1, 7, -1, -1, -1, 11, 12, 139, 140, 141,
4968 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
4969 -1, 153, -1, -1, 30, 31, 32, 33, 34, 35,
4970 36, -1, -1, 39, -1, -1, -1, -1, -1, -1,
4971 46, -1, -1, 49, 50, 51, 52, 53, 54, 55,
4972 56, 57, -1, 59, 60, 61, 62, 63, 64, 65,
4973 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
4974 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4975 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
4976 -1, -1, 98, -1, -1, 101, 102, -1, 104, 105,
4977 -1, -1, -1, -1, 110, 111, 112, 113, 114, 115,
4978 116, 117, 118, -1, -1, -1, -1, -1, -1, -1,
4979 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
4980 -1, 11, 12, 139, 140, 141, 16, -1, 18, 19,
4981 20, 21, 22, 23, 24, 151, -1, 153, -1, -1,
4982 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
4983 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
4984 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
4985 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
4986 -1, -1, -1, -1, -1, 75, 76, -1, -1, -1,
4987 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4988 90, 91, -1, -1, -1, -1, -1, -1, 98, -1,
4989 -1, 101, 102, -1, 104, 105, -1, -1, -1, -1,
4990 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
4991 -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
4992 4, 5, 6, 7, -1, -1, -1, 11, 12, 139,
4993 140, 141, 16, -1, 18, 19, 20, 21, 22, 23,
4994 24, -1, -1, 153, -1, -1, 30, 31, 32, 33,
4995 34, 35, 36, -1, -1, 39, -1, -1, -1, -1,
4996 -1, 45, 46, 47, 48, 49, 50, 51, 52, 53,
4997 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
4998 64, 65, -1, -1, -1, -1, -1, -1, -1, -1,
4999 -1, 75, 76, -1, -1, -1, -1, -1, -1, -1,
5000 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
5001 -1, -1, -1, -1, 98, -1, -1, 101, 102, -1,
5002 104, 105, -1, 107, -1, -1, 110, 111, 112, 113,
5003 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
5004 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
5005 -1, -1, -1, 11, 12, 139, 140, 141, 16, -1,
5006 18, 19, 20, 21, 22, 23, 24, 151, -1, -1,
5007 -1, -1, 30, 31, 32, 33, 34, 35, 36, -1,
5008 -1, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5009 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
5010 -1, 59, 60, 61, 62, 63, 64, 65, -1, -1,
5011 -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
5012 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5013 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
5014 98, -1, -1, 101, 102, -1, 104, 105, -1, 107,
5015 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
5016 118, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5017 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5018 -1, 139, 140, 141, -1, -1, -1, -1, -1, -1,
5019 -1, -1, -1, 151, 3, 4, 5, 6, 7, 8,
5020 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
5021 19, 20, 21, 22, 23, 24, 25, 26, -1, -1,
5022 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
5023 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
5024 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5025 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5026 -1, -1, -1, -1, -1, -1, 75, 76, 77, 78,
5027 79, 80, 81, 82, 83, -1, -1, 86, 87, -1,
5028 -1, -1, -1, 92, 93, 94, 95, -1, -1, -1,
5029 -1, -1, -1, -1, -1, -1, -1, -1, 107, 108,
5030 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5031 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5032 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
5033 -1, 140, 141, -1, -1, -1, -1, -1, 147, 148,
5034 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
5035 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
5036 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
5037 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
5038 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5039 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
5040 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5041 -1, -1, 75, 76, 77, 78, 79, 80, 81, 82,
5042 83, -1, -1, 86, 87, -1, -1, -1, -1, 92,
5043 93, 94, 95, -1, -1, -1, -1, -1, -1, -1,
5044 -1, -1, -1, -1, 107, 108, -1, -1, -1, -1,
5045 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5046 -1, -1, -1, -1, -1, -1, 129, 130, 131, 132,
5047 133, 134, 135, 136, 137, 138, -1, 140, 141, -1,
5048 -1, -1, -1, -1, 147, 3, 4, 5, 6, 7,
5049 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
5050 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
5051 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
5052 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5053 48, 49, 50, 51, 52, 53, 54, -1, 56, -1,
5054 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5055 -1, -1, -1, -1, -1, -1, -1, 75, 76, 77,
5056 78, 79, 80, 81, 82, 83, -1, -1, 86, 87,
5057 -1, -1, -1, -1, 92, 93, 94, 95, -1, -1,
5058 -1, -1, -1, -1, -1, -1, -1, -1, -1, 107,
5059 108, -1, -1, 111, -1, -1, -1, -1, -1, -1,
5060 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5061 -1, 129, 130, 131, 132, 133, 134, 135, 136, 137,
5062 138, -1, 140, 141, -1, -1, -1, -1, -1, 147,
5063 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
5064 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
5065 23, 24, 25, 26, -1, -1, -1, 30, 31, 32,
5066 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
5067 -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
5068 53, -1, -1, 56, -1, -1, -1, -1, -1, -1,
5069 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5070 -1, -1, 75, 76, 77, 78, 79, 80, 81, 82,
5071 83, -1, -1, 86, 87, -1, -1, -1, -1, 92,
5072 93, 94, 95, -1, -1, -1, -1, -1, -1, -1,
5073 -1, -1, -1, -1, 107, 108, -1, -1, 111, -1,
5074 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5075 -1, -1, -1, -1, -1, -1, 129, 130, 131, 132,
5076 133, 134, 135, 136, 137, 138, -1, 140, 141, -1,
5077 -1, -1, -1, -1, 147, 3, 4, 5, 6, 7,
5078 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
5079 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
5080 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
5081 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
5082 48, 49, 50, 51, 52, 53, -1, -1, 56, -1,
5083 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5084 -1, -1, -1, -1, -1, -1, -1, 75, 76, 77,
5085 78, 79, 80, 81, 82, 83, -1, -1, 86, 87,
5086 -1, -1, -1, -1, 92, 93, 94, 95, -1, -1,
5087 -1, -1, -1, -1, -1, -1, -1, -1, -1, 107,
5088 108, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5089 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5090 -1, 129, 130, 131, 132, 133, 134, 135, 136, 137,
5091 138, -1, 140, 141, 3, 4, 5, -1, 7, 147,
5092 -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
5093 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5094 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5095 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5096 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5097 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5098 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5099 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5100 -1, -1, -1, -1, -1, -1, -1, -1, -1, 98,
5101 -1, -1, 101, 102, -1, 104, 105, -1, -1, -1,
5102 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5103 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5104 -1, -1, -1, 3, 4, 5, -1, 7, -1, -1,
5105 139, 11, 12, -1, -1, -1, 16, 146, 18, 19,
5106 20, 21, 22, 23, 24, -1, -1, -1, -1, -1,
5107 30, 31, 32, 33, 34, 35, 36, -1, -1, 39,
5108 -1, -1, -1, -1, -1, -1, 46, -1, -1, 49,
5109 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
5110 60, 61, 62, 63, 64, 65, -1, -1, -1, -1,
5111 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5112 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5113 -1, -1, -1, -1, -1, -1, -1, -1, 98, -1,
5114 -1, 101, 102, -1, 104, 105, -1, -1, -1, -1,
5115 110, 111, 112, 113, 114, 115, 116, 117, 118, -1,
5116 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5117 -1, -1, 3, 4, 5, 6, 7, -1, -1, 139,
5118 11, 12, -1, -1, -1, 16, 146, 18, 19, 20,
5119 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5120 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5121 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
5122 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5123 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5124 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5125 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5126 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5127 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
5128 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5129 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5130 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5131 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5132 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5133 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5134 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5135 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
5136 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5137 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5138 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5139 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5140 105, -1, 107, 108, 109, 110, 111, 112, 113, 114,
5141 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5142 -1, -1, -1, -1, 3, 4, 5, 6, 7, -1,
5143 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5144 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5145 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5146 39, -1, -1, -1, -1, -1, 45, 46, -1, 48,
5147 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5148 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5149 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5150 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5151 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5152 -1, -1, 101, 102, -1, 104, 105, -1, 107, -1,
5153 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5154 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5155 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5156 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5157 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5158 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5159 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5160 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5161 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5162 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5163 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5164 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5165 -1, 104, 105, -1, 107, 108, 109, 110, 111, 112,
5166 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5167 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5168 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5169 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5170 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5171 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5172 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5173 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
5174 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5175 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5176 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5177 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5178 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
5179 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5180 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5181 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5182 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5183 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5184 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5185 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
5186 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5187 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5188 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5189 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5190 101, 102, -1, 104, 105, -1, 107, 108, 109, 110,
5191 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5192 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5193 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5194 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5195 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5196 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5197 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5198 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
5199 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5200 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5201 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5202 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5203 105, -1, 107, 108, -1, 110, 111, 112, 113, 114,
5204 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5205 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5206 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5207 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5208 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5209 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5210 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
5211 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5212 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5213 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5214 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5215 -1, -1, 101, 102, -1, 104, 105, -1, -1, 108,
5216 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5217 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5218 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5219 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5220 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5221 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5222 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5223 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
5224 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5225 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5226 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5227 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5228 -1, 104, 105, -1, 107, 108, -1, 110, 111, 112,
5229 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5230 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5231 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5232 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5233 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5234 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5235 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5236 57, 58, 59, 60, 61, 62, 63, 64, 65, -1,
5237 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5238 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5239 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5240 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5241 -1, 108, -1, 110, 111, 112, 113, 114, 115, 116,
5242 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5243 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5244 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5245 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5246 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5247 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5248 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5249 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5250 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5251 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5252 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5253 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
5254 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5255 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5256 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5257 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5258 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5259 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5260 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5261 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5262 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5263 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5264 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5265 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5266 105, -1, 107, -1, -1, 110, 111, 112, 113, 114,
5267 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5268 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5269 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5270 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5271 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5272 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5273 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5274 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5275 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5277 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5278 -1, -1, 101, 102, -1, 104, 105, -1, 107, -1,
5279 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5281 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5282 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5283 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5284 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5285 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5286 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5287 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5288 -1, -1, 75, 76, -1, -1, -1, -1, -1, -1,
5289 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
5290 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5291 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
5292 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5293 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5294 7, -1, -1, -1, 11, 12, 139, 140, 141, 16,
5295 -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5296 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5297 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5298 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5299 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5300 -1, -1, -1, -1, -1, -1, -1, -1, 75, 76,
5301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5302 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
5303 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5304 107, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5305 117, 118, -1, -1, -1, -1, -1, -1, -1, -1,
5306 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5307 11, 12, 139, 140, 141, 16, -1, 18, 19, 20,
5308 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5309 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5310 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5311 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5312 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5313 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
5314 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
5315 91, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5316 101, 102, -1, 104, 105, -1, -1, -1, -1, 110,
5317 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5318 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
5319 5, -1, 7, -1, -1, -1, 11, 12, 139, 140,
5320 141, 16, -1, 18, 19, 20, 21, 22, 23, 24,
5321 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5322 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5323 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5324 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5325 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5326 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
5327 -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
5328 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5329 105, -1, -1, -1, -1, 110, 111, 112, 113, 114,
5330 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5331 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5332 -1, -1, 11, 12, 139, 140, 141, 16, -1, 18,
5333 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5334 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5335 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5336 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5337 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5338 -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
5339 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5340 -1, 90, 91, -1, -1, -1, -1, -1, -1, 98,
5341 -1, -1, 101, 102, -1, 104, 105, -1, -1, -1,
5342 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5343 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5344 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5345 139, 140, 141, 16, -1, 18, 19, 20, 21, 22,
5346 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5347 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5348 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5349 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5350 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5351 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5353 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5354 -1, 104, 105, -1, 107, -1, -1, 110, 111, 112,
5355 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5356 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5357 11, 12, -1, -1, -1, 16, 139, 18, 19, 20,
5358 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5359 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5360 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5361 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5362 61, 62, 63, 64, 65, -1, -1, -1, -1, -1,
5363 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5364 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5365 -1, -1, -1, -1, -1, -1, -1, 98, -1, -1,
5366 101, 102, -1, 104, 105, -1, 107, -1, -1, 110,
5367 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5368 -1, -1, -1, -1, 3, 4, 5, -1, 7, -1,
5369 -1, -1, 11, 12, -1, -1, -1, 16, 139, 18,
5370 19, 20, 21, 22, 23, 24, -1, -1, -1, -1,
5371 -1, 30, 31, 32, 33, 34, 35, 36, -1, -1,
5372 39, -1, -1, -1, -1, -1, -1, 46, -1, -1,
5373 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
5374 59, 60, 61, 62, 63, 64, 65, -1, -1, -1,
5375 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5376 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5377 -1, -1, -1, -1, -1, 94, -1, -1, -1, 98,
5378 -1, -1, 101, 102, -1, 104, 105, -1, -1, -1,
5379 -1, 110, 111, 112, 113, 114, 115, 116, 117, 118,
5380 -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
5381 7, -1, -1, -1, 11, 12, -1, -1, -1, 16,
5382 139, 18, 19, 20, 21, 22, 23, 24, -1, -1,
5383 -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
5384 -1, -1, 39, -1, -1, -1, -1, -1, -1, 46,
5385 -1, -1, 49, 50, 51, 52, 53, 54, 55, 56,
5386 57, -1, 59, 60, 61, 62, 63, 64, 65, -1,
5387 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5388 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5389 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5390 -1, 98, -1, -1, 101, 102, -1, 104, 105, -1,
5391 -1, -1, -1, 110, 111, 112, 113, 114, 115, 116,
5392 117, 118, -1, -1, -1, -1, -1, -1, 3, 4,
5393 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
5394 -1, 16, 139, 18, 19, 20, 21, 22, 23, 24,
5395 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34,
5396 35, 36, -1, -1, 39, -1, -1, -1, -1, -1,
5397 -1, 46, -1, -1, 49, 50, 51, 52, 53, 54,
5398 55, 56, 57, -1, 59, 60, 61, 62, 63, 64,
5399 65, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5401 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5402 -1, -1, -1, 98, -1, -1, 101, 102, -1, 104,
5403 105, -1, -1, -1, -1, 110, 111, 112, 113, 114,
5404 115, 116, 117, 118, -1, -1, -1, -1, -1, -1,
5405 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
5406 -1, -1, -1, 16, 139, 18, 19, 20, 21, 22,
5407 23, 24, -1, -1, -1, -1, -1, 30, 31, 32,
5408 33, 34, 35, 36, -1, -1, 39, -1, -1, -1,
5409 -1, -1, -1, 46, -1, -1, 49, 50, 51, 52,
5410 53, 54, 55, 56, 57, -1, 59, 60, 61, 62,
5411 63, 64, 65, -1, -1, -1, -1, -1, -1, -1,
5412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5414 -1, -1, -1, -1, -1, 98, -1, -1, 101, 102,
5415 -1, 104, 105, -1, -1, -1, -1, 110, 111, 112,
5416 113, 114, 115, 116, 117, 118, -1, -1, -1, -1,
5417 -1, -1, 3, 4, 5, -1, 7, -1, -1, -1,
5418 11, 12, -1, -1, -1, 16, 139, 18, 19, 20,
5419 21, 22, 23, 24, -1, -1, -1, -1, -1, 30,
5420 31, 32, 33, 34, 35, 36, -1, -1, 39, -1,
5421 -1, -1, -1, -1, -1, 46, -1, -1, 49, 50,
5422 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,
5423 61, 62, 63, 64, 65, 33, 34, 35, 36, -1,
5424 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5425 -1, 49, 50, 51, 52, -1, -1, -1, 56, -1,
5426 -1, 59, 60, 61, 62, 63, -1, 98, -1, -1,
5427 101, 102, -1, 104, 105, -1, -1, -1, -1, 110,
5428 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
5429 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
5430 98, -1, -1, 101, -1, -1, 104, 105, 139, 107,
5431 -1, -1, 110, 111, 112, 113, 114, 115, 116, 117,
5432 118, 33, 34, 35, 36, -1, -1, -1, -1, -1,
5433 -1, -1, -1, -1, 132, -1, -1, 49, 50, 51,
5434 52, 139, -1, -1, 56, -1, -1, 59, 60, 61,
5435 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
5436 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5437 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
5438 -1, -1, -1, -1, -1, -1, 98, -1, -1, 101,
5439 -1, -1, 104, 105, -1, 107, -1, -1, 110, 111,
5440 112, 113, 114, 115, 116, 117, 118, 52, 53, -1,
5441 -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
5442 132, -1, -1, -1, -1, -1, -1, 139, -1, -1,
5443 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5444 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5445 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5446 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5447 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5448 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5449 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5450 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5451 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5452 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5453 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5454 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5455 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5456 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5457 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5458 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5459 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5460 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5461 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5462 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5463 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5464 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5465 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5466 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5467 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5468 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5469 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5470 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5471 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5472 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5473 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5475 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5476 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5477 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5478 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5479 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5480 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5481 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5482 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5483 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5484 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5485 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5486 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5487 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5488 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5489 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5490 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5491 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5492 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5493 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5494 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5495 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5496 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5497 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5498 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5499 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5500 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5501 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5502 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5503 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5504 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5505 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5506 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5507 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5508 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5509 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5510 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5511 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5512 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5513 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5514 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5515 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5516 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5517 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5518 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5519 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5520 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5521 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5522 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5523 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5524 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5525 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5526 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5527 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5528 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5529 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5530 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5531 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5532 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5533 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5534 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5535 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5536 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5537 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5538 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5539 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5540 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5541 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5542 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5543 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5544 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5545 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5547 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5548 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5549 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5550 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5551 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5552 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5553 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5554 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5555 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5556 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5557 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5558 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5559 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5560 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5561 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5562 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5563 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5564 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5565 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5566 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5567 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5568 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5569 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5570 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5571 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5572 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5573 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5574 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5575 135, 136, 137, 138, -1, 140, 141, 52, 53, -1,
5576 -1, 56, 147, 148, -1, -1, -1, -1, -1, -1,
5577 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5578 75, 76, 77, 78, 79, 80, 81, 82, 83, -1,
5579 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
5580 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5581 -1, -1, 107, 108, -1, -1, -1, -1, -1, -1,
5582 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
5583 -1, -1, -1, -1, 129, 130, 131, 132, 133, 134,
5584 135, 136, 137, 138, -1, 140, 141, -1, -1, -1,
5585 -1, -1, 147
5586};
5587
5588/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
5589 state STATE-NUM. */
5590static const yytype_int16 yystos[] =
5591{
5592 0, 155, 156, 0, 1, 3, 4, 5, 6, 7,
5593 11, 12, 16, 18, 19, 20, 21, 22, 23, 24,
5594 30, 31, 32, 33, 34, 35, 36, 39, 45, 46,
5595 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
5596 57, 59, 60, 61, 62, 63, 64, 65, 75, 76,
5597 90, 91, 98, 101, 102, 104, 105, 107, 110, 111,
5598 112, 113, 114, 115, 116, 117, 118, 139, 140, 141,
5599 157, 158, 159, 167, 169, 171, 179, 180, 186, 187,
5600 189, 190, 191, 193, 194, 195, 197, 198, 207, 210,
5601 226, 236, 237, 238, 239, 240, 241, 242, 243, 244,
5602 245, 246, 255, 275, 283, 284, 335, 336, 337, 338,
5603 339, 340, 341, 344, 346, 347, 361, 362, 364, 365,
5604 366, 367, 368, 369, 370, 371, 409, 423, 159, 3,
5605 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
5606 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
5607 24, 25, 26, 30, 31, 32, 33, 34, 35, 36,
5608 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
5609 52, 53, 56, 75, 76, 77, 78, 79, 80, 81,
5610 82, 83, 86, 87, 92, 93, 94, 95, 107, 108,
5611 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
5612 140, 141, 147, 201, 202, 203, 205, 206, 361, 39,
5613 58, 98, 101, 107, 108, 109, 112, 140, 190, 198,
5614 207, 212, 218, 221, 223, 236, 367, 368, 370, 371,
5615 407, 408, 218, 148, 219, 220, 148, 215, 219, 148,
5616 153, 416, 54, 202, 416, 143, 160, 143, 21, 22,
5617 31, 32, 189, 207, 236, 255, 207, 207, 207, 56,
5618 1, 47, 101, 163, 164, 165, 167, 192, 193, 423,
5619 167, 228, 213, 223, 407, 423, 212, 406, 407, 423,
5620 46, 98, 139, 146, 179, 180, 197, 226, 236, 367,
5621 368, 371, 276, 54, 55, 57, 201, 350, 363, 350,
5622 351, 352, 152, 152, 152, 152, 366, 186, 207, 207,
5623 151, 153, 415, 421, 422, 40, 41, 42, 43, 44,
5624 37, 38, 148, 374, 375, 376, 377, 423, 374, 376,
5625 26, 143, 215, 219, 247, 285, 28, 248, 282, 126,
5626 146, 101, 107, 194, 126, 25, 77, 78, 79, 80,
5627 81, 82, 83, 84, 85, 86, 87, 88, 89, 94,
5628 95, 100, 127, 129, 130, 131, 132, 133, 134, 135,
5629 136, 137, 138, 209, 209, 68, 96, 97, 145, 413,
5630 227, 171, 182, 182, 183, 184, 183, 182, 415, 422,
5631 98, 191, 198, 236, 260, 367, 368, 371, 52, 56,
5632 94, 98, 199, 200, 236, 367, 368, 371, 200, 33,
5633 34, 35, 36, 49, 50, 51, 52, 56, 148, 178,
5634 201, 369, 404, 218, 97, 413, 414, 285, 338, 99,
5635 99, 146, 212, 56, 212, 212, 212, 350, 126, 100,
5636 146, 222, 423, 97, 145, 413, 99, 99, 146, 222,
5637 218, 416, 417, 218, 91, 217, 218, 223, 381, 407,
5638 423, 171, 417, 171, 54, 64, 65, 168, 148, 208,
5639 157, 163, 97, 413, 99, 167, 166, 192, 149, 415,
5640 422, 417, 229, 417, 150, 146, 153, 420, 146, 420,
5641 144, 420, 416, 56, 366, 194, 196, 375, 146, 97,
5642 145, 413, 277, 66, 119, 121, 122, 353, 119, 119,
5643 353, 67, 353, 342, 348, 345, 349, 77, 151, 159,
5644 182, 182, 182, 182, 167, 171, 171, 52, 54, 55,
5645 56, 57, 58, 77, 91, 101, 107, 108, 109, 133,
5646 136, 265, 378, 380, 381, 382, 383, 384, 385, 386,
5647 387, 388, 391, 392, 393, 394, 395, 398, 399, 400,
5648 401, 402, 126, 161, 163, 380, 386, 126, 161, 286,
5649 287, 106, 188, 290, 291, 290, 70, 211, 423, 192,
5650 146, 197, 146, 211, 175, 207, 207, 207, 207, 207,
5651 207, 207, 207, 207, 207, 207, 207, 207, 172, 207,
5652 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
5653 52, 53, 56, 205, 215, 410, 411, 217, 223, 52,
5654 53, 56, 205, 215, 410, 161, 13, 256, 421, 256,
5655 163, 182, 163, 415, 232, 56, 97, 145, 413, 25,
5656 171, 52, 56, 199, 130, 372, 97, 145, 413, 235,
5657 405, 68, 97, 412, 52, 56, 410, 211, 211, 204,
5658 124, 211, 212, 107, 212, 221, 407, 52, 56, 217,
5659 52, 56, 211, 211, 408, 417, 149, 417, 146, 417,
5660 146, 417, 202, 230, 207, 144, 144, 410, 410, 211,
5661 160, 417, 165, 417, 407, 146, 196, 52, 56, 217,
5662 52, 56, 278, 355, 354, 119, 343, 353, 66, 119,
5663 119, 343, 66, 119, 207, 101, 107, 261, 262, 263,
5664 264, 383, 146, 403, 423, 417, 417, 126, 146, 379,
5665 212, 146, 403, 34, 52, 146, 379, 52, 146, 379,
5666 52, 207, 10, 254, 8, 249, 331, 423, 421, 146,
5667 207, 254, 144, 288, 286, 254, 292, 254, 107, 186,
5668 212, 223, 224, 225, 417, 196, 146, 169, 170, 186,
5669 198, 207, 212, 214, 225, 236, 371, 176, 173, 416,
5670 99, 99, 215, 219, 416, 418, 146, 99, 99, 215,
5671 216, 219, 423, 254, 163, 13, 163, 254, 27, 257,
5672 421, 254, 25, 231, 297, 17, 251, 295, 52, 56,
5673 217, 52, 56, 183, 234, 373, 233, 52, 56, 199,
5674 217, 161, 171, 181, 216, 219, 170, 207, 214, 170,
5675 214, 202, 212, 212, 222, 99, 99, 418, 99, 99,
5676 381, 407, 171, 214, 420, 194, 418, 148, 280, 380,
5677 356, 54, 55, 57, 360, 371, 152, 353, 152, 152,
5678 152, 263, 383, 146, 417, 146, 402, 212, 378, 381,
5679 385, 398, 400, 388, 392, 394, 386, 395, 400, 384,
5680 386, 44, 212, 225, 332, 423, 9, 15, 250, 252,
5681 334, 423, 44, 289, 144, 293, 212, 146, 44, 196,
5682 44, 126, 44, 97, 145, 413, 52, 56, 90, 91,
5683 98, 101, 104, 105, 132, 275, 304, 305, 306, 309,
5684 326, 327, 328, 329, 330, 335, 336, 339, 340, 341,
5685 344, 346, 347, 368, 304, 128, 211, 211, 188, 150,
5686 99, 211, 211, 188, 14, 252, 253, 258, 259, 423,
5687 259, 185, 298, 295, 254, 107, 212, 294, 254, 418,
5688 163, 421, 182, 161, 418, 254, 417, 178, 285, 282,
5689 211, 211, 99, 211, 211, 417, 146, 417, 380, 279,
5690 357, 417, 261, 264, 262, 417, 146, 379, 146, 379,
5691 403, 146, 379, 146, 379, 379, 207, 100, 333, 423,
5692 163, 162, 207, 131, 270, 271, 423, 270, 107, 212,
5693 167, 167, 211, 207, 52, 56, 217, 52, 56, 327,
5694 327, 56, 199, 311, 107, 304, 312, 313, 314, 315,
5695 316, 318, 418, 310, 416, 419, 52, 100, 177, 131,
5696 88, 89, 97, 145, 148, 307, 308, 174, 207, 170,
5697 214, 170, 214, 211, 170, 214, 170, 214, 163, 182,
5698 254, 254, 299, 254, 212, 146, 256, 254, 161, 421,
5699 254, 211, 272, 416, 29, 123, 281, 358, 146, 146,
5700 386, 400, 386, 386, 98, 198, 236, 367, 368, 371,
5701 256, 163, 265, 266, 269, 272, 384, 386, 387, 389,
5702 390, 396, 397, 400, 402, 163, 161, 212, 418, 304,
5703 52, 418, 107, 304, 318, 418, 146, 146, 58, 112,
5704 319, 320, 321, 322, 323, 324, 325, 392, 144, 328,
5705 309, 327, 327, 199, 418, 417, 112, 312, 315, 319,
5706 312, 315, 319, 170, 214, 256, 302, 303, 304, 314,
5707 315, 319, 107, 212, 163, 254, 149, 151, 161, 163,
5708 359, 262, 379, 146, 379, 379, 379, 56, 97, 145,
5709 413, 163, 334, 403, 272, 131, 126, 146, 267, 268,
5710 98, 236, 146, 403, 146, 267, 146, 267, 417, 52,
5711 146, 146, 317, 318, 350, 419, 146, 304, 34, 52,
5712 350, 417, 417, 417, 418, 418, 418, 163, 256, 40,
5713 41, 146, 212, 259, 295, 296, 52, 273, 274, 382,
5714 254, 144, 163, 386, 52, 56, 217, 52, 56, 331,
5715 131, 236, 266, 397, 400, 56, 97, 389, 394, 386,
5716 396, 400, 386, 146, 317, 146, 124, 321, 325, 258,
5717 300, 182, 182, 312, 316, 146, 416, 120, 379, 418,
5718 146, 267, 146, 267, 52, 56, 403, 146, 267, 146,
5719 267, 267, 317, 146, 316, 318, 163, 146, 274, 386,
5720 400, 386, 386, 259, 297, 301, 317, 267, 146, 267,
5721 267, 267, 386, 267
5722};
5723
5724/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
5725static const yytype_int16 yyr1[] =
5726{
5727 0, 154, 156, 155, 157, 158, 158, 158, 158, 159,
5728 159, 160, 162, 161, 161, 163, 164, 164, 164, 164,
5729 165, 166, 165, 168, 167, 167, 167, 167, 167, 167,
5730 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
5731 167, 169, 169, 169, 169, 169, 169, 169, 169, 170,
5732 170, 170, 171, 171, 171, 171, 171, 172, 173, 174,
5733 171, 175, 176, 177, 171, 171, 178, 179, 181, 180,
5734 182, 184, 185, 183, 186, 186, 187, 187, 188, 189,
5735 190, 190, 190, 190, 190, 190, 190, 190, 190, 190,
5736 190, 191, 191, 192, 192, 193, 193, 193, 193, 193,
5737 193, 193, 193, 193, 193, 194, 194, 195, 195, 196,
5738 196, 197, 197, 197, 197, 197, 197, 197, 197, 197,
5739 198, 198, 198, 198, 198, 198, 198, 198, 198, 199,
5740 199, 200, 200, 200, 201, 201, 201, 201, 201, 202,
5741 202, 203, 204, 203, 205, 205, 205, 205, 205, 205,
5742 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
5743 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
5744 205, 205, 205, 205, 206, 206, 206, 206, 206, 206,
5745 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
5746 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
5747 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
5748 206, 206, 206, 206, 206, 207, 207, 207, 207, 207,
5749 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
5750 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
5751 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
5752 207, 207, 207, 207, 207, 208, 207, 207, 207, 207,
5753 207, 207, 207, 209, 209, 209, 209, 210, 210, 211,
5754 211, 212, 213, 213, 213, 213, 214, 214, 215, 215,
5755 215, 216, 216, 217, 217, 217, 217, 217, 218, 218,
5756 218, 218, 218, 220, 219, 221, 222, 222, 223, 223,
5757 223, 223, 224, 224, 225, 225, 225, 226, 226, 226,
5758 226, 226, 226, 226, 226, 226, 226, 226, 227, 226,
5759 228, 226, 229, 226, 226, 226, 226, 226, 226, 226,
5760 226, 226, 226, 230, 226, 226, 226, 226, 226, 226,
5761 226, 226, 226, 226, 226, 231, 226, 232, 226, 226,
5762 226, 233, 226, 234, 226, 235, 226, 226, 226, 226,
5763 226, 226, 226, 236, 237, 238, 239, 240, 241, 242,
5764 243, 244, 245, 246, 247, 248, 249, 250, 251, 252,
5765 253, 254, 255, 256, 256, 256, 257, 257, 258, 258,
5766 259, 259, 260, 260, 261, 261, 262, 262, 263, 263,
5767 263, 263, 263, 264, 264, 265, 265, 266, 266, 266,
5768 266, 267, 267, 268, 269, 269, 269, 269, 269, 269,
5769 269, 269, 269, 269, 269, 269, 269, 269, 269, 270,
5770 270, 271, 271, 272, 272, 273, 273, 274, 274, 276,
5771 277, 278, 279, 275, 280, 280, 281, 281, 282, 283,
5772 283, 283, 283, 284, 284, 284, 284, 284, 284, 284,
5773 284, 284, 285, 285, 287, 288, 289, 286, 291, 292,
5774 293, 290, 294, 294, 294, 294, 295, 296, 296, 298,
5775 299, 300, 297, 301, 301, 302, 302, 302, 303, 303,
5776 303, 303, 303, 303, 304, 305, 305, 306, 306, 307,
5777 308, 309, 309, 309, 309, 309, 309, 309, 309, 309,
5778 309, 309, 309, 310, 309, 309, 311, 309, 312, 312,
5779 312, 312, 312, 312, 312, 312, 313, 313, 314, 314,
5780 315, 316, 316, 317, 317, 318, 319, 319, 319, 319,
5781 320, 320, 321, 321, 322, 322, 323, 323, 324, 325,
5782 325, 326, 326, 326, 326, 326, 326, 326, 326, 326,
5783 326, 327, 327, 327, 327, 327, 327, 327, 327, 327,
5784 327, 328, 329, 330, 330, 330, 331, 331, 332, 332,
5785 332, 333, 333, 334, 334, 335, 335, 336, 337, 337,
5786 337, 338, 339, 340, 341, 342, 342, 343, 343, 344,
5787 345, 345, 346, 347, 348, 348, 349, 349, 350, 350,
5788 351, 351, 352, 352, 353, 354, 353, 355, 356, 357,
5789 358, 359, 353, 360, 360, 360, 360, 361, 361, 362,
5790 363, 363, 363, 363, 364, 365, 365, 366, 366, 366,
5791 366, 367, 367, 367, 367, 367, 368, 368, 368, 368,
5792 368, 368, 368, 369, 369, 370, 370, 371, 371, 373,
5793 372, 372, 374, 374, 375, 375, 375, 376, 377, 376,
5794 378, 378, 378, 378, 379, 379, 380, 380, 380, 380,
5795 380, 380, 380, 380, 380, 380, 380, 380, 380, 380,
5796 380, 381, 382, 382, 382, 382, 383, 383, 384, 385,
5797 385, 386, 386, 387, 388, 388, 389, 389, 390, 390,
5798 391, 391, 392, 392, 393, 394, 394, 395, 396, 397,
5799 397, 398, 398, 399, 399, 400, 400, 401, 401, 402,
5800 403, 403, 404, 405, 404, 406, 406, 407, 407, 408,
5801 408, 408, 408, 409, 409, 409, 410, 410, 410, 410,
5802 411, 411, 411, 412, 412, 413, 413, 414, 414, 415,
5803 415, 416, 416, 417, 418, 419, 420, 420, 420, 421,
5804 421, 422, 422, 423
5805};
5806
5807/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
5808static const yytype_int8 yyr2[] =
5809{
5810 0, 2, 0, 2, 2, 1, 1, 3, 2, 1,
5811 2, 3, 0, 6, 3, 2, 1, 1, 3, 2,
5812 1, 0, 3, 0, 4, 3, 3, 3, 2, 3,
5813 3, 3, 3, 3, 4, 1, 4, 4, 6, 4,
5814 1, 4, 4, 7, 6, 6, 6, 6, 4, 1,
5815 3, 1, 1, 3, 3, 3, 2, 0, 0, 0,
5816 6, 0, 0, 0, 6, 1, 1, 2, 0, 5,
5817 1, 0, 0, 4, 1, 1, 1, 4, 3, 1,
5818 2, 3, 4, 5, 4, 5, 2, 2, 2, 2,
5819 2, 1, 3, 1, 3, 1, 2, 3, 5, 2,
5820 4, 2, 4, 1, 3, 1, 3, 2, 3, 1,
5821 3, 1, 1, 4, 3, 3, 3, 3, 2, 1,
5822 1, 1, 4, 3, 3, 3, 3, 2, 1, 1,
5823 1, 2, 1, 3, 1, 1, 1, 1, 1, 1,
5824 1, 1, 0, 4, 1, 1, 1, 1, 1, 1,
5825 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5826 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5827 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5828 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5829 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5830 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5831 1, 1, 1, 1, 1, 4, 4, 7, 6, 6,
5832 6, 6, 5, 4, 3, 3, 2, 2, 2, 2,
5833 3, 3, 3, 3, 3, 3, 4, 2, 2, 3,
5834 3, 3, 3, 1, 3, 3, 3, 3, 3, 2,
5835 2, 3, 3, 3, 3, 0, 4, 6, 4, 6,
5836 4, 6, 1, 1, 1, 1, 1, 3, 3, 1,
5837 1, 1, 1, 2, 4, 2, 1, 3, 3, 5,
5838 3, 1, 1, 1, 1, 2, 4, 2, 1, 2,
5839 2, 4, 1, 0, 2, 2, 2, 1, 1, 2,
5840 3, 4, 1, 1, 3, 4, 2, 1, 1, 1,
5841 1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
5842 0, 3, 0, 4, 3, 3, 2, 3, 3, 1,
5843 4, 3, 1, 0, 6, 4, 3, 2, 1, 2,
5844 1, 6, 6, 4, 4, 0, 6, 0, 5, 5,
5845 6, 0, 6, 0, 7, 0, 5, 4, 4, 1,
5846 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5847 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5848 1, 1, 1, 1, 1, 2, 1, 1, 1, 5,
5849 1, 2, 1, 1, 1, 3, 1, 3, 1, 3,
5850 5, 1, 3, 2, 1, 1, 1, 4, 2, 2,
5851 1, 2, 0, 1, 6, 8, 4, 6, 4, 2,
5852 6, 2, 4, 6, 2, 4, 2, 4, 1, 1,
5853 1, 3, 4, 1, 4, 1, 3, 1, 1, 0,
5854 0, 0, 0, 7, 4, 1, 3, 3, 3, 2,
5855 4, 5, 5, 2, 4, 4, 3, 3, 3, 2,
5856 1, 4, 3, 3, 0, 0, 0, 5, 0, 0,
5857 0, 5, 1, 2, 3, 4, 5, 1, 1, 0,
5858 0, 0, 8, 1, 1, 1, 3, 3, 1, 2,
5859 3, 1, 1, 1, 1, 3, 1, 3, 1, 1,
5860 1, 1, 4, 4, 4, 3, 4, 4, 4, 3,
5861 3, 3, 2, 0, 4, 2, 0, 4, 1, 1,
5862 2, 3, 5, 2, 4, 1, 2, 3, 1, 3,
5863 5, 2, 1, 1, 3, 1, 3, 1, 2, 1,
5864 1, 3, 2, 1, 1, 3, 2, 1, 2, 1,
5865 1, 1, 3, 3, 2, 2, 1, 1, 1, 2,
5866 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5867 1, 1, 2, 2, 3, 1, 6, 1, 1, 1,
5868 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
5869 2, 3, 3, 3, 4, 0, 3, 1, 2, 4,
5870 0, 3, 4, 4, 0, 3, 0, 3, 0, 2,
5871 0, 2, 0, 2, 1, 0, 3, 0, 0, 0,
5872 0, 0, 8, 1, 1, 1, 1, 1, 1, 2,
5873 1, 1, 1, 1, 3, 1, 2, 1, 1, 1,
5874 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5875 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
5876 4, 0, 1, 1, 3, 5, 3, 1, 0, 3,
5877 4, 2, 2, 1, 2, 0, 6, 8, 4, 6,
5878 4, 6, 2, 4, 6, 2, 4, 2, 4, 1,
5879 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5880 3, 1, 3, 1, 2, 1, 2, 1, 1, 3,
5881 1, 3, 1, 1, 2, 2, 1, 3, 3, 1,
5882 3, 1, 3, 1, 1, 2, 1, 1, 1, 2,
5883 2, 1, 1, 0, 4, 1, 2, 1, 3, 3,
5884 2, 4, 2, 1, 1, 1, 1, 1, 1, 1,
5885 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
5886 1, 0, 1, 2, 2, 2, 0, 1, 1, 1,
5887 1, 1, 2, 0
5888};
5889
5890
5891enum { YYENOMEM = -2 };
5892
5893#define yyerrok (yyerrstatus = 0)
5894#define yyclearin (yychar = YYEMPTY)
5895
5896#define YYACCEPT goto yyacceptlab
5897#define YYABORT goto yyabortlab
5898#define YYERROR goto yyerrorlab
5899#define YYNOMEM goto yyexhaustedlab
5900
5901
5902#define YYRECOVERING() (!!yyerrstatus)
5903
5904#define YYBACKUP(Token, Value) \
5905 do \
5906 if (yychar == YYEMPTY) \
5907 { \
5908 yychar = (Token); \
5909 yylval = (Value); \
5910 YYPOPSTACK (yylen); \
5911 yystate = *yyssp; \
5912 goto yybackup; \
5913 } \
5914 else \
5915 { \
5916 yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
5917 YYERROR; \
5918 } \
5919 while (0)
5920
5921/* Backward compatibility with an undocumented macro.
5922 Use YYerror or YYUNDEF. */
5923#define YYERRCODE YYUNDEF
5924
5925/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
5926 If N is 0, then set CURRENT to the empty location which ends
5927 the previous symbol: RHS[0] (always defined). */
5928
5929#ifndef YYLLOC_DEFAULT
5930# define YYLLOC_DEFAULT(Current, Rhs, N) \
5931 do \
5932 if (N) \
5933 { \
5934 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
5935 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
5936 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
5937 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
5938 } \
5939 else \
5940 { \
5941 (Current).first_line = (Current).last_line = \
5942 YYRHSLOC (Rhs, 0).last_line; \
5943 (Current).first_column = (Current).last_column = \
5944 YYRHSLOC (Rhs, 0).last_column; \
5945 } \
5946 while (0)
5947#endif
5948
5949#define YYRHSLOC(Rhs, K) ((Rhs)[K])
5950
5951
5952/* Enable debugging if requested. */
5953#if YYDEBUG
5954
5955# ifndef YYFPRINTF
5956# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
5957# define YYFPRINTF fprintf
5958# endif
5959
5960# define YYDPRINTF(Args) \
5961do { \
5962 if (yydebug) \
5963 YYFPRINTF Args; \
5964} while (0)
5965
5966
5967/* YYLOCATION_PRINT -- Print the location on the stream.
5968 This macro was not mandated originally: define only if we know
5969 we won't break user code: when these are the locations we know. */
5970
5971# ifndef YYLOCATION_PRINT
5972
5973# if defined YY_LOCATION_PRINT
5974
5975 /* Temporary convenience wrapper in case some people defined the
5976 undocumented and private YY_LOCATION_PRINT macros. */
5977# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
5978
5979# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
5980
5981/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
5982
5984static int
5985yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
5986{
5987 int res = 0;
5988 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
5989 if (0 <= yylocp->first_line)
5990 {
5991 res += YYFPRINTF (p, "%d", yylocp->first_line);
5992 if (0 <= yylocp->first_column)
5993 res += YYFPRINTF (p, ".%d", yylocp->first_column);
5994 }
5995 if (0 <= yylocp->last_line)
5996 {
5997 if (yylocp->first_line < yylocp->last_line)
5998 {
5999 res += YYFPRINTF (p, "-%d", yylocp->last_line);
6000 if (0 <= end_col)
6001 res += YYFPRINTF (p, ".%d", end_col);
6002 }
6003 else if (0 <= end_col && yylocp->first_column < end_col)
6004 res += YYFPRINTF (p, "-%d", end_col);
6005 }
6006 return res;
6007}
6008
6009# define YYLOCATION_PRINT yy_location_print_
6010
6011 /* Temporary convenience wrapper in case some people defined the
6012 undocumented and private YY_LOCATION_PRINT macros. */
6013# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
6014
6015# else
6016
6017# define YYLOCATION_PRINT(File, Loc) ((void) 0)
6018 /* Temporary convenience wrapper in case some people defined the
6019 undocumented and private YY_LOCATION_PRINT macros. */
6020# define YY_LOCATION_PRINT YYLOCATION_PRINT
6021
6022# endif
6023# endif /* !defined YYLOCATION_PRINT */
6024
6025
6026# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
6027do { \
6028 if (yydebug) \
6029 { \
6030 YYFPRINTF (p, "%s ", Title); \
6031 yy_symbol_print (stderr, \
6032 Kind, Value, Location, p); \
6033 YYFPRINTF (p, "\n"); \
6034 } \
6035} while (0)
6036
6037
6038/*-----------------------------------.
6039| Print this symbol's value on YYO. |
6040`-----------------------------------*/
6041
6042static void
6043yy_symbol_value_print (FILE *yyo,
6044 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6045{
6046 FILE *yyoutput = yyo;
6047 YY_USE (yyoutput);
6048 YY_USE (yylocationp);
6049 YY_USE (p);
6050 if (!yyvaluep)
6051 return;
6053 switch (yykind)
6054 {
6055 case YYSYMBOL_tIDENTIFIER: /* "local variable or method" */
6056#line 1085 "parse.y"
6057 {
6058#ifndef RIPPER
6059 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6060#else
6061 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6062#endif
6063}
6064#line 6063 "parse.c"
6065 break;
6066
6067 case YYSYMBOL_tFID: /* "method" */
6068#line 1085 "parse.y"
6069 {
6070#ifndef RIPPER
6071 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6072#else
6073 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6074#endif
6075}
6076#line 6075 "parse.c"
6077 break;
6078
6079 case YYSYMBOL_tGVAR: /* "global variable" */
6080#line 1085 "parse.y"
6081 {
6082#ifndef RIPPER
6083 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6084#else
6085 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6086#endif
6087}
6088#line 6087 "parse.c"
6089 break;
6090
6091 case YYSYMBOL_tIVAR: /* "instance variable" */
6092#line 1085 "parse.y"
6093 {
6094#ifndef RIPPER
6095 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6096#else
6097 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6098#endif
6099}
6100#line 6099 "parse.c"
6101 break;
6102
6103 case YYSYMBOL_tCONSTANT: /* "constant" */
6104#line 1085 "parse.y"
6105 {
6106#ifndef RIPPER
6107 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6108#else
6109 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6110#endif
6111}
6112#line 6111 "parse.c"
6113 break;
6114
6115 case YYSYMBOL_tCVAR: /* "class variable" */
6116#line 1085 "parse.y"
6117 {
6118#ifndef RIPPER
6119 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6120#else
6121 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6122#endif
6123}
6124#line 6123 "parse.c"
6125 break;
6126
6127 case YYSYMBOL_tLABEL: /* "label" */
6128#line 1085 "parse.y"
6129 {
6130#ifndef RIPPER
6131 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6132#else
6133 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6134#endif
6135}
6136#line 6135 "parse.c"
6137 break;
6138
6139 case YYSYMBOL_tINTEGER: /* "integer literal" */
6140#line 1092 "parse.y"
6141 {
6142#ifndef RIPPER
6143 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6144#else
6145 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6146#endif
6147}
6148#line 6147 "parse.c"
6149 break;
6150
6151 case YYSYMBOL_tFLOAT: /* "float literal" */
6152#line 1092 "parse.y"
6153 {
6154#ifndef RIPPER
6155 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6156#else
6157 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6158#endif
6159}
6160#line 6159 "parse.c"
6161 break;
6162
6163 case YYSYMBOL_tRATIONAL: /* "rational literal" */
6164#line 1092 "parse.y"
6165 {
6166#ifndef RIPPER
6167 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6168#else
6169 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6170#endif
6171}
6172#line 6171 "parse.c"
6173 break;
6174
6175 case YYSYMBOL_tIMAGINARY: /* "imaginary literal" */
6176#line 1092 "parse.y"
6177 {
6178#ifndef RIPPER
6179 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6180#else
6181 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6182#endif
6183}
6184#line 6183 "parse.c"
6185 break;
6186
6187 case YYSYMBOL_tCHAR: /* "char literal" */
6188#line 1092 "parse.y"
6189 {
6190#ifndef RIPPER
6191 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6192#else
6193 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6194#endif
6195}
6196#line 6195 "parse.c"
6197 break;
6198
6199 case YYSYMBOL_tNTH_REF: /* "numbered reference" */
6200#line 1099 "parse.y"
6201 {
6202#ifndef RIPPER
6203 rb_parser_printf(p, "$%ld", ((*yyvaluep).node)->nd_nth);
6204#else
6205 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6206#endif
6207}
6208#line 6207 "parse.c"
6209 break;
6210
6211 case YYSYMBOL_tBACK_REF: /* "back reference" */
6212#line 1106 "parse.y"
6213 {
6214#ifndef RIPPER
6215 rb_parser_printf(p, "$%c", (int)((*yyvaluep).node)->nd_nth);
6216#else
6217 rb_parser_printf(p, "%"PRIsVALUE, ((*yyvaluep).node));
6218#endif
6219}
6220#line 6219 "parse.c"
6221 break;
6222
6223 case YYSYMBOL_tSTRING_CONTENT: /* "literal content" */
6224#line 1092 "parse.y"
6225 {
6226#ifndef RIPPER
6227 rb_parser_printf(p, "%+"PRIsVALUE, ((*yyvaluep).node)->nd_lit);
6228#else
6229 rb_parser_printf(p, "%+"PRIsVALUE, get_value(((*yyvaluep).node)));
6230#endif
6231}
6232#line 6231 "parse.c"
6233 break;
6234
6235 case YYSYMBOL_tOP_ASGN: /* "operator-assignment" */
6236#line 1085 "parse.y"
6237 {
6238#ifndef RIPPER
6239 rb_parser_printf(p, "%"PRIsVALUE, rb_id2str(((*yyvaluep).id)));
6240#else
6241 rb_parser_printf(p, "%"PRIsVALUE, RNODE(((*yyvaluep).id))->nd_rval);
6242#endif
6243}
6244#line 6243 "parse.c"
6245 break;
6246
6247 default:
6248 break;
6249 }
6251}
6252
6253
6254/*---------------------------.
6255| Print this symbol on YYO. |
6256`---------------------------*/
6257
6258static void
6259yy_symbol_print (FILE *yyo,
6260 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct parser_params *p)
6261{
6262 YYFPRINTF (p, "%s %s (",
6263 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
6264
6265 YYLOCATION_PRINT (yyo, yylocationp);
6266 YYFPRINTF (p, ": ");
6267 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, p);
6268 YYFPRINTF (p, ")");
6269}
6270
6271/*------------------------------------------------------------------.
6272| yy_stack_print -- Print the state stack from its BOTTOM up to its |
6273| TOP (included). |
6274`------------------------------------------------------------------*/
6275
6276static void
6277ruby_parser_yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop, struct parser_params *p)
6278#define yy_stack_print(b, t) ruby_parser_yy_stack_print(b, t, p)
6279{
6280 YYFPRINTF (p, "Stack now");
6281 for (; yybottom <= yytop; yybottom++)
6282 {
6283 int yybot = *yybottom;
6284 YYFPRINTF (p, " %d", yybot);
6285 }
6286 YYFPRINTF (p, "\n");
6287}
6288
6289# define YY_STACK_PRINT(Bottom, Top) \
6290do { \
6291 if (yydebug) \
6292 yy_stack_print ((Bottom), (Top)); \
6293} while (0)
6294
6295
6296/*------------------------------------------------.
6297| Report that the YYRULE is going to be reduced. |
6298`------------------------------------------------*/
6299
6300static void
6301yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
6302 int yyrule, struct parser_params *p)
6303{
6304 int yylno = yyrline[yyrule];
6305 int yynrhs = yyr2[yyrule];
6306 int yyi;
6307 YYFPRINTF (p, "Reducing stack by rule %d (line %d):\n",
6308 yyrule - 1, yylno);
6309 /* The symbols being reduced. */
6310 for (yyi = 0; yyi < yynrhs; yyi++)
6311 {
6312 YYFPRINTF (p, " $%d = ", yyi + 1);
6313 yy_symbol_print (stderr,
6314 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
6315 &yyvsp[(yyi + 1) - (yynrhs)],
6316 &(yylsp[(yyi + 1) - (yynrhs)]), p);
6317 YYFPRINTF (p, "\n");
6318 }
6319}
6320
6321# define YY_REDUCE_PRINT(Rule) \
6322do { \
6323 if (yydebug) \
6324 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, p); \
6325} while (0)
6326
6327/* Nonzero means print parse trace. It is left uninitialized so that
6328 multiple parsers can coexist. */
6329#ifndef yydebug
6330int yydebug;
6331#endif
6332#else /* !YYDEBUG */
6333# define YYDPRINTF(Args) ((void) 0)
6334# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
6335# define YY_STACK_PRINT(Bottom, Top)
6336# define YY_REDUCE_PRINT(Rule)
6337#endif /* !YYDEBUG */
6338
6339
6340/* YYINITDEPTH -- initial size of the parser's stacks. */
6341#ifndef YYINITDEPTH
6342# define YYINITDEPTH 200
6343#endif
6344
6345/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
6346 if the built-in stack extension method is used).
6347
6348 Do not make this value too large; the results are undefined if
6349 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
6350 evaluated with infinite-precision integer arithmetic. */
6351
6352#ifndef YYMAXDEPTH
6353# define YYMAXDEPTH 10000
6354#endif
6355
6356
6357/* Context of a parse error. */
6358typedef struct
6359{
6360 yy_state_t *yyssp;
6361 yysymbol_kind_t yytoken;
6362 YYLTYPE *yylloc;
6363} yypcontext_t;
6364
6365/* Put in YYARG at most YYARGN of the expected tokens given the
6366 current YYCTX, and return the number of tokens stored in YYARG. If
6367 YYARG is null, return the number of expected tokens (guaranteed to
6368 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
6369 Return 0 if there are more than YYARGN expected tokens, yet fill
6370 YYARG up to YYARGN. */
6371static int
6372yypcontext_expected_tokens (const yypcontext_t *yyctx,
6373 yysymbol_kind_t yyarg[], int yyargn)
6374{
6375 /* Actual size of YYARG. */
6376 int yycount = 0;
6377 int yyn = yypact[+*yyctx->yyssp];
6378 if (!yypact_value_is_default (yyn))
6379 {
6380 /* Start YYX at -YYN if negative to avoid negative indexes in
6381 YYCHECK. In other words, skip the first -YYN actions for
6382 this state because they are default actions. */
6383 int yyxbegin = yyn < 0 ? -yyn : 0;
6384 /* Stay within bounds of both yycheck and yytname. */
6385 int yychecklim = YYLAST - yyn + 1;
6386 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6387 int yyx;
6388 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6389 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
6390 && !yytable_value_is_error (yytable[yyx + yyn]))
6391 {
6392 if (!yyarg)
6393 ++yycount;
6394 else if (yycount == yyargn)
6395 return 0;
6396 else
6397 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
6398 }
6399 }
6400 if (yyarg && yycount == 0 && 0 < yyargn)
6401 yyarg[0] = YYSYMBOL_YYEMPTY;
6402 return yycount;
6403}
6404
6405
6406
6407
6408#ifndef yystrlen
6409# if defined __GLIBC__ && defined _STRING_H
6410# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
6411# else
6412/* Return the length of YYSTR. */
6413static YYPTRDIFF_T
6414yystrlen (const char *yystr)
6415{
6416 YYPTRDIFF_T yylen;
6417 for (yylen = 0; yystr[yylen]; yylen++)
6418 continue;
6419 return yylen;
6420}
6421# endif
6422#endif
6423
6424#ifndef yystpcpy
6425# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
6426# define yystpcpy stpcpy
6427# else
6428/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
6429 YYDEST. */
6430static char *
6431yystpcpy (char *yydest, const char *yysrc)
6432{
6433 char *yyd = yydest;
6434 const char *yys = yysrc;
6435
6436 while ((*yyd++ = *yys++) != '\0')
6437 continue;
6438
6439 return yyd - 1;
6440}
6441# endif
6442#endif
6443
6444#ifndef yytnamerr
6445/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
6446 quotes and backslashes, so that it's suitable for yyerror. The
6447 heuristic is that double-quoting is unnecessary unless the string
6448 contains an apostrophe, a comma, or backslash (other than
6449 backslash-backslash). YYSTR is taken from yytname. If YYRES is
6450 null, do not copy; instead, return the length of what the result
6451 would have been. */
6452static YYPTRDIFF_T
6453yytnamerr (char *yyres, const char *yystr)
6454{
6455 if (*yystr == '"')
6456 {
6457 YYPTRDIFF_T yyn = 0;
6458 char const *yyp = yystr;
6459 for (;;)
6460 switch (*++yyp)
6461 {
6462 case '\'':
6463 case ',':
6464 goto do_not_strip_quotes;
6465
6466 case '\\':
6467 if (*++yyp != '\\')
6468 goto do_not_strip_quotes;
6469 else
6470 goto append;
6471
6472 append:
6473 default:
6474 if (yyres)
6475 yyres[yyn] = *yyp;
6476 yyn++;
6477 break;
6478
6479 case '"':
6480 if (yyres)
6481 yyres[yyn] = '\0';
6482 return yyn;
6483 }
6484 do_not_strip_quotes: ;
6485 }
6486
6487 if (yyres)
6488 return yystpcpy (yyres, yystr) - yyres;
6489 else
6490 return yystrlen (yystr);
6491}
6492#endif
6493
6494
6495static int
6496yy_syntax_error_arguments (const yypcontext_t *yyctx,
6497 yysymbol_kind_t yyarg[], int yyargn)
6498{
6499 /* Actual size of YYARG. */
6500 int yycount = 0;
6501 /* There are many possibilities here to consider:
6502 - If this state is a consistent state with a default action, then
6503 the only way this function was invoked is if the default action
6504 is an error action. In that case, don't check for expected
6505 tokens because there are none.
6506 - The only way there can be no lookahead present (in yychar) is if
6507 this state is a consistent state with a default action. Thus,
6508 detecting the absence of a lookahead is sufficient to determine
6509 that there is no unexpected or expected token to report. In that
6510 case, just report a simple "syntax error".
6511 - Don't assume there isn't a lookahead just because this state is a
6512 consistent state with a default action. There might have been a
6513 previous inconsistent state, consistent state with a non-default
6514 action, or user semantic action that manipulated yychar.
6515 - Of course, the expected token list depends on states to have
6516 correct lookahead information, and it depends on the parser not
6517 to perform extra reductions after fetching a lookahead from the
6518 scanner and before detecting a syntax error. Thus, state merging
6519 (from LALR or IELR) and default reductions corrupt the expected
6520 token list. However, the list is correct for canonical LR with
6521 one exception: it will still contain any token that will not be
6522 accepted due to an error action in a later state.
6523 */
6524 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
6525 {
6526 int yyn;
6527 if (yyarg)
6528 yyarg[yycount] = yyctx->yytoken;
6529 ++yycount;
6530 yyn = yypcontext_expected_tokens (yyctx,
6531 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
6532 if (yyn == YYENOMEM)
6533 return YYENOMEM;
6534 else
6535 yycount += yyn;
6536 }
6537 return yycount;
6538}
6539
6540/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
6541 about the unexpected token YYTOKEN for the state stack whose top is
6542 YYSSP.
6543
6544 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
6545 not large enough to hold the message. In that case, also set
6546 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
6547 required number of bytes is too large to store. */
6548static int
6549yysyntax_error (struct parser_params *p, YYPTRDIFF_T *yymsg_alloc, char **yymsg,
6550 const yypcontext_t *yyctx)
6551{
6552 enum { YYARGS_MAX = 5 };
6553 /* Internationalized format string. */
6554 const char *yyformat = YY_NULLPTR;
6555 /* Arguments of yyformat: reported tokens (one for the "unexpected",
6556 one per "expected"). */
6557 yysymbol_kind_t yyarg[YYARGS_MAX];
6558 /* Cumulated lengths of YYARG. */
6559 YYPTRDIFF_T yysize = 0;
6560
6561 /* Actual size of YYARG. */
6562 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
6563 if (yycount == YYENOMEM)
6564 return YYENOMEM;
6565
6566 switch (yycount)
6567 {
6568#define YYCASE_(N, S) \
6569 case N: \
6570 yyformat = S; \
6571 break
6572 default: /* Avoid compiler warnings. */
6573 YYCASE_(0, YY_("syntax error"));
6574 YYCASE_(1, YY_("syntax error, unexpected %s"));
6575 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
6576 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
6577 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
6578 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
6579#undef YYCASE_
6580 }
6581
6582 /* Compute error message size. Don't count the "%s"s, but reserve
6583 room for the terminator. */
6584 yysize = yystrlen (yyformat) - 2 * yycount + 1;
6585 {
6586 int yyi;
6587 for (yyi = 0; yyi < yycount; ++yyi)
6588 {
6589 YYPTRDIFF_T yysize1
6590 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
6591 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
6592 yysize = yysize1;
6593 else
6594 return YYENOMEM;
6595 }
6596 }
6597
6598 if (*yymsg_alloc < yysize)
6599 {
6600 *yymsg_alloc = 2 * yysize;
6601 if (! (yysize <= *yymsg_alloc
6602 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
6603 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
6604 return -1;
6605 }
6606
6607 /* Avoid sprintf, as that infringes on the user's name space.
6608 Don't have undefined behavior even if the translation
6609 produced a string with the wrong number of "%s"s. */
6610 {
6611 char *yyp = *yymsg;
6612 int yyi = 0;
6613 while ((*yyp = *yyformat) != '\0')
6614 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
6615 {
6616 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
6617 yyformat += 2;
6618 }
6619 else
6620 {
6621 ++yyp;
6622 ++yyformat;
6623 }
6624 }
6625 return 0;
6626}
6627
6628
6629/*-----------------------------------------------.
6630| Release the memory associated to this symbol. |
6631`-----------------------------------------------*/
6632
6633static void
6634yydestruct (const char *yymsg,
6635 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parser_params *p)
6636{
6637 YY_USE (yyvaluep);
6638 YY_USE (yylocationp);
6639 YY_USE (p);
6640 if (!yymsg)
6641 yymsg = "Deleting";
6642 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
6643
6645 YY_USE (yykind);
6647}
6648
6649
6650
6651
6652
6653
6654/*----------.
6655| yyparse. |
6656`----------*/
6657
6658int
6660{
6661/* Lookahead token kind. */
6662int yychar;
6663
6664
6665/* The semantic value of the lookahead symbol. */
6666/* Default value used for initialization, for pacifying older GCCs
6667 or non-GCC compilers. */
6668YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
6669YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
6670
6671/* Location data for the lookahead symbol. */
6672static YYLTYPE yyloc_default
6673# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
6674 = { 1, 1, 1, 1 }
6675# endif
6676;
6677YYLTYPE yylloc = yyloc_default;
6678
6679 /* Number of syntax errors so far. */
6680 int yynerrs = 0;
6681
6682 yy_state_fast_t yystate = 0;
6683 /* Number of tokens to shift before error messages enabled. */
6684 int yyerrstatus = 0;
6685
6686 /* Refer to the stacks through separate pointers, to allow yyoverflow
6687 to reallocate them elsewhere. */
6688
6689 /* Their size. */
6690 YYPTRDIFF_T yystacksize = YYINITDEPTH;
6691
6692 /* The state stack: array, bottom, top. */
6693 yy_state_t yyssa[YYINITDEPTH];
6694 yy_state_t *yyss = yyssa;
6695 yy_state_t *yyssp = yyss;
6696
6697 /* The semantic value stack: array, bottom, top. */
6698 YYSTYPE yyvsa[YYINITDEPTH];
6699 YYSTYPE *yyvs = yyvsa;
6700 YYSTYPE *yyvsp = yyvs;
6701
6702 /* The location stack: array, bottom, top. */
6703 YYLTYPE yylsa[YYINITDEPTH];
6704 YYLTYPE *yyls = yylsa;
6705 YYLTYPE *yylsp = yyls;
6706
6707 int yyn;
6708 /* The return value of yyparse. */
6709 int yyresult;
6710 /* Lookahead symbol kind. */
6712 /* The variables used to return semantic value and location from the
6713 action routines. */
6714 YYSTYPE yyval;
6715 YYLTYPE yyloc;
6716
6717 /* The locations where the error started and ended. */
6718 YYLTYPE yyerror_range[3];
6719
6720 /* Buffer for error messages, and its allocated size. */
6721 char yymsgbuf[128];
6722 char *yymsg = yymsgbuf;
6723 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
6724
6725#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
6726
6727 /* The number of symbols on the RHS of the reduced rule.
6728 Keep to zero when no symbol should be popped. */
6729 int yylen = 0;
6730
6731 YYDPRINTF ((p, "Starting parse\n"));
6732
6733 yychar = YYEMPTY; /* Cause a token to be read. */
6734
6735
6736/* User initialization code. */
6737#line 1117 "parse.y"
6738{
6740}
6741
6742#line 6738 "parse.c"
6743
6744 yylsp[0] = yylloc;
6745 goto yysetstate;
6746
6747
6748/*------------------------------------------------------------.
6749| yynewstate -- push a new state, which is found in yystate. |
6750`------------------------------------------------------------*/
6751yynewstate:
6752 /* In all cases, when you get here, the value and location stacks
6753 have just been pushed. So pushing a state here evens the stacks. */
6754 yyssp++;
6755
6756
6757/*--------------------------------------------------------------------.
6758| yysetstate -- set current state (the top of the stack) to yystate. |
6759`--------------------------------------------------------------------*/
6760yysetstate:
6761 YYDPRINTF ((p, "Entering state %d\n", yystate));
6762 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
6764 *yyssp = YY_CAST (yy_state_t, yystate);
6766 YY_STACK_PRINT (yyss, yyssp);
6767
6768 if (yyss + yystacksize - 1 <= yyssp)
6769#if !defined yyoverflow && !defined YYSTACK_RELOCATE
6770 YYNOMEM;
6771#else
6772 {
6773 /* Get the current used size of the three stacks, in elements. */
6774 YYPTRDIFF_T yysize = yyssp - yyss + 1;
6775
6776# if defined yyoverflow
6777 {
6778 /* Give user a chance to reallocate the stack. Use copies of
6779 these so that the &'s don't force the real ones into
6780 memory. */
6781 yy_state_t *yyss1 = yyss;
6782 YYSTYPE *yyvs1 = yyvs;
6783 YYLTYPE *yyls1 = yyls;
6784
6785 /* Each stack pointer address is followed by the size of the
6786 data in use in that stack, in bytes. This used to be a
6787 conditional around just the two extra args, but that might
6788 be undefined if yyoverflow is a macro. */
6789 yyoverflow (YY_("memory exhausted"),
6790 &yyss1, yysize * YYSIZEOF (*yyssp),
6791 &yyvs1, yysize * YYSIZEOF (*yyvsp),
6792 &yyls1, yysize * YYSIZEOF (*yylsp),
6793 &yystacksize);
6794 yyss = yyss1;
6795 yyvs = yyvs1;
6796 yyls = yyls1;
6797 }
6798# else /* defined YYSTACK_RELOCATE */
6799 /* Extend the stack our own way. */
6800 if (YYMAXDEPTH <= yystacksize)
6801 YYNOMEM;
6802 yystacksize *= 2;
6803 if (YYMAXDEPTH < yystacksize)
6804 yystacksize = YYMAXDEPTH;
6805
6806 {
6807 yy_state_t *yyss1 = yyss;
6808 union yyalloc *yyptr =
6809 YY_CAST (union yyalloc *,
6810 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
6811 if (! yyptr)
6812 YYNOMEM;
6813 YYSTACK_RELOCATE (yyss_alloc, yyss);
6814 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
6815 YYSTACK_RELOCATE (yyls_alloc, yyls);
6816# undef YYSTACK_RELOCATE
6817 if (yyss1 != yyssa)
6818 YYSTACK_FREE (yyss1);
6819 }
6820# endif
6821
6822 yyssp = yyss + yysize - 1;
6823 yyvsp = yyvs + yysize - 1;
6824 yylsp = yyls + yysize - 1;
6825
6827 YYDPRINTF ((p, "Stack size increased to %ld\n",
6828 YY_CAST (long, yystacksize)));
6830
6831 if (yyss + yystacksize - 1 <= yyssp)
6832 YYABORT;
6833 }
6834#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
6835
6836
6837 if (yystate == YYFINAL)
6838 YYACCEPT;
6839
6840 goto yybackup;
6841
6842
6843/*-----------.
6844| yybackup. |
6845`-----------*/
6846yybackup:
6847 /* Do appropriate processing given the current state. Read a
6848 lookahead token if we need one and don't already have one. */
6849
6850 /* First try to decide what to do without reference to lookahead token. */
6851 yyn = yypact[yystate];
6852 if (yypact_value_is_default (yyn))
6853 goto yydefault;
6854
6855 /* Not known => get a lookahead token if don't already have one. */
6856
6857 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
6858 if (yychar == YYEMPTY)
6859 {
6860 YYDPRINTF ((p, "Reading a token\n"));
6861 yychar = yylex (&yylval, &yylloc, p);
6862 }
6863
6864 if (yychar <= END_OF_INPUT)
6865 {
6866 yychar = END_OF_INPUT;
6867 yytoken = YYSYMBOL_YYEOF;
6868 YYDPRINTF ((p, "Now at end of input.\n"));
6869 }
6870 else if (yychar == YYerror)
6871 {
6872 /* The scanner already issued an error message, process directly
6873 to error recovery. But do not keep the error token as
6874 lookahead, it is too special and may lead us to an endless
6875 loop in error recovery. */
6876 yychar = YYUNDEF;
6877 yytoken = YYSYMBOL_YYerror;
6878 yyerror_range[1] = yylloc;
6879 goto yyerrlab1;
6880 }
6881 else
6882 {
6883 yytoken = YYTRANSLATE (yychar);
6884 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
6885 }
6886
6887 /* If the proper action on seeing token YYTOKEN is to reduce or to
6888 detect an error, take that action. */
6889 yyn += yytoken;
6890 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
6891 goto yydefault;
6892 yyn = yytable[yyn];
6893 if (yyn <= 0)
6894 {
6895 if (yytable_value_is_error (yyn))
6896 goto yyerrlab;
6897 yyn = -yyn;
6898 goto yyreduce;
6899 }
6900
6901 /* Count tokens shifted since error; after three, turn off error
6902 status. */
6903 if (yyerrstatus)
6904 yyerrstatus--;
6905
6906 /* Shift the lookahead token. */
6907 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
6908 yystate = yyn;
6910 *++yyvsp = yylval;
6912 *++yylsp = yylloc;
6913
6914 /* Discard the shifted token. */
6915 yychar = YYEMPTY;
6916 goto yynewstate;
6917
6918
6919/*-----------------------------------------------------------.
6920| yydefault -- do the default action for the current state. |
6921`-----------------------------------------------------------*/
6922yydefault:
6923 yyn = yydefact[yystate];
6924 if (yyn == 0)
6925 goto yyerrlab;
6926 goto yyreduce;
6927
6928
6929/*-----------------------------.
6930| yyreduce -- do a reduction. |
6931`-----------------------------*/
6932yyreduce:
6933 /* yyn is the number of a rule to reduce with. */
6934 yylen = yyr2[yyn];
6935
6936 /* If YYLEN is nonzero, implement the default value of the action:
6937 '$$ = $1'.
6938
6939 Otherwise, the following line sets YYVAL to garbage.
6940 This behavior is undocumented and Bison
6941 users should not rely upon it. Assigning to YYVAL
6942 unconditionally makes the parser a bit smaller, and it avoids a
6943 GCC warning that YYVAL may be used uninitialized. */
6944 yyval = yyvsp[1-yylen];
6945
6946 /* Default location. */
6947 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
6948 yyerror_range[1] = yyloc;
6949 YY_REDUCE_PRINT (yyn);
6950 switch (yyn)
6951 {
6952 case 2: /* $@1: %empty */
6953#line 1322 "parse.y"
6954 {
6955 SET_LEX_STATE(EXPR_BEG);
6956 local_push(p, ifndef_ripper(1)+0);
6957 }
6958#line 6954 "parse.c"
6959 break;
6960
6961 case 3: /* program: $@1 top_compstmt */
6962#line 1327 "parse.y"
6963 {
6964 /*%%%*/
6965 if ((yyvsp[0].node) && !compile_for_eval) {
6966 NODE *node = (yyvsp[0].node);
6967 /* last expression should not be void */
6968 if (nd_type(node) == NODE_BLOCK) {
6969 while (node->nd_next) {
6970 node = node->nd_next;
6971 }
6972 node = node->nd_head;
6973 }
6974 node = remove_begin(node);
6975 void_expr(p, node);
6976 }
6977 p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, (yyvsp[0].node)), &(yyloc));
6978 /*% %*/
6979 /*% ripper[final]: program!($2) %*/
6980 local_pop(p);
6981 }
6982#line 6978 "parse.c"
6983 break;
6984
6985 case 4: /* top_compstmt: top_stmts opt_terms */
6986#line 1349 "parse.y"
6987 {
6988 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
6989 }
6990#line 6986 "parse.c"
6991 break;
6992
6993 case 5: /* top_stmts: none */
6994#line 1355 "parse.y"
6995 {
6996 /*%%%*/
6997 (yyval.node) = NEW_BEGIN(0, &(yyloc));
6998 /*% %*/
6999 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
7000 }
7001#line 6997 "parse.c"
7002 break;
7003
7004 case 6: /* top_stmts: top_stmt */
7005#line 1362 "parse.y"
7006 {
7007 /*%%%*/
7008 (yyval.node) = newline_node((yyvsp[0].node));
7009 /*% %*/
7010 /*% ripper: stmts_add!(stmts_new!, $1) %*/
7011 }
7012#line 7008 "parse.c"
7013 break;
7014
7015 case 7: /* top_stmts: top_stmts terms top_stmt */
7016#line 1369 "parse.y"
7017 {
7018 /*%%%*/
7019 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
7020 /*% %*/
7021 /*% ripper: stmts_add!($1, $3) %*/
7022 }
7023#line 7019 "parse.c"
7024 break;
7025
7026 case 8: /* top_stmts: error top_stmt */
7027#line 1376 "parse.y"
7028 {
7029 (yyval.node) = remove_begin((yyvsp[0].node));
7030 }
7031#line 7027 "parse.c"
7032 break;
7033
7034 case 10: /* top_stmt: "`BEGIN'" begin_block */
7035#line 1383 "parse.y"
7036 {
7037 (yyval.node) = (yyvsp[0].node);
7038 }
7039#line 7035 "parse.c"
7040 break;
7041
7042 case 11: /* begin_block: '{' top_compstmt '}' */
7043#line 1389 "parse.y"
7044 {
7045 /*%%%*/
7046 p->eval_tree_begin = block_append(p, p->eval_tree_begin,
7047 NEW_BEGIN((yyvsp[-1].node), &(yyloc)));
7048 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7049 /*% %*/
7050 /*% ripper: BEGIN!($2) %*/
7051 }
7052#line 7048 "parse.c"
7053 break;
7054
7055 case 12: /* $@2: %empty */
7056#line 1401 "parse.y"
7057 {if (!(yyvsp[-1].node)) {yyerror1(&(yylsp[0]), "else without rescue is useless");}}
7058#line 7054 "parse.c"
7059 break;
7060
7061 case 13: /* bodystmt: compstmt opt_rescue k_else $@2 compstmt opt_ensure */
7062#line 1404 "parse.y"
7063 {
7064 /*%%%*/
7065 (yyval.node) = new_bodystmt(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
7066 /*% %*/
7067 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), escape_Qundef($5), escape_Qundef($6)) %*/
7068 }
7069#line 7065 "parse.c"
7070 break;
7071
7072 case 14: /* bodystmt: compstmt opt_rescue opt_ensure */
7073#line 1413 "parse.y"
7074 {
7075 /*%%%*/
7076 (yyval.node) = new_bodystmt(p, (yyvsp[-2].node), (yyvsp[-1].node), 0, (yyvsp[0].node), &(yyloc));
7077 /*% %*/
7078 /*% ripper: bodystmt!(escape_Qundef($1), escape_Qundef($2), Qnil, escape_Qundef($3)) %*/
7079 }
7080#line 7076 "parse.c"
7081 break;
7082
7083 case 15: /* compstmt: stmts opt_terms */
7084#line 1422 "parse.y"
7085 {
7086 (yyval.node) = void_stmts(p, (yyvsp[-1].node));
7087 }
7088#line 7084 "parse.c"
7089 break;
7090
7091 case 16: /* stmts: none */
7092#line 1428 "parse.y"
7093 {
7094 /*%%%*/
7095 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7096 /*% %*/
7097 /*% ripper: stmts_add!(stmts_new!, void_stmt!) %*/
7098 }
7099#line 7095 "parse.c"
7100 break;
7101
7102 case 17: /* stmts: stmt_or_begin */
7103#line 1435 "parse.y"
7104 {
7105 /*%%%*/
7106 (yyval.node) = newline_node((yyvsp[0].node));
7107 /*% %*/
7108 /*% ripper: stmts_add!(stmts_new!, $1) %*/
7109 }
7110#line 7106 "parse.c"
7111 break;
7112
7113 case 18: /* stmts: stmts terms stmt_or_begin */
7114#line 1442 "parse.y"
7115 {
7116 /*%%%*/
7117 (yyval.node) = block_append(p, (yyvsp[-2].node), newline_node((yyvsp[0].node)));
7118 /*% %*/
7119 /*% ripper: stmts_add!($1, $3) %*/
7120 }
7121#line 7117 "parse.c"
7122 break;
7123
7124 case 19: /* stmts: error stmt */
7125#line 1449 "parse.y"
7126 {
7127 (yyval.node) = remove_begin((yyvsp[0].node));
7128 }
7129#line 7125 "parse.c"
7130 break;
7131
7132 case 20: /* stmt_or_begin: stmt */
7133#line 1455 "parse.y"
7134 {
7135 (yyval.node) = (yyvsp[0].node);
7136 }
7137#line 7133 "parse.c"
7138 break;
7139
7140 case 21: /* $@3: %empty */
7141#line 1459 "parse.y"
7142 {
7143 yyerror1(&(yylsp[0]), "BEGIN is permitted only at toplevel");
7144 }
7145#line 7141 "parse.c"
7146 break;
7147
7148 case 22: /* stmt_or_begin: "`BEGIN'" $@3 begin_block */
7149#line 1463 "parse.y"
7150 {
7151 (yyval.node) = (yyvsp[0].node);
7152 }
7153#line 7149 "parse.c"
7154 break;
7155
7156 case 23: /* $@4: %empty */
7157#line 1468 "parse.y"
7158 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
7159#line 7155 "parse.c"
7160 break;
7161
7162 case 24: /* stmt: "`alias'" fitem $@4 fitem */
7163#line 1469 "parse.y"
7164 {
7165 /*%%%*/
7166 (yyval.node) = NEW_ALIAS((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7167 /*% %*/
7168 /*% ripper: alias!($2, $4) %*/
7169 }
7170#line 7166 "parse.c"
7171 break;
7172
7173 case 25: /* stmt: "`alias'" "global variable" "global variable" */
7174#line 1476 "parse.y"
7175 {
7176 /*%%%*/
7177 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
7178 /*% %*/
7179 /*% ripper: var_alias!($2, $3) %*/
7180 }
7181#line 7177 "parse.c"
7182 break;
7183
7184 case 26: /* stmt: "`alias'" "global variable" "back reference" */
7185#line 1483 "parse.y"
7186 {
7187 /*%%%*/
7188 char buf[2];
7189 buf[0] = '$';
7190 buf[1] = (char)(yyvsp[0].node)->nd_nth;
7191 (yyval.node) = NEW_VALIAS((yyvsp[-1].id), rb_intern2(buf, 2), &(yyloc));
7192 /*% %*/
7193 /*% ripper: var_alias!($2, $3) %*/
7194 }
7195#line 7191 "parse.c"
7196 break;
7197
7198 case 27: /* stmt: "`alias'" "global variable" "numbered reference" */
7199#line 1493 "parse.y"
7200 {
7201 static const char mesg[] = "can't make alias for the number variables";
7202 /*%%%*/
7203 yyerror1(&(yylsp[0]), mesg);
7204 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7205 /*% %*/
7206 /*% ripper[error]: alias_error!(ERR_MESG(), $3) %*/
7207 }
7208#line 7204 "parse.c"
7209 break;
7210
7211 case 28: /* stmt: "`undef'" undef_list */
7212#line 1502 "parse.y"
7213 {
7214 /*%%%*/
7215 (yyval.node) = (yyvsp[0].node);
7216 /*% %*/
7217 /*% ripper: undef!($2) %*/
7218 }
7219#line 7215 "parse.c"
7220 break;
7221
7222 case 29: /* stmt: stmt "`if' modifier" expr_value */
7223#line 1509 "parse.y"
7224 {
7225 /*%%%*/
7226 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
7227 fixpos((yyval.node), (yyvsp[0].node));
7228 /*% %*/
7229 /*% ripper: if_mod!($3, $1) %*/
7230 }
7231#line 7227 "parse.c"
7232 break;
7233
7234 case 30: /* stmt: stmt "`unless' modifier" expr_value */
7235#line 1517 "parse.y"
7236 {
7237 /*%%%*/
7238 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
7239 fixpos((yyval.node), (yyvsp[0].node));
7240 /*% %*/
7241 /*% ripper: unless_mod!($3, $1) %*/
7242 }
7243#line 7239 "parse.c"
7244 break;
7245
7246 case 31: /* stmt: stmt "`while' modifier" expr_value */
7247#line 1525 "parse.y"
7248 {
7249 /*%%%*/
7250 if ((yyvsp[-2].node) && nd_type((yyvsp[-2].node)) == NODE_BEGIN) {
7251 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
7252 }
7253 else {
7254 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
7255 }
7256 /*% %*/
7257 /*% ripper: while_mod!($3, $1) %*/
7258 }
7259#line 7255 "parse.c"
7260 break;
7261
7262 case 32: /* stmt: stmt "`until' modifier" expr_value */
7263#line 1537 "parse.y"
7264 {
7265 /*%%%*/
7266 if ((yyvsp[-2].node) && nd_type((yyvsp[-2].node)) == NODE_BEGIN) {
7267 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node)->nd_body, 0, &(yyloc));
7268 }
7269 else {
7270 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[0].node), &(yylsp[0])), (yyvsp[-2].node), 1, &(yyloc));
7271 }
7272 /*% %*/
7273 /*% ripper: until_mod!($3, $1) %*/
7274 }
7275#line 7271 "parse.c"
7276 break;
7277
7278 case 33: /* stmt: stmt "`rescue' modifier" stmt */
7279#line 1549 "parse.y"
7280 {
7281 /*%%%*/
7282 NODE *resq;
7283 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7284 resq = NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc);
7285 (yyval.node) = NEW_RESCUE(remove_begin((yyvsp[-2].node)), resq, 0, &(yyloc));
7286 /*% %*/
7287 /*% ripper: rescue_mod!($1, $3) %*/
7288 }
7289#line 7285 "parse.c"
7290 break;
7291
7292 case 34: /* stmt: "`END'" '{' compstmt '}' */
7293#line 1559 "parse.y"
7294 {
7295 if (p->ctxt.in_def) {
7296 rb_warn0("END in method; use at_exit");
7297 }
7298 /*%%%*/
7299 {
7300 NODE *scope = NEW_NODE(
7301 NODE_SCOPE, 0 /* tbl */, (yyvsp[-1].node) /* body */, 0 /* args */, &(yyloc));
7302 (yyval.node) = NEW_POSTEXE(scope, &(yyloc));
7303 }
7304 /*% %*/
7305 /*% ripper: END!($3) %*/
7306 }
7307#line 7303 "parse.c"
7308 break;
7309
7310 case 36: /* stmt: mlhs '=' lex_ctxt command_call */
7311#line 1574 "parse.y"
7312 {
7313 /*%%%*/
7314 value_expr((yyvsp[0].node));
7315 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7316 /*% %*/
7317 /*% ripper: massign!($1, $4) %*/
7318 }
7319#line 7315 "parse.c"
7320 break;
7321
7322 case 37: /* stmt: lhs '=' lex_ctxt mrhs */
7323#line 1582 "parse.y"
7324 {
7325 /*%%%*/
7326 value_expr((yyvsp[0].node));
7327 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7328 /*% %*/
7329 /*% ripper: assign!($1, $4) %*/
7330 }
7331#line 7327 "parse.c"
7332 break;
7333
7334 case 38: /* stmt: mlhs '=' lex_ctxt mrhs_arg "`rescue' modifier" stmt */
7335#line 1590 "parse.y"
7336 {
7337 /*%%%*/
7338 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7339 value_expr((yyvsp[-2].node));
7340 (yyval.node) = node_assign(p, (yyvsp[-5].node), NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc)), (yyvsp[-3].ctxt), &(yyloc));
7341 /*% %*/
7342 /*% ripper: massign!($1, rescue_mod!($4, $6)) %*/
7343 }
7344#line 7340 "parse.c"
7345 break;
7346
7347 case 39: /* stmt: mlhs '=' lex_ctxt mrhs_arg */
7348#line 1599 "parse.y"
7349 {
7350 /*%%%*/
7351 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7352 /*% %*/
7353 /*% ripper: massign!($1, $4) %*/
7354 }
7355#line 7351 "parse.c"
7356 break;
7357
7358 case 41: /* command_asgn: lhs '=' lex_ctxt command_rhs */
7359#line 1609 "parse.y"
7360 {
7361 /*%%%*/
7362 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7363 /*% %*/
7364 /*% ripper: assign!($1, $4) %*/
7365 }
7366#line 7362 "parse.c"
7367 break;
7368
7369 case 42: /* command_asgn: var_lhs "operator-assignment" lex_ctxt command_rhs */
7370#line 1616 "parse.y"
7371 {
7372 /*%%%*/
7373 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7374 /*% %*/
7375 /*% ripper: opassign!($1, $2, $4) %*/
7376 }
7377#line 7373 "parse.c"
7378 break;
7379
7380 case 43: /* command_asgn: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt command_rhs */
7381#line 1623 "parse.y"
7382 {
7383 /*%%%*/
7384 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
7385 /*% %*/
7386 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
7387
7388 }
7389#line 7385 "parse.c"
7390 break;
7391
7392 case 44: /* command_asgn: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt command_rhs */
7393#line 1631 "parse.y"
7394 {
7395 /*%%%*/
7396 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
7397 /*% %*/
7398 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
7399 }
7400#line 7396 "parse.c"
7401 break;
7402
7403 case 45: /* command_asgn: primary_value call_op "constant" "operator-assignment" lex_ctxt command_rhs */
7404#line 1638 "parse.y"
7405 {
7406 /*%%%*/
7407 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
7408 /*% %*/
7409 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
7410 }
7411#line 7407 "parse.c"
7412 break;
7413
7414 case 46: /* command_asgn: primary_value "::" "constant" "operator-assignment" lex_ctxt command_rhs */
7415#line 1645 "parse.y"
7416 {
7417 /*%%%*/
7418 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
7419 (yyval.node) = new_const_op_assign(p, NEW_COLON2((yyvsp[-5].node), (yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
7420 /*% %*/
7421 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
7422 }
7423#line 7419 "parse.c"
7424 break;
7425
7426 case 47: /* command_asgn: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt command_rhs */
7427#line 1653 "parse.y"
7428 {
7429 /*%%%*/
7430 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
7431 /*% %*/
7432 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/
7433 }
7434#line 7430 "parse.c"
7435 break;
7436
7437 case 48: /* command_asgn: backref "operator-assignment" lex_ctxt command_rhs */
7438#line 1660 "parse.y"
7439 {
7440 /*%%%*/
7441 rb_backref_error(p, (yyvsp[-3].node));
7442 (yyval.node) = NEW_BEGIN(0, &(yyloc));
7443 /*% %*/
7444 /*% ripper[error]: backref_error(p, RNODE($1), assign!(var_field(p, $1), $4)) %*/
7445 }
7446#line 7442 "parse.c"
7447 break;
7448
7449 case 49: /* command_rhs: command_call */
7450#line 1670 "parse.y"
7451 {
7452 value_expr((yyvsp[0].node));
7453 (yyval.node) = (yyvsp[0].node);
7454 }
7455#line 7451 "parse.c"
7456 break;
7457
7458 case 50: /* command_rhs: command_call "`rescue' modifier" stmt */
7459#line 1675 "parse.y"
7460 {
7461 /*%%%*/
7462 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
7463 value_expr((yyvsp[-2].node));
7464 (yyval.node) = NEW_RESCUE((yyvsp[-2].node), NEW_RESBODY(0, remove_begin((yyvsp[0].node)), 0, &loc), 0, &(yyloc));
7465 /*% %*/
7466 /*% ripper: rescue_mod!($1, $3) %*/
7467 }
7468#line 7464 "parse.c"
7469 break;
7470
7471 case 53: /* expr: expr "`and'" expr */
7472#line 1688 "parse.y"
7473 {
7474 (yyval.node) = logop(p, idAND, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7475 }
7476#line 7472 "parse.c"
7477 break;
7478
7479 case 54: /* expr: expr "`or'" expr */
7480#line 1692 "parse.y"
7481 {
7482 (yyval.node) = logop(p, idOR, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7483 }
7484#line 7480 "parse.c"
7485 break;
7486
7487 case 55: /* expr: "`not'" opt_nl expr */
7488#line 1696 "parse.y"
7489 {
7490 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
7491 }
7492#line 7488 "parse.c"
7493 break;
7494
7495 case 56: /* expr: '!' command_call */
7496#line 1700 "parse.y"
7497 {
7498 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
7499 }
7500#line 7496 "parse.c"
7501 break;
7502
7503 case 57: /* @5: %empty */
7504#line 1704 "parse.y"
7505 {
7506 value_expr((yyvsp[-1].node));
7507 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
7508 p->command_start = FALSE;
7509 (yyval.ctxt) = p->ctxt;
7510 p->ctxt.in_kwarg = 1;
7511 }
7512#line 7508 "parse.c"
7513 break;
7514
7515 case 58: /* @6: %empty */
7516#line 1711 "parse.y"
7517 {(yyval.tbl) = push_pvtbl(p);}
7518#line 7514 "parse.c"
7519 break;
7520
7521 case 59: /* $@7: %empty */
7522#line 1713 "parse.y"
7523 {pop_pvtbl(p, (yyvsp[-1].tbl));}
7524#line 7520 "parse.c"
7525 break;
7526
7527 case 60: /* expr: arg "=>" @5 @6 p_expr $@7 */
7528#line 1714 "parse.y"
7529 {
7530 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
7531 /*%%%*/
7532 (yyval.node) = NEW_CASE3((yyvsp[-5].node), NEW_IN((yyvsp[-1].node), 0, 0, &(yylsp[-1])), &(yyloc));
7533 warn_one_line_pattern_matching(p, (yyval.node), (yyvsp[-1].node), true);
7534 /*% %*/
7535 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
7536 }
7537#line 7533 "parse.c"
7538 break;
7539
7540 case 61: /* @8: %empty */
7541#line 1723 "parse.y"
7542 {
7543 value_expr((yyvsp[-1].node));
7544 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
7545 p->command_start = FALSE;
7546 (yyval.ctxt) = p->ctxt;
7547 p->ctxt.in_kwarg = 1;
7548 }
7549#line 7545 "parse.c"
7550 break;
7551
7552 case 62: /* @9: %empty */
7553#line 1730 "parse.y"
7554 {(yyval.tbl) = push_pvtbl(p);}
7555#line 7551 "parse.c"
7556 break;
7557
7558 case 63: /* $@10: %empty */
7559#line 1732 "parse.y"
7560 {pop_pvtbl(p, (yyvsp[-1].tbl));}
7561#line 7557 "parse.c"
7562 break;
7563
7564 case 64: /* expr: arg "`in'" @8 @9 p_expr $@10 */
7565#line 1733 "parse.y"
7566 {
7567 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
7568 /*%%%*/
7569 (yyval.node) = NEW_CASE3((yyvsp[-5].node), NEW_IN((yyvsp[-1].node), NEW_TRUE(&(yylsp[-1])), NEW_FALSE(&(yylsp[-1])), &(yylsp[-1])), &(yyloc));
7570 warn_one_line_pattern_matching(p, (yyval.node), (yyvsp[-1].node), false);
7571 /*% %*/
7572 /*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
7573 }
7574#line 7570 "parse.c"
7575 break;
7576
7577 case 66: /* def_name: fname */
7578#line 1745 "parse.y"
7579 {
7580 ID fname = get_id((yyvsp[0].id));
7581 ID cur_arg = p->cur_arg;
7582 YYSTYPE c = {.ctxt = p->ctxt};
7583 numparam_name(p, fname);
7584 local_push(p, 0);
7585 p->cur_arg = 0;
7586 p->ctxt.in_def = 1;
7587 (yyval.node) = NEW_NODE(NODE_SELF, /*vid*/cur_arg, /*mid*/fname, /*cval*/c.val, &(yyloc));
7588 /*%%%*/
7589 /*%
7590 $$ = NEW_RIPPER(fname, get_value($1), $$, &NULL_LOC);
7591 %*/
7592 }
7593#line 7589 "parse.c"
7594 break;
7595
7596 case 67: /* defn_head: k_def def_name */
7597#line 1762 "parse.y"
7598 {
7599 (yyval.node) = (yyvsp[0].node);
7600 /*%%%*/
7601 (yyval.node) = NEW_NODE(NODE_DEFN, 0, (yyval.node)->nd_mid, (yyval.node), &(yyloc));
7602 /*% %*/
7603 }
7604#line 7600 "parse.c"
7605 break;
7606
7607 case 68: /* $@11: %empty */
7608#line 1770 "parse.y"
7609 {SET_LEX_STATE(EXPR_FNAME);}
7610#line 7606 "parse.c"
7611 break;
7612
7613 case 69: /* defs_head: k_def singleton dot_or_colon $@11 def_name */
7614#line 1771 "parse.y"
7615 {
7616 SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
7617 (yyval.node) = (yyvsp[0].node);
7618 /*%%%*/
7619 (yyval.node) = NEW_NODE(NODE_DEFS, (yyvsp[-3].node), (yyval.node)->nd_mid, (yyval.node), &(yyloc));
7620 /*%
7621 VALUE ary = rb_ary_new_from_args(3, $2, $3, get_value($$));
7622 add_mark_object(p, ary);
7623 $<node>$->nd_rval = ary;
7624 %*/
7625 }
7626#line 7622 "parse.c"
7627 break;
7628
7629 case 70: /* expr_value: expr */
7630#line 1785 "parse.y"
7631 {
7632 value_expr((yyvsp[0].node));
7633 (yyval.node) = (yyvsp[0].node);
7634 }
7635#line 7631 "parse.c"
7636 break;
7637
7638 case 71: /* $@12: %empty */
7639#line 1791 "parse.y"
7640 {COND_PUSH(1);}
7641#line 7637 "parse.c"
7642 break;
7643
7644 case 72: /* $@13: %empty */
7645#line 1791 "parse.y"
7646 {COND_POP();}
7647#line 7643 "parse.c"
7648 break;
7649
7650 case 73: /* expr_value_do: $@12 expr_value do $@13 */
7651#line 1792 "parse.y"
7652 {
7653 (yyval.node) = (yyvsp[-2].node);
7654 }
7655#line 7651 "parse.c"
7656 break;
7657
7658 case 77: /* block_command: block_call call_op2 operation2 command_args */
7659#line 1803 "parse.y"
7660 {
7661 /*%%%*/
7662 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
7663 /*% %*/
7664 /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/
7665 }
7666#line 7662 "parse.c"
7667 break;
7668
7669 case 78: /* cmd_brace_block: "{ arg" brace_body '}' */
7670#line 1812 "parse.y"
7671 {
7672 (yyval.node) = (yyvsp[-1].node);
7673 /*%%%*/
7674 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
7675 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
7676 /*% %*/
7677 }
7678#line 7674 "parse.c"
7679 break;
7680
7681 case 79: /* fcall: operation */
7682#line 1822 "parse.y"
7683 {
7684 /*%%%*/
7685 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
7686 nd_set_line((yyval.node), p->tokline);
7687 /*% %*/
7688 /*% ripper: $1 %*/
7689 }
7690#line 7686 "parse.c"
7691 break;
7692
7693 case 80: /* command: fcall command_args */
7694#line 1832 "parse.y"
7695 {
7696 /*%%%*/
7697 (yyvsp[-1].node)->nd_args = (yyvsp[0].node);
7698 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
7699 (yyval.node) = (yyvsp[-1].node);
7700 /*% %*/
7701 /*% ripper: command!($1, $2) %*/
7702 }
7703#line 7699 "parse.c"
7704 break;
7705
7706 case 81: /* command: fcall command_args cmd_brace_block */
7707#line 1841 "parse.y"
7708 {
7709 /*%%%*/
7710 block_dup_check(p, (yyvsp[-1].node), (yyvsp[0].node));
7711 (yyvsp[-2].node)->nd_args = (yyvsp[-1].node);
7712 (yyval.node) = method_add_block(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7713 fixpos((yyval.node), (yyvsp[-2].node));
7714 nd_set_last_loc((yyvsp[-2].node), (yylsp[-1]).end_pos);
7715 /*% %*/
7716 /*% ripper: method_add_block!(command!($1, $2), $3) %*/
7717 }
7718#line 7714 "parse.c"
7719 break;
7720
7721 case 82: /* command: primary_value call_op operation2 command_args */
7722#line 1852 "parse.y"
7723 {
7724 /*%%%*/
7725 (yyval.node) = new_command_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
7726 /*% %*/
7727 /*% ripper: command_call!($1, $2, $3, $4) %*/
7728 }
7729#line 7725 "parse.c"
7730 break;
7731
7732 case 83: /* command: primary_value call_op operation2 command_args cmd_brace_block */
7733#line 1859 "parse.y"
7734 {
7735 /*%%%*/
7736 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
7737 /*% %*/
7738 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
7739 }
7740#line 7736 "parse.c"
7741 break;
7742
7743 case 84: /* command: primary_value "::" operation2 command_args */
7744#line 1866 "parse.y"
7745 {
7746 /*%%%*/
7747 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), Qnull, &(yylsp[-1]), &(yyloc));
7748 /*% %*/
7749 /*% ripper: command_call!($1, ID2VAL(idCOLON2), $3, $4) %*/
7750 }
7751#line 7747 "parse.c"
7752 break;
7753
7754 case 85: /* command: primary_value "::" operation2 command_args cmd_brace_block */
7755#line 1873 "parse.y"
7756 {
7757 /*%%%*/
7758 (yyval.node) = new_command_qcall(p, ID2VAL(idCOLON2), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
7759 /*% %*/
7760 /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/
7761 }
7762#line 7758 "parse.c"
7763 break;
7764
7765 case 86: /* command: "`super'" command_args */
7766#line 1880 "parse.y"
7767 {
7768 /*%%%*/
7769 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
7770 fixpos((yyval.node), (yyvsp[0].node));
7771 /*% %*/
7772 /*% ripper: super!($2) %*/
7773 }
7774#line 7770 "parse.c"
7775 break;
7776
7777 case 87: /* command: "`yield'" command_args */
7778#line 1888 "parse.y"
7779 {
7780 /*%%%*/
7781 (yyval.node) = new_yield(p, (yyvsp[0].node), &(yyloc));
7782 fixpos((yyval.node), (yyvsp[0].node));
7783 /*% %*/
7784 /*% ripper: yield!($2) %*/
7785 }
7786#line 7782 "parse.c"
7787 break;
7788
7789 case 88: /* command: k_return call_args */
7790#line 1896 "parse.y"
7791 {
7792 /*%%%*/
7793 (yyval.node) = NEW_RETURN(ret_args(p, (yyvsp[0].node)), &(yyloc));
7794 /*% %*/
7795 /*% ripper: return!($2) %*/
7796 }
7797#line 7793 "parse.c"
7798 break;
7799
7800 case 89: /* command: "`break'" call_args */
7801#line 1903 "parse.y"
7802 {
7803 /*%%%*/
7804 (yyval.node) = NEW_BREAK(ret_args(p, (yyvsp[0].node)), &(yyloc));
7805 /*% %*/
7806 /*% ripper: break!($2) %*/
7807 }
7808#line 7804 "parse.c"
7809 break;
7810
7811 case 90: /* command: "`next'" call_args */
7812#line 1910 "parse.y"
7813 {
7814 /*%%%*/
7815 (yyval.node) = NEW_NEXT(ret_args(p, (yyvsp[0].node)), &(yyloc));
7816 /*% %*/
7817 /*% ripper: next!($2) %*/
7818 }
7819#line 7815 "parse.c"
7820 break;
7821
7822 case 92: /* mlhs: "(" mlhs_inner rparen */
7823#line 1920 "parse.y"
7824 {
7825 /*%%%*/
7826 (yyval.node) = (yyvsp[-1].node);
7827 /*% %*/
7828 /*% ripper: mlhs_paren!($2) %*/
7829 }
7830#line 7826 "parse.c"
7831 break;
7832
7833 case 94: /* mlhs_inner: "(" mlhs_inner rparen */
7834#line 1930 "parse.y"
7835 {
7836 /*%%%*/
7837 (yyval.node) = NEW_MASGN(NEW_LIST((yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
7838 /*% %*/
7839 /*% ripper: mlhs_paren!($2) %*/
7840 }
7841#line 7837 "parse.c"
7842 break;
7843
7844 case 95: /* mlhs_basic: mlhs_head */
7845#line 1939 "parse.y"
7846 {
7847 /*%%%*/
7848 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
7849 /*% %*/
7850 /*% ripper: $1 %*/
7851 }
7852#line 7848 "parse.c"
7853 break;
7854
7855 case 96: /* mlhs_basic: mlhs_head mlhs_item */
7856#line 1946 "parse.y"
7857 {
7858 /*%%%*/
7859 (yyval.node) = NEW_MASGN(list_append(p, (yyvsp[-1].node),(yyvsp[0].node)), 0, &(yyloc));
7860 /*% %*/
7861 /*% ripper: mlhs_add!($1, $2) %*/
7862 }
7863#line 7859 "parse.c"
7864 break;
7865
7866 case 97: /* mlhs_basic: mlhs_head "*" mlhs_node */
7867#line 1953 "parse.y"
7868 {
7869 /*%%%*/
7870 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
7871 /*% %*/
7872 /*% ripper: mlhs_add_star!($1, $3) %*/
7873 }
7874#line 7870 "parse.c"
7875 break;
7876
7877 case 98: /* mlhs_basic: mlhs_head "*" mlhs_node ',' mlhs_post */
7878#line 1960 "parse.y"
7879 {
7880 /*%%%*/
7881 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
7882 /*% %*/
7883 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
7884 }
7885#line 7881 "parse.c"
7886 break;
7887
7888 case 99: /* mlhs_basic: mlhs_head "*" */
7889#line 1967 "parse.y"
7890 {
7891 /*%%%*/
7892 (yyval.node) = NEW_MASGN((yyvsp[-1].node), NODE_SPECIAL_NO_NAME_REST, &(yyloc));
7893 /*% %*/
7894 /*% ripper: mlhs_add_star!($1, Qnil) %*/
7895 }
7896#line 7892 "parse.c"
7897 break;
7898
7899 case 100: /* mlhs_basic: mlhs_head "*" ',' mlhs_post */
7900#line 1974 "parse.y"
7901 {
7902 /*%%%*/
7903 (yyval.node) = NEW_MASGN((yyvsp[-3].node), NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
7904 /*% %*/
7905 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, Qnil), $4) %*/
7906 }
7907#line 7903 "parse.c"
7908 break;
7909
7910 case 101: /* mlhs_basic: "*" mlhs_node */
7911#line 1981 "parse.y"
7912 {
7913 /*%%%*/
7914 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
7915 /*% %*/
7916 /*% ripper: mlhs_add_star!(mlhs_new!, $2) %*/
7917 }
7918#line 7914 "parse.c"
7919 break;
7920
7921 case 102: /* mlhs_basic: "*" mlhs_node ',' mlhs_post */
7922#line 1988 "parse.y"
7923 {
7924 /*%%%*/
7925 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node),(yyvsp[0].node),&(yyloc)), &(yyloc));
7926 /*% %*/
7927 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $2), $4) %*/
7928 }
7929#line 7925 "parse.c"
7930 break;
7931
7932 case 103: /* mlhs_basic: "*" */
7933#line 1995 "parse.y"
7934 {
7935 /*%%%*/
7936 (yyval.node) = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &(yyloc));
7937 /*% %*/
7938 /*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
7939 }
7940#line 7936 "parse.c"
7941 break;
7942
7943 case 104: /* mlhs_basic: "*" ',' mlhs_post */
7944#line 2002 "parse.y"
7945 {
7946 /*%%%*/
7947 (yyval.node) = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, (yyvsp[0].node), &(yyloc)), &(yyloc));
7948 /*% %*/
7949 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $3) %*/
7950 }
7951#line 7947 "parse.c"
7952 break;
7953
7954 case 106: /* mlhs_item: "(" mlhs_inner rparen */
7955#line 2012 "parse.y"
7956 {
7957 /*%%%*/
7958 (yyval.node) = (yyvsp[-1].node);
7959 /*% %*/
7960 /*% ripper: mlhs_paren!($2) %*/
7961 }
7962#line 7958 "parse.c"
7963 break;
7964
7965 case 107: /* mlhs_head: mlhs_item ',' */
7966#line 2021 "parse.y"
7967 {
7968 /*%%%*/
7969 (yyval.node) = NEW_LIST((yyvsp[-1].node), &(yylsp[-1]));
7970 /*% %*/
7971 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
7972 }
7973#line 7969 "parse.c"
7974 break;
7975
7976 case 108: /* mlhs_head: mlhs_head mlhs_item ',' */
7977#line 2028 "parse.y"
7978 {
7979 /*%%%*/
7980 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
7981 /*% %*/
7982 /*% ripper: mlhs_add!($1, $2) %*/
7983 }
7984#line 7980 "parse.c"
7985 break;
7986
7987 case 109: /* mlhs_post: mlhs_item */
7988#line 2037 "parse.y"
7989 {
7990 /*%%%*/
7991 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
7992 /*% %*/
7993 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
7994 }
7995#line 7991 "parse.c"
7996 break;
7997
7998 case 110: /* mlhs_post: mlhs_post ',' mlhs_item */
7999#line 2044 "parse.y"
8000 {
8001 /*%%%*/
8002 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
8003 /*% %*/
8004 /*% ripper: mlhs_add!($1, $3) %*/
8005 }
8006#line 8002 "parse.c"
8007 break;
8008
8009 case 111: /* mlhs_node: user_variable */
8010#line 2053 "parse.y"
8011 {
8012 /*%%%*/
8013 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8014 /*% %*/
8015 /*% ripper: assignable(p, var_field(p, $1)) %*/
8016 }
8017#line 8013 "parse.c"
8018 break;
8019
8020 case 112: /* mlhs_node: keyword_variable */
8021#line 2060 "parse.y"
8022 {
8023 /*%%%*/
8024 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8025 /*% %*/
8026 /*% ripper: assignable(p, var_field(p, $1)) %*/
8027 }
8028#line 8024 "parse.c"
8029 break;
8030
8031 case 113: /* mlhs_node: primary_value '[' opt_call_args rbracket */
8032#line 2067 "parse.y"
8033 {
8034 /*%%%*/
8035 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
8036 /*% %*/
8037 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
8038 }
8039#line 8035 "parse.c"
8040 break;
8041
8042 case 114: /* mlhs_node: primary_value call_op "local variable or method" */
8043#line 2074 "parse.y"
8044 {
8045 if ((yyvsp[-1].id) == tANDDOT) {
8046 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
8047 }
8048 /*%%%*/
8049 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8050 /*% %*/
8051 /*% ripper: field!($1, $2, $3) %*/
8052 }
8053#line 8049 "parse.c"
8054 break;
8055
8056 case 115: /* mlhs_node: primary_value "::" "local variable or method" */
8057#line 2084 "parse.y"
8058 {
8059 /*%%%*/
8060 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
8061 /*% %*/
8062 /*% ripper: const_path_field!($1, $3) %*/
8063 }
8064#line 8060 "parse.c"
8065 break;
8066
8067 case 116: /* mlhs_node: primary_value call_op "constant" */
8068#line 2091 "parse.y"
8069 {
8070 if ((yyvsp[-1].id) == tANDDOT) {
8071 yyerror1(&(yylsp[-1]), "&. inside multiple assignment destination");
8072 }
8073 /*%%%*/
8074 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8075 /*% %*/
8076 /*% ripper: field!($1, $2, $3) %*/
8077 }
8078#line 8074 "parse.c"
8079 break;
8080
8081 case 117: /* mlhs_node: primary_value "::" "constant" */
8082#line 2101 "parse.y"
8083 {
8084 /*%%%*/
8085 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
8086 /*% %*/
8087 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
8088 }
8089#line 8085 "parse.c"
8090 break;
8091
8092 case 118: /* mlhs_node: ":: at EXPR_BEG" "constant" */
8093#line 2108 "parse.y"
8094 {
8095 /*%%%*/
8096 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
8097 /*% %*/
8098 /*% ripper: const_decl(p, top_const_field!($2)) %*/
8099 }
8100#line 8096 "parse.c"
8101 break;
8102
8103 case 119: /* mlhs_node: backref */
8104#line 2115 "parse.y"
8105 {
8106 /*%%%*/
8107 rb_backref_error(p, (yyvsp[0].node));
8108 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8109 /*% %*/
8110 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
8111 }
8112#line 8108 "parse.c"
8113 break;
8114
8115 case 120: /* lhs: user_variable */
8116#line 2125 "parse.y"
8117 {
8118 /*%%%*/
8119 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8120 /*% %*/
8121 /*% ripper: assignable(p, var_field(p, $1)) %*/
8122 }
8123#line 8119 "parse.c"
8124 break;
8125
8126 case 121: /* lhs: keyword_variable */
8127#line 2132 "parse.y"
8128 {
8129 /*%%%*/
8130 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
8131 /*% %*/
8132 /*% ripper: assignable(p, var_field(p, $1)) %*/
8133 }
8134#line 8130 "parse.c"
8135 break;
8136
8137 case 122: /* lhs: primary_value '[' opt_call_args rbracket */
8138#line 2139 "parse.y"
8139 {
8140 /*%%%*/
8141 (yyval.node) = aryset(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
8142 /*% %*/
8143 /*% ripper: aref_field!($1, escape_Qundef($3)) %*/
8144 }
8145#line 8141 "parse.c"
8146 break;
8147
8148 case 123: /* lhs: primary_value call_op "local variable or method" */
8149#line 2146 "parse.y"
8150 {
8151 /*%%%*/
8152 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8153 /*% %*/
8154 /*% ripper: field!($1, $2, $3) %*/
8155 }
8156#line 8152 "parse.c"
8157 break;
8158
8159 case 124: /* lhs: primary_value "::" "local variable or method" */
8160#line 2153 "parse.y"
8161 {
8162 /*%%%*/
8163 (yyval.node) = attrset(p, (yyvsp[-2].node), idCOLON2, (yyvsp[0].id), &(yyloc));
8164 /*% %*/
8165 /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/
8166 }
8167#line 8163 "parse.c"
8168 break;
8169
8170 case 125: /* lhs: primary_value call_op "constant" */
8171#line 2160 "parse.y"
8172 {
8173 /*%%%*/
8174 (yyval.node) = attrset(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].id), &(yyloc));
8175 /*% %*/
8176 /*% ripper: field!($1, $2, $3) %*/
8177 }
8178#line 8174 "parse.c"
8179 break;
8180
8181 case 126: /* lhs: primary_value "::" "constant" */
8182#line 2167 "parse.y"
8183 {
8184 /*%%%*/
8185 (yyval.node) = const_decl(p, NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc)), &(yyloc));
8186 /*% %*/
8187 /*% ripper: const_decl(p, const_path_field!($1, $3)) %*/
8188 }
8189#line 8185 "parse.c"
8190 break;
8191
8192 case 127: /* lhs: ":: at EXPR_BEG" "constant" */
8193#line 2174 "parse.y"
8194 {
8195 /*%%%*/
8196 (yyval.node) = const_decl(p, NEW_COLON3((yyvsp[0].id), &(yyloc)), &(yyloc));
8197 /*% %*/
8198 /*% ripper: const_decl(p, top_const_field!($2)) %*/
8199 }
8200#line 8196 "parse.c"
8201 break;
8202
8203 case 128: /* lhs: backref */
8204#line 2181 "parse.y"
8205 {
8206 /*%%%*/
8207 rb_backref_error(p, (yyvsp[0].node));
8208 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8209 /*% %*/
8210 /*% ripper[error]: backref_error(p, RNODE($1), var_field(p, $1)) %*/
8211 }
8212#line 8208 "parse.c"
8213 break;
8214
8215 case 129: /* cname: "local variable or method" */
8216#line 2191 "parse.y"
8217 {
8218 static const char mesg[] = "class/module name must be CONSTANT";
8219 /*%%%*/
8220 yyerror1(&(yylsp[0]), mesg);
8221 /*% %*/
8222 /*% ripper[error]: class_name_error!(ERR_MESG(), $1) %*/
8223 }
8224#line 8220 "parse.c"
8225 break;
8226
8227 case 131: /* cpath: ":: at EXPR_BEG" cname */
8228#line 2202 "parse.y"
8229 {
8230 /*%%%*/
8231 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
8232 /*% %*/
8233 /*% ripper: top_const_ref!($2) %*/
8234 }
8235#line 8231 "parse.c"
8236 break;
8237
8238 case 132: /* cpath: cname */
8239#line 2209 "parse.y"
8240 {
8241 /*%%%*/
8242 (yyval.node) = NEW_COLON2(0, (yyval.node), &(yyloc));
8243 /*% %*/
8244 /*% ripper: const_ref!($1) %*/
8245 }
8246#line 8242 "parse.c"
8247 break;
8248
8249 case 133: /* cpath: primary_value "::" cname */
8250#line 2216 "parse.y"
8251 {
8252 /*%%%*/
8253 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
8254 /*% %*/
8255 /*% ripper: const_path_ref!($1, $3) %*/
8256 }
8257#line 8253 "parse.c"
8258 break;
8259
8260 case 137: /* fname: op */
8261#line 2228 "parse.y"
8262 {
8263 SET_LEX_STATE(EXPR_ENDFN);
8264 (yyval.id) = (yyvsp[0].id);
8265 }
8266#line 8262 "parse.c"
8267 break;
8268
8269 case 139: /* fitem: fname */
8270#line 2236 "parse.y"
8271 {
8272 /*%%%*/
8273 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
8274 /*% %*/
8275 /*% ripper: symbol_literal!($1) %*/
8276 }
8277#line 8273 "parse.c"
8278 break;
8279
8280 case 141: /* undef_list: fitem */
8281#line 2246 "parse.y"
8282 {
8283 /*%%%*/
8284 (yyval.node) = NEW_UNDEF((yyvsp[0].node), &(yyloc));
8285 /*% %*/
8286 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
8287 }
8288#line 8284 "parse.c"
8289 break;
8290
8291 case 142: /* $@14: %empty */
8292#line 2252 "parse.y"
8293 {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);}
8294#line 8290 "parse.c"
8295 break;
8296
8297 case 143: /* undef_list: undef_list ',' $@14 fitem */
8298#line 2253 "parse.y"
8299 {
8300 /*%%%*/
8301 NODE *undef = NEW_UNDEF((yyvsp[0].node), &(yylsp[0]));
8302 (yyval.node) = block_append(p, (yyvsp[-3].node), undef);
8303 /*% %*/
8304 /*% ripper: rb_ary_push($1, get_value($4)) %*/
8305 }
8306#line 8302 "parse.c"
8307 break;
8308
8309 case 144: /* op: '|' */
8310#line 2262 "parse.y"
8311 { ifndef_ripper((yyval.id) = '|'); }
8312#line 8308 "parse.c"
8313 break;
8314
8315 case 145: /* op: '^' */
8316#line 2263 "parse.y"
8317 { ifndef_ripper((yyval.id) = '^'); }
8318#line 8314 "parse.c"
8319 break;
8320
8321 case 146: /* op: '&' */
8322#line 2264 "parse.y"
8323 { ifndef_ripper((yyval.id) = '&'); }
8324#line 8320 "parse.c"
8325 break;
8326
8327 case 147: /* op: "<=>" */
8328#line 2265 "parse.y"
8329 { ifndef_ripper((yyval.id) = tCMP); }
8330#line 8326 "parse.c"
8331 break;
8332
8333 case 148: /* op: "==" */
8334#line 2266 "parse.y"
8335 { ifndef_ripper((yyval.id) = tEQ); }
8336#line 8332 "parse.c"
8337 break;
8338
8339 case 149: /* op: "===" */
8340#line 2267 "parse.y"
8341 { ifndef_ripper((yyval.id) = tEQQ); }
8342#line 8338 "parse.c"
8343 break;
8344
8345 case 150: /* op: "=~" */
8346#line 2268 "parse.y"
8347 { ifndef_ripper((yyval.id) = tMATCH); }
8348#line 8344 "parse.c"
8349 break;
8350
8351 case 151: /* op: "!~" */
8352#line 2269 "parse.y"
8353 { ifndef_ripper((yyval.id) = tNMATCH); }
8354#line 8350 "parse.c"
8355 break;
8356
8357 case 152: /* op: '>' */
8358#line 2270 "parse.y"
8359 { ifndef_ripper((yyval.id) = '>'); }
8360#line 8356 "parse.c"
8361 break;
8362
8363 case 153: /* op: ">=" */
8364#line 2271 "parse.y"
8365 { ifndef_ripper((yyval.id) = tGEQ); }
8366#line 8362 "parse.c"
8367 break;
8368
8369 case 154: /* op: '<' */
8370#line 2272 "parse.y"
8371 { ifndef_ripper((yyval.id) = '<'); }
8372#line 8368 "parse.c"
8373 break;
8374
8375 case 155: /* op: "<=" */
8376#line 2273 "parse.y"
8377 { ifndef_ripper((yyval.id) = tLEQ); }
8378#line 8374 "parse.c"
8379 break;
8380
8381 case 156: /* op: "!=" */
8382#line 2274 "parse.y"
8383 { ifndef_ripper((yyval.id) = tNEQ); }
8384#line 8380 "parse.c"
8385 break;
8386
8387 case 157: /* op: "<<" */
8388#line 2275 "parse.y"
8389 { ifndef_ripper((yyval.id) = tLSHFT); }
8390#line 8386 "parse.c"
8391 break;
8392
8393 case 158: /* op: ">>" */
8394#line 2276 "parse.y"
8395 { ifndef_ripper((yyval.id) = tRSHFT); }
8396#line 8392 "parse.c"
8397 break;
8398
8399 case 159: /* op: '+' */
8400#line 2277 "parse.y"
8401 { ifndef_ripper((yyval.id) = '+'); }
8402#line 8398 "parse.c"
8403 break;
8404
8405 case 160: /* op: '-' */
8406#line 2278 "parse.y"
8407 { ifndef_ripper((yyval.id) = '-'); }
8408#line 8404 "parse.c"
8409 break;
8410
8411 case 161: /* op: '*' */
8412#line 2279 "parse.y"
8413 { ifndef_ripper((yyval.id) = '*'); }
8414#line 8410 "parse.c"
8415 break;
8416
8417 case 162: /* op: "*" */
8418#line 2280 "parse.y"
8419 { ifndef_ripper((yyval.id) = '*'); }
8420#line 8416 "parse.c"
8421 break;
8422
8423 case 163: /* op: '/' */
8424#line 2281 "parse.y"
8425 { ifndef_ripper((yyval.id) = '/'); }
8426#line 8422 "parse.c"
8427 break;
8428
8429 case 164: /* op: '%' */
8430#line 2282 "parse.y"
8431 { ifndef_ripper((yyval.id) = '%'); }
8432#line 8428 "parse.c"
8433 break;
8434
8435 case 165: /* op: "**" */
8436#line 2283 "parse.y"
8437 { ifndef_ripper((yyval.id) = tPOW); }
8438#line 8434 "parse.c"
8439 break;
8440
8441 case 166: /* op: "**arg" */
8442#line 2284 "parse.y"
8443 { ifndef_ripper((yyval.id) = tDSTAR); }
8444#line 8440 "parse.c"
8445 break;
8446
8447 case 167: /* op: '!' */
8448#line 2285 "parse.y"
8449 { ifndef_ripper((yyval.id) = '!'); }
8450#line 8446 "parse.c"
8451 break;
8452
8453 case 168: /* op: '~' */
8454#line 2286 "parse.y"
8455 { ifndef_ripper((yyval.id) = '~'); }
8456#line 8452 "parse.c"
8457 break;
8458
8459 case 169: /* op: "unary+" */
8460#line 2287 "parse.y"
8461 { ifndef_ripper((yyval.id) = tUPLUS); }
8462#line 8458 "parse.c"
8463 break;
8464
8465 case 170: /* op: "unary-" */
8466#line 2288 "parse.y"
8467 { ifndef_ripper((yyval.id) = tUMINUS); }
8468#line 8464 "parse.c"
8469 break;
8470
8471 case 171: /* op: "[]" */
8472#line 2289 "parse.y"
8473 { ifndef_ripper((yyval.id) = tAREF); }
8474#line 8470 "parse.c"
8475 break;
8476
8477 case 172: /* op: "[]=" */
8478#line 2290 "parse.y"
8479 { ifndef_ripper((yyval.id) = tASET); }
8480#line 8476 "parse.c"
8481 break;
8482
8483 case 173: /* op: '`' */
8484#line 2291 "parse.y"
8485 { ifndef_ripper((yyval.id) = '`'); }
8486#line 8482 "parse.c"
8487 break;
8488
8489 case 215: /* arg: lhs '=' lex_ctxt arg_rhs */
8490#line 2309 "parse.y"
8491 {
8492 /*%%%*/
8493 (yyval.node) = node_assign(p, (yyvsp[-3].node), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8494 /*% %*/
8495 /*% ripper: assign!($1, $4) %*/
8496 }
8497#line 8493 "parse.c"
8498 break;
8499
8500 case 216: /* arg: var_lhs "operator-assignment" lex_ctxt arg_rhs */
8501#line 2316 "parse.y"
8502 {
8503 /*%%%*/
8504 (yyval.node) = new_op_assign(p, (yyvsp[-3].node), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8505 /*% %*/
8506 /*% ripper: opassign!($1, $2, $4) %*/
8507 }
8508#line 8504 "parse.c"
8509 break;
8510
8511 case 217: /* arg: primary_value '[' opt_call_args rbracket "operator-assignment" lex_ctxt arg_rhs */
8512#line 2323 "parse.y"
8513 {
8514 /*%%%*/
8515 (yyval.node) = new_ary_op_assign(p, (yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[0].node), &(yylsp[-4]), &(yyloc));
8516 /*% %*/
8517 /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $7) %*/
8518 }
8519#line 8515 "parse.c"
8520 break;
8521
8522 case 218: /* arg: primary_value call_op "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
8523#line 2330 "parse.y"
8524 {
8525 /*%%%*/
8526 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
8527 /*% %*/
8528 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
8529 }
8530#line 8526 "parse.c"
8531 break;
8532
8533 case 219: /* arg: primary_value call_op "constant" "operator-assignment" lex_ctxt arg_rhs */
8534#line 2337 "parse.y"
8535 {
8536 /*%%%*/
8537 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), (yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
8538 /*% %*/
8539 /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/
8540 }
8541#line 8537 "parse.c"
8542 break;
8543
8544 case 220: /* arg: primary_value "::" "local variable or method" "operator-assignment" lex_ctxt arg_rhs */
8545#line 2344 "parse.y"
8546 {
8547 /*%%%*/
8548 (yyval.node) = new_attr_op_assign(p, (yyvsp[-5].node), ID2VAL(idCOLON2), (yyvsp[-3].id), (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
8549 /*% %*/
8550 /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/
8551 }
8552#line 8548 "parse.c"
8553 break;
8554
8555 case 221: /* arg: primary_value "::" "constant" "operator-assignment" lex_ctxt arg_rhs */
8556#line 2351 "parse.y"
8557 {
8558 /*%%%*/
8559 YYLTYPE loc = code_loc_gen(&(yylsp[-5]), &(yylsp[-3]));
8560 (yyval.node) = new_const_op_assign(p, NEW_COLON2((yyvsp[-5].node), (yyvsp[-3].id), &loc), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8561 /*% %*/
8562 /*% ripper: opassign!(const_path_field!($1, $3), $4, $6) %*/
8563 }
8564#line 8560 "parse.c"
8565 break;
8566
8567 case 222: /* arg: ":: at EXPR_BEG" "constant" "operator-assignment" lex_ctxt arg_rhs */
8568#line 2359 "parse.y"
8569 {
8570 /*%%%*/
8571 (yyval.node) = new_const_op_assign(p, NEW_COLON3((yyvsp[-3].id), &(yyloc)), (yyvsp[-2].id), (yyvsp[0].node), (yyvsp[-1].ctxt), &(yyloc));
8572 /*% %*/
8573 /*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
8574 }
8575#line 8571 "parse.c"
8576 break;
8577
8578 case 223: /* arg: backref "operator-assignment" lex_ctxt arg_rhs */
8579#line 2366 "parse.y"
8580 {
8581 /*%%%*/
8582 rb_backref_error(p, (yyvsp[-3].node));
8583 (yyval.node) = NEW_BEGIN(0, &(yyloc));
8584 /*% %*/
8585 /*% ripper[error]: backref_error(p, RNODE($1), opassign!(var_field(p, $1), $2, $4)) %*/
8586 }
8587#line 8583 "parse.c"
8588 break;
8589
8590 case 224: /* arg: arg ".." arg */
8591#line 2374 "parse.y"
8592 {
8593 /*%%%*/
8594 value_expr((yyvsp[-2].node));
8595 value_expr((yyvsp[0].node));
8596 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8597 /*% %*/
8598 /*% ripper: dot2!($1, $3) %*/
8599 }
8600#line 8596 "parse.c"
8601 break;
8602
8603 case 225: /* arg: arg "..." arg */
8604#line 2383 "parse.y"
8605 {
8606 /*%%%*/
8607 value_expr((yyvsp[-2].node));
8608 value_expr((yyvsp[0].node));
8609 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8610 /*% %*/
8611 /*% ripper: dot3!($1, $3) %*/
8612 }
8613#line 8609 "parse.c"
8614 break;
8615
8616 case 226: /* arg: arg ".." */
8617#line 2392 "parse.y"
8618 {
8619 /*%%%*/
8620 value_expr((yyvsp[-1].node));
8621 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
8622 /*% %*/
8623 /*% ripper: dot2!($1, Qnil) %*/
8624 }
8625#line 8621 "parse.c"
8626 break;
8627
8628 case 227: /* arg: arg "..." */
8629#line 2400 "parse.y"
8630 {
8631 /*%%%*/
8632 value_expr((yyvsp[-1].node));
8633 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
8634 /*% %*/
8635 /*% ripper: dot3!($1, Qnil) %*/
8636 }
8637#line 8633 "parse.c"
8638 break;
8639
8640 case 228: /* arg: "(.." arg */
8641#line 2408 "parse.y"
8642 {
8643 /*%%%*/
8644 value_expr((yyvsp[0].node));
8645 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
8646 /*% %*/
8647 /*% ripper: dot2!(Qnil, $2) %*/
8648 }
8649#line 8645 "parse.c"
8650 break;
8651
8652 case 229: /* arg: "(..." arg */
8653#line 2416 "parse.y"
8654 {
8655 /*%%%*/
8656 value_expr((yyvsp[0].node));
8657 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
8658 /*% %*/
8659 /*% ripper: dot3!(Qnil, $2) %*/
8660 }
8661#line 8657 "parse.c"
8662 break;
8663
8664 case 230: /* arg: arg '+' arg */
8665#line 2424 "parse.y"
8666 {
8667 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '+', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8668 }
8669#line 8665 "parse.c"
8670 break;
8671
8672 case 231: /* arg: arg '-' arg */
8673#line 2428 "parse.y"
8674 {
8675 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '-', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8676 }
8677#line 8673 "parse.c"
8678 break;
8679
8680 case 232: /* arg: arg '*' arg */
8681#line 2432 "parse.y"
8682 {
8683 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '*', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8684 }
8685#line 8681 "parse.c"
8686 break;
8687
8688 case 233: /* arg: arg '/' arg */
8689#line 2436 "parse.y"
8690 {
8691 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '/', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8692 }
8693#line 8689 "parse.c"
8694 break;
8695
8696 case 234: /* arg: arg '%' arg */
8697#line 2440 "parse.y"
8698 {
8699 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '%', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8700 }
8701#line 8697 "parse.c"
8702 break;
8703
8704 case 235: /* arg: arg "**" arg */
8705#line 2444 "parse.y"
8706 {
8707 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8708 }
8709#line 8705 "parse.c"
8710 break;
8711
8712 case 236: /* arg: tUMINUS_NUM simple_numeric "**" arg */
8713#line 2448 "parse.y"
8714 {
8715 (yyval.node) = call_uni_op(p, call_bin_op(p, (yyvsp[-2].node), idPow, (yyvsp[0].node), &(yylsp[-2]), &(yyloc)), idUMinus, &(yylsp[-3]), &(yyloc));
8716 }
8717#line 8713 "parse.c"
8718 break;
8719
8720 case 237: /* arg: "unary+" arg */
8721#line 2452 "parse.y"
8722 {
8723 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUPlus, &(yylsp[-1]), &(yyloc));
8724 }
8725#line 8721 "parse.c"
8726 break;
8727
8728 case 238: /* arg: "unary-" arg */
8729#line 2456 "parse.y"
8730 {
8731 (yyval.node) = call_uni_op(p, (yyvsp[0].node), idUMinus, &(yylsp[-1]), &(yyloc));
8732 }
8733#line 8729 "parse.c"
8734 break;
8735
8736 case 239: /* arg: arg '|' arg */
8737#line 2460 "parse.y"
8738 {
8739 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '|', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8740 }
8741#line 8737 "parse.c"
8742 break;
8743
8744 case 240: /* arg: arg '^' arg */
8745#line 2464 "parse.y"
8746 {
8747 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '^', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8748 }
8749#line 8745 "parse.c"
8750 break;
8751
8752 case 241: /* arg: arg '&' arg */
8753#line 2468 "parse.y"
8754 {
8755 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), '&', (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8756 }
8757#line 8753 "parse.c"
8758 break;
8759
8760 case 242: /* arg: arg "<=>" arg */
8761#line 2472 "parse.y"
8762 {
8763 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idCmp, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8764 }
8765#line 8761 "parse.c"
8766 break;
8767
8768 case 244: /* arg: arg "==" arg */
8769#line 2477 "parse.y"
8770 {
8771 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8772 }
8773#line 8769 "parse.c"
8774 break;
8775
8776 case 245: /* arg: arg "===" arg */
8777#line 2481 "parse.y"
8778 {
8779 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idEqq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8780 }
8781#line 8777 "parse.c"
8782 break;
8783
8784 case 246: /* arg: arg "!=" arg */
8785#line 2485 "parse.y"
8786 {
8787 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeq, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8788 }
8789#line 8785 "parse.c"
8790 break;
8791
8792 case 247: /* arg: arg "=~" arg */
8793#line 2489 "parse.y"
8794 {
8795 (yyval.node) = match_op(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8796 }
8797#line 8793 "parse.c"
8798 break;
8799
8800 case 248: /* arg: arg "!~" arg */
8801#line 2493 "parse.y"
8802 {
8803 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idNeqTilde, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8804 }
8805#line 8801 "parse.c"
8806 break;
8807
8808 case 249: /* arg: '!' arg */
8809#line 2497 "parse.y"
8810 {
8811 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[0].node), &(yylsp[0])), '!', &(yylsp[-1]), &(yyloc));
8812 }
8813#line 8809 "parse.c"
8814 break;
8815
8816 case 250: /* arg: '~' arg */
8817#line 2501 "parse.y"
8818 {
8819 (yyval.node) = call_uni_op(p, (yyvsp[0].node), '~', &(yylsp[-1]), &(yyloc));
8820 }
8821#line 8817 "parse.c"
8822 break;
8823
8824 case 251: /* arg: arg "<<" arg */
8825#line 2505 "parse.y"
8826 {
8827 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idLTLT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8828 }
8829#line 8825 "parse.c"
8830 break;
8831
8832 case 252: /* arg: arg ">>" arg */
8833#line 2509 "parse.y"
8834 {
8835 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), idGTGT, (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8836 }
8837#line 8833 "parse.c"
8838 break;
8839
8840 case 253: /* arg: arg "&&" arg */
8841#line 2513 "parse.y"
8842 {
8843 (yyval.node) = logop(p, idANDOP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8844 }
8845#line 8841 "parse.c"
8846 break;
8847
8848 case 254: /* arg: arg "||" arg */
8849#line 2517 "parse.y"
8850 {
8851 (yyval.node) = logop(p, idOROP, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8852 }
8853#line 8849 "parse.c"
8854 break;
8855
8856 case 255: /* $@15: %empty */
8857#line 2520 "parse.y"
8858 {p->ctxt.in_defined = 1;}
8859#line 8855 "parse.c"
8860 break;
8861
8862 case 256: /* arg: "`defined?'" opt_nl $@15 arg */
8863#line 2521 "parse.y"
8864 {
8865 p->ctxt.in_defined = 0;
8866 (yyval.node) = new_defined(p, (yyvsp[0].node), &(yyloc));
8867 }
8868#line 8864 "parse.c"
8869 break;
8870
8871 case 257: /* arg: arg '?' arg opt_nl ':' arg */
8872#line 2526 "parse.y"
8873 {
8874 /*%%%*/
8875 value_expr((yyvsp[-5].node));
8876 (yyval.node) = new_if(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
8877 fixpos((yyval.node), (yyvsp[-5].node));
8878 /*% %*/
8879 /*% ripper: ifop!($1, $3, $6) %*/
8880 }
8881#line 8877 "parse.c"
8882 break;
8883
8884 case 258: /* arg: defn_head f_opt_paren_args '=' arg */
8885#line 2535 "parse.y"
8886 {
8887 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
8888 restore_defun(p, (yyvsp[-3].node)->nd_defn);
8889 /*%%%*/
8890 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8891 /*% %*/
8892 /*% ripper: def!(get_value($1), $2, $4) %*/
8893 local_pop(p);
8894 }
8895#line 8891 "parse.c"
8896 break;
8897
8898 case 259: /* arg: defn_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
8899#line 2545 "parse.y"
8900 {
8901 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
8902 restore_defun(p, (yyvsp[-5].node)->nd_defn);
8903 /*%%%*/
8904 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
8905 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
8906 /*% %*/
8907 /*% ripper: def!(get_value($1), $2, rescue_mod!($4, $6)) %*/
8908 local_pop(p);
8909 }
8910#line 8906 "parse.c"
8911 break;
8912
8913 case 260: /* arg: defs_head f_opt_paren_args '=' arg */
8914#line 2556 "parse.y"
8915 {
8916 endless_method_name(p, (yyvsp[-3].node), &(yylsp[-3]));
8917 restore_defun(p, (yyvsp[-3].node)->nd_defn);
8918 /*%%%*/
8919 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
8920 /*%
8921 $1 = get_value($1);
8922 %*/
8923 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
8924 local_pop(p);
8925 }
8926#line 8922 "parse.c"
8927 break;
8928
8929 case 261: /* arg: defs_head f_opt_paren_args '=' arg "`rescue' modifier" arg */
8930#line 2568 "parse.y"
8931 {
8932 endless_method_name(p, (yyvsp[-5].node), &(yylsp[-5]));
8933 restore_defun(p, (yyvsp[-5].node)->nd_defn);
8934 /*%%%*/
8935 (yyvsp[-2].node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
8936 (yyval.node) = set_defun_body(p, (yyvsp[-5].node), (yyvsp[-4].node), (yyvsp[-2].node), &(yyloc));
8937 /*%
8938 $1 = get_value($1);
8939 %*/
8940 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, rescue_mod!($4, $6)) %*/
8941 local_pop(p);
8942 }
8943#line 8939 "parse.c"
8944 break;
8945
8946 case 262: /* arg: primary */
8947#line 2581 "parse.y"
8948 {
8949 (yyval.node) = (yyvsp[0].node);
8950 }
8951#line 8947 "parse.c"
8952 break;
8953
8954 case 263: /* relop: '>' */
8955#line 2586 "parse.y"
8956 {(yyval.id) = '>';}
8957#line 8953 "parse.c"
8958 break;
8959
8960 case 264: /* relop: '<' */
8961#line 2587 "parse.y"
8962 {(yyval.id) = '<';}
8963#line 8959 "parse.c"
8964 break;
8965
8966 case 265: /* relop: ">=" */
8967#line 2588 "parse.y"
8968 {(yyval.id) = idGE;}
8969#line 8965 "parse.c"
8970 break;
8971
8972 case 266: /* relop: "<=" */
8973#line 2589 "parse.y"
8974 {(yyval.id) = idLE;}
8975#line 8971 "parse.c"
8976 break;
8977
8978 case 267: /* rel_expr: arg relop arg */
8979#line 2593 "parse.y"
8980 {
8981 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8982 }
8983#line 8979 "parse.c"
8984 break;
8985
8986 case 268: /* rel_expr: rel_expr relop arg */
8987#line 2597 "parse.y"
8988 {
8989 rb_warning1("comparison '%s' after comparison", WARN_ID((yyvsp[-1].id)));
8990 (yyval.node) = call_bin_op(p, (yyvsp[-2].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
8991 }
8992#line 8988 "parse.c"
8993 break;
8994
8995 case 269: /* lex_ctxt: "escaped space" */
8996#line 2604 "parse.y"
8997 {
8998 (yyval.ctxt) = p->ctxt;
8999 }
9000#line 8996 "parse.c"
9001 break;
9002
9003 case 270: /* lex_ctxt: none */
9004#line 2608 "parse.y"
9005 {
9006 (yyval.ctxt) = p->ctxt;
9007 }
9008#line 9004 "parse.c"
9009 break;
9010
9011 case 271: /* arg_value: arg */
9012#line 2614 "parse.y"
9013 {
9014 value_expr((yyvsp[0].node));
9015 (yyval.node) = (yyvsp[0].node);
9016 }
9017#line 9013 "parse.c"
9018 break;
9019
9020 case 273: /* aref_args: args trailer */
9021#line 2622 "parse.y"
9022 {
9023 (yyval.node) = (yyvsp[-1].node);
9024 }
9025#line 9021 "parse.c"
9026 break;
9027
9028 case 274: /* aref_args: args ',' assocs trailer */
9029#line 2626 "parse.y"
9030 {
9031 /*%%%*/
9032 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
9033 /*% %*/
9034 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
9035 }
9036#line 9032 "parse.c"
9037 break;
9038
9039 case 275: /* aref_args: assocs trailer */
9040#line 2633 "parse.y"
9041 {
9042 /*%%%*/
9043 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : 0;
9044 /*% %*/
9045 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
9046 }
9047#line 9043 "parse.c"
9048 break;
9049
9050 case 276: /* arg_rhs: arg */
9051#line 2642 "parse.y"
9052 {
9053 value_expr((yyvsp[0].node));
9054 (yyval.node) = (yyvsp[0].node);
9055 }
9056#line 9052 "parse.c"
9057 break;
9058
9059 case 277: /* arg_rhs: arg "`rescue' modifier" arg */
9060#line 2647 "parse.y"
9061 {
9062 /*%%%*/
9063 value_expr((yyvsp[-2].node));
9064 (yyval.node) = rescued_expr(p, (yyvsp[-2].node), (yyvsp[0].node), &(yylsp[-2]), &(yylsp[-1]), &(yylsp[0]));
9065 /*% %*/
9066 /*% ripper: rescue_mod!($1, $3) %*/
9067 }
9068#line 9064 "parse.c"
9069 break;
9070
9071 case 278: /* paren_args: '(' opt_call_args rparen */
9072#line 2657 "parse.y"
9073 {
9074 /*%%%*/
9075 (yyval.node) = (yyvsp[-1].node);
9076 /*% %*/
9077 /*% ripper: arg_paren!(escape_Qundef($2)) %*/
9078 }
9079#line 9075 "parse.c"
9080 break;
9081
9082 case 279: /* paren_args: '(' args ',' args_forward rparen */
9083#line 2664 "parse.y"
9084 {
9085 if (!check_forwarding_args(p)) {
9086 (yyval.node) = Qnone;
9087 }
9088 else {
9089 /*%%%*/
9090 (yyval.node) = new_args_forward_call(p, (yyvsp[-3].node), &(yylsp[-1]), &(yyloc));
9091 /*% %*/
9092 /*% ripper: arg_paren!(args_add!($2, $4)) %*/
9093 }
9094 }
9095#line 9091 "parse.c"
9096 break;
9097
9098 case 280: /* paren_args: '(' args_forward rparen */
9099#line 2676 "parse.y"
9100 {
9101 if (!check_forwarding_args(p)) {
9102 (yyval.node) = Qnone;
9103 }
9104 else {
9105 /*%%%*/
9106 (yyval.node) = new_args_forward_call(p, 0, &(yylsp[-1]), &(yyloc));
9107 /*% %*/
9108 /*% ripper: arg_paren!($2) %*/
9109 }
9110 }
9111#line 9107 "parse.c"
9112 break;
9113
9114 case 285: /* opt_call_args: args ',' */
9115#line 2696 "parse.y"
9116 {
9117 (yyval.node) = (yyvsp[-1].node);
9118 }
9119#line 9115 "parse.c"
9120 break;
9121
9122 case 286: /* opt_call_args: args ',' assocs ',' */
9123#line 2700 "parse.y"
9124 {
9125 /*%%%*/
9126 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
9127 /*% %*/
9128 /*% ripper: args_add!($1, bare_assoc_hash!($3)) %*/
9129 }
9130#line 9126 "parse.c"
9131 break;
9132
9133 case 287: /* opt_call_args: assocs ',' */
9134#line 2707 "parse.y"
9135 {
9136 /*%%%*/
9137 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
9138 /*% %*/
9139 /*% ripper: args_add!(args_new!, bare_assoc_hash!($1)) %*/
9140 }
9141#line 9137 "parse.c"
9142 break;
9143
9144 case 288: /* call_args: command */
9145#line 2716 "parse.y"
9146 {
9147 /*%%%*/
9148 value_expr((yyvsp[0].node));
9149 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
9150 /*% %*/
9151 /*% ripper: args_add!(args_new!, $1) %*/
9152 }
9153#line 9149 "parse.c"
9154 break;
9155
9156 case 289: /* call_args: args opt_block_arg */
9157#line 2724 "parse.y"
9158 {
9159 /*%%%*/
9160 (yyval.node) = arg_blk_pass((yyvsp[-1].node), (yyvsp[0].node));
9161 /*% %*/
9162 /*% ripper: args_add_block!($1, $2) %*/
9163 }
9164#line 9160 "parse.c"
9165 break;
9166
9167 case 290: /* call_args: assocs opt_block_arg */
9168#line 2731 "parse.y"
9169 {
9170 /*%%%*/
9171 (yyval.node) = (yyvsp[-1].node) ? NEW_LIST(new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yylsp[-1])) : 0;
9172 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
9173 /*% %*/
9174 /*% ripper: args_add_block!(args_add!(args_new!, bare_assoc_hash!($1)), $2) %*/
9175 }
9176#line 9172 "parse.c"
9177 break;
9178
9179 case 291: /* call_args: args ',' assocs opt_block_arg */
9180#line 2739 "parse.y"
9181 {
9182 /*%%%*/
9183 (yyval.node) = (yyvsp[-1].node) ? arg_append(p, (yyvsp[-3].node), new_hash(p, (yyvsp[-1].node), &(yylsp[-1])), &(yyloc)) : (yyvsp[-3].node);
9184 (yyval.node) = arg_blk_pass((yyval.node), (yyvsp[0].node));
9185 /*% %*/
9186 /*% ripper: args_add_block!(args_add!($1, bare_assoc_hash!($3)), $4) %*/
9187 }
9188#line 9184 "parse.c"
9189 break;
9190
9191 case 293: /* $@16: %empty */
9192#line 2750 "parse.y"
9193 {
9194 /* If call_args starts with a open paren '(' or '[',
9195 * look-ahead reading of the letters calls CMDARG_PUSH(0),
9196 * but the push must be done after CMDARG_PUSH(1).
9197 * So this code makes them consistent by first cancelling
9198 * the premature CMDARG_PUSH(0), doing CMDARG_PUSH(1),
9199 * and finally redoing CMDARG_PUSH(0).
9200 */
9201 int lookahead = 0;
9202 switch (yychar) {
9203 case '(': case tLPAREN: case tLPAREN_ARG: case '[': case tLBRACK:
9204 lookahead = 1;
9205 }
9206 if (lookahead) CMDARG_POP();
9207 CMDARG_PUSH(1);
9208 if (lookahead) CMDARG_PUSH(0);
9209 }
9210#line 9206 "parse.c"
9211 break;
9212
9213 case 294: /* command_args: $@16 call_args */
9214#line 2768 "parse.y"
9215 {
9216 /* call_args can be followed by tLBRACE_ARG (that does CMDARG_PUSH(0) in the lexer)
9217 * but the push must be done after CMDARG_POP() in the parser.
9218 * So this code does CMDARG_POP() to pop 0 pushed by tLBRACE_ARG,
9219 * CMDARG_POP() to pop 1 pushed by command_args,
9220 * and CMDARG_PUSH(0) to restore back the flag set by tLBRACE_ARG.
9221 */
9222 int lookahead = 0;
9223 switch (yychar) {
9224 case tLBRACE_ARG:
9225 lookahead = 1;
9226 }
9227 if (lookahead) CMDARG_POP();
9228 CMDARG_POP();
9229 if (lookahead) CMDARG_PUSH(0);
9230 (yyval.node) = (yyvsp[0].node);
9231 }
9232#line 9228 "parse.c"
9233 break;
9234
9235 case 295: /* block_arg: "&" arg_value */
9236#line 2788 "parse.y"
9237 {
9238 /*%%%*/
9239 (yyval.node) = NEW_BLOCK_PASS((yyvsp[0].node), &(yyloc));
9240 /*% %*/
9241 /*% ripper: $2 %*/
9242 }
9243#line 9239 "parse.c"
9244 break;
9245
9246 case 296: /* opt_block_arg: ',' block_arg */
9247#line 2797 "parse.y"
9248 {
9249 (yyval.node) = (yyvsp[0].node);
9250 }
9251#line 9247 "parse.c"
9252 break;
9253
9254 case 297: /* opt_block_arg: none */
9255#line 2801 "parse.y"
9256 {
9257 (yyval.node) = 0;
9258 }
9259#line 9255 "parse.c"
9260 break;
9261
9262 case 298: /* args: arg_value */
9263#line 2807 "parse.y"
9264 {
9265 /*%%%*/
9266 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
9267 /*% %*/
9268 /*% ripper: args_add!(args_new!, $1) %*/
9269 }
9270#line 9266 "parse.c"
9271 break;
9272
9273 case 299: /* args: "*" arg_value */
9274#line 2814 "parse.y"
9275 {
9276 /*%%%*/
9277 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
9278 /*% %*/
9279 /*% ripper: args_add_star!(args_new!, $2) %*/
9280 }
9281#line 9277 "parse.c"
9282 break;
9283
9284 case 300: /* args: args ',' arg_value */
9285#line 2821 "parse.y"
9286 {
9287 /*%%%*/
9288 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9289 /*% %*/
9290 /*% ripper: args_add!($1, $3) %*/
9291 }
9292#line 9288 "parse.c"
9293 break;
9294
9295 case 301: /* args: args ',' "*" arg_value */
9296#line 2828 "parse.y"
9297 {
9298 /*%%%*/
9299 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
9300 /*% %*/
9301 /*% ripper: args_add_star!($1, $4) %*/
9302 }
9303#line 9299 "parse.c"
9304 break;
9305
9306 case 304: /* mrhs: args ',' arg_value */
9307#line 2841 "parse.y"
9308 {
9309 /*%%%*/
9310 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
9311 /*% %*/
9312 /*% ripper: mrhs_add!(mrhs_new_from_args!($1), $3) %*/
9313 }
9314#line 9310 "parse.c"
9315 break;
9316
9317 case 305: /* mrhs: args ',' "*" arg_value */
9318#line 2848 "parse.y"
9319 {
9320 /*%%%*/
9321 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
9322 /*% %*/
9323 /*% ripper: mrhs_add_star!(mrhs_new_from_args!($1), $4) %*/
9324 }
9325#line 9321 "parse.c"
9326 break;
9327
9328 case 306: /* mrhs: "*" arg_value */
9329#line 2855 "parse.y"
9330 {
9331 /*%%%*/
9332 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
9333 /*% %*/
9334 /*% ripper: mrhs_add_star!(mrhs_new!, $2) %*/
9335 }
9336#line 9332 "parse.c"
9337 break;
9338
9339 case 317: /* primary: "method" */
9340#line 2874 "parse.y"
9341 {
9342 /*%%%*/
9343 (yyval.node) = NEW_FCALL((yyvsp[0].id), 0, &(yyloc));
9344 /*% %*/
9345 /*% ripper: method_add_arg!(fcall!($1), args_new!) %*/
9346 }
9347#line 9343 "parse.c"
9348 break;
9349
9350 case 318: /* $@17: %empty */
9351#line 2881 "parse.y"
9352 {
9353 CMDARG_PUSH(0);
9354 }
9355#line 9351 "parse.c"
9356 break;
9357
9358 case 319: /* primary: k_begin $@17 bodystmt k_end */
9359#line 2886 "parse.y"
9360 {
9361 CMDARG_POP();
9362 /*%%%*/
9363 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9364 (yyval.node) = NEW_BEGIN((yyvsp[-1].node), &(yyloc));
9365 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9366 /*% %*/
9367 /*% ripper: begin!($3) %*/
9368 }
9369#line 9365 "parse.c"
9370 break;
9371
9372 case 320: /* $@18: %empty */
9373#line 2895 "parse.y"
9374 {SET_LEX_STATE(EXPR_ENDARG);}
9375#line 9371 "parse.c"
9376 break;
9377
9378 case 321: /* primary: "( arg" $@18 rparen */
9379#line 2896 "parse.y"
9380 {
9381 /*%%%*/
9382 (yyval.node) = NEW_BEGIN(0, &(yyloc));
9383 /*% %*/
9384 /*% ripper: paren!(0) %*/
9385 }
9386#line 9382 "parse.c"
9387 break;
9388
9389 case 322: /* $@19: %empty */
9390#line 2902 "parse.y"
9391 {SET_LEX_STATE(EXPR_ENDARG);}
9392#line 9388 "parse.c"
9393 break;
9394
9395 case 323: /* primary: "( arg" stmt $@19 rparen */
9396#line 2903 "parse.y"
9397 {
9398 /*%%%*/
9399 if (nd_type((yyvsp[-2].node)) == NODE_SELF) (yyvsp[-2].node)->nd_state = 0;
9400 (yyval.node) = (yyvsp[-2].node);
9401 /*% %*/
9402 /*% ripper: paren!($2) %*/
9403 }
9404#line 9400 "parse.c"
9405 break;
9406
9407 case 324: /* primary: "(" compstmt ')' */
9408#line 2911 "parse.y"
9409 {
9410 /*%%%*/
9411 if (nd_type((yyvsp[-1].node)) == NODE_SELF) (yyvsp[-1].node)->nd_state = 0;
9412 (yyval.node) = (yyvsp[-1].node);
9413 /*% %*/
9414 /*% ripper: paren!($2) %*/
9415 }
9416#line 9412 "parse.c"
9417 break;
9418
9419 case 325: /* primary: primary_value "::" "constant" */
9420#line 2919 "parse.y"
9421 {
9422 /*%%%*/
9423 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
9424 /*% %*/
9425 /*% ripper: const_path_ref!($1, $3) %*/
9426 }
9427#line 9423 "parse.c"
9428 break;
9429
9430 case 326: /* primary: ":: at EXPR_BEG" "constant" */
9431#line 2926 "parse.y"
9432 {
9433 /*%%%*/
9434 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
9435 /*% %*/
9436 /*% ripper: top_const_ref!($2) %*/
9437 }
9438#line 9434 "parse.c"
9439 break;
9440
9441 case 327: /* primary: "[" aref_args ']' */
9442#line 2933 "parse.y"
9443 {
9444 /*%%%*/
9445 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
9446 /*% %*/
9447 /*% ripper: array!(escape_Qundef($2)) %*/
9448 }
9449#line 9445 "parse.c"
9450 break;
9451
9452 case 328: /* primary: "{" assoc_list '}' */
9453#line 2940 "parse.y"
9454 {
9455 /*%%%*/
9456 (yyval.node) = new_hash(p, (yyvsp[-1].node), &(yyloc));
9457 (yyval.node)->nd_brace = TRUE;
9458 /*% %*/
9459 /*% ripper: hash!(escape_Qundef($2)) %*/
9460 }
9461#line 9457 "parse.c"
9462 break;
9463
9464 case 329: /* primary: k_return */
9465#line 2948 "parse.y"
9466 {
9467 /*%%%*/
9468 (yyval.node) = NEW_RETURN(0, &(yyloc));
9469 /*% %*/
9470 /*% ripper: return0! %*/
9471 }
9472#line 9468 "parse.c"
9473 break;
9474
9475 case 330: /* primary: "`yield'" '(' call_args rparen */
9476#line 2955 "parse.y"
9477 {
9478 /*%%%*/
9479 (yyval.node) = new_yield(p, (yyvsp[-1].node), &(yyloc));
9480 /*% %*/
9481 /*% ripper: yield!(paren!($3)) %*/
9482 }
9483#line 9479 "parse.c"
9484 break;
9485
9486 case 331: /* primary: "`yield'" '(' rparen */
9487#line 2962 "parse.y"
9488 {
9489 /*%%%*/
9490 (yyval.node) = NEW_YIELD(0, &(yyloc));
9491 /*% %*/
9492 /*% ripper: yield!(paren!(args_new!)) %*/
9493 }
9494#line 9490 "parse.c"
9495 break;
9496
9497 case 332: /* primary: "`yield'" */
9498#line 2969 "parse.y"
9499 {
9500 /*%%%*/
9501 (yyval.node) = NEW_YIELD(0, &(yyloc));
9502 /*% %*/
9503 /*% ripper: yield0! %*/
9504 }
9505#line 9501 "parse.c"
9506 break;
9507
9508 case 333: /* $@20: %empty */
9509#line 2975 "parse.y"
9510 {p->ctxt.in_defined = 1;}
9511#line 9507 "parse.c"
9512 break;
9513
9514 case 334: /* primary: "`defined?'" opt_nl '(' $@20 expr rparen */
9515#line 2976 "parse.y"
9516 {
9517 p->ctxt.in_defined = 0;
9518 (yyval.node) = new_defined(p, (yyvsp[-1].node), &(yyloc));
9519 }
9520#line 9516 "parse.c"
9521 break;
9522
9523 case 335: /* primary: "`not'" '(' expr rparen */
9524#line 2981 "parse.y"
9525 {
9526 (yyval.node) = call_uni_op(p, method_cond(p, (yyvsp[-1].node), &(yylsp[-1])), METHOD_NOT, &(yylsp[-3]), &(yyloc));
9527 }
9528#line 9524 "parse.c"
9529 break;
9530
9531 case 336: /* primary: "`not'" '(' rparen */
9532#line 2985 "parse.y"
9533 {
9534 (yyval.node) = call_uni_op(p, method_cond(p, new_nil(&(yylsp[-1])), &(yylsp[-1])), METHOD_NOT, &(yylsp[-2]), &(yyloc));
9535 }
9536#line 9532 "parse.c"
9537 break;
9538
9539 case 337: /* primary: fcall brace_block */
9540#line 2989 "parse.y"
9541 {
9542 /*%%%*/
9543 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9544 /*% %*/
9545 /*% ripper: method_add_block!(method_add_arg!(fcall!($1), args_new!), $2) %*/
9546 }
9547#line 9543 "parse.c"
9548 break;
9549
9550 case 339: /* primary: method_call brace_block */
9551#line 2997 "parse.y"
9552 {
9553 /*%%%*/
9554 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
9555 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
9556 /*% %*/
9557 /*% ripper: method_add_block!($1, $2) %*/
9558 }
9559#line 9555 "parse.c"
9560 break;
9561
9562 case 341: /* primary: k_if expr_value then compstmt if_tail k_end */
9563#line 3009 "parse.y"
9564 {
9565 /*%%%*/
9566 (yyval.node) = new_if(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9567 fixpos((yyval.node), (yyvsp[-4].node));
9568 /*% %*/
9569 /*% ripper: if!($2, $4, escape_Qundef($5)) %*/
9570 }
9571#line 9567 "parse.c"
9572 break;
9573
9574 case 342: /* primary: k_unless expr_value then compstmt opt_else k_end */
9575#line 3020 "parse.y"
9576 {
9577 /*%%%*/
9578 (yyval.node) = new_unless(p, (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9579 fixpos((yyval.node), (yyvsp[-4].node));
9580 /*% %*/
9581 /*% ripper: unless!($2, $4, escape_Qundef($5)) %*/
9582 }
9583#line 9579 "parse.c"
9584 break;
9585
9586 case 343: /* primary: k_while expr_value_do compstmt k_end */
9587#line 3030 "parse.y"
9588 {
9589 /*%%%*/
9590 (yyval.node) = NEW_WHILE(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
9591 fixpos((yyval.node), (yyvsp[-2].node));
9592 /*% %*/
9593 /*% ripper: while!($2, $3) %*/
9594 }
9595#line 9591 "parse.c"
9596 break;
9597
9598 case 344: /* primary: k_until expr_value_do compstmt k_end */
9599#line 3040 "parse.y"
9600 {
9601 /*%%%*/
9602 (yyval.node) = NEW_UNTIL(cond(p, (yyvsp[-2].node), &(yylsp[-2])), (yyvsp[-1].node), 1, &(yyloc));
9603 fixpos((yyval.node), (yyvsp[-2].node));
9604 /*% %*/
9605 /*% ripper: until!($2, $3) %*/
9606 }
9607#line 9603 "parse.c"
9608 break;
9609
9610 case 345: /* @21: %empty */
9611#line 3048 "parse.y"
9612 {
9613 (yyval.val) = p->case_labels;
9614 p->case_labels = Qnil;
9615 }
9616#line 9612 "parse.c"
9617 break;
9618
9619 case 346: /* primary: k_case expr_value opt_terms @21 case_body k_end */
9620#line 3054 "parse.y"
9621 {
9623 p->case_labels = (yyvsp[-2].val);
9624 /*%%%*/
9625 (yyval.node) = NEW_CASE((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
9626 fixpos((yyval.node), (yyvsp[-4].node));
9627 /*% %*/
9628 /*% ripper: case!($2, $5) %*/
9629 }
9630#line 9626 "parse.c"
9631 break;
9632
9633 case 347: /* @22: %empty */
9634#line 3064 "parse.y"
9635 {
9636 (yyval.val) = p->case_labels;
9637 p->case_labels = 0;
9638 }
9639#line 9635 "parse.c"
9640 break;
9641
9642 case 348: /* primary: k_case opt_terms @22 case_body k_end */
9643#line 3070 "parse.y"
9644 {
9646 p->case_labels = (yyvsp[-2].val);
9647 /*%%%*/
9648 (yyval.node) = NEW_CASE2((yyvsp[-1].node), &(yyloc));
9649 /*% %*/
9650 /*% ripper: case!(Qnil, $4) %*/
9651 }
9652#line 9648 "parse.c"
9653 break;
9654
9655 case 349: /* primary: k_case expr_value opt_terms p_case_body k_end */
9656#line 3081 "parse.y"
9657 {
9658 /*%%%*/
9659 (yyval.node) = NEW_CASE3((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
9660 /*% %*/
9661 /*% ripper: case!($2, $4) %*/
9662 }
9663#line 9659 "parse.c"
9664 break;
9665
9666 case 350: /* primary: k_for for_var "`in'" expr_value_do compstmt k_end */
9667#line 3090 "parse.y"
9668 {
9669 /*%%%*/
9670 /*
9671 * for a, b, c in e
9672 * #=>
9673 * e.each{|*x| a, b, c = x}
9674 *
9675 * for a in e
9676 * #=>
9677 * e.each{|x| a, = x}
9678 */
9679 ID id = internal_id(p);
9680 NODE *m = NEW_ARGS_AUX(0, 0, &NULL_LOC);
9681 NODE *args, *scope, *internal_var = NEW_DVAR(id, &(yylsp[-4]));
9682 ID *tbl = ALLOC_N(ID, 3);
9683 tbl[0] = 1 /* length of local var table */; tbl[1] = id /* internal id */;
9684 rb_ast_add_local_table(p->ast, tbl);
9685
9686 switch (nd_type((yyvsp[-4].node))) {
9687 case NODE_LASGN:
9688 case NODE_DASGN:
9689 case NODE_DASGN_CURR: /* e.each {|internal_var| a = internal_var; ... } */
9690 (yyvsp[-4].node)->nd_value = internal_var;
9691 id = 0;
9692 m->nd_plen = 1;
9693 m->nd_next = (yyvsp[-4].node);
9694 break;
9695 case NODE_MASGN: /* e.each {|*internal_var| a, b, c = (internal_var.length == 1 && Array === (tmp = internal_var[0]) ? tmp : internal_var); ... } */
9696 m->nd_next = node_assign(p, (yyvsp[-4].node), NEW_FOR_MASGN(internal_var, &(yylsp[-4])), NO_LEX_CTXT, &(yylsp[-4]));
9697 break;
9698 default: /* e.each {|*internal_var| @a, B, c[1], d.attr = internal_val; ... } */
9699 m->nd_next = node_assign(p, NEW_MASGN(NEW_LIST((yyvsp[-4].node), &(yylsp[-4])), 0, &(yylsp[-4])), internal_var, NO_LEX_CTXT, &(yylsp[-4]));
9700 }
9701 /* {|*internal_id| <m> = internal_id; ... } */
9702 args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &(yylsp[-4])), &(yylsp[-4]));
9703 scope = NEW_NODE(NODE_SCOPE, tbl, (yyvsp[-1].node), args, &(yyloc));
9704 (yyval.node) = NEW_FOR((yyvsp[-2].node), scope, &(yyloc));
9705 fixpos((yyval.node), (yyvsp[-4].node));
9706 /*% %*/
9707 /*% ripper: for!($2, $4, $5) %*/
9708 }
9709#line 9705 "parse.c"
9710 break;
9711
9712 case 351: /* $@23: %empty */
9713#line 3132 "parse.y"
9714 {
9715 if (p->ctxt.in_def) {
9716 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[-1]));
9717 yyerror1(&loc, "class definition in method body");
9718 }
9719 p->ctxt.in_class = 1;
9720 local_push(p, 0);
9721 }
9722#line 9718 "parse.c"
9723 break;
9724
9725 case 352: /* primary: k_class cpath superclass $@23 bodystmt k_end */
9726#line 3142 "parse.y"
9727 {
9728 /*%%%*/
9729 (yyval.node) = NEW_CLASS((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[-3].node), &(yyloc));
9730 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9731 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9732 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9733 /*% %*/
9734 /*% ripper: class!($2, $3, $5) %*/
9735 local_pop(p);
9736 p->ctxt.in_class = (yyvsp[-5].ctxt).in_class;
9737 p->ctxt.shareable_constant_value = (yyvsp[-5].ctxt).shareable_constant_value;
9738 }
9739#line 9735 "parse.c"
9740 break;
9741
9742 case 353: /* $@24: %empty */
9743#line 3155 "parse.y"
9744 {
9745 p->ctxt.in_def = 0;
9746 p->ctxt.in_class = 0;
9747 local_push(p, 0);
9748 }
9749#line 9745 "parse.c"
9750 break;
9751
9752 case 354: /* primary: k_class "<<" expr $@24 term bodystmt k_end */
9753#line 3163 "parse.y"
9754 {
9755 /*%%%*/
9756 (yyval.node) = NEW_SCLASS((yyvsp[-4].node), (yyvsp[-1].node), &(yyloc));
9757 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9758 set_line_body((yyvsp[-1].node), nd_line((yyvsp[-4].node)));
9759 fixpos((yyval.node), (yyvsp[-4].node));
9760 /*% %*/
9761 /*% ripper: sclass!($3, $6) %*/
9762 local_pop(p);
9763 p->ctxt.in_def = (yyvsp[-6].ctxt).in_def;
9764 p->ctxt.in_class = (yyvsp[-6].ctxt).in_class;
9765 p->ctxt.shareable_constant_value = (yyvsp[-6].ctxt).shareable_constant_value;
9766 }
9767#line 9763 "parse.c"
9768 break;
9769
9770 case 355: /* $@25: %empty */
9771#line 3177 "parse.y"
9772 {
9773 if (p->ctxt.in_def) {
9774 YYLTYPE loc = code_loc_gen(&(yylsp[-1]), &(yylsp[0]));
9775 yyerror1(&loc, "module definition in method body");
9776 }
9777 p->ctxt.in_class = 1;
9778 local_push(p, 0);
9779 }
9780#line 9776 "parse.c"
9781 break;
9782
9783 case 356: /* primary: k_module cpath $@25 bodystmt k_end */
9784#line 3187 "parse.y"
9785 {
9786 /*%%%*/
9787 (yyval.node) = NEW_MODULE((yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
9788 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
9789 set_line_body((yyvsp[-1].node), (yylsp[-3]).end_pos.lineno);
9790 nd_set_line((yyval.node), (yylsp[-3]).end_pos.lineno);
9791 /*% %*/
9792 /*% ripper: module!($2, $4) %*/
9793 local_pop(p);
9794 p->ctxt.in_class = (yyvsp[-4].ctxt).in_class;
9795 p->ctxt.shareable_constant_value = (yyvsp[-4].ctxt).shareable_constant_value;
9796 }
9797#line 9793 "parse.c"
9798 break;
9799
9800 case 357: /* primary: defn_head f_arglist bodystmt k_end */
9801#line 3203 "parse.y"
9802 {
9803 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9804 /*%%%*/
9805 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9806 /*% %*/
9807 /*% ripper: def!(get_value($1), $2, $3) %*/
9808 local_pop(p);
9809 }
9810#line 9806 "parse.c"
9811 break;
9812
9813 case 358: /* primary: defs_head f_arglist bodystmt k_end */
9814#line 3215 "parse.y"
9815 {
9816 restore_defun(p, (yyvsp[-3].node)->nd_defn);
9817 /*%%%*/
9818 (yyval.node) = set_defun_body(p, (yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), &(yyloc));
9819 /*%
9820 $1 = get_value($1);
9821 %*/
9822 /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $3) %*/
9823 local_pop(p);
9824 }
9825#line 9821 "parse.c"
9826 break;
9827
9828 case 359: /* primary: "`break'" */
9829#line 3226 "parse.y"
9830 {
9831 /*%%%*/
9832 (yyval.node) = NEW_BREAK(0, &(yyloc));
9833 /*% %*/
9834 /*% ripper: break!(args_new!) %*/
9835 }
9836#line 9832 "parse.c"
9837 break;
9838
9839 case 360: /* primary: "`next'" */
9840#line 3233 "parse.y"
9841 {
9842 /*%%%*/
9843 (yyval.node) = NEW_NEXT(0, &(yyloc));
9844 /*% %*/
9845 /*% ripper: next!(args_new!) %*/
9846 }
9847#line 9843 "parse.c"
9848 break;
9849
9850 case 361: /* primary: "`redo'" */
9851#line 3240 "parse.y"
9852 {
9853 /*%%%*/
9854 (yyval.node) = NEW_REDO(&(yyloc));
9855 /*% %*/
9856 /*% ripper: redo! %*/
9857 }
9858#line 9854 "parse.c"
9859 break;
9860
9861 case 362: /* primary: "`retry'" */
9862#line 3247 "parse.y"
9863 {
9864 /*%%%*/
9865 (yyval.node) = NEW_RETRY(&(yyloc));
9866 /*% %*/
9867 /*% ripper: retry! %*/
9868 }
9869#line 9865 "parse.c"
9870 break;
9871
9872 case 363: /* primary_value: primary */
9873#line 3256 "parse.y"
9874 {
9875 value_expr((yyvsp[0].node));
9876 (yyval.node) = (yyvsp[0].node);
9877 }
9878#line 9874 "parse.c"
9879 break;
9880
9881 case 364: /* k_begin: "`begin'" */
9882#line 3263 "parse.y"
9883 {
9884 token_info_push(p, "begin", &(yyloc));
9885 }
9886#line 9882 "parse.c"
9887 break;
9888
9889 case 365: /* k_if: "`if'" */
9890#line 3269 "parse.y"
9891 {
9892 WARN_EOL("if");
9893 token_info_push(p, "if", &(yyloc));
9894 if (p->token_info && p->token_info->nonspc &&
9895 p->token_info->next && !strcmp(p->token_info->next->token, "else")) {
9896 const char *tok = p->lex.ptok;
9897 const char *beg = p->lex.pbeg + p->token_info->next->beg.column;
9898 beg += rb_strlen_lit("else");
9899 while (beg < tok && ISSPACE(*beg)) beg++;
9900 if (beg == tok) {
9901 p->token_info->nonspc = 0;
9902 }
9903 }
9904 }
9905#line 9901 "parse.c"
9906 break;
9907
9908 case 366: /* k_unless: "`unless'" */
9909#line 3286 "parse.y"
9910 {
9911 token_info_push(p, "unless", &(yyloc));
9912 }
9913#line 9909 "parse.c"
9914 break;
9915
9916 case 367: /* k_while: "`while'" */
9917#line 3292 "parse.y"
9918 {
9919 token_info_push(p, "while", &(yyloc));
9920 }
9921#line 9917 "parse.c"
9922 break;
9923
9924 case 368: /* k_until: "`until'" */
9925#line 3298 "parse.y"
9926 {
9927 token_info_push(p, "until", &(yyloc));
9928 }
9929#line 9925 "parse.c"
9930 break;
9931
9932 case 369: /* k_case: "`case'" */
9933#line 3304 "parse.y"
9934 {
9935 token_info_push(p, "case", &(yyloc));
9936 }
9937#line 9933 "parse.c"
9938 break;
9939
9940 case 370: /* k_for: "`for'" */
9941#line 3310 "parse.y"
9942 {
9943 token_info_push(p, "for", &(yyloc));
9944 }
9945#line 9941 "parse.c"
9946 break;
9947
9948 case 371: /* k_class: "`class'" */
9949#line 3316 "parse.y"
9950 {
9951 token_info_push(p, "class", &(yyloc));
9952 (yyval.ctxt) = p->ctxt;
9953 }
9954#line 9950 "parse.c"
9955 break;
9956
9957 case 372: /* k_module: "`module'" */
9958#line 3323 "parse.y"
9959 {
9960 token_info_push(p, "module", &(yyloc));
9961 (yyval.ctxt) = p->ctxt;
9962 }
9963#line 9959 "parse.c"
9964 break;
9965
9966 case 373: /* k_def: "`def'" */
9967#line 3330 "parse.y"
9968 {
9969 token_info_push(p, "def", &(yyloc));
9970 }
9971#line 9967 "parse.c"
9972 break;
9973
9974 case 374: /* k_do: "`do'" */
9975#line 3336 "parse.y"
9976 {
9977 token_info_push(p, "do", &(yyloc));
9978 }
9979#line 9975 "parse.c"
9980 break;
9981
9982 case 375: /* k_do_block: "`do' for block" */
9983#line 3342 "parse.y"
9984 {
9985 token_info_push(p, "do", &(yyloc));
9986 }
9987#line 9983 "parse.c"
9988 break;
9989
9990 case 376: /* k_rescue: "`rescue'" */
9991#line 3348 "parse.y"
9992 {
9993 token_info_warn(p, "rescue", p->token_info, 1, &(yyloc));
9994 }
9995#line 9991 "parse.c"
9996 break;
9997
9998 case 377: /* k_ensure: "`ensure'" */
9999#line 3354 "parse.y"
10000 {
10001 token_info_warn(p, "ensure", p->token_info, 1, &(yyloc));
10002 }
10003#line 9999 "parse.c"
10004 break;
10005
10006 case 378: /* k_when: "`when'" */
10007#line 3360 "parse.y"
10008 {
10009 token_info_warn(p, "when", p->token_info, 0, &(yyloc));
10010 }
10011#line 10007 "parse.c"
10012 break;
10013
10014 case 379: /* k_else: "`else'" */
10015#line 3366 "parse.y"
10016 {
10017 token_info *ptinfo_beg = p->token_info;
10018 int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
10019 token_info_warn(p, "else", p->token_info, same, &(yyloc));
10020 if (same) {
10021 token_info e;
10022 e.next = ptinfo_beg->next;
10023 e.token = "else";
10024 token_info_setup(&e, p->lex.pbeg, &(yyloc));
10025 if (!e.nonspc) *ptinfo_beg = e;
10026 }
10027 }
10028#line 10024 "parse.c"
10029 break;
10030
10031 case 380: /* k_elsif: "`elsif'" */
10032#line 3381 "parse.y"
10033 {
10034 WARN_EOL("elsif");
10035 token_info_warn(p, "elsif", p->token_info, 1, &(yyloc));
10036 }
10037#line 10033 "parse.c"
10038 break;
10039
10040 case 381: /* k_end: "`end'" */
10041#line 3388 "parse.y"
10042 {
10043 token_info_pop(p, "end", &(yyloc));
10044 }
10045#line 10041 "parse.c"
10046 break;
10047
10048 case 382: /* k_return: "`return'" */
10049#line 3394 "parse.y"
10050 {
10051 if (p->ctxt.in_class && !p->ctxt.in_def && !dyna_in_block(p))
10052 yyerror1(&(yylsp[0]), "Invalid return in class/module body");
10053 }
10054#line 10050 "parse.c"
10055 break;
10056
10057 case 389: /* if_tail: k_elsif expr_value then compstmt if_tail */
10058#line 3413 "parse.y"
10059 {
10060 /*%%%*/
10061 (yyval.node) = new_if(p, (yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10062 fixpos((yyval.node), (yyvsp[-3].node));
10063 /*% %*/
10064 /*% ripper: elsif!($2, $4, escape_Qundef($5)) %*/
10065 }
10066#line 10062 "parse.c"
10067 break;
10068
10069 case 391: /* opt_else: k_else compstmt */
10070#line 3424 "parse.y"
10071 {
10072 /*%%%*/
10073 (yyval.node) = (yyvsp[0].node);
10074 /*% %*/
10075 /*% ripper: else!($2) %*/
10076 }
10077#line 10073 "parse.c"
10078 break;
10079
10080 case 394: /* f_marg: f_norm_arg */
10081#line 3437 "parse.y"
10082 {
10083 /*%%%*/
10084 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10085 mark_lvar_used(p, (yyval.node));
10086 /*% %*/
10087 /*% ripper: assignable(p, $1) %*/
10088 }
10089#line 10085 "parse.c"
10090 break;
10091
10092 case 395: /* f_marg: "(" f_margs rparen */
10093#line 3445 "parse.y"
10094 {
10095 /*%%%*/
10096 (yyval.node) = (yyvsp[-1].node);
10097 /*% %*/
10098 /*% ripper: mlhs_paren!($2) %*/
10099 }
10100#line 10096 "parse.c"
10101 break;
10102
10103 case 396: /* f_marg_list: f_marg */
10104#line 3454 "parse.y"
10105 {
10106 /*%%%*/
10107 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
10108 /*% %*/
10109 /*% ripper: mlhs_add!(mlhs_new!, $1) %*/
10110 }
10111#line 10107 "parse.c"
10112 break;
10113
10114 case 397: /* f_marg_list: f_marg_list ',' f_marg */
10115#line 3461 "parse.y"
10116 {
10117 /*%%%*/
10118 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[0].node));
10119 /*% %*/
10120 /*% ripper: mlhs_add!($1, $3) %*/
10121 }
10122#line 10118 "parse.c"
10123 break;
10124
10125 case 398: /* f_margs: f_marg_list */
10126#line 3470 "parse.y"
10127 {
10128 /*%%%*/
10129 (yyval.node) = NEW_MASGN((yyvsp[0].node), 0, &(yyloc));
10130 /*% %*/
10131 /*% ripper: $1 %*/
10132 }
10133#line 10129 "parse.c"
10134 break;
10135
10136 case 399: /* f_margs: f_marg_list ',' f_rest_marg */
10137#line 3477 "parse.y"
10138 {
10139 /*%%%*/
10140 (yyval.node) = NEW_MASGN((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10141 /*% %*/
10142 /*% ripper: mlhs_add_star!($1, $3) %*/
10143 }
10144#line 10140 "parse.c"
10145 break;
10146
10147 case 400: /* f_margs: f_marg_list ',' f_rest_marg ',' f_marg_list */
10148#line 3484 "parse.y"
10149 {
10150 /*%%%*/
10151 (yyval.node) = NEW_MASGN((yyvsp[-4].node), NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
10152 /*% %*/
10153 /*% ripper: mlhs_add_post!(mlhs_add_star!($1, $3), $5) %*/
10154 }
10155#line 10151 "parse.c"
10156 break;
10157
10158 case 401: /* f_margs: f_rest_marg */
10159#line 3491 "parse.y"
10160 {
10161 /*%%%*/
10162 (yyval.node) = NEW_MASGN(0, (yyvsp[0].node), &(yyloc));
10163 /*% %*/
10164 /*% ripper: mlhs_add_star!(mlhs_new!, $1) %*/
10165 }
10166#line 10162 "parse.c"
10167 break;
10168
10169 case 402: /* f_margs: f_rest_marg ',' f_marg_list */
10170#line 3498 "parse.y"
10171 {
10172 /*%%%*/
10173 (yyval.node) = NEW_MASGN(0, NEW_POSTARG((yyvsp[-2].node), (yyvsp[0].node), &(yyloc)), &(yyloc));
10174 /*% %*/
10175 /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $1), $3) %*/
10176 }
10177#line 10173 "parse.c"
10178 break;
10179
10180 case 403: /* f_rest_marg: "*" f_norm_arg */
10181#line 3507 "parse.y"
10182 {
10183 /*%%%*/
10184 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
10185 mark_lvar_used(p, (yyval.node));
10186 /*% %*/
10187 /*% ripper: assignable(p, $2) %*/
10188 }
10189#line 10185 "parse.c"
10190 break;
10191
10192 case 404: /* f_rest_marg: "*" */
10193#line 3515 "parse.y"
10194 {
10195 /*%%%*/
10197 /*% %*/
10198 /*% ripper: Qnil %*/
10199 }
10200#line 10196 "parse.c"
10201 break;
10202
10203 case 406: /* f_any_kwrest: f_no_kwarg */
10204#line 3524 "parse.y"
10205 {(yyval.id) = ID2VAL(idNil);}
10206#line 10202 "parse.c"
10207 break;
10208
10209 case 407: /* block_args_tail: f_block_kwarg ',' f_kwrest opt_f_block_arg */
10210#line 3528 "parse.y"
10211 {
10212 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
10213 }
10214#line 10210 "parse.c"
10215 break;
10216
10217 case 408: /* block_args_tail: f_block_kwarg opt_f_block_arg */
10218#line 3532 "parse.y"
10219 {
10220 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
10221 }
10222#line 10218 "parse.c"
10223 break;
10224
10225 case 409: /* block_args_tail: f_any_kwrest opt_f_block_arg */
10226#line 3536 "parse.y"
10227 {
10228 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
10229 }
10230#line 10226 "parse.c"
10231 break;
10232
10233 case 410: /* block_args_tail: f_block_arg */
10234#line 3540 "parse.y"
10235 {
10236 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
10237 }
10238#line 10234 "parse.c"
10239 break;
10240
10241 case 411: /* opt_block_args_tail: ',' block_args_tail */
10242#line 3546 "parse.y"
10243 {
10244 (yyval.node) = (yyvsp[0].node);
10245 }
10246#line 10242 "parse.c"
10247 break;
10248
10249 case 412: /* opt_block_args_tail: %empty */
10250#line 3550 "parse.y"
10251 {
10252 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
10253 }
10254#line 10250 "parse.c"
10255 break;
10256
10257 case 413: /* excessed_comma: ',' */
10258#line 3556 "parse.y"
10259 {
10260 /* magic number for rest_id in iseq_set_arguments() */
10261 /*%%%*/
10263 /*% %*/
10264 /*% ripper: excessed_comma! %*/
10265 }
10266#line 10262 "parse.c"
10267 break;
10268
10269 case 414: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail */
10270#line 3566 "parse.y"
10271 {
10272 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10273 }
10274#line 10270 "parse.c"
10275 break;
10276
10277 case 415: /* block_param: f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10278#line 3570 "parse.y"
10279 {
10280 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10281 }
10282#line 10278 "parse.c"
10283 break;
10284
10285 case 416: /* block_param: f_arg ',' f_block_optarg opt_block_args_tail */
10286#line 3574 "parse.y"
10287 {
10288 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10289 }
10290#line 10286 "parse.c"
10291 break;
10292
10293 case 417: /* block_param: f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail */
10294#line 3578 "parse.y"
10295 {
10296 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10297 }
10298#line 10294 "parse.c"
10299 break;
10300
10301 case 418: /* block_param: f_arg ',' f_rest_arg opt_block_args_tail */
10302#line 3582 "parse.y"
10303 {
10304 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10305 }
10306#line 10302 "parse.c"
10307 break;
10308
10309 case 419: /* block_param: f_arg excessed_comma */
10310#line 3586 "parse.y"
10311 {
10312 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
10313 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), Qnone, (yyval.node), &(yyloc));
10314 }
10315#line 10311 "parse.c"
10316 break;
10317
10318 case 420: /* block_param: f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10319#line 3591 "parse.y"
10320 {
10321 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10322 }
10323#line 10319 "parse.c"
10324 break;
10325
10326 case 421: /* block_param: f_arg opt_block_args_tail */
10327#line 3595 "parse.y"
10328 {
10329 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10330 }
10331#line 10327 "parse.c"
10332 break;
10333
10334 case 422: /* block_param: f_block_optarg ',' f_rest_arg opt_block_args_tail */
10335#line 3599 "parse.y"
10336 {
10337 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10338 }
10339#line 10335 "parse.c"
10340 break;
10341
10342 case 423: /* block_param: f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail */
10343#line 3603 "parse.y"
10344 {
10345 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10346 }
10347#line 10343 "parse.c"
10348 break;
10349
10350 case 424: /* block_param: f_block_optarg opt_block_args_tail */
10351#line 3607 "parse.y"
10352 {
10353 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10354 }
10355#line 10351 "parse.c"
10356 break;
10357
10358 case 425: /* block_param: f_block_optarg ',' f_arg opt_block_args_tail */
10359#line 3611 "parse.y"
10360 {
10361 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10362 }
10363#line 10359 "parse.c"
10364 break;
10365
10366 case 426: /* block_param: f_rest_arg opt_block_args_tail */
10367#line 3615 "parse.y"
10368 {
10369 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
10370 }
10371#line 10367 "parse.c"
10372 break;
10373
10374 case 427: /* block_param: f_rest_arg ',' f_arg opt_block_args_tail */
10375#line 3619 "parse.y"
10376 {
10377 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10378 }
10379#line 10375 "parse.c"
10380 break;
10381
10382 case 428: /* block_param: block_args_tail */
10383#line 3623 "parse.y"
10384 {
10385 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10386 }
10387#line 10383 "parse.c"
10388 break;
10389
10390 case 430: /* opt_block_param: block_param_def */
10391#line 3630 "parse.y"
10392 {
10393 p->command_start = TRUE;
10394 }
10395#line 10391 "parse.c"
10396 break;
10397
10398 case 431: /* block_param_def: '|' opt_bv_decl '|' */
10399#line 3636 "parse.y"
10400 {
10401 p->cur_arg = 0;
10403 /*%%%*/
10404 (yyval.node) = 0;
10405 /*% %*/
10406 /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/
10407 }
10408#line 10404 "parse.c"
10409 break;
10410
10411 case 432: /* block_param_def: '|' block_param opt_bv_decl '|' */
10412#line 3645 "parse.y"
10413 {
10414 p->cur_arg = 0;
10416 /*%%%*/
10417 (yyval.node) = (yyvsp[-2].node);
10418 /*% %*/
10419 /*% ripper: block_var!(escape_Qundef($2), escape_Qundef($3)) %*/
10420 }
10421#line 10417 "parse.c"
10422 break;
10423
10424 case 433: /* opt_bv_decl: opt_nl */
10425#line 3657 "parse.y"
10426 {
10427 (yyval.node) = 0;
10428 }
10429#line 10425 "parse.c"
10430 break;
10431
10432 case 434: /* opt_bv_decl: opt_nl ';' bv_decls opt_nl */
10433#line 3661 "parse.y"
10434 {
10435 /*%%%*/
10436 (yyval.node) = 0;
10437 /*% %*/
10438 /*% ripper: $3 %*/
10439 }
10440#line 10436 "parse.c"
10441 break;
10442
10443 case 437: /* bvar: "local variable or method" */
10444#line 3676 "parse.y"
10445 {
10446 new_bv(p, get_id((yyvsp[0].id)));
10447 /*% ripper: get_value($1) %*/
10448 }
10449#line 10445 "parse.c"
10450 break;
10451
10452 case 438: /* bvar: f_bad_arg */
10453#line 3681 "parse.y"
10454 {
10455 (yyval.node) = 0;
10456 }
10457#line 10453 "parse.c"
10458 break;
10459
10460 case 439: /* @26: %empty */
10461#line 3687 "parse.y"
10462 {
10463 token_info_push(p, "->", &(yylsp[0]));
10464 (yyvsp[0].vars) = dyna_push(p);
10465 (yyval.num) = p->lex.lpar_beg;
10466 p->lex.lpar_beg = p->lex.paren_nest;
10467 }
10468#line 10464 "parse.c"
10469 break;
10470
10471 case 440: /* @27: %empty */
10472#line 3693 "parse.y"
10473 {
10474 (yyval.num) = p->max_numparam;
10475 p->max_numparam = 0;
10476 }
10477#line 10473 "parse.c"
10478 break;
10479
10480 case 441: /* @28: %empty */
10481#line 3697 "parse.y"
10482 {
10483 (yyval.node) = numparam_push(p);
10484 }
10485#line 10481 "parse.c"
10486 break;
10487
10488 case 442: /* $@29: %empty */
10489#line 3701 "parse.y"
10490 {
10491 CMDARG_PUSH(0);
10492 }
10493#line 10489 "parse.c"
10494 break;
10495
10496 case 443: /* lambda: "->" @26 @27 @28 f_larglist $@29 lambda_body */
10497#line 3705 "parse.y"
10498 {
10499 int max_numparam = p->max_numparam;
10500 p->lex.lpar_beg = (yyvsp[-5].num);
10501 p->max_numparam = (yyvsp[-4].num);
10502 CMDARG_POP();
10503 (yyvsp[-2].node) = args_with_numbered(p, (yyvsp[-2].node), max_numparam);
10504 /*%%%*/
10505 {
10506 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10507 (yyval.node) = NEW_LAMBDA((yyvsp[-2].node), (yyvsp[0].node), &loc);
10508 nd_set_line((yyval.node)->nd_body, (yylsp[0]).end_pos.lineno);
10509 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10510 nd_set_first_loc((yyval.node), (yylsp[-6]).beg_pos);
10511 }
10512 /*% %*/
10513 /*% ripper: lambda!($5, $7) %*/
10514 numparam_pop(p, (yyvsp[-3].node));
10515 dyna_pop(p, (yyvsp[-6].vars));
10516 }
10517#line 10513 "parse.c"
10518 break;
10519
10520 case 444: /* f_larglist: '(' f_args opt_bv_decl ')' */
10521#line 3727 "parse.y"
10522 {
10523 /*%%%*/
10524 (yyval.node) = (yyvsp[-2].node);
10526 /*% %*/
10527 /*% ripper: paren!($2) %*/
10528 }
10529#line 10525 "parse.c"
10530 break;
10531
10532 case 445: /* f_larglist: f_args */
10533#line 3735 "parse.y"
10534 {
10535 /*%%%*/
10536 if (!args_info_empty_p((yyvsp[0].node)->nd_ainfo))
10538 /*% %*/
10539 (yyval.node) = (yyvsp[0].node);
10540 }
10541#line 10537 "parse.c"
10542 break;
10543
10544 case 446: /* lambda_body: tLAMBEG compstmt '}' */
10545#line 3745 "parse.y"
10546 {
10547 token_info_pop(p, "}", &(yylsp[0]));
10548 (yyval.node) = (yyvsp[-1].node);
10549 }
10550#line 10546 "parse.c"
10551 break;
10552
10553 case 447: /* lambda_body: "`do' for lambda" bodystmt k_end */
10554#line 3750 "parse.y"
10555 {
10556 (yyval.node) = (yyvsp[-1].node);
10557 }
10558#line 10554 "parse.c"
10559 break;
10560
10561 case 448: /* do_block: k_do_block do_body k_end */
10562#line 3756 "parse.y"
10563 {
10564 (yyval.node) = (yyvsp[-1].node);
10565 /*%%%*/
10566 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10567 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10568 /*% %*/
10569 }
10570#line 10566 "parse.c"
10571 break;
10572
10573 case 449: /* block_call: command do_block */
10574#line 3766 "parse.y"
10575 {
10576 /*%%%*/
10577 if (nd_type((yyvsp[-1].node)) == NODE_YIELD) {
10578 compile_error(p, "block given to yield");
10579 }
10580 else {
10581 block_dup_check(p, (yyvsp[-1].node)->nd_args, (yyvsp[0].node));
10582 }
10583 (yyval.node) = method_add_block(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10584 fixpos((yyval.node), (yyvsp[-1].node));
10585 /*% %*/
10586 /*% ripper: method_add_block!($1, $2) %*/
10587 }
10588#line 10584 "parse.c"
10589 break;
10590
10591 case 450: /* block_call: block_call call_op2 operation2 opt_paren_args */
10592#line 3780 "parse.y"
10593 {
10594 /*%%%*/
10595 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10596 /*% %*/
10597 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
10598 }
10599#line 10595 "parse.c"
10600 break;
10601
10602 case 451: /* block_call: block_call call_op2 operation2 opt_paren_args brace_block */
10603#line 3787 "parse.y"
10604 {
10605 /*%%%*/
10606 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10607 /*% %*/
10608 /*% ripper: opt_event(:method_add_block!, command_call!($1, $2, $3, $4), $5) %*/
10609 }
10610#line 10606 "parse.c"
10611 break;
10612
10613 case 452: /* block_call: block_call call_op2 operation2 command_args do_block */
10614#line 3794 "parse.y"
10615 {
10616 /*%%%*/
10617 (yyval.node) = new_command_qcall(p, (yyvsp[-3].id), (yyvsp[-4].node), (yyvsp[-2].id), (yyvsp[-1].node), (yyvsp[0].node), &(yylsp[-2]), &(yyloc));
10618 /*% %*/
10619 /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/
10620 }
10621#line 10617 "parse.c"
10622 break;
10623
10624 case 453: /* method_call: fcall paren_args */
10625#line 3803 "parse.y"
10626 {
10627 /*%%%*/
10628 (yyval.node) = (yyvsp[-1].node);
10629 (yyval.node)->nd_args = (yyvsp[0].node);
10630 nd_set_last_loc((yyvsp[-1].node), (yylsp[0]).end_pos);
10631 /*% %*/
10632 /*% ripper: method_add_arg!(fcall!($1), $2) %*/
10633 }
10634#line 10630 "parse.c"
10635 break;
10636
10637 case 454: /* method_call: primary_value call_op operation2 opt_paren_args */
10638#line 3812 "parse.y"
10639 {
10640 /*%%%*/
10641 (yyval.node) = new_qcall(p, (yyvsp[-2].id), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10642 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10643 /*% %*/
10644 /*% ripper: opt_event(:method_add_arg!, call!($1, $2, $3), $4) %*/
10645 }
10646#line 10642 "parse.c"
10647 break;
10648
10649 case 455: /* method_call: primary_value "::" operation2 paren_args */
10650#line 3820 "parse.y"
10651 {
10652 /*%%%*/
10653 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10654 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10655 /*% %*/
10656 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), $3), $4) %*/
10657 }
10658#line 10654 "parse.c"
10659 break;
10660
10661 case 456: /* method_call: primary_value "::" operation3 */
10662#line 3828 "parse.y"
10663 {
10664 /*%%%*/
10665 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), (yyvsp[0].id), Qnull, &(yylsp[0]), &(yyloc));
10666 /*% %*/
10667 /*% ripper: call!($1, ID2VAL(idCOLON2), $3) %*/
10668 }
10669#line 10665 "parse.c"
10670 break;
10671
10672 case 457: /* method_call: primary_value call_op paren_args */
10673#line 3835 "parse.y"
10674 {
10675 /*%%%*/
10676 (yyval.node) = new_qcall(p, (yyvsp[-1].id), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10677 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10678 /*% %*/
10679 /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/
10680 }
10681#line 10677 "parse.c"
10682 break;
10683
10684 case 458: /* method_call: primary_value "::" paren_args */
10685#line 3843 "parse.y"
10686 {
10687 /*%%%*/
10688 (yyval.node) = new_qcall(p, ID2VAL(idCOLON2), (yyvsp[-2].node), ID2VAL(idCall), (yyvsp[0].node), &(yylsp[-1]), &(yyloc));
10689 nd_set_line((yyval.node), (yylsp[-1]).end_pos.lineno);
10690 /*% %*/
10691 /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), ID2VAL(idCall)), $3) %*/
10692 }
10693#line 10689 "parse.c"
10694 break;
10695
10696 case 459: /* method_call: "`super'" paren_args */
10697#line 3851 "parse.y"
10698 {
10699 /*%%%*/
10700 (yyval.node) = NEW_SUPER((yyvsp[0].node), &(yyloc));
10701 /*% %*/
10702 /*% ripper: super!($2) %*/
10703 }
10704#line 10700 "parse.c"
10705 break;
10706
10707 case 460: /* method_call: "`super'" */
10708#line 3858 "parse.y"
10709 {
10710 /*%%%*/
10711 (yyval.node) = NEW_ZSUPER(&(yyloc));
10712 /*% %*/
10713 /*% ripper: zsuper! %*/
10714 }
10715#line 10711 "parse.c"
10716 break;
10717
10718 case 461: /* method_call: primary_value '[' opt_call_args rbracket */
10719#line 3865 "parse.y"
10720 {
10721 /*%%%*/
10722 if ((yyvsp[-3].node) && nd_type((yyvsp[-3].node)) == NODE_SELF)
10723 (yyval.node) = NEW_FCALL(tAREF, (yyvsp[-1].node), &(yyloc));
10724 else
10725 (yyval.node) = NEW_CALL((yyvsp[-3].node), tAREF, (yyvsp[-1].node), &(yyloc));
10726 fixpos((yyval.node), (yyvsp[-3].node));
10727 /*% %*/
10728 /*% ripper: aref!($1, escape_Qundef($3)) %*/
10729 }
10730#line 10726 "parse.c"
10731 break;
10732
10733 case 462: /* brace_block: '{' brace_body '}' */
10734#line 3878 "parse.y"
10735 {
10736 (yyval.node) = (yyvsp[-1].node);
10737 /*%%%*/
10738 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10739 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10740 /*% %*/
10741 }
10742#line 10738 "parse.c"
10743 break;
10744
10745 case 463: /* brace_block: k_do do_body k_end */
10746#line 3886 "parse.y"
10747 {
10748 (yyval.node) = (yyvsp[-1].node);
10749 /*%%%*/
10750 (yyval.node)->nd_body->nd_loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
10751 nd_set_line((yyval.node), (yylsp[-2]).end_pos.lineno);
10752 /*% %*/
10753 }
10754#line 10750 "parse.c"
10755 break;
10756
10757 case 464: /* @30: %empty */
10758#line 3895 "parse.y"
10759 {(yyval.vars) = dyna_push(p);}
10760#line 10756 "parse.c"
10761 break;
10762
10763 case 465: /* @31: %empty */
10764#line 3896 "parse.y"
10765 {
10766 (yyval.num) = p->max_numparam;
10767 p->max_numparam = 0;
10768 }
10769#line 10765 "parse.c"
10770 break;
10771
10772 case 466: /* @32: %empty */
10773#line 3900 "parse.y"
10774 {
10775 (yyval.node) = numparam_push(p);
10776 }
10777#line 10773 "parse.c"
10778 break;
10779
10780 case 467: /* brace_body: @30 @31 @32 opt_block_param compstmt */
10781#line 3904 "parse.y"
10782 {
10783 int max_numparam = p->max_numparam;
10784 p->max_numparam = (yyvsp[-3].num);
10785 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
10786 /*%%%*/
10787 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10788 /*% %*/
10789 /*% ripper: brace_block!(escape_Qundef($4), $5) %*/
10790 numparam_pop(p, (yyvsp[-2].node));
10791 dyna_pop(p, (yyvsp[-4].vars));
10792 }
10793#line 10789 "parse.c"
10794 break;
10795
10796 case 468: /* @33: %empty */
10797#line 3917 "parse.y"
10798 {(yyval.vars) = dyna_push(p);}
10799#line 10795 "parse.c"
10800 break;
10801
10802 case 469: /* @34: %empty */
10803#line 3918 "parse.y"
10804 {
10805 (yyval.num) = p->max_numparam;
10806 p->max_numparam = 0;
10807 }
10808#line 10804 "parse.c"
10809 break;
10810
10811 case 470: /* @35: %empty */
10812#line 3922 "parse.y"
10813 {
10814 (yyval.node) = numparam_push(p);
10815 CMDARG_PUSH(0);
10816 }
10817#line 10813 "parse.c"
10818 break;
10819
10820 case 471: /* do_body: @33 @34 @35 opt_block_param bodystmt */
10821#line 3927 "parse.y"
10822 {
10823 int max_numparam = p->max_numparam;
10824 p->max_numparam = (yyvsp[-3].num);
10825 (yyvsp[-1].node) = args_with_numbered(p, (yyvsp[-1].node), max_numparam);
10826 /*%%%*/
10827 (yyval.node) = NEW_ITER((yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10828 /*% %*/
10829 /*% ripper: do_block!(escape_Qundef($4), $5) %*/
10830 CMDARG_POP();
10831 numparam_pop(p, (yyvsp[-2].node));
10832 dyna_pop(p, (yyvsp[-4].vars));
10833 }
10834#line 10830 "parse.c"
10835 break;
10836
10837 case 472: /* case_args: arg_value */
10838#line 3942 "parse.y"
10839 {
10840 /*%%%*/
10841 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
10842 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
10843 /*% %*/
10844 /*% ripper: args_add!(args_new!, $1) %*/
10845 }
10846#line 10842 "parse.c"
10847 break;
10848
10849 case 473: /* case_args: "*" arg_value */
10850#line 3950 "parse.y"
10851 {
10852 /*%%%*/
10853 (yyval.node) = NEW_SPLAT((yyvsp[0].node), &(yyloc));
10854 /*% %*/
10855 /*% ripper: args_add_star!(args_new!, $2) %*/
10856 }
10857#line 10853 "parse.c"
10858 break;
10859
10860 case 474: /* case_args: case_args ',' arg_value */
10861#line 3957 "parse.y"
10862 {
10863 /*%%%*/
10864 check_literal_when(p, (yyvsp[0].node), &(yylsp[0]));
10865 (yyval.node) = last_arg_append(p, (yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
10866 /*% %*/
10867 /*% ripper: args_add!($1, $3) %*/
10868 }
10869#line 10865 "parse.c"
10870 break;
10871
10872 case 475: /* case_args: case_args ',' "*" arg_value */
10873#line 3965 "parse.y"
10874 {
10875 /*%%%*/
10876 (yyval.node) = rest_arg_append(p, (yyvsp[-3].node), (yyvsp[0].node), &(yyloc));
10877 /*% %*/
10878 /*% ripper: args_add_star!($1, $4) %*/
10879 }
10880#line 10876 "parse.c"
10881 break;
10882
10883 case 476: /* case_body: k_when case_args then compstmt cases */
10884#line 3976 "parse.y"
10885 {
10886 /*%%%*/
10887 (yyval.node) = NEW_WHEN((yyvsp[-3].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10888 fixpos((yyval.node), (yyvsp[-3].node));
10889 /*% %*/
10890 /*% ripper: when!($2, $4, escape_Qundef($5)) %*/
10891 }
10892#line 10888 "parse.c"
10893 break;
10894
10895 case 479: /* @36: %empty */
10896#line 3990 "parse.y"
10897 {
10898 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
10899 p->command_start = FALSE;
10900 (yyvsp[0].ctxt) = p->ctxt;
10901 p->ctxt.in_kwarg = 1;
10902 (yyval.tbl) = push_pvtbl(p);
10903 }
10904#line 10900 "parse.c"
10905 break;
10906
10907 case 480: /* @37: %empty */
10908#line 3997 "parse.y"
10909 {
10910 (yyval.tbl) = push_pktbl(p);
10911 }
10912#line 10908 "parse.c"
10913 break;
10914
10915 case 481: /* $@38: %empty */
10916#line 4001 "parse.y"
10917 {
10918 pop_pktbl(p, (yyvsp[-2].tbl));
10919 pop_pvtbl(p, (yyvsp[-3].tbl));
10920 p->ctxt.in_kwarg = (yyvsp[-4].ctxt).in_kwarg;
10921 }
10922#line 10918 "parse.c"
10923 break;
10924
10925 case 482: /* p_case_body: "`in'" @36 @37 p_top_expr then $@38 compstmt p_cases */
10926#line 4008 "parse.y"
10927 {
10928 /*%%%*/
10929 (yyval.node) = NEW_IN((yyvsp[-4].node), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
10930 /*% %*/
10931 /*% ripper: in!($4, $7, escape_Qundef($8)) %*/
10932 }
10933#line 10929 "parse.c"
10934 break;
10935
10936 case 486: /* p_top_expr: p_top_expr_body "`if' modifier" expr_value */
10937#line 4022 "parse.y"
10938 {
10939 /*%%%*/
10940 (yyval.node) = new_if(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10941 fixpos((yyval.node), (yyvsp[0].node));
10942 /*% %*/
10943 /*% ripper: if_mod!($3, $1) %*/
10944 }
10945#line 10941 "parse.c"
10946 break;
10947
10948 case 487: /* p_top_expr: p_top_expr_body "`unless' modifier" expr_value */
10949#line 4030 "parse.y"
10950 {
10951 /*%%%*/
10952 (yyval.node) = new_unless(p, (yyvsp[0].node), remove_begin((yyvsp[-2].node)), 0, &(yyloc));
10953 fixpos((yyval.node), (yyvsp[0].node));
10954 /*% %*/
10955 /*% ripper: unless_mod!($3, $1) %*/
10956 }
10957#line 10953 "parse.c"
10958 break;
10959
10960 case 489: /* p_top_expr_body: p_expr ',' */
10961#line 4041 "parse.y"
10962 {
10963 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, 0, Qnone, &(yyloc));
10964 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-1].node)), (yyval.node), &(yyloc));
10965 }
10966#line 10962 "parse.c"
10967 break;
10968
10969 case 490: /* p_top_expr_body: p_expr ',' p_args */
10970#line 4046 "parse.y"
10971 {
10972 (yyval.node) = new_array_pattern(p, Qnone, get_value((yyvsp[-2].node)), (yyvsp[0].node), &(yyloc));
10973 /*%%%*/
10974 nd_set_first_loc((yyval.node), (yylsp[-2]).beg_pos);
10975 /*%
10976 %*/
10977 }
10978#line 10974 "parse.c"
10979 break;
10980
10981 case 491: /* p_top_expr_body: p_find */
10982#line 4054 "parse.y"
10983 {
10984 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
10985 }
10986#line 10982 "parse.c"
10987 break;
10988
10989 case 492: /* p_top_expr_body: p_args_tail */
10990#line 4058 "parse.y"
10991 {
10992 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
10993 }
10994#line 10990 "parse.c"
10995 break;
10996
10997 case 493: /* p_top_expr_body: p_kwargs */
10998#line 4062 "parse.y"
10999 {
11000 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[0].node), &(yyloc));
11001 }
11002#line 10998 "parse.c"
11003 break;
11004
11005 case 495: /* p_as: p_expr "=>" p_variable */
11006#line 4071 "parse.y"
11007 {
11008 /*%%%*/
11009 NODE *n = NEW_LIST((yyvsp[-2].node), &(yyloc));
11010 n = list_append(p, n, (yyvsp[0].node));
11011 (yyval.node) = new_hash(p, n, &(yyloc));
11012 /*% %*/
11013 /*% ripper: binary!($1, STATIC_ID2SYM((id_assoc)), $3) %*/
11014 }
11015#line 11011 "parse.c"
11016 break;
11017
11018 case 497: /* p_alt: p_alt '|' p_expr_basic */
11019#line 4083 "parse.y"
11020 {
11021 /*%%%*/
11022 (yyval.node) = NEW_NODE(NODE_OR, (yyvsp[-2].node), (yyvsp[0].node), 0, &(yyloc));
11023 /*% %*/
11024 /*% ripper: binary!($1, STATIC_ID2SYM(idOr), $3) %*/
11025 }
11026#line 11022 "parse.c"
11027 break;
11028
11029 case 499: /* p_lparen: '(' */
11030#line 4092 "parse.y"
11031 {(yyval.tbl) = push_pktbl(p);}
11032#line 11028 "parse.c"
11033 break;
11034
11035 case 500: /* p_lbracket: '[' */
11036#line 4093 "parse.y"
11037 {(yyval.tbl) = push_pktbl(p);}
11038#line 11034 "parse.c"
11039 break;
11040
11041 case 502: /* p_expr_basic: p_const p_lparen p_args rparen */
11042#line 4097 "parse.y"
11043 {
11044 pop_pktbl(p, (yyvsp[-2].tbl));
11045 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
11046 /*%%%*/
11047 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11048 /*%
11049 %*/
11050 }
11051#line 11047 "parse.c"
11052 break;
11053
11054 case 503: /* p_expr_basic: p_const p_lparen p_find rparen */
11055#line 4106 "parse.y"
11056 {
11057 pop_pktbl(p, (yyvsp[-2].tbl));
11058 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11059 /*%%%*/
11060 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11061 /*%
11062 %*/
11063 }
11064#line 11060 "parse.c"
11065 break;
11066
11067 case 504: /* p_expr_basic: p_const p_lparen p_kwargs rparen */
11068#line 4115 "parse.y"
11069 {
11070 pop_pktbl(p, (yyvsp[-2].tbl));
11071 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11072 /*%%%*/
11073 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11074 /*%
11075 %*/
11076 }
11077#line 11073 "parse.c"
11078 break;
11079
11080 case 505: /* p_expr_basic: p_const '(' rparen */
11081#line 4124 "parse.y"
11082 {
11083 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
11084 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
11085 }
11086#line 11082 "parse.c"
11087 break;
11088
11089 case 506: /* p_expr_basic: p_const p_lbracket p_args rbracket */
11090#line 4129 "parse.y"
11091 {
11092 pop_pktbl(p, (yyvsp[-2].tbl));
11093 (yyval.node) = new_array_pattern(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), &(yyloc));
11094 /*%%%*/
11095 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11096 /*%
11097 %*/
11098 }
11099#line 11095 "parse.c"
11100 break;
11101
11102 case 507: /* p_expr_basic: p_const p_lbracket p_find rbracket */
11103#line 4138 "parse.y"
11104 {
11105 pop_pktbl(p, (yyvsp[-2].tbl));
11106 (yyval.node) = new_find_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11107 /*%%%*/
11108 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11109 /*%
11110 %*/
11111 }
11112#line 11108 "parse.c"
11113 break;
11114
11115 case 508: /* p_expr_basic: p_const p_lbracket p_kwargs rbracket */
11116#line 4147 "parse.y"
11117 {
11118 pop_pktbl(p, (yyvsp[-2].tbl));
11119 (yyval.node) = new_hash_pattern(p, (yyvsp[-3].node), (yyvsp[-1].node), &(yyloc));
11120 /*%%%*/
11121 nd_set_first_loc((yyval.node), (yylsp[-3]).beg_pos);
11122 /*%
11123 %*/
11124 }
11125#line 11121 "parse.c"
11126 break;
11127
11128 case 509: /* p_expr_basic: p_const '[' rbracket */
11129#line 4156 "parse.y"
11130 {
11131 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
11132 (yyval.node) = new_array_pattern(p, (yyvsp[-2].node), Qnone, (yyval.node), &(yyloc));
11133 }
11134#line 11130 "parse.c"
11135 break;
11136
11137 case 510: /* p_expr_basic: "[" p_args rbracket */
11138#line 4161 "parse.y"
11139 {
11140 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyvsp[-1].node), &(yyloc));
11141 }
11142#line 11138 "parse.c"
11143 break;
11144
11145 case 511: /* p_expr_basic: "[" p_find rbracket */
11146#line 4165 "parse.y"
11147 {
11148 (yyval.node) = new_find_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
11149 }
11150#line 11146 "parse.c"
11151 break;
11152
11153 case 512: /* p_expr_basic: "[" rbracket */
11154#line 4169 "parse.y"
11155 {
11156 (yyval.node) = new_array_pattern_tail(p, Qnone, 0, 0, Qnone, &(yyloc));
11157 (yyval.node) = new_array_pattern(p, Qnone, Qnone, (yyval.node), &(yyloc));
11158 }
11159#line 11155 "parse.c"
11160 break;
11161
11162 case 513: /* @39: %empty */
11163#line 4174 "parse.y"
11164 {
11165 (yyval.tbl) = push_pktbl(p);
11166 (yyvsp[0].ctxt) = p->ctxt;
11167 p->ctxt.in_kwarg = 0;
11168 }
11169#line 11165 "parse.c"
11170 break;
11171
11172 case 514: /* p_expr_basic: "{" @39 p_kwargs rbrace */
11173#line 4180 "parse.y"
11174 {
11175 pop_pktbl(p, (yyvsp[-2].tbl));
11176 p->ctxt.in_kwarg = (yyvsp[-3].ctxt).in_kwarg;
11177 (yyval.node) = new_hash_pattern(p, Qnone, (yyvsp[-1].node), &(yyloc));
11178 }
11179#line 11175 "parse.c"
11180 break;
11181
11182 case 515: /* p_expr_basic: "{" rbrace */
11183#line 4186 "parse.y"
11184 {
11185 (yyval.node) = new_hash_pattern_tail(p, Qnone, 0, &(yyloc));
11186 (yyval.node) = new_hash_pattern(p, Qnone, (yyval.node), &(yyloc));
11187 }
11188#line 11184 "parse.c"
11189 break;
11190
11191 case 516: /* @40: %empty */
11192#line 4190 "parse.y"
11193 {(yyval.tbl) = push_pktbl(p);}
11194#line 11190 "parse.c"
11195 break;
11196
11197 case 517: /* p_expr_basic: "(" @40 p_expr rparen */
11198#line 4191 "parse.y"
11199 {
11200 pop_pktbl(p, (yyvsp[-2].tbl));
11201 (yyval.node) = (yyvsp[-1].node);
11202 }
11203#line 11199 "parse.c"
11204 break;
11205
11206 case 518: /* p_args: p_expr */
11207#line 4198 "parse.y"
11208 {
11209 /*%%%*/
11210 NODE *pre_args = NEW_LIST((yyvsp[0].node), &(yyloc));
11211 (yyval.node) = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &(yyloc));
11212 /*%
11213 $$ = new_array_pattern_tail(p, rb_ary_new_from_args(1, get_value($1)), 0, 0, Qnone, &@$);
11214 %*/
11215 }
11216#line 11212 "parse.c"
11217 break;
11218
11219 case 519: /* p_args: p_args_head */
11220#line 4207 "parse.y"
11221 {
11222 (yyval.node) = new_array_pattern_tail(p, (yyvsp[0].node), 1, 0, Qnone, &(yyloc));
11223 }
11224#line 11220 "parse.c"
11225 break;
11226
11227 case 520: /* p_args: p_args_head p_arg */
11228#line 4211 "parse.y"
11229 {
11230 /*%%%*/
11231 (yyval.node) = new_array_pattern_tail(p, list_concat((yyvsp[-1].node), (yyvsp[0].node)), 0, 0, Qnone, &(yyloc));
11232 /*%
11233 VALUE pre_args = rb_ary_concat($1, get_value($2));
11234 $$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$);
11235 %*/
11236 }
11237#line 11233 "parse.c"
11238 break;
11239
11240 case 521: /* p_args: p_args_head "*" "local variable or method" */
11241#line 4220 "parse.y"
11242 {
11243 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-2].node), 1, (yyvsp[0].id), Qnone, &(yyloc));
11244 }
11245#line 11241 "parse.c"
11246 break;
11247
11248 case 522: /* p_args: p_args_head "*" "local variable or method" ',' p_args_post */
11249#line 4224 "parse.y"
11250 {
11251 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-4].node), 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11252 }
11253#line 11249 "parse.c"
11254 break;
11255
11256 case 523: /* p_args: p_args_head "*" */
11257#line 4228 "parse.y"
11258 {
11259 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-1].node), 1, 0, Qnone, &(yyloc));
11260 }
11261#line 11257 "parse.c"
11262 break;
11263
11264 case 524: /* p_args: p_args_head "*" ',' p_args_post */
11265#line 4232 "parse.y"
11266 {
11267 (yyval.node) = new_array_pattern_tail(p, (yyvsp[-3].node), 1, 0, (yyvsp[0].node), &(yyloc));
11268 }
11269#line 11265 "parse.c"
11270 break;
11271
11272 case 526: /* p_args_head: p_arg ',' */
11273#line 4239 "parse.y"
11274 {
11275 (yyval.node) = (yyvsp[-1].node);
11276 }
11277#line 11273 "parse.c"
11278 break;
11279
11280 case 527: /* p_args_head: p_args_head p_arg ',' */
11281#line 4243 "parse.y"
11282 {
11283 /*%%%*/
11284 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[-1].node));
11285 /*% %*/
11286 /*% ripper: rb_ary_concat($1, get_value($2)) %*/
11287 }
11288#line 11284 "parse.c"
11289 break;
11290
11291 case 528: /* p_args_tail: p_rest */
11292#line 4252 "parse.y"
11293 {
11294 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[0].id), Qnone, &(yyloc));
11295 }
11296#line 11292 "parse.c"
11297 break;
11298
11299 case 529: /* p_args_tail: p_rest ',' p_args_post */
11300#line 4256 "parse.y"
11301 {
11302 (yyval.node) = new_array_pattern_tail(p, Qnone, 1, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc));
11303 }
11304#line 11300 "parse.c"
11305 break;
11306
11307 case 530: /* p_find: p_rest ',' p_args_post ',' p_rest */
11308#line 4262 "parse.y"
11309 {
11310 (yyval.node) = new_find_pattern_tail(p, (yyvsp[-4].id), (yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11311
11313 rb_warn0L_experimental(nd_line((yyval.node)), "Find pattern is experimental, and the behavior may change in future versions of Ruby!");
11314 }
11315#line 11311 "parse.c"
11316 break;
11317
11318 case 531: /* p_rest: "*" "local variable or method" */
11319#line 4272 "parse.y"
11320 {
11321 (yyval.id) = (yyvsp[0].id);
11322 }
11323#line 11319 "parse.c"
11324 break;
11325
11326 case 532: /* p_rest: "*" */
11327#line 4276 "parse.y"
11328 {
11329 (yyval.id) = 0;
11330 }
11331#line 11327 "parse.c"
11332 break;
11333
11334 case 534: /* p_args_post: p_args_post ',' p_arg */
11335#line 4283 "parse.y"
11336 {
11337 /*%%%*/
11338 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
11339 /*% %*/
11340 /*% ripper: rb_ary_concat($1, get_value($3)) %*/
11341 }
11342#line 11338 "parse.c"
11343 break;
11344
11345 case 535: /* p_arg: p_expr */
11346#line 4292 "parse.y"
11347 {
11348 /*%%%*/
11349 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11350 /*% %*/
11351 /*% ripper: rb_ary_new_from_args(1, get_value($1)) %*/
11352 }
11353#line 11349 "parse.c"
11354 break;
11355
11356 case 536: /* p_kwargs: p_kwarg ',' p_any_kwrest */
11357#line 4301 "parse.y"
11358 {
11359 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-2].node), &(yyloc)), (yyvsp[0].id), &(yyloc));
11360 }
11361#line 11357 "parse.c"
11362 break;
11363
11364 case 537: /* p_kwargs: p_kwarg */
11365#line 4305 "parse.y"
11366 {
11367 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[0].node), &(yyloc)), 0, &(yyloc));
11368 }
11369#line 11365 "parse.c"
11370 break;
11371
11372 case 538: /* p_kwargs: p_kwarg ',' */
11373#line 4309 "parse.y"
11374 {
11375 (yyval.node) = new_hash_pattern_tail(p, new_unique_key_hash(p, (yyvsp[-1].node), &(yyloc)), 0, &(yyloc));
11376 }
11377#line 11373 "parse.c"
11378 break;
11379
11380 case 539: /* p_kwargs: p_any_kwrest */
11381#line 4313 "parse.y"
11382 {
11383 (yyval.node) = new_hash_pattern_tail(p, new_hash(p, Qnone, &(yyloc)), (yyvsp[0].id), &(yyloc));
11384 }
11385#line 11381 "parse.c"
11386 break;
11387
11388 case 541: /* p_kwarg: p_kwarg ',' p_kw */
11389#line 4321 "parse.y"
11390 {
11391 /*%%%*/
11392 (yyval.node) = list_concat((yyvsp[-2].node), (yyvsp[0].node));
11393 /*% %*/
11394 /*% ripper: rb_ary_push($1, $3) %*/
11395 }
11396#line 11392 "parse.c"
11397 break;
11398
11399 case 542: /* p_kw: p_kw_label p_expr */
11400#line 4330 "parse.y"
11401 {
11402 error_duplicate_pattern_key(p, get_id((yyvsp[-1].id)), &(yylsp[-1]));
11403 /*%%%*/
11404 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yyloc)), &(yyloc)), (yyvsp[0].node));
11405 /*% %*/
11406 /*% ripper: rb_ary_new_from_args(2, get_value($1), get_value($2)) %*/
11407 }
11408#line 11404 "parse.c"
11409 break;
11410
11411 case 543: /* p_kw: p_kw_label */
11412#line 4338 "parse.y"
11413 {
11414 error_duplicate_pattern_key(p, get_id((yyvsp[0].id)), &(yylsp[0]));
11415 if ((yyvsp[0].id) && !is_local_id(get_id((yyvsp[0].id)))) {
11416 yyerror1(&(yylsp[0]), "key must be valid as local variables");
11417 }
11418 error_duplicate_pattern_variable(p, get_id((yyvsp[0].id)), &(yylsp[0]));
11419 /*%%%*/
11420 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc)), &(yyloc)), assignable(p, (yyvsp[0].id), 0, &(yyloc)));
11421 /*% %*/
11422 /*% ripper: rb_ary_new_from_args(2, get_value($1), Qnil) %*/
11423 }
11424#line 11420 "parse.c"
11425 break;
11426
11427 case 545: /* p_kw_label: "string literal" string_contents tLABEL_END */
11428#line 4353 "parse.y"
11429 {
11430 YYLTYPE loc = code_loc_gen(&(yylsp[-2]), &(yylsp[0]));
11431 /*%%%*/
11432 if (!(yyvsp[-1].node) || nd_type((yyvsp[-1].node)) == NODE_STR) {
11433 NODE *node = dsym_node(p, (yyvsp[-1].node), &loc);
11434 (yyval.id) = SYM2ID(node->nd_lit);
11435 }
11436 /*%
11437 if (ripper_is_node_yylval($2) && RNODE($2)->nd_cval) {
11438 VALUE label = RNODE($2)->nd_cval;
11439 VALUE rval = RNODE($2)->nd_rval;
11440 $$ = ripper_new_yylval(p, rb_intern_str(label), rval, label);
11441 RNODE($$)->nd_loc = loc;
11442 }
11443 %*/
11444 else {
11445 yyerror1(&loc, "symbol literal with interpolation is not allowed");
11446 (yyval.id) = 0;
11447 }
11448 }
11449#line 11445 "parse.c"
11450 break;
11451
11452 case 546: /* p_kwrest: kwrest_mark "local variable or method" */
11453#line 4376 "parse.y"
11454 {
11455 (yyval.id) = (yyvsp[0].id);
11456 }
11457#line 11453 "parse.c"
11458 break;
11459
11460 case 547: /* p_kwrest: kwrest_mark */
11461#line 4380 "parse.y"
11462 {
11463 (yyval.id) = 0;
11464 }
11465#line 11461 "parse.c"
11466 break;
11467
11468 case 548: /* p_kwnorest: kwrest_mark "`nil'" */
11469#line 4386 "parse.y"
11470 {
11471 (yyval.id) = 0;
11472 }
11473#line 11469 "parse.c"
11474 break;
11475
11476 case 550: /* p_any_kwrest: p_kwnorest */
11477#line 4392 "parse.y"
11478 {(yyval.id) = ID2VAL(idNil);}
11479#line 11475 "parse.c"
11480 break;
11481
11482 case 552: /* p_value: p_primitive ".." p_primitive */
11483#line 4397 "parse.y"
11484 {
11485 /*%%%*/
11486 value_expr((yyvsp[-2].node));
11487 value_expr((yyvsp[0].node));
11488 (yyval.node) = NEW_DOT2((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11489 /*% %*/
11490 /*% ripper: dot2!($1, $3) %*/
11491 }
11492#line 11488 "parse.c"
11493 break;
11494
11495 case 553: /* p_value: p_primitive "..." p_primitive */
11496#line 4406 "parse.y"
11497 {
11498 /*%%%*/
11499 value_expr((yyvsp[-2].node));
11500 value_expr((yyvsp[0].node));
11501 (yyval.node) = NEW_DOT3((yyvsp[-2].node), (yyvsp[0].node), &(yyloc));
11502 /*% %*/
11503 /*% ripper: dot3!($1, $3) %*/
11504 }
11505#line 11501 "parse.c"
11506 break;
11507
11508 case 554: /* p_value: p_primitive ".." */
11509#line 4415 "parse.y"
11510 {
11511 /*%%%*/
11512 value_expr((yyvsp[-1].node));
11513 (yyval.node) = NEW_DOT2((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11514 /*% %*/
11515 /*% ripper: dot2!($1, Qnil) %*/
11516 }
11517#line 11513 "parse.c"
11518 break;
11519
11520 case 555: /* p_value: p_primitive "..." */
11521#line 4423 "parse.y"
11522 {
11523 /*%%%*/
11524 value_expr((yyvsp[-1].node));
11525 (yyval.node) = NEW_DOT3((yyvsp[-1].node), new_nil_at(p, &(yylsp[0]).end_pos), &(yyloc));
11526 /*% %*/
11527 /*% ripper: dot3!($1, Qnil) %*/
11528 }
11529#line 11525 "parse.c"
11530 break;
11531
11532 case 559: /* p_value: "(.." p_primitive */
11533#line 4434 "parse.y"
11534 {
11535 /*%%%*/
11536 value_expr((yyvsp[0].node));
11537 (yyval.node) = NEW_DOT2(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11538 /*% %*/
11539 /*% ripper: dot2!(Qnil, $2) %*/
11540 }
11541#line 11537 "parse.c"
11542 break;
11543
11544 case 560: /* p_value: "(..." p_primitive */
11545#line 4442 "parse.y"
11546 {
11547 /*%%%*/
11548 value_expr((yyvsp[0].node));
11549 (yyval.node) = NEW_DOT3(new_nil_at(p, &(yylsp[-1]).beg_pos), (yyvsp[0].node), &(yyloc));
11550 /*% %*/
11551 /*% ripper: dot3!(Qnil, $2) %*/
11552 }
11553#line 11549 "parse.c"
11554 break;
11555
11556 case 569: /* p_primitive: keyword_variable */
11557#line 4460 "parse.y"
11558 {
11559 /*%%%*/
11560 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
11561 /*% %*/
11562 /*% ripper: var_ref!($1) %*/
11563 }
11564#line 11560 "parse.c"
11565 break;
11566
11567 case 571: /* p_variable: "local variable or method" */
11568#line 4470 "parse.y"
11569 {
11570 /*%%%*/
11571 error_duplicate_pattern_variable(p, (yyvsp[0].id), &(yylsp[0]));
11572 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
11573 /*% %*/
11574 /*% ripper: assignable(p, var_field(p, $1)) %*/
11575 }
11576#line 11572 "parse.c"
11577 break;
11578
11579 case 572: /* p_var_ref: '^' "local variable or method" */
11580#line 4480 "parse.y"
11581 {
11582 /*%%%*/
11583 NODE *n = gettable(p, (yyvsp[0].id), &(yyloc));
11584 if (!(nd_type(n) == NODE_LVAR || nd_type(n) == NODE_DVAR)) {
11585 compile_error(p, "%"PRIsVALUE": no such local variable", rb_id2str((yyvsp[0].id)));
11586 }
11587 (yyval.node) = n;
11588 /*% %*/
11589 /*% ripper: var_ref!($2) %*/
11590 }
11591#line 11587 "parse.c"
11592 break;
11593
11594 case 573: /* p_const: ":: at EXPR_BEG" cname */
11595#line 4493 "parse.y"
11596 {
11597 /*%%%*/
11598 (yyval.node) = NEW_COLON3((yyvsp[0].id), &(yyloc));
11599 /*% %*/
11600 /*% ripper: top_const_ref!($2) %*/
11601 }
11602#line 11598 "parse.c"
11603 break;
11604
11605 case 574: /* p_const: p_const "::" cname */
11606#line 4500 "parse.y"
11607 {
11608 /*%%%*/
11609 (yyval.node) = NEW_COLON2((yyvsp[-2].node), (yyvsp[0].id), &(yyloc));
11610 /*% %*/
11611 /*% ripper: const_path_ref!($1, $3) %*/
11612 }
11613#line 11609 "parse.c"
11614 break;
11615
11616 case 575: /* p_const: "constant" */
11617#line 4507 "parse.y"
11618 {
11619 /*%%%*/
11620 (yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc));
11621 /*% %*/
11622 /*% ripper: var_ref!($1) %*/
11623 }
11624#line 11620 "parse.c"
11625 break;
11626
11627 case 576: /* opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue */
11628#line 4518 "parse.y"
11629 {
11630 /*%%%*/
11631 (yyval.node) = NEW_RESBODY((yyvsp[-4].node),
11632 (yyvsp[-3].node) ? block_append(p, node_assign(p, (yyvsp[-3].node), NEW_ERRINFO(&(yylsp[-3])), NO_LEX_CTXT, &(yylsp[-3])), (yyvsp[-1].node)) : (yyvsp[-1].node),
11633 (yyvsp[0].node), &(yyloc));
11634 fixpos((yyval.node), (yyvsp[-4].node)?(yyvsp[-4].node):(yyvsp[-1].node));
11635 /*% %*/
11636 /*% ripper: rescue!(escape_Qundef($2), escape_Qundef($3), escape_Qundef($5), escape_Qundef($6)) %*/
11637 }
11638#line 11634 "parse.c"
11639 break;
11640
11641 case 578: /* exc_list: arg_value */
11642#line 4531 "parse.y"
11643 {
11644 /*%%%*/
11645 (yyval.node) = NEW_LIST((yyvsp[0].node), &(yyloc));
11646 /*% %*/
11647 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
11648 }
11649#line 11645 "parse.c"
11650 break;
11651
11652 case 579: /* exc_list: mrhs */
11653#line 4538 "parse.y"
11654 {
11655 /*%%%*/
11656 if (!((yyval.node) = splat_array((yyvsp[0].node)))) (yyval.node) = (yyvsp[0].node);
11657 /*% %*/
11658 /*% ripper: $1 %*/
11659 }
11660#line 11656 "parse.c"
11661 break;
11662
11663 case 581: /* exc_var: "=>" lhs */
11664#line 4548 "parse.y"
11665 {
11666 (yyval.node) = (yyvsp[0].node);
11667 }
11668#line 11664 "parse.c"
11669 break;
11670
11671 case 583: /* opt_ensure: k_ensure compstmt */
11672#line 4555 "parse.y"
11673 {
11674 /*%%%*/
11675 (yyval.node) = (yyvsp[0].node);
11676 /*% %*/
11677 /*% ripper: ensure!($2) %*/
11678 }
11679#line 11675 "parse.c"
11680 break;
11681
11682 case 587: /* strings: string */
11683#line 4569 "parse.y"
11684 {
11685 /*%%%*/
11686 NODE *node = (yyvsp[0].node);
11687 if (!node) {
11688 node = NEW_STR(STR_NEW0(), &(yyloc));
11689 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
11690 }
11691 else {
11692 node = evstr2dstr(p, node);
11693 }
11694 (yyval.node) = node;
11695 /*% %*/
11696 /*% ripper: $1 %*/
11697 }
11698#line 11694 "parse.c"
11699 break;
11700
11701 case 590: /* string: string string1 */
11702#line 4588 "parse.y"
11703 {
11704 /*%%%*/
11705 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11706 /*% %*/
11707 /*% ripper: string_concat!($1, $2) %*/
11708 }
11709#line 11705 "parse.c"
11710 break;
11711
11712 case 591: /* string1: "string literal" string_contents "terminator" */
11713#line 4597 "parse.y"
11714 {
11715 /*%%%*/
11716 (yyval.node) = heredoc_dedent(p, (yyvsp[-1].node));
11717 if ((yyval.node)) nd_set_loc((yyval.node), &(yyloc));
11718 /*% %*/
11719 /*% ripper: string_literal!(heredoc_dedent(p, $2)) %*/
11720 }
11721#line 11717 "parse.c"
11722 break;
11723
11724 case 592: /* xstring: "backtick literal" xstring_contents "terminator" */
11725#line 4607 "parse.y"
11726 {
11727 /*%%%*/
11728 (yyval.node) = new_xstring(p, heredoc_dedent(p, (yyvsp[-1].node)), &(yyloc));
11729 /*% %*/
11730 /*% ripper: xstring_literal!(heredoc_dedent(p, $2)) %*/
11731 }
11732#line 11728 "parse.c"
11733 break;
11734
11735 case 593: /* regexp: "regexp literal" regexp_contents tREGEXP_END */
11736#line 4616 "parse.y"
11737 {
11738 (yyval.node) = new_regexp(p, (yyvsp[-1].node), (yyvsp[0].num), &(yyloc));
11739 }
11740#line 11736 "parse.c"
11741 break;
11742
11743 case 594: /* words: "word list" ' ' word_list "terminator" */
11744#line 4622 "parse.y"
11745 {
11746 /*%%%*/
11747 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11748 /*% %*/
11749 /*% ripper: array!($3) %*/
11750 }
11751#line 11747 "parse.c"
11752 break;
11753
11754 case 595: /* word_list: %empty */
11755#line 4631 "parse.y"
11756 {
11757 /*%%%*/
11758 (yyval.node) = 0;
11759 /*% %*/
11760 /*% ripper: words_new! %*/
11761 }
11762#line 11758 "parse.c"
11763 break;
11764
11765 case 596: /* word_list: word_list word ' ' */
11766#line 4638 "parse.y"
11767 {
11768 /*%%%*/
11769 (yyval.node) = list_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
11770 /*% %*/
11771 /*% ripper: words_add!($1, $2) %*/
11772 }
11773#line 11769 "parse.c"
11774 break;
11775
11776 case 598: /* word: word string_content */
11777#line 4649 "parse.y"
11778 {
11779 /*%%%*/
11780 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11781 /*% %*/
11782 /*% ripper: word_add!($1, $2) %*/
11783 }
11784#line 11780 "parse.c"
11785 break;
11786
11787 case 599: /* symbols: "symbol list" ' ' symbol_list "terminator" */
11788#line 4658 "parse.y"
11789 {
11790 /*%%%*/
11791 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11792 /*% %*/
11793 /*% ripper: array!($3) %*/
11794 }
11795#line 11791 "parse.c"
11796 break;
11797
11798 case 600: /* symbol_list: %empty */
11799#line 4667 "parse.y"
11800 {
11801 /*%%%*/
11802 (yyval.node) = 0;
11803 /*% %*/
11804 /*% ripper: symbols_new! %*/
11805 }
11806#line 11802 "parse.c"
11807 break;
11808
11809 case 601: /* symbol_list: symbol_list word ' ' */
11810#line 4674 "parse.y"
11811 {
11812 /*%%%*/
11813 (yyval.node) = symbol_append(p, (yyvsp[-2].node), evstr2dstr(p, (yyvsp[-1].node)));
11814 /*% %*/
11815 /*% ripper: symbols_add!($1, $2) %*/
11816 }
11817#line 11813 "parse.c"
11818 break;
11819
11820 case 602: /* qwords: "verbatim word list" ' ' qword_list "terminator" */
11821#line 4683 "parse.y"
11822 {
11823 /*%%%*/
11824 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11825 /*% %*/
11826 /*% ripper: array!($3) %*/
11827 }
11828#line 11824 "parse.c"
11829 break;
11830
11831 case 603: /* qsymbols: "verbatim symbol list" ' ' qsym_list "terminator" */
11832#line 4692 "parse.y"
11833 {
11834 /*%%%*/
11835 (yyval.node) = make_list((yyvsp[-1].node), &(yyloc));
11836 /*% %*/
11837 /*% ripper: array!($3) %*/
11838 }
11839#line 11835 "parse.c"
11840 break;
11841
11842 case 604: /* qword_list: %empty */
11843#line 4701 "parse.y"
11844 {
11845 /*%%%*/
11846 (yyval.node) = 0;
11847 /*% %*/
11848 /*% ripper: qwords_new! %*/
11849 }
11850#line 11846 "parse.c"
11851 break;
11852
11853 case 605: /* qword_list: qword_list "literal content" ' ' */
11854#line 4708 "parse.y"
11855 {
11856 /*%%%*/
11857 (yyval.node) = list_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
11858 /*% %*/
11859 /*% ripper: qwords_add!($1, $2) %*/
11860 }
11861#line 11857 "parse.c"
11862 break;
11863
11864 case 606: /* qsym_list: %empty */
11865#line 4717 "parse.y"
11866 {
11867 /*%%%*/
11868 (yyval.node) = 0;
11869 /*% %*/
11870 /*% ripper: qsymbols_new! %*/
11871 }
11872#line 11868 "parse.c"
11873 break;
11874
11875 case 607: /* qsym_list: qsym_list "literal content" ' ' */
11876#line 4724 "parse.y"
11877 {
11878 /*%%%*/
11879 (yyval.node) = symbol_append(p, (yyvsp[-2].node), (yyvsp[-1].node));
11880 /*% %*/
11881 /*% ripper: qsymbols_add!($1, $2) %*/
11882 }
11883#line 11879 "parse.c"
11884 break;
11885
11886 case 608: /* string_contents: %empty */
11887#line 4733 "parse.y"
11888 {
11889 /*%%%*/
11890 (yyval.node) = 0;
11891 /*% %*/
11892 /*% ripper: string_content! %*/
11893 /*%%%*/
11894 /*%
11895 $$ = ripper_new_yylval(p, 0, $$, 0);
11896 %*/
11897 }
11898#line 11894 "parse.c"
11899 break;
11900
11901 case 609: /* string_contents: string_contents string_content */
11902#line 4744 "parse.y"
11903 {
11904 /*%%%*/
11905 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11906 /*% %*/
11907 /*% ripper: string_add!($1, $2) %*/
11908 /*%%%*/
11909 /*%
11910 if (ripper_is_node_yylval($1) && ripper_is_node_yylval($2) &&
11911 !RNODE($1)->nd_cval) {
11912 RNODE($1)->nd_cval = RNODE($2)->nd_cval;
11913 RNODE($1)->nd_rval = add_mark_object(p, $$);
11914 $$ = $1;
11915 }
11916 %*/
11917 }
11918#line 11914 "parse.c"
11919 break;
11920
11921 case 610: /* xstring_contents: %empty */
11922#line 4762 "parse.y"
11923 {
11924 /*%%%*/
11925 (yyval.node) = 0;
11926 /*% %*/
11927 /*% ripper: xstring_new! %*/
11928 }
11929#line 11925 "parse.c"
11930 break;
11931
11932 case 611: /* xstring_contents: xstring_contents string_content */
11933#line 4769 "parse.y"
11934 {
11935 /*%%%*/
11936 (yyval.node) = literal_concat(p, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
11937 /*% %*/
11938 /*% ripper: xstring_add!($1, $2) %*/
11939 }
11940#line 11936 "parse.c"
11941 break;
11942
11943 case 612: /* regexp_contents: %empty */
11944#line 4778 "parse.y"
11945 {
11946 /*%%%*/
11947 (yyval.node) = 0;
11948 /*% %*/
11949 /*% ripper: regexp_new! %*/
11950 /*%%%*/
11951 /*%
11952 $$ = ripper_new_yylval(p, 0, $$, 0);
11953 %*/
11954 }
11955#line 11951 "parse.c"
11956 break;
11957
11958 case 613: /* regexp_contents: regexp_contents string_content */
11959#line 4789 "parse.y"
11960 {
11961 /*%%%*/
11962 NODE *head = (yyvsp[-1].node), *tail = (yyvsp[0].node);
11963 if (!head) {
11964 (yyval.node) = tail;
11965 }
11966 else if (!tail) {
11967 (yyval.node) = head;
11968 }
11969 else {
11970 switch (nd_type(head)) {
11971 case NODE_STR:
11972 nd_set_type(head, NODE_DSTR);
11973 break;
11974 case NODE_DSTR:
11975 break;
11976 default:
11977 head = list_append(p, NEW_DSTR(Qnil, &(yyloc)), head);
11978 break;
11979 }
11980 (yyval.node) = list_append(p, head, tail);
11981 }
11982 /*%
11983 VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
11984 if (ripper_is_node_yylval(n1)) {
11985 s1 = RNODE(n1)->nd_cval;
11986 n1 = RNODE(n1)->nd_rval;
11987 }
11988 if (ripper_is_node_yylval(n2)) {
11989 s2 = RNODE(n2)->nd_cval;
11990 n2 = RNODE(n2)->nd_rval;
11991 }
11992 $$ = dispatch2(regexp_add, n1, n2);
11993 if (!s1 && s2) {
11994 $$ = ripper_new_yylval(p, 0, $$, s2);
11995 }
11996 %*/
11997 }
11998#line 11994 "parse.c"
11999 break;
12000
12001 case 615: /* @41: %empty */
12002#line 4832 "parse.y"
12003 {
12004 /* need to backup p->lex.strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
12005 (yyval.strterm) = p->lex.strterm;
12006 p->lex.strterm = 0;
12007 SET_LEX_STATE(EXPR_BEG);
12008 }
12009#line 12005 "parse.c"
12010 break;
12011
12012 case 616: /* string_content: tSTRING_DVAR @41 string_dvar */
12013#line 4839 "parse.y"
12014 {
12015 p->lex.strterm = (yyvsp[-1].strterm);
12016 /*%%%*/
12017 (yyval.node) = NEW_EVSTR((yyvsp[0].node), &(yyloc));
12018 nd_set_line((yyval.node), (yylsp[0]).end_pos.lineno);
12019 /*% %*/
12020 /*% ripper: string_dvar!($3) %*/
12021 }
12022#line 12018 "parse.c"
12023 break;
12024
12025 case 617: /* $@42: %empty */
12026#line 4848 "parse.y"
12027 {
12028 CMDARG_PUSH(0);
12029 COND_PUSH(0);
12030 }
12031#line 12027 "parse.c"
12032 break;
12033
12034 case 618: /* @43: %empty */
12035#line 4852 "parse.y"
12036 {
12037 /* need to backup p->lex.strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
12038 (yyval.strterm) = p->lex.strterm;
12039 p->lex.strterm = 0;
12040 }
12041#line 12037 "parse.c"
12042 break;
12043
12044 case 619: /* @44: %empty */
12045#line 4857 "parse.y"
12046 {
12047 (yyval.num) = p->lex.state;
12048 SET_LEX_STATE(EXPR_BEG);
12049 }
12050#line 12046 "parse.c"
12051 break;
12052
12053 case 620: /* @45: %empty */
12054#line 4861 "parse.y"
12055 {
12056 (yyval.num) = p->lex.brace_nest;
12057 p->lex.brace_nest = 0;
12058 }
12059#line 12055 "parse.c"
12060 break;
12061
12062 case 621: /* @46: %empty */
12063#line 4865 "parse.y"
12064 {
12065 (yyval.num) = p->heredoc_indent;
12066 p->heredoc_indent = 0;
12067 }
12068#line 12064 "parse.c"
12069 break;
12070
12071 case 622: /* string_content: tSTRING_DBEG $@42 @43 @44 @45 @46 compstmt "'}'" */
12072#line 4870 "parse.y"
12073 {
12074 COND_POP();
12075 CMDARG_POP();
12076 p->lex.strterm = (yyvsp[-5].strterm);
12077 SET_LEX_STATE((yyvsp[-4].num));
12078 p->lex.brace_nest = (yyvsp[-3].num);
12079 p->heredoc_indent = (yyvsp[-2].num);
12080 p->heredoc_line_indent = -1;
12081 /*%%%*/
12082 if ((yyvsp[-1].node)) (yyvsp[-1].node)->flags &= ~NODE_FL_NEWLINE;
12083 (yyval.node) = new_evstr(p, (yyvsp[-1].node), &(yyloc));
12084 /*% %*/
12085 /*% ripper: string_embexpr!($7) %*/
12086 }
12087#line 12083 "parse.c"
12088 break;
12089
12090 case 623: /* string_dvar: "global variable" */
12091#line 4887 "parse.y"
12092 {
12093 /*%%%*/
12094 (yyval.node) = NEW_GVAR((yyvsp[0].id), &(yyloc));
12095 /*% %*/
12096 /*% ripper: var_ref!($1) %*/
12097 }
12098#line 12094 "parse.c"
12099 break;
12100
12101 case 624: /* string_dvar: "instance variable" */
12102#line 4894 "parse.y"
12103 {
12104 /*%%%*/
12105 (yyval.node) = NEW_IVAR((yyvsp[0].id), &(yyloc));
12106 /*% %*/
12107 /*% ripper: var_ref!($1) %*/
12108 }
12109#line 12105 "parse.c"
12110 break;
12111
12112 case 625: /* string_dvar: "class variable" */
12113#line 4901 "parse.y"
12114 {
12115 /*%%%*/
12116 (yyval.node) = NEW_CVAR((yyvsp[0].id), &(yyloc));
12117 /*% %*/
12118 /*% ripper: var_ref!($1) %*/
12119 }
12120#line 12116 "parse.c"
12121 break;
12122
12123 case 629: /* ssym: "symbol literal" sym */
12124#line 4915 "parse.y"
12125 {
12126 SET_LEX_STATE(EXPR_END);
12127 /*%%%*/
12128 (yyval.node) = NEW_LIT(ID2SYM((yyvsp[0].id)), &(yyloc));
12129 /*% %*/
12130 /*% ripper: symbol_literal!(symbol!($2)) %*/
12131 }
12132#line 12128 "parse.c"
12133 break;
12134
12135 case 634: /* dsym: "symbol literal" string_contents "terminator" */
12136#line 4931 "parse.y"
12137 {
12138 SET_LEX_STATE(EXPR_END);
12139 /*%%%*/
12140 (yyval.node) = dsym_node(p, (yyvsp[-1].node), &(yyloc));
12141 /*% %*/
12142 /*% ripper: dyna_symbol!($2) %*/
12143 }
12144#line 12140 "parse.c"
12145 break;
12146
12147 case 636: /* numeric: tUMINUS_NUM simple_numeric */
12148#line 4942 "parse.y"
12149 {
12150 /*%%%*/
12151 (yyval.node) = (yyvsp[0].node);
12152 RB_OBJ_WRITE(p->ast, &(yyval.node)->nd_lit, negate_lit(p, (yyval.node)->nd_lit));
12153 /*% %*/
12154 /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
12155 }
12156#line 12152 "parse.c"
12157 break;
12158
12159 case 646: /* keyword_variable: "`nil'" */
12160#line 4964 "parse.y"
12161 {(yyval.id) = KWD2EID(nil, (yyvsp[0].id));}
12162#line 12158 "parse.c"
12163 break;
12164
12165 case 647: /* keyword_variable: "`self'" */
12166#line 4965 "parse.y"
12167 {(yyval.id) = KWD2EID(self, (yyvsp[0].id));}
12168#line 12164 "parse.c"
12169 break;
12170
12171 case 648: /* keyword_variable: "`true'" */
12172#line 4966 "parse.y"
12173 {(yyval.id) = KWD2EID(true, (yyvsp[0].id));}
12174#line 12170 "parse.c"
12175 break;
12176
12177 case 649: /* keyword_variable: "`false'" */
12178#line 4967 "parse.y"
12179 {(yyval.id) = KWD2EID(false, (yyvsp[0].id));}
12180#line 12176 "parse.c"
12181 break;
12182
12183 case 650: /* keyword_variable: "`__FILE__'" */
12184#line 4968 "parse.y"
12185 {(yyval.id) = KWD2EID(_FILE__, (yyvsp[0].id));}
12186#line 12182 "parse.c"
12187 break;
12188
12189 case 651: /* keyword_variable: "`__LINE__'" */
12190#line 4969 "parse.y"
12191 {(yyval.id) = KWD2EID(_LINE__, (yyvsp[0].id));}
12192#line 12188 "parse.c"
12193 break;
12194
12195 case 652: /* keyword_variable: "`__ENCODING__'" */
12196#line 4970 "parse.y"
12197 {(yyval.id) = KWD2EID(_ENCODING__, (yyvsp[0].id));}
12198#line 12194 "parse.c"
12199 break;
12200
12201 case 653: /* var_ref: user_variable */
12202#line 4974 "parse.y"
12203 {
12204 /*%%%*/
12205 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
12206 /*%
12207 if (id_is_var(p, get_id($1))) {
12208 $$ = dispatch1(var_ref, $1);
12209 }
12210 else {
12211 $$ = dispatch1(vcall, $1);
12212 }
12213 %*/
12214 }
12215#line 12211 "parse.c"
12216 break;
12217
12218 case 654: /* var_ref: keyword_variable */
12219#line 4987 "parse.y"
12220 {
12221 /*%%%*/
12222 if (!((yyval.node) = gettable(p, (yyvsp[0].id), &(yyloc)))) (yyval.node) = NEW_BEGIN(0, &(yyloc));
12223 /*% %*/
12224 /*% ripper: var_ref!($1) %*/
12225 }
12226#line 12222 "parse.c"
12227 break;
12228
12229 case 655: /* var_lhs: user_variable */
12230#line 4996 "parse.y"
12231 {
12232 /*%%%*/
12233 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12234 /*% %*/
12235 /*% ripper: assignable(p, var_field(p, $1)) %*/
12236 }
12237#line 12233 "parse.c"
12238 break;
12239
12240 case 656: /* var_lhs: keyword_variable */
12241#line 5003 "parse.y"
12242 {
12243 /*%%%*/
12244 (yyval.node) = assignable(p, (yyvsp[0].id), 0, &(yyloc));
12245 /*% %*/
12246 /*% ripper: assignable(p, var_field(p, $1)) %*/
12247 }
12248#line 12244 "parse.c"
12249 break;
12250
12251 case 659: /* $@47: %empty */
12252#line 5016 "parse.y"
12253 {
12254 SET_LEX_STATE(EXPR_BEG);
12255 p->command_start = TRUE;
12256 }
12257#line 12253 "parse.c"
12258 break;
12259
12260 case 660: /* superclass: '<' $@47 expr_value term */
12261#line 5021 "parse.y"
12262 {
12263 (yyval.node) = (yyvsp[-1].node);
12264 }
12265#line 12261 "parse.c"
12266 break;
12267
12268 case 661: /* superclass: %empty */
12269#line 5025 "parse.y"
12270 {
12271 /*%%%*/
12272 (yyval.node) = 0;
12273 /*% %*/
12274 /*% ripper: Qnil %*/
12275 }
12276#line 12272 "parse.c"
12277 break;
12278
12279 case 664: /* f_paren_args: '(' f_args rparen */
12280#line 5036 "parse.y"
12281 {
12282 /*%%%*/
12283 (yyval.node) = (yyvsp[-1].node);
12284 /*% %*/
12285 /*% ripper: paren!($2) %*/
12286 SET_LEX_STATE(EXPR_BEG);
12287 p->command_start = TRUE;
12288 }
12289#line 12285 "parse.c"
12290 break;
12291
12292 case 665: /* f_paren_args: '(' f_arg ',' args_forward rparen */
12293#line 5045 "parse.y"
12294 {
12295 add_forwarding_args(p);
12296 /*%%%*/
12297 (yyval.node) = new_args_forward_def(p, (yyvsp[-3].node), &(yyloc));
12298 /*% %*/
12299 /*% ripper: paren!(params!($2, Qnone, $4, Qnone, Qnone, Qnone, Qnone)) %*/
12300 SET_LEX_STATE(EXPR_BEG);
12301 p->command_start = TRUE;
12302 }
12303#line 12299 "parse.c"
12304 break;
12305
12306 case 666: /* f_paren_args: '(' args_forward rparen */
12307#line 5055 "parse.y"
12308 {
12309 add_forwarding_args(p);
12310 /*%%%*/
12311 (yyval.node) = new_args_forward_def(p, 0, &(yyloc));
12312 /*% %*/
12313 /*% ripper: paren!(params!(Qnone, Qnone, $2, Qnone, Qnone, Qnone, Qnone)) %*/
12314 SET_LEX_STATE(EXPR_BEG);
12315 p->command_start = TRUE;
12316 }
12317#line 12313 "parse.c"
12318 break;
12319
12320 case 668: /* @48: %empty */
12321#line 5067 "parse.y"
12322 {
12323 (yyval.ctxt) = p->ctxt;
12324 p->ctxt.in_kwarg = 1;
12325 SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
12326 }
12327#line 12323 "parse.c"
12328 break;
12329
12330 case 669: /* f_arglist: @48 f_args term */
12331#line 5073 "parse.y"
12332 {
12333 p->ctxt.in_kwarg = (yyvsp[-2].ctxt).in_kwarg;
12334 (yyval.node) = (yyvsp[-1].node);
12335 SET_LEX_STATE(EXPR_BEG);
12336 p->command_start = TRUE;
12337 }
12338#line 12334 "parse.c"
12339 break;
12340
12341 case 670: /* args_tail: f_kwarg ',' f_kwrest opt_f_block_arg */
12342#line 5082 "parse.y"
12343 {
12344 (yyval.node) = new_args_tail(p, (yyvsp[-3].node), (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12345 }
12346#line 12342 "parse.c"
12347 break;
12348
12349 case 671: /* args_tail: f_kwarg opt_f_block_arg */
12350#line 5086 "parse.y"
12351 {
12352 (yyval.node) = new_args_tail(p, (yyvsp[-1].node), Qnone, (yyvsp[0].id), &(yylsp[-1]));
12353 }
12354#line 12350 "parse.c"
12355 break;
12356
12357 case 672: /* args_tail: f_any_kwrest opt_f_block_arg */
12358#line 5090 "parse.y"
12359 {
12360 (yyval.node) = new_args_tail(p, Qnone, (yyvsp[-1].id), (yyvsp[0].id), &(yylsp[-1]));
12361 }
12362#line 12358 "parse.c"
12363 break;
12364
12365 case 673: /* args_tail: f_block_arg */
12366#line 5094 "parse.y"
12367 {
12368 (yyval.node) = new_args_tail(p, Qnone, Qnone, (yyvsp[0].id), &(yylsp[0]));
12369 }
12370#line 12366 "parse.c"
12371 break;
12372
12373 case 674: /* opt_args_tail: ',' args_tail */
12374#line 5100 "parse.y"
12375 {
12376 (yyval.node) = (yyvsp[0].node);
12377 }
12378#line 12374 "parse.c"
12379 break;
12380
12381 case 675: /* opt_args_tail: %empty */
12382#line 5104 "parse.y"
12383 {
12384 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12385 }
12386#line 12382 "parse.c"
12387 break;
12388
12389 case 676: /* f_args: f_arg ',' f_optarg ',' f_rest_arg opt_args_tail */
12390#line 5110 "parse.y"
12391 {
12392 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12393 }
12394#line 12390 "parse.c"
12395 break;
12396
12397 case 677: /* f_args: f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
12398#line 5114 "parse.y"
12399 {
12400 (yyval.node) = new_args(p, (yyvsp[-7].node), (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12401 }
12402#line 12398 "parse.c"
12403 break;
12404
12405 case 678: /* f_args: f_arg ',' f_optarg opt_args_tail */
12406#line 5118 "parse.y"
12407 {
12408 (yyval.node) = new_args(p, (yyvsp[-3].node), (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12409 }
12410#line 12406 "parse.c"
12411 break;
12412
12413 case 679: /* f_args: f_arg ',' f_optarg ',' f_arg opt_args_tail */
12414#line 5122 "parse.y"
12415 {
12416 (yyval.node) = new_args(p, (yyvsp[-5].node), (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12417 }
12418#line 12414 "parse.c"
12419 break;
12420
12421 case 680: /* f_args: f_arg ',' f_rest_arg opt_args_tail */
12422#line 5126 "parse.y"
12423 {
12424 (yyval.node) = new_args(p, (yyvsp[-3].node), Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12425 }
12426#line 12422 "parse.c"
12427 break;
12428
12429 case 681: /* f_args: f_arg ',' f_rest_arg ',' f_arg opt_args_tail */
12430#line 5130 "parse.y"
12431 {
12432 (yyval.node) = new_args(p, (yyvsp[-5].node), Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12433 }
12434#line 12430 "parse.c"
12435 break;
12436
12437 case 682: /* f_args: f_arg opt_args_tail */
12438#line 5134 "parse.y"
12439 {
12440 (yyval.node) = new_args(p, (yyvsp[-1].node), Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12441 }
12442#line 12438 "parse.c"
12443 break;
12444
12445 case 683: /* f_args: f_optarg ',' f_rest_arg opt_args_tail */
12446#line 5138 "parse.y"
12447 {
12448 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12449 }
12450#line 12446 "parse.c"
12451 break;
12452
12453 case 684: /* f_args: f_optarg ',' f_rest_arg ',' f_arg opt_args_tail */
12454#line 5142 "parse.y"
12455 {
12456 (yyval.node) = new_args(p, Qnone, (yyvsp[-5].node), (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12457 }
12458#line 12454 "parse.c"
12459 break;
12460
12461 case 685: /* f_args: f_optarg opt_args_tail */
12462#line 5146 "parse.y"
12463 {
12464 (yyval.node) = new_args(p, Qnone, (yyvsp[-1].node), Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12465 }
12466#line 12462 "parse.c"
12467 break;
12468
12469 case 686: /* f_args: f_optarg ',' f_arg opt_args_tail */
12470#line 5150 "parse.y"
12471 {
12472 (yyval.node) = new_args(p, Qnone, (yyvsp[-3].node), Qnone, (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12473 }
12474#line 12470 "parse.c"
12475 break;
12476
12477 case 687: /* f_args: f_rest_arg opt_args_tail */
12478#line 5154 "parse.y"
12479 {
12480 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-1].id), Qnone, (yyvsp[0].node), &(yyloc));
12481 }
12482#line 12478 "parse.c"
12483 break;
12484
12485 case 688: /* f_args: f_rest_arg ',' f_arg opt_args_tail */
12486#line 5158 "parse.y"
12487 {
12488 (yyval.node) = new_args(p, Qnone, Qnone, (yyvsp[-3].id), (yyvsp[-1].node), (yyvsp[0].node), &(yyloc));
12489 }
12490#line 12486 "parse.c"
12491 break;
12492
12493 case 689: /* f_args: args_tail */
12494#line 5162 "parse.y"
12495 {
12496 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyvsp[0].node), &(yyloc));
12497 }
12498#line 12494 "parse.c"
12499 break;
12500
12501 case 690: /* f_args: %empty */
12502#line 5166 "parse.y"
12503 {
12504 (yyval.node) = new_args_tail(p, Qnone, Qnone, Qnone, &(yylsp[0]));
12505 (yyval.node) = new_args(p, Qnone, Qnone, Qnone, Qnone, (yyval.node), &(yylsp[0]));
12506 }
12507#line 12503 "parse.c"
12508 break;
12509
12510 case 691: /* args_forward: "(..." */
12511#line 5173 "parse.y"
12512 {
12513 /*%%%*/
12514 (yyval.id) = idDot3;
12515 /*% %*/
12516 /*% ripper: args_forward! %*/
12517 }
12518#line 12514 "parse.c"
12519 break;
12520
12521 case 692: /* f_bad_arg: "constant" */
12522#line 5182 "parse.y"
12523 {
12524 static const char mesg[] = "formal argument cannot be a constant";
12525 /*%%%*/
12526 yyerror1(&(yylsp[0]), mesg);
12527 (yyval.id) = 0;
12528 /*% %*/
12529 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12530 }
12531#line 12527 "parse.c"
12532 break;
12533
12534 case 693: /* f_bad_arg: "instance variable" */
12535#line 5191 "parse.y"
12536 {
12537 static const char mesg[] = "formal argument cannot be an instance variable";
12538 /*%%%*/
12539 yyerror1(&(yylsp[0]), mesg);
12540 (yyval.id) = 0;
12541 /*% %*/
12542 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12543 }
12544#line 12540 "parse.c"
12545 break;
12546
12547 case 694: /* f_bad_arg: "global variable" */
12548#line 5200 "parse.y"
12549 {
12550 static const char mesg[] = "formal argument cannot be a global variable";
12551 /*%%%*/
12552 yyerror1(&(yylsp[0]), mesg);
12553 (yyval.id) = 0;
12554 /*% %*/
12555 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12556 }
12557#line 12553 "parse.c"
12558 break;
12559
12560 case 695: /* f_bad_arg: "class variable" */
12561#line 5209 "parse.y"
12562 {
12563 static const char mesg[] = "formal argument cannot be a class variable";
12564 /*%%%*/
12565 yyerror1(&(yylsp[0]), mesg);
12566 (yyval.id) = 0;
12567 /*% %*/
12568 /*% ripper[error]: param_error!(ERR_MESG(), $1) %*/
12569 }
12570#line 12566 "parse.c"
12571 break;
12572
12573 case 697: /* f_norm_arg: "local variable or method" */
12574#line 5221 "parse.y"
12575 {
12576 formal_argument(p, (yyvsp[0].id));
12578 (yyval.id) = (yyvsp[0].id);
12579 }
12580#line 12576 "parse.c"
12581 break;
12582
12583 case 698: /* f_arg_asgn: f_norm_arg */
12584#line 5229 "parse.y"
12585 {
12586 ID id = get_id((yyvsp[0].id));
12587 arg_var(p, id);
12588 p->cur_arg = id;
12589 (yyval.id) = (yyvsp[0].id);
12590 }
12591#line 12587 "parse.c"
12592 break;
12593
12594 case 699: /* f_arg_item: f_arg_asgn */
12595#line 5238 "parse.y"
12596 {
12597 p->cur_arg = 0;
12598 /*%%%*/
12599 (yyval.node) = NEW_ARGS_AUX((yyvsp[0].id), 1, &NULL_LOC);
12600 /*% %*/
12601 /*% ripper: get_value($1) %*/
12602 }
12603#line 12599 "parse.c"
12604 break;
12605
12606 case 700: /* f_arg_item: "(" f_margs rparen */
12607#line 5246 "parse.y"
12608 {
12609 /*%%%*/
12610 ID tid = internal_id(p);
12611 YYLTYPE loc;
12612 loc.beg_pos = (yylsp[-1]).beg_pos;
12613 loc.end_pos = (yylsp[-1]).beg_pos;
12614 arg_var(p, tid);
12615 if (dyna_in_block(p)) {
12616 (yyvsp[-1].node)->nd_value = NEW_DVAR(tid, &loc);
12617 }
12618 else {
12619 (yyvsp[-1].node)->nd_value = NEW_LVAR(tid, &loc);
12620 }
12621 (yyval.node) = NEW_ARGS_AUX(tid, 1, &NULL_LOC);
12622 (yyval.node)->nd_next = (yyvsp[-1].node);
12623 /*% %*/
12624 /*% ripper: mlhs_paren!($2) %*/
12625 }
12626#line 12622 "parse.c"
12627 break;
12628
12629 case 702: /* f_arg: f_arg ',' f_arg_item */
12630#line 5269 "parse.y"
12631 {
12632 /*%%%*/
12633 (yyval.node) = (yyvsp[-2].node);
12634 (yyval.node)->nd_plen++;
12635 (yyval.node)->nd_next = block_append(p, (yyval.node)->nd_next, (yyvsp[0].node)->nd_next);
12636 rb_discard_node(p, (yyvsp[0].node));
12637 /*% %*/
12638 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12639 }
12640#line 12636 "parse.c"
12641 break;
12642
12643 case 703: /* f_label: "label" */
12644#line 5282 "parse.y"
12645 {
12646 arg_var(p, formal_argument(p, (yyvsp[0].id)));
12647 p->cur_arg = get_id((yyvsp[0].id));
12649 (yyval.id) = (yyvsp[0].id);
12650 }
12651#line 12647 "parse.c"
12652 break;
12653
12654 case 704: /* f_kw: f_label arg_value */
12655#line 5291 "parse.y"
12656 {
12657 p->cur_arg = 0;
12658 /*%%%*/
12659 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12660 /*% %*/
12661 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
12662 }
12663#line 12659 "parse.c"
12664 break;
12665
12666 case 705: /* f_kw: f_label */
12667#line 5299 "parse.y"
12668 {
12669 p->cur_arg = 0;
12670 /*%%%*/
12671 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
12672 /*% %*/
12673 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
12674 }
12675#line 12671 "parse.c"
12676 break;
12677
12678 case 706: /* f_block_kw: f_label primary_value */
12679#line 5309 "parse.y"
12680 {
12681 /*%%%*/
12682 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[-1].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12683 /*% %*/
12684 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/
12685 }
12686#line 12682 "parse.c"
12687 break;
12688
12689 case 707: /* f_block_kw: f_label */
12690#line 5316 "parse.y"
12691 {
12692 /*%%%*/
12693 (yyval.node) = new_kw_arg(p, assignable(p, (yyvsp[0].id), NODE_SPECIAL_REQUIRED_KEYWORD, &(yyloc)), &(yyloc));
12694 /*% %*/
12695 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/
12696 }
12697#line 12693 "parse.c"
12698 break;
12699
12700 case 708: /* f_block_kwarg: f_block_kw */
12701#line 5325 "parse.y"
12702 {
12703 /*%%%*/
12704 (yyval.node) = (yyvsp[0].node);
12705 /*% %*/
12706 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12707 }
12708#line 12704 "parse.c"
12709 break;
12710
12711 case 709: /* f_block_kwarg: f_block_kwarg ',' f_block_kw */
12712#line 5332 "parse.y"
12713 {
12714 /*%%%*/
12715 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
12716 /*% %*/
12717 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12718 }
12719#line 12715 "parse.c"
12720 break;
12721
12722 case 710: /* f_kwarg: f_kw */
12723#line 5342 "parse.y"
12724 {
12725 /*%%%*/
12726 (yyval.node) = (yyvsp[0].node);
12727 /*% %*/
12728 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12729 }
12730#line 12726 "parse.c"
12731 break;
12732
12733 case 711: /* f_kwarg: f_kwarg ',' f_kw */
12734#line 5349 "parse.y"
12735 {
12736 /*%%%*/
12737 (yyval.node) = kwd_append((yyvsp[-2].node), (yyvsp[0].node));
12738 /*% %*/
12739 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12740 }
12741#line 12737 "parse.c"
12742 break;
12743
12744 case 714: /* f_no_kwarg: kwrest_mark "`nil'" */
12745#line 5362 "parse.y"
12746 {
12747 /*%%%*/
12748 /*% %*/
12749 /*% ripper: nokw_param!(Qnil) %*/
12750 }
12751#line 12747 "parse.c"
12752 break;
12753
12754 case 715: /* f_kwrest: kwrest_mark "local variable or method" */
12755#line 5370 "parse.y"
12756 {
12757 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
12758 /*%%%*/
12759 (yyval.id) = (yyvsp[0].id);
12760 /*% %*/
12761 /*% ripper: kwrest_param!($2) %*/
12762 }
12763#line 12759 "parse.c"
12764 break;
12765
12766 case 716: /* f_kwrest: kwrest_mark */
12767#line 5378 "parse.y"
12768 {
12769 /*%%%*/
12770 (yyval.id) = internal_id(p);
12771 arg_var(p, (yyval.id));
12772 /*% %*/
12773 /*% ripper: kwrest_param!(Qnil) %*/
12774 }
12775#line 12771 "parse.c"
12776 break;
12777
12778 case 717: /* f_opt: f_arg_asgn '=' arg_value */
12779#line 5388 "parse.y"
12780 {
12781 p->cur_arg = 0;
12782 /*%%%*/
12783 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12784 /*% %*/
12785 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
12786 }
12787#line 12783 "parse.c"
12788 break;
12789
12790 case 718: /* f_block_opt: f_arg_asgn '=' primary_value */
12791#line 5398 "parse.y"
12792 {
12793 p->cur_arg = 0;
12794 /*%%%*/
12795 (yyval.node) = NEW_OPT_ARG(0, assignable(p, (yyvsp[-2].id), (yyvsp[0].node), &(yyloc)), &(yyloc));
12796 /*% %*/
12797 /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/
12798 }
12799#line 12795 "parse.c"
12800 break;
12801
12802 case 719: /* f_block_optarg: f_block_opt */
12803#line 5408 "parse.y"
12804 {
12805 /*%%%*/
12806 (yyval.node) = (yyvsp[0].node);
12807 /*% %*/
12808 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12809 }
12810#line 12806 "parse.c"
12811 break;
12812
12813 case 720: /* f_block_optarg: f_block_optarg ',' f_block_opt */
12814#line 5415 "parse.y"
12815 {
12816 /*%%%*/
12817 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
12818 /*% %*/
12819 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12820 }
12821#line 12817 "parse.c"
12822 break;
12823
12824 case 721: /* f_optarg: f_opt */
12825#line 5424 "parse.y"
12826 {
12827 /*%%%*/
12828 (yyval.node) = (yyvsp[0].node);
12829 /*% %*/
12830 /*% ripper: rb_ary_new3(1, get_value($1)) %*/
12831 }
12832#line 12828 "parse.c"
12833 break;
12834
12835 case 722: /* f_optarg: f_optarg ',' f_opt */
12836#line 5431 "parse.y"
12837 {
12838 /*%%%*/
12839 (yyval.node) = opt_arg_append((yyvsp[-2].node), (yyvsp[0].node));
12840 /*% %*/
12841 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12842 }
12843#line 12839 "parse.c"
12844 break;
12845
12846 case 725: /* f_rest_arg: restarg_mark "local variable or method" */
12847#line 5444 "parse.y"
12848 {
12849 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
12850 /*%%%*/
12851 (yyval.id) = (yyvsp[0].id);
12852 /*% %*/
12853 /*% ripper: rest_param!($2) %*/
12854 }
12855#line 12851 "parse.c"
12856 break;
12857
12858 case 726: /* f_rest_arg: restarg_mark */
12859#line 5452 "parse.y"
12860 {
12861 /*%%%*/
12862 (yyval.id) = internal_id(p);
12863 arg_var(p, (yyval.id));
12864 /*% %*/
12865 /*% ripper: rest_param!(Qnil) %*/
12866 }
12867#line 12863 "parse.c"
12868 break;
12869
12870 case 729: /* f_block_arg: blkarg_mark "local variable or method" */
12871#line 5466 "parse.y"
12872 {
12873 arg_var(p, shadowing_lvar(p, get_id((yyvsp[0].id))));
12874 /*%%%*/
12875 (yyval.id) = (yyvsp[0].id);
12876 /*% %*/
12877 /*% ripper: blockarg!($2) %*/
12878 }
12879#line 12875 "parse.c"
12880 break;
12881
12882 case 730: /* opt_f_block_arg: ',' f_block_arg */
12883#line 5476 "parse.y"
12884 {
12885 (yyval.id) = (yyvsp[0].id);
12886 }
12887#line 12883 "parse.c"
12888 break;
12889
12890 case 731: /* opt_f_block_arg: none */
12891#line 5480 "parse.y"
12892 {
12893 (yyval.id) = Qnull;
12894 }
12895#line 12891 "parse.c"
12896 break;
12897
12898 case 732: /* singleton: var_ref */
12899#line 5486 "parse.y"
12900 {
12901 value_expr((yyvsp[0].node));
12902 (yyval.node) = (yyvsp[0].node);
12903 }
12904#line 12900 "parse.c"
12905 break;
12906
12907 case 733: /* $@49: %empty */
12908#line 5490 "parse.y"
12909 {SET_LEX_STATE(EXPR_BEG);}
12910#line 12906 "parse.c"
12911 break;
12912
12913 case 734: /* singleton: '(' $@49 expr rparen */
12914#line 5491 "parse.y"
12915 {
12916 /*%%%*/
12917 switch (nd_type((yyvsp[-1].node))) {
12918 case NODE_STR:
12919 case NODE_DSTR:
12920 case NODE_XSTR:
12921 case NODE_DXSTR:
12922 case NODE_DREGX:
12923 case NODE_LIT:
12924 case NODE_LIST:
12925 case NODE_ZLIST:
12926 yyerror1(&(yylsp[-1]), "can't define singleton method for literals");
12927 break;
12928 default:
12929 value_expr((yyvsp[-1].node));
12930 break;
12931 }
12932 (yyval.node) = (yyvsp[-1].node);
12933 /*% %*/
12934 /*% ripper: paren!($3) %*/
12935 }
12936#line 12932 "parse.c"
12937 break;
12938
12939 case 736: /* assoc_list: assocs trailer */
12940#line 5516 "parse.y"
12941 {
12942 /*%%%*/
12943 (yyval.node) = (yyvsp[-1].node);
12944 /*% %*/
12945 /*% ripper: assoclist_from_args!($1) %*/
12946 }
12947#line 12943 "parse.c"
12948 break;
12949
12950 case 738: /* assocs: assocs ',' assoc */
12951#line 5527 "parse.y"
12952 {
12953 /*%%%*/
12954 NODE *assocs = (yyvsp[-2].node);
12955 NODE *tail = (yyvsp[0].node);
12956 if (!assocs) {
12957 assocs = tail;
12958 }
12959 else if (tail) {
12960 if (assocs->nd_head &&
12961 !tail->nd_head && nd_type(tail->nd_next) == NODE_LIST &&
12962 nd_type(tail->nd_next->nd_head) == NODE_HASH) {
12963 /* DSTAR */
12964 tail = tail->nd_next->nd_head->nd_head;
12965 }
12966 assocs = list_concat(assocs, tail);
12967 }
12968 (yyval.node) = assocs;
12969 /*% %*/
12970 /*% ripper: rb_ary_push($1, get_value($3)) %*/
12971 }
12972#line 12968 "parse.c"
12973 break;
12974
12975 case 739: /* assoc: arg_value "=>" arg_value */
12976#line 5550 "parse.y"
12977 {
12978 /*%%%*/
12979 if (nd_type((yyvsp[-2].node)) == NODE_STR) {
12980 nd_set_type((yyvsp[-2].node), NODE_LIT);
12981 RB_OBJ_WRITE(p->ast, &(yyvsp[-2].node)->nd_lit, rb_fstring((yyvsp[-2].node)->nd_lit));
12982 }
12983 (yyval.node) = list_append(p, NEW_LIST((yyvsp[-2].node), &(yyloc)), (yyvsp[0].node));
12984 /*% %*/
12985 /*% ripper: assoc_new!($1, $3) %*/
12986 }
12987#line 12983 "parse.c"
12988 break;
12989
12990 case 740: /* assoc: "label" arg_value */
12991#line 5561 "parse.y"
12992 {
12993 /*%%%*/
12994 (yyval.node) = list_append(p, NEW_LIST(NEW_LIT(ID2SYM((yyvsp[-1].id)), &(yylsp[-1])), &(yyloc)), (yyvsp[0].node));
12995 /*% %*/
12996 /*% ripper: assoc_new!($1, $2) %*/
12997 }
12998#line 12994 "parse.c"
12999 break;
13000
13001 case 741: /* assoc: "string literal" string_contents tLABEL_END arg_value */
13002#line 5568 "parse.y"
13003 {
13004 /*%%%*/
13005 YYLTYPE loc = code_loc_gen(&(yylsp[-3]), &(yylsp[-1]));
13006 (yyval.node) = list_append(p, NEW_LIST(dsym_node(p, (yyvsp[-2].node), &loc), &loc), (yyvsp[0].node));
13007 /*% %*/
13008 /*% ripper: assoc_new!(dyna_symbol!($2), $4) %*/
13009 }
13010#line 13006 "parse.c"
13011 break;
13012
13013 case 742: /* assoc: "**arg" arg_value */
13014#line 5576 "parse.y"
13015 {
13016 /*%%%*/
13017 if (nd_type((yyvsp[0].node)) == NODE_HASH &&
13018 !((yyvsp[0].node)->nd_head && (yyvsp[0].node)->nd_head->nd_alen)) {
13019 static VALUE empty_hash;
13020 if (!empty_hash) {
13021 empty_hash = rb_obj_freeze(rb_hash_new());
13022 rb_gc_register_mark_object(empty_hash);
13023 }
13024 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), NEW_LIT(empty_hash, &(yyloc)));
13025 }
13026 else
13027 (yyval.node) = list_append(p, NEW_LIST(0, &(yyloc)), (yyvsp[0].node));
13028 /*% %*/
13029 /*% ripper: assoc_splat!($2) %*/
13030 }
13031#line 13027 "parse.c"
13032 break;
13033
13034 case 769: /* term: ';' */
13035#line 5644 "parse.y"
13036 {yyerrok;token_flush(p);}
13037#line 13033 "parse.c"
13038 break;
13039
13040 case 770: /* term: '\n' */
13041#line 5645 "parse.y"
13042 {token_flush(p);}
13043#line 13039 "parse.c"
13044 break;
13045
13046 case 772: /* terms: terms ';' */
13047#line 5649 "parse.y"
13048 {yyerrok;}
13049#line 13045 "parse.c"
13050 break;
13051
13052 case 773: /* none: %empty */
13053#line 5653 "parse.y"
13054 {
13055 (yyval.node) = Qnull;
13056 }
13057#line 13053 "parse.c"
13058 break;
13059
13060
13061#line 13057 "parse.c"
13062
13063 default: break;
13064 }
13065 /* User semantic actions sometimes alter yychar, and that requires
13066 that yytoken be updated with the new translation. We take the
13067 approach of translating immediately before every use of yytoken.
13068 One alternative is translating here after every semantic action,
13069 but that translation would be missed if the semantic action invokes
13070 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
13071 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
13072 incorrect destructor might then be invoked immediately. In the
13073 case of YYERROR or YYBACKUP, subsequent parser actions might lead
13074 to an incorrect destructor call or verbose syntax error message
13075 before the lookahead is translated. */
13076 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
13077
13078 YYPOPSTACK (yylen);
13079 yylen = 0;
13080
13081 *++yyvsp = yyval;
13082 *++yylsp = yyloc;
13083
13084 /* Now 'shift' the result of the reduction. Determine what state
13085 that goes to, based on the state we popped back to and the rule
13086 number reduced by. */
13087 {
13088 const int yylhs = yyr1[yyn] - YYNTOKENS;
13089 const int yyi = yypgoto[yylhs] + *yyssp;
13090 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
13091 ? yytable[yyi]
13092 : yydefgoto[yylhs]);
13093 }
13094
13095 goto yynewstate;
13096
13097
13098/*--------------------------------------.
13099| yyerrlab -- here on detecting error. |
13100`--------------------------------------*/
13101yyerrlab:
13102 /* Make sure we have latest lookahead translation. See comments at
13103 user semantic actions for why this is necessary. */
13104 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
13105 /* If not already recovering from an error, report this error. */
13106 if (!yyerrstatus)
13107 {
13108 ++yynerrs;
13109 {
13110 yypcontext_t yyctx
13111 = {yyssp, yytoken, &yylloc};
13112 char const *yymsgp = YY_("syntax error");
13113 int yysyntax_error_status;
13114 yysyntax_error_status = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
13115 if (yysyntax_error_status == 0)
13116 yymsgp = yymsg;
13117 else if (yysyntax_error_status == -1)
13118 {
13119 if (yymsg != yymsgbuf)
13120 YYSTACK_FREE (yymsg);
13121 yymsg = YY_CAST (char *,
13122 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
13123 if (yymsg)
13124 {
13125 yysyntax_error_status
13126 = yysyntax_error (p, &yymsg_alloc, &yymsg, &yyctx);
13127 yymsgp = yymsg;
13128 }
13129 else
13130 {
13131 yymsg = yymsgbuf;
13132 yymsg_alloc = sizeof yymsgbuf;
13133 yysyntax_error_status = YYENOMEM;
13134 }
13135 }
13136 yyerror (&yylloc, p, yymsgp);
13137 if (yysyntax_error_status == YYENOMEM)
13138 YYNOMEM;
13139 }
13140 }
13141
13142 yyerror_range[1] = yylloc;
13143 if (yyerrstatus == 3)
13144 {
13145 /* If just tried and failed to reuse lookahead token after an
13146 error, discard it. */
13147
13148 if (yychar <= END_OF_INPUT)
13149 {
13150 /* Return failure if at end of input. */
13151 if (yychar == END_OF_INPUT)
13152 YYABORT;
13153 }
13154 else
13155 {
13156 yydestruct ("Error: discarding",
13157 yytoken, &yylval, &yylloc, p);
13158 yychar = YYEMPTY;
13159 }
13160 }
13161
13162 /* Else will try to reuse lookahead token after shifting the error
13163 token. */
13164 goto yyerrlab1;
13165
13166
13167/*---------------------------------------------------.
13168| yyerrorlab -- error raised explicitly by YYERROR. |
13169`---------------------------------------------------*/
13170yyerrorlab:
13171 /* Pacify compilers when the user code never invokes YYERROR and the
13172 label yyerrorlab therefore never appears in user code. */
13173 if (0)
13174 YYERROR;
13175 ++yynerrs;
13176
13177 /* Do not reclaim the symbols of the rule whose action triggered
13178 this YYERROR. */
13179 YYPOPSTACK (yylen);
13180 yylen = 0;
13181 YY_STACK_PRINT (yyss, yyssp);
13182 yystate = *yyssp;
13183 goto yyerrlab1;
13184
13185
13186/*-------------------------------------------------------------.
13187| yyerrlab1 -- common code for both syntax error and YYERROR. |
13188`-------------------------------------------------------------*/
13189yyerrlab1:
13190 yyerrstatus = 3; /* Each real token shifted decrements this. */
13191
13192 /* Pop stack until we find a state that shifts the error token. */
13193 for (;;)
13194 {
13195 yyn = yypact[yystate];
13196 if (!yypact_value_is_default (yyn))
13197 {
13198 yyn += YYSYMBOL_YYerror;
13199 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
13200 {
13201 yyn = yytable[yyn];
13202 if (0 < yyn)
13203 break;
13204 }
13205 }
13206
13207 /* Pop the current state because it cannot handle the error token. */
13208 if (yyssp == yyss)
13209 YYABORT;
13210
13211 yyerror_range[1] = *yylsp;
13212 yydestruct ("Error: popping",
13213 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p);
13214 YYPOPSTACK (1);
13215 yystate = *yyssp;
13216 YY_STACK_PRINT (yyss, yyssp);
13217 }
13218
13220 *++yyvsp = yylval;
13222
13223 yyerror_range[2] = yylloc;
13224 ++yylsp;
13225 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
13226
13227 /* Shift the error token. */
13228 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
13229
13230 yystate = yyn;
13231 goto yynewstate;
13232
13233
13234/*-------------------------------------.
13235| yyacceptlab -- YYACCEPT comes here. |
13236`-------------------------------------*/
13237yyacceptlab:
13238 yyresult = 0;
13239 goto yyreturnlab;
13240
13241
13242/*-----------------------------------.
13243| yyabortlab -- YYABORT comes here. |
13244`-----------------------------------*/
13245yyabortlab:
13246 yyresult = 1;
13247 goto yyreturnlab;
13248
13249
13250/*-----------------------------------------------------------.
13251| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
13252`-----------------------------------------------------------*/
13253yyexhaustedlab:
13254 yyerror (&yylloc, p, YY_("memory exhausted"));
13255 yyresult = 2;
13256 goto yyreturnlab;
13257
13258
13259/*----------------------------------------------------------.
13260| yyreturnlab -- parsing is finished, clean up and return. |
13261`----------------------------------------------------------*/
13262yyreturnlab:
13263 if (yychar != YYEMPTY)
13264 {
13265 /* Make sure we have latest lookahead translation. See comments at
13266 user semantic actions for why this is necessary. */
13267 yytoken = YYTRANSLATE (yychar);
13268 yydestruct ("Cleanup: discarding lookahead",
13269 yytoken, &yylval, &yylloc, p);
13270 }
13271 /* Do not reclaim the symbols of the rule whose action triggered
13272 this YYABORT or YYACCEPT. */
13273 YYPOPSTACK (yylen);
13274 YY_STACK_PRINT (yyss, yyssp);
13275 while (yyssp != yyss)
13276 {
13277 yydestruct ("Cleanup: popping",
13278 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p);
13279 YYPOPSTACK (1);
13280 }
13281#ifndef yyoverflow
13282 if (yyss != yyssa)
13283 YYSTACK_FREE (yyss);
13284#endif
13285 if (yymsg != yymsgbuf)
13286 YYSTACK_FREE (yymsg);
13287 return yyresult;
13288}
13289
13290#line 5657 "parse.y"
13291
13292# undef p
13293# undef yylex
13294# undef yylval
13295# define yylval (*p->lval)
13296
13297static int regx_options(struct parser_params*);
13298static int tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
13299static void tokaddmbc(struct parser_params *p, int c, rb_encoding *enc);
13300static enum yytokentype parse_string(struct parser_params*,rb_strterm_literal_t*);
13301static enum yytokentype here_document(struct parser_params*,rb_strterm_heredoc_t*);
13302
13303#ifndef RIPPER
13304# define set_yylval_node(x) { \
13305 YYLTYPE _cur_loc; \
13306 rb_parser_set_location(p, &_cur_loc); \
13307 yylval.node = (x); \
13308}
13309# define set_yylval_str(x) \
13310do { \
13311 set_yylval_node(NEW_STR(x, &_cur_loc)); \
13312 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
13313} while(0)
13314# define set_yylval_literal(x) \
13315do { \
13316 set_yylval_node(NEW_LIT(x, &_cur_loc)); \
13317 RB_OBJ_WRITTEN(p->ast, Qnil, x); \
13318} while(0)
13319# define set_yylval_num(x) (yylval.num = (x))
13320# define set_yylval_id(x) (yylval.id = (x))
13321# define set_yylval_name(x) (yylval.id = (x))
13322# define yylval_id() (yylval.id)
13323#else
13324static inline VALUE
13325ripper_yylval_id(struct parser_params *p, ID x)
13326{
13327 return ripper_new_yylval(p, x, ID2SYM(x), 0);
13328}
13329# define set_yylval_str(x) (yylval.val = add_mark_object(p, (x)))
13330# define set_yylval_num(x) (yylval.val = ripper_new_yylval(p, (x), 0, 0))
13331# define set_yylval_id(x) (void)(x)
13332# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(p, x))
13333# define set_yylval_literal(x) add_mark_object(p, (x))
13334# define set_yylval_node(x) (yylval.val = ripper_new_yylval(p, 0, 0, STR_NEW(p->lex.ptok, p->lex.pcur-p->lex.ptok)))
13335# define yylval_id() yylval.id
13336# define _cur_loc NULL_LOC /* dummy */
13337#endif
13338
13339#define set_yylval_noname() set_yylval_id(keyword_nil)
13340
13341#ifndef RIPPER
13342#define literal_flush(p, ptr) ((p)->lex.ptok = (ptr))
13343#define dispatch_scan_event(p, t) ((void)0)
13344#define dispatch_delayed_token(p, t) ((void)0)
13345#define has_delayed_token(p) (0)
13346#else
13347#define literal_flush(p, ptr) ((void)(ptr))
13348
13349#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val))
13350
13351static inline VALUE
13352intern_sym(const char *name)
13353{
13354 ID id = rb_intern_const(name);
13355 return ID2SYM(id);
13356}
13357
13358static int
13359ripper_has_scan_event(struct parser_params *p)
13360{
13361 if (p->lex.pcur < p->lex.ptok) rb_raise(rb_eRuntimeError, "lex.pcur < lex.ptok");
13362 return p->lex.pcur > p->lex.ptok;
13363}
13364
13365static VALUE
13366ripper_scan_event_val(struct parser_params *p, enum yytokentype t)
13367{
13368 VALUE str = STR_NEW(p->lex.ptok, p->lex.pcur - p->lex.ptok);
13369 VALUE rval = ripper_dispatch1(p, ripper_token2eventid(t), str);
13370 token_flush(p);
13371 return rval;
13372}
13373
13374static void
13375ripper_dispatch_scan_event(struct parser_params *p, enum yytokentype t)
13376{
13377 if (!ripper_has_scan_event(p)) return;
13378 add_mark_object(p, yylval_rval = ripper_scan_event_val(p, t));
13379}
13380#define dispatch_scan_event(p, t) ripper_dispatch_scan_event(p, t)
13381
13382static void
13383ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
13384{
13385 int saved_line = p->ruby_sourceline;
13386 const char *saved_tokp = p->lex.ptok;
13387
13388 if (NIL_P(p->delayed.token)) return;
13389 p->ruby_sourceline = p->delayed.line;
13390 p->lex.ptok = p->lex.pbeg + p->delayed.col;
13391 add_mark_object(p, yylval_rval = ripper_dispatch1(p, ripper_token2eventid(t), p->delayed.token));
13392 p->delayed.token = Qnil;
13393 p->ruby_sourceline = saved_line;
13394 p->lex.ptok = saved_tokp;
13395}
13396#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
13397#define has_delayed_token(p) (!NIL_P(p->delayed.token))
13398#endif /* RIPPER */
13399
13400static inline int
13401is_identchar(const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
13402{
13403 return rb_enc_isalnum((unsigned char)*ptr, enc) || *ptr == '_' || !ISASCII(*ptr);
13404}
13405
13406static inline int
13407parser_is_identchar(struct parser_params *p)
13408{
13409 return !(p)->eofp && is_identchar(p->lex.pcur-1, p->lex.pend, p->enc);
13410}
13411
13412static inline int
13413parser_isascii(struct parser_params *p)
13414{
13415 return ISASCII(*(p->lex.pcur-1));
13416}
13417
13418static void
13419token_info_setup(token_info *ptinfo, const char *ptr, const rb_code_location_t *loc)
13420{
13421 int column = 1, nonspc = 0, i;
13422 for (i = 0; i < loc->beg_pos.column; i++, ptr++) {
13423 if (*ptr == '\t') {
13424 column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
13425 }
13426 column++;
13427 if (*ptr != ' ' && *ptr != '\t') {
13428 nonspc = 1;
13429 }
13430 }
13431
13432 ptinfo->beg = loc->beg_pos;
13433 ptinfo->indent = column;
13434 ptinfo->nonspc = nonspc;
13435}
13436
13437static void
13438token_info_push(struct parser_params *p, const char *token, const rb_code_location_t *loc)
13439{
13440 token_info *ptinfo;
13441
13442 if (!p->token_info_enabled) return;
13443 ptinfo = ALLOC(token_info);
13444 ptinfo->token = token;
13445 ptinfo->next = p->token_info;
13446 token_info_setup(ptinfo, p->lex.pbeg, loc);
13447
13448 p->token_info = ptinfo;
13449}
13450
13451static void
13452token_info_pop(struct parser_params *p, const char *token, const rb_code_location_t *loc)
13453{
13454 token_info *ptinfo_beg = p->token_info;
13455
13456 if (!ptinfo_beg) return;
13457 p->token_info = ptinfo_beg->next;
13458
13459 /* indentation check of matched keywords (begin..end, if..end, etc.) */
13460 token_info_warn(p, token, ptinfo_beg, 1, loc);
13461 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
13462}
13463
13464static void
13465token_info_drop(struct parser_params *p, const char *token, rb_code_position_t beg_pos)
13466{
13467 token_info *ptinfo_beg = p->token_info;
13468
13469 if (!ptinfo_beg) return;
13470 p->token_info = ptinfo_beg->next;
13471
13472 if (ptinfo_beg->beg.lineno != beg_pos.lineno ||
13473 ptinfo_beg->beg.column != beg_pos.column ||
13474 strcmp(ptinfo_beg->token, token)) {
13475 compile_error(p, "token position mismatch: %d:%d:%s expected but %d:%d:%s",
13476 beg_pos.lineno, beg_pos.column, token,
13477 ptinfo_beg->beg.lineno, ptinfo_beg->beg.column,
13478 ptinfo_beg->token);
13479 }
13480
13481 ruby_sized_xfree(ptinfo_beg, sizeof(*ptinfo_beg));
13482}
13483
13484static void
13485token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_beg, int same, const rb_code_location_t *loc)
13486{
13487 token_info ptinfo_end_body, *ptinfo_end = &ptinfo_end_body;
13488 if (!p->token_info_enabled) return;
13489 if (!ptinfo_beg) return;
13490 token_info_setup(ptinfo_end, p->lex.pbeg, loc);
13491 if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */
13492 if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */
13493 if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */
13494 if (!same && ptinfo_beg->indent < ptinfo_end->indent) return;
13495 rb_warn3L(ptinfo_end->beg.lineno,
13496 "mismatched indentations at '%s' with '%s' at %d",
13497 WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno));
13498}
13499
13500static int
13501parser_precise_mbclen(struct parser_params *p, const char *ptr)
13502{
13503 int len = rb_enc_precise_mbclen(ptr, p->lex.pend, p->enc);
13504 if (!MBCLEN_CHARFOUND_P(len)) {
13505 compile_error(p, "invalid multibyte char (%s)", rb_enc_name(p->enc));
13506 return -1;
13507 }
13508 return len;
13509}
13510
13511#ifndef RIPPER
13512static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str);
13513
13514static inline void
13515parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
13516{
13517 VALUE str;
13518 int lineno = p->ruby_sourceline;
13519 if (!yylloc) {
13520 return;
13521 }
13522 else if (yylloc->beg_pos.lineno == lineno) {
13523 str = p->lex.lastline;
13524 }
13525 else {
13526 return;
13527 }
13528 ruby_show_error_line(p->error_buffer, yylloc, lineno, str);
13529}
13530
13531static int
13532parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
13533{
13534 YYLTYPE current;
13535
13536 if (!yylloc) {
13537 yylloc = RUBY_SET_YYLLOC(current);
13538 }
13539 else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
13540 p->ruby_sourceline != yylloc->end_pos.lineno) ||
13541 (yylloc->beg_pos.lineno == yylloc->end_pos.lineno &&
13542 yylloc->beg_pos.column == yylloc->end_pos.column)) {
13543 yylloc = 0;
13544 }
13545 compile_error(p, "%s", msg);
13546 parser_show_error_line(p, yylloc);
13547 return 0;
13548}
13549
13550static void
13551ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno, VALUE str)
13552{
13553 VALUE mesg;
13554 const int max_line_margin = 30;
13555 const char *ptr, *ptr_end, *pt, *pb;
13556 const char *pre = "", *post = "", *pend;
13557 const char *code = "", *caret = "";
13558 const char *lim;
13559 const char *const pbeg = RSTRING_PTR(str);
13560 char *buf;
13561 long len;
13562 int i;
13563
13564 if (!yylloc) return;
13565 pend = RSTRING_END(str);
13566 if (pend > pbeg && pend[-1] == '\n') {
13567 if (--pend > pbeg && pend[-1] == '\r') --pend;
13568 }
13569
13570 pt = pend;
13571 if (lineno == yylloc->end_pos.lineno &&
13572 (pend - pbeg) > yylloc->end_pos.column) {
13573 pt = pbeg + yylloc->end_pos.column;
13574 }
13575
13576 ptr = ptr_end = pt;
13577 lim = ptr - pbeg > max_line_margin ? ptr - max_line_margin : pbeg;
13578 while ((lim < ptr) && (*(ptr-1) != '\n')) ptr--;
13579
13580 lim = pend - ptr_end > max_line_margin ? ptr_end + max_line_margin : pend;
13581 while ((ptr_end < lim) && (*ptr_end != '\n') && (*ptr_end != '\r')) ptr_end++;
13582
13583 len = ptr_end - ptr;
13584 if (len > 4) {
13585 if (ptr > pbeg) {
13586 ptr = rb_enc_prev_char(pbeg, ptr, pt, rb_enc_get(str));
13587 if (ptr > pbeg) pre = "...";
13588 }
13589 if (ptr_end < pend) {
13590 ptr_end = rb_enc_prev_char(pt, ptr_end, pend, rb_enc_get(str));
13591 if (ptr_end < pend) post = "...";
13592 }
13593 }
13594 pb = pbeg;
13595 if (lineno == yylloc->beg_pos.lineno) {
13596 pb += yylloc->beg_pos.column;
13597 if (pb > pt) pb = pt;
13598 }
13599 if (pb < ptr) pb = ptr;
13600 if (len <= 4 && yylloc->beg_pos.lineno == yylloc->end_pos.lineno) {
13601 return;
13602 }
13603 if (RTEST(errbuf)) {
13604 mesg = rb_attr_get(errbuf, idMesg);
13605 if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
13606 rb_str_cat_cstr(mesg, "\n");
13607 }
13608 else {
13609 mesg = rb_enc_str_new(0, 0, rb_enc_get(str));
13610 }
13611 if (!errbuf && rb_stderr_tty_p()) {
13612#define CSI_BEGIN "\033["
13613#define CSI_SGR "m"
13614 rb_str_catf(mesg,
13615 CSI_BEGIN""CSI_SGR"%s" /* pre */
13616 CSI_BEGIN"1"CSI_SGR"%.*s"
13617 CSI_BEGIN"1;4"CSI_SGR"%.*s"
13618 CSI_BEGIN";1"CSI_SGR"%.*s"
13619 CSI_BEGIN""CSI_SGR"%s" /* post */
13620 "\n",
13621 pre,
13622 (int)(pb - ptr), ptr,
13623 (int)(pt - pb), pb,
13624 (int)(ptr_end - pt), pt,
13625 post);
13626 }
13627 else {
13628 char *p2;
13629
13630 len = ptr_end - ptr;
13631 lim = pt < pend ? pt : pend;
13632 i = (int)(lim - ptr);
13633 buf = ALLOCA_N(char, i+2);
13634 code = ptr;
13635 caret = p2 = buf;
13636 if (ptr <= pb) {
13637 while (ptr < pb) {
13638 *p2++ = *ptr++ == '\t' ? '\t' : ' ';
13639 }
13640 *p2++ = '^';
13641 ptr++;
13642 }
13643 if (lim > ptr) {
13644 memset(p2, '~', (lim - ptr));
13645 p2 += (lim - ptr);
13646 }
13647 *p2 = '\0';
13648 rb_str_catf(mesg, "%s%.*s%s\n""%s%s\n",
13649 pre, (int)len, code, post,
13650 pre, caret);
13651 }
13652 if (!errbuf) rb_write_error_str(mesg);
13653}
13654#else
13655static int
13656parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
13657{
13658 const char *pcur = 0, *ptok = 0;
13659 if (yylloc &&
13660 p->ruby_sourceline == yylloc->beg_pos.lineno &&
13661 p->ruby_sourceline == yylloc->end_pos.lineno) {
13662 pcur = p->lex.pcur;
13663 ptok = p->lex.ptok;
13664 p->lex.ptok = p->lex.pbeg + yylloc->beg_pos.column;
13665 p->lex.pcur = p->lex.pbeg + yylloc->end_pos.column;
13666 }
13667 dispatch1(parse_error, STR_NEW2(msg));
13668 ripper_error(p);
13669 if (pcur) {
13670 p->lex.ptok = ptok;
13671 p->lex.pcur = pcur;
13672 }
13673 return 0;
13674}
13675
13676static inline void
13677parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
13678{
13679}
13680#endif /* !RIPPER */
13681
13682#ifndef RIPPER
13683static int
13684vtable_size(const struct vtable *tbl)
13685{
13686 if (!DVARS_TERMINAL_P(tbl)) {
13687 return tbl->pos;
13688 }
13689 else {
13690 return 0;
13691 }
13692}
13693#endif
13694
13695static struct vtable *
13696vtable_alloc_gen(struct parser_params *p, int line, struct vtable *prev)
13697{
13698 struct vtable *tbl = ALLOC(struct vtable);
13699 tbl->pos = 0;
13700 tbl->capa = 8;
13701 tbl->tbl = ALLOC_N(ID, tbl->capa);
13702 tbl->prev = prev;
13703#ifndef RIPPER
13704 if (p->debug) {
13705 rb_parser_printf(p, "vtable_alloc:%d: %p\n", line, (void *)tbl);
13706 }
13707#endif
13708 return tbl;
13709}
13710#define vtable_alloc(prev) vtable_alloc_gen(p, __LINE__, prev)
13711
13712static void
13713vtable_free_gen(struct parser_params *p, int line, const char *name,
13714 struct vtable *tbl)
13715{
13716#ifndef RIPPER
13717 if (p->debug) {
13718 rb_parser_printf(p, "vtable_free:%d: %s(%p)\n", line, name, (void *)tbl);
13719 }
13720#endif
13721 if (!DVARS_TERMINAL_P(tbl)) {
13722 if (tbl->tbl) {
13723 ruby_sized_xfree(tbl->tbl, tbl->capa * sizeof(ID));
13724 }
13725 ruby_sized_xfree(tbl, sizeof(*tbl));
13726 }
13727}
13728#define vtable_free(tbl) vtable_free_gen(p, __LINE__, #tbl, tbl)
13729
13730static void
13731vtable_add_gen(struct parser_params *p, int line, const char *name,
13732 struct vtable *tbl, ID id)
13733{
13734#ifndef RIPPER
13735 if (p->debug) {
13736 rb_parser_printf(p, "vtable_add:%d: %s(%p), %s\n",
13737 line, name, (void *)tbl, rb_id2name(id));
13738 }
13739#endif
13740 if (DVARS_TERMINAL_P(tbl)) {
13741 rb_parser_fatal(p, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
13742 return;
13743 }
13744 if (tbl->pos == tbl->capa) {
13745 tbl->capa = tbl->capa * 2;
13746 SIZED_REALLOC_N(tbl->tbl, ID, tbl->capa, tbl->pos);
13747 }
13748 tbl->tbl[tbl->pos++] = id;
13749}
13750#define vtable_add(tbl, id) vtable_add_gen(p, __LINE__, #tbl, tbl, id)
13751
13752#ifndef RIPPER
13753static void
13754vtable_pop_gen(struct parser_params *p, int line, const char *name,
13755 struct vtable *tbl, int n)
13756{
13757 if (p->debug) {
13758 rb_parser_printf(p, "vtable_pop:%d: %s(%p), %d\n",
13759 line, name, (void *)tbl, n);
13760 }
13761 if (tbl->pos < n) {
13762 rb_parser_fatal(p, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
13763 return;
13764 }
13765 tbl->pos -= n;
13766}
13767#define vtable_pop(tbl, n) vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
13768#endif
13769
13770static int
13771vtable_included(const struct vtable * tbl, ID id)
13772{
13773 int i;
13774
13775 if (!DVARS_TERMINAL_P(tbl)) {
13776 for (i = 0; i < tbl->pos; i++) {
13777 if (tbl->tbl[i] == id) {
13778 return i+1;
13779 }
13780 }
13781 }
13782 return 0;
13783}
13784
13785static void parser_prepare(struct parser_params *p);
13786
13787#ifndef RIPPER
13788static NODE *parser_append_options(struct parser_params *p, NODE *node);
13789
13790static VALUE
13791debug_lines(VALUE fname)
13792{
13793 ID script_lines;
13794 CONST_ID(script_lines, "SCRIPT_LINES__");
13795 if (rb_const_defined_at(rb_cObject, script_lines)) {
13796 VALUE hash = rb_const_get_at(rb_cObject, script_lines);
13797 if (RB_TYPE_P(hash, T_HASH)) {
13798 VALUE lines = rb_ary_new();
13799 rb_hash_aset(hash, fname, lines);
13800 return lines;
13801 }
13802 }
13803 return 0;
13804}
13805
13806static int
13807e_option_supplied(struct parser_params *p)
13808{
13809 return strcmp(p->ruby_sourcefile, "-e") == 0;
13810}
13811
13812static VALUE
13813yycompile0(VALUE arg)
13814{
13815 int n;
13816 NODE *tree;
13817 struct parser_params *p = (struct parser_params *)arg;
13818 VALUE cov = Qfalse;
13819
13822 if (p->debug_lines && p->ruby_sourceline > 0) {
13824 n = p->ruby_sourceline;
13825 do {
13827 } while (--n);
13828 }
13829
13830 if (!e_option_supplied(p)) {
13831 cov = Qtrue;
13832 }
13833 }
13834
13835 parser_prepare(p);
13836#define RUBY_DTRACE_PARSE_HOOK(name) \
13837 if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
13838 RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
13839 }
13841 n = yyparse(p);
13843 p->debug_lines = 0;
13844
13845 p->lex.strterm = 0;
13846 p->lex.pcur = p->lex.pbeg = p->lex.pend = 0;
13847 p->lex.prevline = p->lex.lastline = p->lex.nextline = 0;
13848 if (n || p->error_p) {
13849 VALUE mesg = p->error_buffer;
13850 if (!mesg) {
13852 }
13853 rb_set_errinfo(mesg);
13854 return FALSE;
13855 }
13856 tree = p->eval_tree;
13857 if (!tree) {
13858 tree = NEW_NIL(&NULL_LOC);
13859 }
13860 else {
13861 VALUE opt = p->compile_option;
13862 NODE *prelude;
13863 NODE *body = parser_append_options(p, tree->nd_body);
13864 if (!opt) opt = rb_obj_hide(rb_ident_hash_new());
13865 rb_hash_aset(opt, rb_sym_intern_ascii_cstr("coverage_enabled"), cov);
13866 prelude = block_append(p, p->eval_tree_begin, body);
13867 tree->nd_body = prelude;
13868 RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt);
13869 }
13870 p->ast->body.root = tree;
13871 p->ast->body.line_count = p->line_count;
13872 return TRUE;
13873}
13874
13875static rb_ast_t *
13876yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line)
13877{
13878 rb_ast_t *ast;
13879 if (NIL_P(fname)) {
13881 p->ruby_sourcefile = "(none)";
13882 }
13883 else {
13885 p->ruby_sourcefile = StringValueCStr(fname);
13886 }
13887 p->ruby_sourceline = line - 1;
13888
13889 p->ast = ast = rb_ast_new();
13890 rb_suppress_tracing(yycompile0, (VALUE)p);
13891 p->ast = 0;
13892 RB_GC_GUARD(vparser); /* prohibit tail call optimization */
13893
13894 return ast;
13895}
13896#endif /* !RIPPER */
13897
13898static rb_encoding *
13899must_be_ascii_compatible(VALUE s)
13900{
13902 if (!rb_enc_asciicompat(enc)) {
13903 rb_raise(rb_eArgError, "invalid source encoding");
13904 }
13905 return enc;
13906}
13907
13908static VALUE
13909lex_get_str(struct parser_params *p, VALUE s)
13910{
13911 char *beg, *end, *start;
13912 long len;
13913
13914 beg = RSTRING_PTR(s);
13915 len = RSTRING_LEN(s);
13916 start = beg;
13917 if (p->lex.gets_.ptr) {
13918 if (len == p->lex.gets_.ptr) return Qnil;
13919 beg += p->lex.gets_.ptr;
13920 len -= p->lex.gets_.ptr;
13921 }
13922 end = memchr(beg, '\n', len);
13923 if (end) len = ++end - beg;
13924 p->lex.gets_.ptr += len;
13925 return rb_str_subseq(s, beg - start, len);
13926}
13927
13928static VALUE
13929lex_getline(struct parser_params *p)
13930{
13931 VALUE line = (*p->lex.gets)(p, p->lex.input);
13932 if (NIL_P(line)) return line;
13933 must_be_ascii_compatible(line);
13934#ifndef RIPPER
13935 if (p->debug_lines) {
13936 rb_enc_associate(line, p->enc);
13937 rb_ary_push(p->debug_lines, line);
13938 }
13939#endif
13940 p->line_count++;
13941 return line;
13942}
13943
13944static const rb_data_type_t parser_data_type;
13945
13946#ifndef RIPPER
13947static rb_ast_t*
13948parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
13949{
13950 struct parser_params *p;
13951
13952 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
13953
13954 p->lex.gets = lex_get_str;
13955 p->lex.gets_.ptr = 0;
13956 p->lex.input = rb_str_new_frozen(s);
13957 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
13958
13959 return yycompile(vparser, p, fname, line);
13960}
13961
13962rb_ast_t*
13963rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
13964{
13966}
13967
13968rb_ast_t*
13970{
13971 must_be_ascii_compatible(s);
13972 return parser_compile_string(vparser, f, s, line);
13973}
13974
13976
13977static VALUE
13978lex_io_gets(struct parser_params *p, VALUE io)
13979{
13980 return rb_io_gets_internal(io);
13981}
13982
13983rb_ast_t*
13985{
13986 struct parser_params *p;
13987
13988 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
13989
13990 p->lex.gets = lex_io_gets;
13991 p->lex.input = file;
13992 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
13993
13994 return yycompile(vparser, p, fname, start);
13995}
13996
13997static VALUE
13998lex_generic_gets(struct parser_params *p, VALUE input)
13999{
14000 return (*p->lex.gets_.call)(input, p->line_count);
14001}
14002
14003rb_ast_t*
14004rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
14005{
14006 struct parser_params *p;
14007
14008 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
14009
14010 p->lex.gets = lex_generic_gets;
14011 p->lex.gets_.call = lex_gets;
14012 p->lex.input = input;
14013 p->lex.pbeg = p->lex.pcur = p->lex.pend = 0;
14014
14015 return yycompile(vparser, p, fname, start);
14016}
14017#endif /* !RIPPER */
14018
14019#define STR_FUNC_ESCAPE 0x01
14020#define STR_FUNC_EXPAND 0x02
14021#define STR_FUNC_REGEXP 0x04
14022#define STR_FUNC_QWORDS 0x08
14023#define STR_FUNC_SYMBOL 0x10
14024#define STR_FUNC_INDENT 0x20
14025#define STR_FUNC_LABEL 0x40
14026#define STR_FUNC_LIST 0x4000
14027#define STR_FUNC_TERM 0x8000
14028
14040
14041static VALUE
14042parser_str_new(const char *ptr, long len, rb_encoding *enc, int func, rb_encoding *enc0)
14043{
14044 VALUE str;
14045
14047 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
14049 }
14050 else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) {
14052 }
14053 }
14054
14055 return str;
14056}
14057
14058#define lex_goto_eol(p) ((p)->lex.pcur = (p)->lex.pend)
14059#define lex_eol_p(p) ((p)->lex.pcur >= (p)->lex.pend)
14060#define lex_eol_n_p(p,n) ((p)->lex.pcur+(n) >= (p)->lex.pend)
14061#define peek(p,c) peek_n(p, (c), 0)
14062#define peek_n(p,c,n) (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
14063#define peekc(p) peekc_n(p, 0)
14064#define peekc_n(p,n) (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
14065
14066#ifdef RIPPER
14067static void
14068add_delayed_token(struct parser_params *p, const char *tok, const char *end)
14069{
14070 if (tok < end) {
14071 if (!has_delayed_token(p)) {
14072 p->delayed.token = rb_str_buf_new(end - tok);
14073 rb_enc_associate(p->delayed.token, p->enc);
14074 p->delayed.line = p->ruby_sourceline;
14075 p->delayed.col = rb_long2int(tok - p->lex.pbeg);
14076 }
14077 rb_str_buf_cat(p->delayed.token, tok, end - tok);
14078 p->lex.ptok = end;
14079 }
14080}
14081#else
14082#define add_delayed_token(p, tok, end) ((void)(tok), (void)(end))
14083#endif
14084
14085static int
14086nextline(struct parser_params *p)
14087{
14088 VALUE v = p->lex.nextline;
14089 p->lex.nextline = 0;
14090 if (!v) {
14091 if (p->eofp)
14092 return -1;
14093
14094 if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
14095 goto end_of_input;
14096 }
14097
14098 if (!p->lex.input || NIL_P(v = lex_getline(p))) {
14099 end_of_input:
14100 p->eofp = 1;
14101 lex_goto_eol(p);
14102 return -1;
14103 }
14104 p->cr_seen = FALSE;
14105 }
14106 else if (NIL_P(v)) {
14107 /* after here-document without terminator */
14108 goto end_of_input;
14109 }
14110 add_delayed_token(p, p->lex.ptok, p->lex.pend);
14111 if (p->heredoc_end > 0) {
14113 p->heredoc_end = 0;
14114 }
14115 p->ruby_sourceline++;
14116 p->lex.pbeg = p->lex.pcur = RSTRING_PTR(v);
14117 p->lex.pend = p->lex.pcur + RSTRING_LEN(v);
14118 token_flush(p);
14119 p->lex.prevline = p->lex.lastline;
14120 p->lex.lastline = v;
14121 return 0;
14122}
14123
14124static int
14125parser_cr(struct parser_params *p, int c)
14126{
14127 if (peek(p, '\n')) {
14128 p->lex.pcur++;
14129 c = '\n';
14130 }
14131 return c;
14132}
14133
14134static inline int
14135nextc(struct parser_params *p)
14136{
14137 int c;
14138
14139 if (UNLIKELY((p->lex.pcur == p->lex.pend) || p->eofp || RTEST(p->lex.nextline))) {
14140 if (nextline(p)) return -1;
14141 }
14142 c = (unsigned char)*p->lex.pcur++;
14143 if (UNLIKELY(c == '\r')) {
14144 c = parser_cr(p, c);
14145 }
14146
14147 return c;
14148}
14149
14150static void
14151pushback(struct parser_params *p, int c)
14152{
14153 if (c == -1) return;
14154 p->lex.pcur--;
14155 if (p->lex.pcur > p->lex.pbeg && p->lex.pcur[0] == '\n' && p->lex.pcur[-1] == '\r') {
14156 p->lex.pcur--;
14157 }
14158}
14159
14160#define was_bol(p) ((p)->lex.pcur == (p)->lex.pbeg + 1)
14161
14162#define tokfix(p) ((p)->tokenbuf[(p)->tokidx]='\0')
14163#define tok(p) (p)->tokenbuf
14164#define toklen(p) (p)->tokidx
14165
14166static int
14167looking_at_eol_p(struct parser_params *p)
14168{
14169 const char *ptr = p->lex.pcur;
14170 while (ptr < p->lex.pend) {
14171 int c = (unsigned char)*ptr++;
14172 int eol = (c == '\n' || c == '#');
14173 if (eol || !ISSPACE(c)) {
14174 return eol;
14175 }
14176 }
14177 return TRUE;
14178}
14179
14180static char*
14181newtok(struct parser_params *p)
14182{
14183 p->tokidx = 0;
14184 p->tokline = p->ruby_sourceline;
14185 if (!p->tokenbuf) {
14186 p->toksiz = 60;
14187 p->tokenbuf = ALLOC_N(char, 60);
14188 }
14189 if (p->toksiz > 4096) {
14190 p->toksiz = 60;
14191 REALLOC_N(p->tokenbuf, char, 60);
14192 }
14193 return p->tokenbuf;
14194}
14195
14196static char *
14197tokspace(struct parser_params *p, int n)
14198{
14199 p->tokidx += n;
14200
14201 if (p->tokidx >= p->toksiz) {
14202 do {p->toksiz *= 2;} while (p->toksiz < p->tokidx);
14203 REALLOC_N(p->tokenbuf, char, p->toksiz);
14204 }
14205 return &p->tokenbuf[p->tokidx-n];
14206}
14207
14208static void
14209tokadd(struct parser_params *p, int c)
14210{
14211 p->tokenbuf[p->tokidx++] = (char)c;
14212 if (p->tokidx >= p->toksiz) {
14213 p->toksiz *= 2;
14214 REALLOC_N(p->tokenbuf, char, p->toksiz);
14215 }
14216}
14217
14218static int
14219tok_hex(struct parser_params *p, size_t *numlen)
14220{
14221 int c;
14222
14223 c = scan_hex(p->lex.pcur, 2, numlen);
14224 if (!*numlen) {
14225 yyerror0("invalid hex escape");
14226 token_flush(p);
14227 return 0;
14228 }
14229 p->lex.pcur += *numlen;
14230 return c;
14231}
14232
14233#define tokcopy(p, n) memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
14234
14235static int
14236escaped_control_code(int c)
14237{
14238 int c2 = 0;
14239 switch (c) {
14240 case ' ':
14241 c2 = 's';
14242 break;
14243 case '\n':
14244 c2 = 'n';
14245 break;
14246 case '\t':
14247 c2 = 't';
14248 break;
14249 case '\v':
14250 c2 = 'v';
14251 break;
14252 case '\r':
14253 c2 = 'r';
14254 break;
14255 case '\f':
14256 c2 = 'f';
14257 break;
14258 }
14259 return c2;
14260}
14261
14262#define WARN_SPACE_CHAR(c, prefix) \
14263 rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
14264
14265static int
14266tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
14267 int regexp_literal, int wide)
14268{
14269 size_t numlen;
14270 int codepoint = scan_hex(p->lex.pcur, wide ? p->lex.pend - p->lex.pcur : 4, &numlen);
14271 literal_flush(p, p->lex.pcur);
14272 p->lex.pcur += numlen;
14273 if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
14274 yyerror0("invalid Unicode escape");
14275 return wide && numlen > 0;
14276 }
14277 if (codepoint > 0x10ffff) {
14278 yyerror0("invalid Unicode codepoint (too large)");
14279 return wide;
14280 }
14281 if ((codepoint & 0xfffff800) == 0xd800) {
14282 yyerror0("invalid Unicode codepoint");
14283 return wide;
14284 }
14285 if (regexp_literal) {
14286 tokcopy(p, (int)numlen);
14287 }
14288 else if (codepoint >= 0x80) {
14289 rb_encoding *utf8 = rb_utf8_encoding();
14290 if (*encp && utf8 != *encp) {
14291 YYLTYPE loc = RUBY_INIT_YYLLOC();
14292 compile_error(p, "UTF-8 mixed within %s source", rb_enc_name(*encp));
14293 parser_show_error_line(p, &loc);
14294 return wide;
14295 }
14296 *encp = utf8;
14297 tokaddmbc(p, codepoint, *encp);
14298 }
14299 else {
14300 tokadd(p, codepoint);
14301 }
14302 return TRUE;
14303}
14304
14305/* return value is for ?\u3042 */
14306static void
14307tokadd_utf8(struct parser_params *p, rb_encoding **encp,
14308 int term, int symbol_literal, int regexp_literal)
14309{
14310 /*
14311 * If `term` is not -1, then we allow multiple codepoints in \u{}
14312 * upto `term` byte, otherwise we're parsing a character literal.
14313 * And then add the codepoints to the current token.
14314 */
14315 static const char multiple_codepoints[] = "Multiple codepoints at single character literal";
14316
14317 const int open_brace = '{', close_brace = '}';
14318
14319 if (regexp_literal) { tokadd(p, '\\'); tokadd(p, 'u'); }
14320
14321 if (peek(p, open_brace)) { /* handle \u{...} form */
14322 const char *second = NULL;
14323 int c, last = nextc(p);
14324 if (p->lex.pcur >= p->lex.pend) goto unterminated;
14325 while (ISSPACE(c = *p->lex.pcur) && ++p->lex.pcur < p->lex.pend);
14326 while (c != close_brace) {
14327 if (c == term) goto unterminated;
14328 if (second == multiple_codepoints)
14329 second = p->lex.pcur;
14330 if (regexp_literal) tokadd(p, last);
14331 if (!tokadd_codepoint(p, encp, regexp_literal, TRUE)) {
14332 break;
14333 }
14334 while (ISSPACE(c = *p->lex.pcur)) {
14335 if (++p->lex.pcur >= p->lex.pend) goto unterminated;
14336 last = c;
14337 }
14338 if (term == -1 && !second)
14339 second = multiple_codepoints;
14340 }
14341
14342 if (c != close_brace) {
14343 unterminated:
14344 token_flush(p);
14345 yyerror0("unterminated Unicode escape");
14346 return;
14347 }
14348 if (second && second != multiple_codepoints) {
14349 const char *pcur = p->lex.pcur;
14350 p->lex.pcur = second;
14352 token_flush(p);
14353 p->lex.pcur = pcur;
14354 yyerror0(multiple_codepoints);
14355 token_flush(p);
14356 }
14357
14358 if (regexp_literal) tokadd(p, close_brace);
14359 nextc(p);
14360 }
14361 else { /* handle \uxxxx form */
14362 if (!tokadd_codepoint(p, encp, regexp_literal, FALSE)) {
14363 token_flush(p);
14364 return;
14365 }
14366 }
14367}
14368
14369#define ESCAPE_CONTROL 1
14370#define ESCAPE_META 2
14371
14372static int
14373read_escape(struct parser_params *p, int flags, rb_encoding **encp)
14374{
14375 int c;
14376 size_t numlen;
14377
14378 switch (c = nextc(p)) {
14379 case '\\': /* Backslash */
14380 return c;
14381
14382 case 'n': /* newline */
14383 return '\n';
14384
14385 case 't': /* horizontal tab */
14386 return '\t';
14387
14388 case 'r': /* carriage-return */
14389 return '\r';
14390
14391 case 'f': /* form-feed */
14392 return '\f';
14393
14394 case 'v': /* vertical tab */
14395 return '\13';
14396
14397 case 'a': /* alarm(bell) */
14398 return '\007';
14399
14400 case 'e': /* escape */
14401 return 033;
14402
14403 case '0': case '1': case '2': case '3': /* octal constant */
14404 case '4': case '5': case '6': case '7':
14405 pushback(p, c);
14406 c = scan_oct(p->lex.pcur, 3, &numlen);
14407 p->lex.pcur += numlen;
14408 return c;
14409
14410 case 'x': /* hex constant */
14411 c = tok_hex(p, &numlen);
14412 if (numlen == 0) return 0;
14413 return c;
14414
14415 case 'b': /* backspace */
14416 return '\010';
14417
14418 case 's': /* space */
14419 return ' ';
14420
14421 case 'M':
14422 if (flags & ESCAPE_META) goto eof;
14423 if ((c = nextc(p)) != '-') {
14424 goto eof;
14425 }
14426 if ((c = nextc(p)) == '\\') {
14427 switch (peekc(p)) {
14428 case 'u': case 'U':
14429 nextc(p);
14430 goto eof;
14431 }
14432 return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
14433 }
14434 else if (c == -1 || !ISASCII(c)) goto eof;
14435 else {
14436 int c2 = escaped_control_code(c);
14437 if (c2) {
14438 if (ISCNTRL(c) || !(flags & ESCAPE_CONTROL)) {
14439 WARN_SPACE_CHAR(c2, "\\M-");
14440 }
14441 else {
14442 WARN_SPACE_CHAR(c2, "\\C-\\M-");
14443 }
14444 }
14445 else if (ISCNTRL(c)) goto eof;
14446 return ((c & 0xff) | 0x80);
14447 }
14448
14449 case 'C':
14450 if ((c = nextc(p)) != '-') {
14451 goto eof;
14452 }
14453 case 'c':
14454 if (flags & ESCAPE_CONTROL) goto eof;
14455 if ((c = nextc(p))== '\\') {
14456 switch (peekc(p)) {
14457 case 'u': case 'U':
14458 nextc(p);
14459 goto eof;
14460 }
14461 c = read_escape(p, flags|ESCAPE_CONTROL, encp);
14462 }
14463 else if (c == '?')
14464 return 0177;
14465 else if (c == -1 || !ISASCII(c)) goto eof;
14466 else {
14467 int c2 = escaped_control_code(c);
14468 if (c2) {
14469 if (ISCNTRL(c)) {
14470 if (flags & ESCAPE_META) {
14471 WARN_SPACE_CHAR(c2, "\\M-");
14472 }
14473 else {
14474 WARN_SPACE_CHAR(c2, "");
14475 }
14476 }
14477 else {
14478 if (flags & ESCAPE_META) {
14479 WARN_SPACE_CHAR(c2, "\\M-\\C-");
14480 }
14481 else {
14482 WARN_SPACE_CHAR(c2, "\\C-");
14483 }
14484 }
14485 }
14486 else if (ISCNTRL(c)) goto eof;
14487 }
14488 return c & 0x9f;
14489
14490 eof:
14491 case -1:
14492 yyerror0("Invalid escape character syntax");
14493 token_flush(p);
14494 return '\0';
14495
14496 default:
14497 return c;
14498 }
14499}
14500
14501static void
14502tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
14503{
14504 int len = rb_enc_codelen(c, enc);
14505 rb_enc_mbcput(c, tokspace(p, len), enc);
14506}
14507
14508static int
14509tokadd_escape(struct parser_params *p, rb_encoding **encp)
14510{
14511 int c;
14512 int flags = 0;
14513 size_t numlen;
14514
14515 first:
14516 switch (c = nextc(p)) {
14517 case '\n':
14518 return 0; /* just ignore */
14519
14520 case '0': case '1': case '2': case '3': /* octal constant */
14521 case '4': case '5': case '6': case '7':
14522 {
14523 ruby_scan_oct(--p->lex.pcur, 3, &numlen);
14524 if (numlen == 0) goto eof;
14525 p->lex.pcur += numlen;
14526 tokcopy(p, (int)numlen + 1);
14527 }
14528 return 0;
14529
14530 case 'x': /* hex constant */
14531 {
14532 tok_hex(p, &numlen);
14533 if (numlen == 0) return -1;
14534 tokcopy(p, (int)numlen + 2);
14535 }
14536 return 0;
14537
14538 case 'M':
14539 if (flags & ESCAPE_META) goto eof;
14540 if ((c = nextc(p)) != '-') {
14541 pushback(p, c);
14542 goto eof;
14543 }
14544 tokcopy(p, 3);
14545 flags |= ESCAPE_META;
14546 goto escaped;
14547
14548 case 'C':
14549 if (flags & ESCAPE_CONTROL) goto eof;
14550 if ((c = nextc(p)) != '-') {
14551 pushback(p, c);
14552 goto eof;
14553 }
14554 tokcopy(p, 3);
14555 goto escaped;
14556
14557 case 'c':
14558 if (flags & ESCAPE_CONTROL) goto eof;
14559 tokcopy(p, 2);
14560 flags |= ESCAPE_CONTROL;
14561 escaped:
14562 if ((c = nextc(p)) == '\\') {
14563 goto first;
14564 }
14565 else if (c == -1) goto eof;
14566 tokadd(p, c);
14567 return 0;
14568
14569 eof:
14570 case -1:
14571 yyerror0("Invalid escape character syntax");
14572 token_flush(p);
14573 return -1;
14574
14575 default:
14576 tokadd(p, '\\');
14577 tokadd(p, c);
14578 }
14579 return 0;
14580}
14581
14582static int
14583regx_options(struct parser_params *p)
14584{
14585 int kcode = 0;
14586 int kopt = 0;
14587 int options = 0;
14588 int c, opt, kc;
14589
14590 newtok(p);
14591 while (c = nextc(p), ISALPHA(c)) {
14592 if (c == 'o') {
14593 options |= RE_OPTION_ONCE;
14594 }
14595 else if (rb_char_to_option_kcode(c, &opt, &kc)) {
14596 if (kc >= 0) {
14597 if (kc != rb_ascii8bit_encindex()) kcode = c;
14598 kopt = opt;
14599 }
14600 else {
14601 options |= opt;
14602 }
14603 }
14604 else {
14605 tokadd(p, c);
14606 }
14607 }
14608 options |= kopt;
14609 pushback(p, c);
14610 if (toklen(p)) {
14611 YYLTYPE loc = RUBY_INIT_YYLLOC();
14612 tokfix(p);
14613 compile_error(p, "unknown regexp option%s - %*s",
14614 toklen(p) > 1 ? "s" : "", toklen(p), tok(p));
14615 parser_show_error_line(p, &loc);
14616 }
14617 return options | RE_OPTION_ENCODING(kcode);
14618}
14619
14620static int
14621tokadd_mbchar(struct parser_params *p, int c)
14622{
14623 int len = parser_precise_mbclen(p, p->lex.pcur-1);
14624 if (len < 0) return -1;
14625 tokadd(p, c);
14626 p->lex.pcur += --len;
14627 if (len > 0) tokcopy(p, len);
14628 return c;
14629}
14630
14631static inline int
14632simple_re_meta(int c)
14633{
14634 switch (c) {
14635 case '$': case '*': case '+': case '.':
14636 case '?': case '^': case '|':
14637 case ')': case ']': case '}': case '>':
14638 return TRUE;
14639 default:
14640 return FALSE;
14641 }
14642}
14643
14644static int
14645parser_update_heredoc_indent(struct parser_params *p, int c)
14646{
14647 if (p->heredoc_line_indent == -1) {
14648 if (c == '\n') p->heredoc_line_indent = 0;
14649 }
14650 else {
14651 if (c == ' ') {
14653 return TRUE;
14654 }
14655 else if (c == '\t') {
14656 int w = (p->heredoc_line_indent / TAB_WIDTH) + 1;
14658 return TRUE;
14659 }
14660 else if (c != '\n') {
14661 if (p->heredoc_indent > p->heredoc_line_indent) {
14663 }
14664 p->heredoc_line_indent = -1;
14665 }
14666 }
14667 return FALSE;
14668}
14669
14670static void
14671parser_mixed_error(struct parser_params *p, rb_encoding *enc1, rb_encoding *enc2)
14672{
14673 YYLTYPE loc = RUBY_INIT_YYLLOC();
14674 const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
14675 compile_error(p, "%s mixed within %s source", n1, n2);
14676 parser_show_error_line(p, &loc);
14677}
14678
14679static void
14680parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
14681{
14682 const char *pos = p->lex.pcur;
14683 p->lex.pcur = beg;
14684 parser_mixed_error(p, enc1, enc2);
14685 p->lex.pcur = pos;
14686}
14687
14688static int
14689tokadd_string(struct parser_params *p,
14690 int func, int term, int paren, long *nest,
14691 rb_encoding **encp, rb_encoding **enc)
14692{
14693 int c;
14694 bool erred = false;
14695
14696#define mixed_error(enc1, enc2) \
14697 (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
14698#define mixed_escape(beg, enc1, enc2) \
14699 (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
14700
14701 while ((c = nextc(p)) != -1) {
14702 if (p->heredoc_indent > 0) {
14703 parser_update_heredoc_indent(p, c);
14704 }
14705
14706 if (paren && c == paren) {
14707 ++*nest;
14708 }
14709 else if (c == term) {
14710 if (!nest || !*nest) {
14711 pushback(p, c);
14712 break;
14713 }
14714 --*nest;
14715 }
14716 else if ((func & STR_FUNC_EXPAND) && c == '#' && p->lex.pcur < p->lex.pend) {
14717 int c2 = *p->lex.pcur;
14718 if (c2 == '$' || c2 == '@' || c2 == '{') {
14719 pushback(p, c);
14720 break;
14721 }
14722 }
14723 else if (c == '\\') {
14724 literal_flush(p, p->lex.pcur - 1);
14725 c = nextc(p);
14726 switch (c) {
14727 case '\n':
14728 if (func & STR_FUNC_QWORDS) break;
14729 if (func & STR_FUNC_EXPAND) {
14730 if (!(func & STR_FUNC_INDENT) || (p->heredoc_indent < 0))
14731 continue;
14732 if (c == term) {
14733 c = '\\';
14734 goto terminate;
14735 }
14736 }
14737 tokadd(p, '\\');
14738 break;
14739
14740 case '\\':
14741 if (func & STR_FUNC_ESCAPE) tokadd(p, c);
14742 break;
14743
14744 case 'u':
14745 if ((func & STR_FUNC_EXPAND) == 0) {
14746 tokadd(p, '\\');
14747 break;
14748 }
14749 tokadd_utf8(p, enc, term,
14750 func & STR_FUNC_SYMBOL,
14751 func & STR_FUNC_REGEXP);
14752 continue;
14753
14754 default:
14755 if (c == -1) return -1;
14756 if (!ISASCII(c)) {
14757 if ((func & STR_FUNC_EXPAND) == 0) tokadd(p, '\\');
14758 goto non_ascii;
14759 }
14760 if (func & STR_FUNC_REGEXP) {
14761 if (c == term && !simple_re_meta(c)) {
14762 tokadd(p, c);
14763 continue;
14764 }
14765 pushback(p, c);
14766 if ((c = tokadd_escape(p, enc)) < 0)
14767 return -1;
14768 if (*enc && *enc != *encp) {
14769 mixed_escape(p->lex.ptok+2, *enc, *encp);
14770 }
14771 continue;
14772 }
14773 else if (func & STR_FUNC_EXPAND) {
14774 pushback(p, c);
14775 if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
14776 c = read_escape(p, 0, enc);
14777 }
14778 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
14779 /* ignore backslashed spaces in %w */
14780 }
14781 else if (c != term && !(paren && c == paren)) {
14782 tokadd(p, '\\');
14783 pushback(p, c);
14784 continue;
14785 }
14786 }
14787 }
14788 else if (!parser_isascii(p)) {
14789 non_ascii:
14790 if (!*enc) {
14791 *enc = *encp;
14792 }
14793 else if (*enc != *encp) {
14794 mixed_error(*enc, *encp);
14795 continue;
14796 }
14797 if (tokadd_mbchar(p, c) == -1) return -1;
14798 continue;
14799 }
14800 else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
14801 pushback(p, c);
14802 break;
14803 }
14804 if (c & 0x80) {
14805 if (!*enc) {
14806 *enc = *encp;
14807 }
14808 else if (*enc != *encp) {
14809 mixed_error(*enc, *encp);
14810 continue;
14811 }
14812 }
14813 tokadd(p, c);
14814 }
14815 terminate:
14816 if (*enc) *encp = *enc;
14817 return c;
14818}
14819
14820static inline rb_strterm_t *
14821new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
14822{
14823 return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
14824}
14825
14826/* imemo_parser_strterm for literal */
14827#define NEW_STRTERM(func, term, paren) \
14828 new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
14829
14830#ifdef RIPPER
14831static void
14833{
14834 VALUE content = yylval.val;
14835 if (!ripper_is_node_yylval(content))
14836 content = ripper_new_yylval(p, 0, 0, content);
14837 if (has_delayed_token(p)) {
14838 ptrdiff_t len = p->lex.pcur - p->lex.ptok;
14839 if (len > 0) {
14840 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
14841 }
14843 p->lex.ptok = p->lex.pcur;
14844 RNODE(content)->nd_rval = yylval.val;
14845 }
14847 if (yylval.val != content)
14848 RNODE(content)->nd_rval = yylval.val;
14849 yylval.val = content;
14850}
14851#else
14852#define flush_string_content(p, enc) ((void)(enc))
14853#endif
14854
14855RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
14856/* this can be shared with ripper, since it's independent from struct
14857 * parser_params. */
14858#ifndef RIPPER
14859#define BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
14860#define SPECIAL_PUNCT(idx) ( \
14861 BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
14862 BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
14863 BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
14864 BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
14865 BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
14866 BIT('0', idx))
14867const unsigned int ruby_global_name_punct_bits[] = {
14868 SPECIAL_PUNCT(0),
14869 SPECIAL_PUNCT(1),
14870 SPECIAL_PUNCT(2),
14871};
14872#undef BIT
14873#undef SPECIAL_PUNCT
14874#endif
14875
14876static enum yytokentype
14877parser_peek_variable_name(struct parser_params *p)
14878{
14879 int c;
14880 const char *ptr = p->lex.pcur;
14881
14882 if (ptr + 1 >= p->lex.pend) return 0;
14883 c = *ptr++;
14884 switch (c) {
14885 case '$':
14886 if ((c = *ptr) == '-') {
14887 if (++ptr >= p->lex.pend) return 0;
14888 c = *ptr;
14889 }
14890 else if (is_global_name_punct(c) || ISDIGIT(c)) {
14891 return tSTRING_DVAR;
14892 }
14893 break;
14894 case '@':
14895 if ((c = *ptr) == '@') {
14896 if (++ptr >= p->lex.pend) return 0;
14897 c = *ptr;
14898 }
14899 break;
14900 case '{':
14901 p->lex.pcur = ptr;
14902 p->command_start = TRUE;
14903 return tSTRING_DBEG;
14904 default:
14905 return 0;
14906 }
14907 if (!ISASCII(c) || c == '_' || ISALPHA(c))
14908 return tSTRING_DVAR;
14909 return 0;
14910}
14911
14912#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
14913#define IS_END() IS_lex_state(EXPR_END_ANY)
14914#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
14915#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
14916#define IS_LABEL_POSSIBLE() (\
14917 (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
14918 IS_ARG())
14919#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
14920#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
14921
14922static inline enum yytokentype
14923parser_string_term(struct parser_params *p, int func)
14924{
14925 p->lex.strterm = 0;
14926 if (func & STR_FUNC_REGEXP) {
14927 set_yylval_num(regx_options(p));
14928 dispatch_scan_event(p, tREGEXP_END);
14929 SET_LEX_STATE(EXPR_END);
14930 return tREGEXP_END;
14931 }
14932 if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
14933 nextc(p);
14934 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
14935 return tLABEL_END;
14936 }
14937 SET_LEX_STATE(EXPR_END);
14938 return tSTRING_END;
14939}
14940
14941static enum yytokentype
14942parse_string(struct parser_params *p, rb_strterm_literal_t *quote)
14943{
14944 int func = (int)quote->u1.func;
14945 int term = (int)quote->u3.term;
14946 int paren = (int)quote->u2.paren;
14947 int c, space = 0;
14948 rb_encoding *enc = p->enc;
14949 rb_encoding *base_enc = 0;
14950 VALUE lit;
14951
14952 if (func & STR_FUNC_TERM) {
14953 if (func & STR_FUNC_QWORDS) nextc(p); /* delayed term */
14954 SET_LEX_STATE(EXPR_END);
14955 p->lex.strterm = 0;
14956 return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
14957 }
14958 c = nextc(p);
14959 if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
14960 do {c = nextc(p);} while (ISSPACE(c));
14961 space = 1;
14962 }
14963 if (func & STR_FUNC_LIST) {
14964 quote->u1.func &= ~STR_FUNC_LIST;
14965 space = 1;
14966 }
14967 if (c == term && !quote->u0.nest) {
14968 if (func & STR_FUNC_QWORDS) {
14969 quote->u1.func |= STR_FUNC_TERM;
14970 pushback(p, c); /* dispatch the term at tSTRING_END */
14971 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
14972 return ' ';
14973 }
14974 return parser_string_term(p, func);
14975 }
14976 if (space) {
14977 pushback(p, c);
14978 add_delayed_token(p, p->lex.ptok, p->lex.pcur);
14979 return ' ';
14980 }
14981 newtok(p);
14982 if ((func & STR_FUNC_EXPAND) && c == '#') {
14983 int t = parser_peek_variable_name(p);
14984 if (t) return t;
14985 tokadd(p, '#');
14986 c = nextc(p);
14987 }
14988 pushback(p, c);
14989 if (tokadd_string(p, func, term, paren, &quote->u0.nest,
14990 &enc, &base_enc) == -1) {
14991 if (p->eofp) {
14992#ifndef RIPPER
14993# define unterminated_literal(mesg) yyerror0(mesg)
14994#else
14995# define unterminated_literal(mesg) compile_error(p, mesg)
14996#endif
14997 literal_flush(p, p->lex.pcur);
14998 if (func & STR_FUNC_QWORDS) {
14999 /* no content to add, bailing out here */
15000 unterminated_literal("unterminated list meets end of file");
15001 p->lex.strterm = 0;
15002 return tSTRING_END;
15003 }
15004 if (func & STR_FUNC_REGEXP) {
15005 unterminated_literal("unterminated regexp meets end of file");
15006 }
15007 else {
15008 unterminated_literal("unterminated string meets end of file");
15009 }
15010 quote->u1.func |= STR_FUNC_TERM;
15011 }
15012 }
15013
15014 tokfix(p);
15015 lit = STR_NEW3(tok(p), toklen(p), enc, func);
15016 set_yylval_str(lit);
15017 flush_string_content(p, enc);
15018
15019 return tSTRING_CONTENT;
15020}
15021
15022static enum yytokentype
15023heredoc_identifier(struct parser_params *p)
15024{
15025 /*
15026 * term_len is length of `<<"END"` except `END`,
15027 * in this case term_len is 4 (<, <, " and ").
15028 */
15029 long len, offset = p->lex.pcur - p->lex.pbeg;
15030 int c = nextc(p), term, func = 0, quote = 0;
15031 enum yytokentype token = tSTRING_BEG;
15032 int indent = 0;
15033
15034 if (c == '-') {
15035 c = nextc(p);
15036 func = STR_FUNC_INDENT;
15037 offset++;
15038 }
15039 else if (c == '~') {
15040 c = nextc(p);
15041 func = STR_FUNC_INDENT;
15042 offset++;
15043 indent = INT_MAX;
15044 }
15045 switch (c) {
15046 case '\'':
15047 func |= str_squote; goto quoted;
15048 case '"':
15049 func |= str_dquote; goto quoted;
15050 case '`':
15052 func |= str_xquote; goto quoted;
15053
15054 quoted:
15055 quote++;
15056 offset++;
15057 term = c;
15058 len = 0;
15059 while ((c = nextc(p)) != term) {
15060 if (c == -1 || c == '\r' || c == '\n') {
15061 yyerror(NULL, p, "unterminated here document identifier");
15062 return -1;
15063 }
15064 }
15065 break;
15066
15067 default:
15068 if (!parser_is_identchar(p)) {
15069 pushback(p, c);
15070 if (func & STR_FUNC_INDENT) {
15071 pushback(p, indent > 0 ? '~' : '-');
15072 }
15073 return 0;
15074 }
15075 func |= str_dquote;
15076 do {
15077 int n = parser_precise_mbclen(p, p->lex.pcur-1);
15078 if (n < 0) return 0;
15079 p->lex.pcur += --n;
15080 } while ((c = nextc(p)) != -1 && parser_is_identchar(p));
15081 pushback(p, c);
15082 break;
15083 }
15084
15085 len = p->lex.pcur - (p->lex.pbeg + offset) - quote;
15086 if ((unsigned long)len >= HERETERM_LENGTH_MAX)
15087 yyerror(NULL, p, "too long here document identifier");
15089 lex_goto_eol(p);
15090
15091 p->lex.strterm = new_strterm(0, 0, 0, p->lex.lastline);
15094 here->offset = offset;
15095 here->sourceline = p->ruby_sourceline;
15096 here->length = (int)len;
15097 here->quote = quote;
15098 here->func = func;
15099
15100 token_flush(p);
15101 p->heredoc_indent = indent;
15102 p->heredoc_line_indent = 0;
15103 return token;
15104}
15105
15106static void
15107heredoc_restore(struct parser_params *p, rb_strterm_heredoc_t *here)
15108{
15109 VALUE line;
15110
15111 p->lex.strterm = 0;
15112 line = here->lastline;
15113 p->lex.lastline = line;
15114 p->lex.pbeg = RSTRING_PTR(line);
15115 p->lex.pend = p->lex.pbeg + RSTRING_LEN(line);
15116 p->lex.pcur = p->lex.pbeg + here->offset + here->length + here->quote;
15117 p->lex.ptok = p->lex.pbeg + here->offset - here->quote;
15119 p->ruby_sourceline = (int)here->sourceline;
15120 if (p->eofp) p->lex.nextline = Qnil;
15121 p->eofp = 0;
15122}
15123
15124static int
15125dedent_string(VALUE string, int width)
15126{
15127 char *str;
15128 long len;
15129 int i, col = 0;
15130
15131 RSTRING_GETMEM(string, str, len);
15132 for (i = 0; i < len && col < width; i++) {
15133 if (str[i] == ' ') {
15134 col++;
15135 }
15136 else if (str[i] == '\t') {
15137 int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
15138 if (n > width) break;
15139 col = n;
15140 }
15141 else {
15142 break;
15143 }
15144 }
15145 if (!i) return 0;
15146 rb_str_modify(string);
15147 str = RSTRING_PTR(string);
15148 if (RSTRING_LEN(string) != len)
15149 rb_fatal("literal string changed: %+"PRIsVALUE, string);
15150 MEMMOVE(str, str + i, char, len - i);
15151 rb_str_set_len(string, len - i);
15152 return i;
15153}
15154
15155#ifndef RIPPER
15156static NODE *
15157heredoc_dedent(struct parser_params *p, NODE *root)
15158{
15159 NODE *node, *str_node, *prev_node;
15160 int indent = p->heredoc_indent;
15161 VALUE prev_lit = 0;
15162
15163 if (indent <= 0) return root;
15164 p->heredoc_indent = 0;
15165 if (!root) return root;
15166
15167 prev_node = node = str_node = root;
15168 if (nd_type(root) == NODE_LIST) str_node = root->nd_head;
15169
15170 while (str_node) {
15171 VALUE lit = str_node->nd_lit;
15172 if (str_node->flags & NODE_FL_NEWLINE) {
15173 dedent_string(lit, indent);
15174 }
15175 if (!prev_lit) {
15176 prev_lit = lit;
15177 }
15178 else if (!literal_concat0(p, prev_lit, lit)) {
15179 return 0;
15180 }
15181 else {
15182 NODE *end = node->nd_end;
15183 node = prev_node->nd_next = node->nd_next;
15184 if (!node) {
15185 if (nd_type(prev_node) == NODE_DSTR)
15186 nd_set_type(prev_node, NODE_STR);
15187 break;
15188 }
15189 node->nd_end = end;
15190 goto next_str;
15191 }
15192
15193 str_node = 0;
15194 while ((node = (prev_node = node)->nd_next) != 0) {
15195 next_str:
15196 if (nd_type(node) != NODE_LIST) break;
15197 if ((str_node = node->nd_head) != 0) {
15198 enum node_type type = nd_type(str_node);
15199 if (type == NODE_STR || type == NODE_DSTR) break;
15200 prev_lit = 0;
15201 str_node = 0;
15202 }
15203 }
15204 }
15205 return root;
15206}
15207#else /* RIPPER */
15208static VALUE
15209heredoc_dedent(struct parser_params *p, VALUE array)
15210{
15211 int indent = p->heredoc_indent;
15212
15213 if (indent <= 0) return array;
15214 p->heredoc_indent = 0;
15215 dispatch2(heredoc_dedent, array, INT2NUM(indent));
15216 return array;
15217}
15218
15219/*
15220 * call-seq:
15221 * Ripper.dedent_string(input, width) -> Integer
15222 *
15223 * USE OF RIPPER LIBRARY ONLY.
15224 *
15225 * Strips up to +width+ leading whitespaces from +input+,
15226 * and returns the stripped column width.
15227 */
15228static VALUE
15229parser_dedent_string(VALUE self, VALUE input, VALUE width)
15230{
15231 int wid, col;
15232
15234 wid = NUM2UINT(width);
15235 col = dedent_string(input, wid);
15236 return INT2NUM(col);
15237}
15238#endif
15239
15240static int
15241whole_match_p(struct parser_params *p, const char *eos, long len, int indent)
15242{
15243 const char *ptr = p->lex.pbeg;
15244 long n;
15245
15246 if (indent) {
15247 while (*ptr && ISSPACE(*ptr)) ptr++;
15248 }
15249 n = p->lex.pend - (ptr + len);
15250 if (n < 0) return FALSE;
15251 if (n > 0 && ptr[len] != '\n') {
15252 if (ptr[len] != '\r') return FALSE;
15253 if (n <= 1 || ptr[len+1] != '\n') return FALSE;
15254 }
15255 return strncmp(eos, ptr, len) == 0;
15256}
15257
15258static int
15259word_match_p(struct parser_params *p, const char *word, long len)
15260{
15261 if (strncmp(p->lex.pcur, word, len)) return 0;
15262 if (p->lex.pcur + len == p->lex.pend) return 1;
15263 int c = (unsigned char)p->lex.pcur[len];
15264 if (ISSPACE(c)) return 1;
15265 switch (c) {
15266 case '\0': case '\004': case '\032': return 1;
15267 }
15268 return 0;
15269}
15270
15271#define NUM_SUFFIX_R (1<<0)
15272#define NUM_SUFFIX_I (1<<1)
15273#define NUM_SUFFIX_ALL 3
15274
15275static int
15276number_literal_suffix(struct parser_params *p, int mask)
15277{
15278 int c, result = 0;
15279 const char *lastp = p->lex.pcur;
15280
15281 while ((c = nextc(p)) != -1) {
15282 if ((mask & NUM_SUFFIX_I) && c == 'i') {
15283 result |= (mask & NUM_SUFFIX_I);
15284 mask &= ~NUM_SUFFIX_I;
15285 /* r after i, rational of complex is disallowed */
15286 mask &= ~NUM_SUFFIX_R;
15287 continue;
15288 }
15289 if ((mask & NUM_SUFFIX_R) && c == 'r') {
15290 result |= (mask & NUM_SUFFIX_R);
15291 mask &= ~NUM_SUFFIX_R;
15292 continue;
15293 }
15294 if (!ISASCII(c) || ISALPHA(c) || c == '_') {
15295 p->lex.pcur = lastp;
15296 literal_flush(p, p->lex.pcur);
15297 return 0;
15298 }
15299 pushback(p, c);
15300 break;
15301 }
15302 return result;
15303}
15304
15305static enum yytokentype
15306set_number_literal(struct parser_params *p, VALUE v,
15307 enum yytokentype type, int suffix)
15308{
15309 if (suffix & NUM_SUFFIX_I) {
15310 v = rb_complex_raw(INT2FIX(0), v);
15311 type = tIMAGINARY;
15312 }
15314 SET_LEX_STATE(EXPR_END);
15315 return type;
15316}
15317
15318static enum yytokentype
15319set_integer_literal(struct parser_params *p, VALUE v, int suffix)
15320{
15321 enum yytokentype type = tINTEGER;
15322 if (suffix & NUM_SUFFIX_R) {
15323 v = rb_rational_raw1(v);
15324 type = tRATIONAL;
15325 }
15326 return set_number_literal(p, v, type, suffix);
15327}
15328
15329#ifdef RIPPER
15330static void
15332{
15333 VALUE str;
15334 if (has_delayed_token(p))
15336 str = STR_NEW(p->lex.ptok, p->lex.pend - p->lex.ptok);
15337 ripper_dispatch1(p, ripper_token2eventid(tHEREDOC_END), str);
15338 lex_goto_eol(p);
15339 token_flush(p);
15340}
15341
15342#else
15343#define dispatch_heredoc_end(p) ((void)0)
15344#endif
15345
15346static enum yytokentype
15347here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
15348{
15349 int c, func, indent = 0;
15350 const char *eos, *ptr, *ptr_end;
15351 long len;
15352 VALUE str = 0;
15353 rb_encoding *enc = p->enc;
15354 rb_encoding *base_enc = 0;
15355 int bol;
15356
15357 eos = RSTRING_PTR(here->lastline) + here->offset;
15358 len = here->length;
15359 indent = (func = here->func) & STR_FUNC_INDENT;
15360
15361 if ((c = nextc(p)) == -1) {
15362 error:
15363#ifdef RIPPER
15364 if (!has_delayed_token(p)) {
15366 }
15367 else {
15368 if ((len = p->lex.pcur - p->lex.ptok) > 0) {
15369 if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
15370 int cr = ENC_CODERANGE_UNKNOWN;
15372 if (cr != ENC_CODERANGE_7BIT &&
15373 p->enc == rb_usascii_encoding() &&
15374 enc != rb_utf8_encoding()) {
15376 }
15377 }
15378 rb_enc_str_buf_cat(p->delayed.token, p->lex.ptok, len, enc);
15379 }
15381 }
15382 lex_goto_eol(p);
15383#endif
15384 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15385 compile_error(p, "can't find string \"%.*s\" anywhere before EOF",
15386 (int)len, eos);
15387 token_flush(p);
15388 p->lex.strterm = 0;
15389 SET_LEX_STATE(EXPR_END);
15390 return tSTRING_END;
15391 }
15392 bol = was_bol(p);
15393 if (!bol) {
15394 /* not beginning of line, cannot be the terminator */
15395 }
15396 else if (p->heredoc_line_indent == -1) {
15397 /* `heredoc_line_indent == -1` means
15398 * - "after an interpolation in the same line", or
15399 * - "in a continuing line"
15400 */
15401 p->heredoc_line_indent = 0;
15402 }
15403 else if (whole_match_p(p, eos, len, indent)) {
15405 restore:
15406 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15407 token_flush(p);
15408 p->lex.strterm = 0;
15409 SET_LEX_STATE(EXPR_END);
15410 return tSTRING_END;
15411 }
15412
15413 if (!(func & STR_FUNC_EXPAND)) {
15414 do {
15416 ptr_end = p->lex.pend;
15417 if (ptr_end > ptr) {
15418 switch (ptr_end[-1]) {
15419 case '\n':
15420 if (--ptr_end == ptr || ptr_end[-1] != '\r') {
15421 ptr_end++;
15422 break;
15423 }
15424 case '\r':
15425 --ptr_end;
15426 }
15427 }
15428
15429 if (p->heredoc_indent > 0) {
15430 long i = 0;
15431 while (ptr + i < ptr_end && parser_update_heredoc_indent(p, ptr[i]))
15432 i++;
15433 p->heredoc_line_indent = 0;
15434 }
15435
15436 if (str)
15437 rb_str_cat(str, ptr, ptr_end - ptr);
15438 else
15439 str = STR_NEW(ptr, ptr_end - ptr);
15440 if (ptr_end < p->lex.pend) rb_str_cat(str, "\n", 1);
15441 lex_goto_eol(p);
15442 if (p->heredoc_indent > 0) {
15443 goto flush_str;
15444 }
15445 if (nextc(p) == -1) {
15446 if (str) {
15447 str = 0;
15448 }
15449 goto error;
15450 }
15451 } while (!whole_match_p(p, eos, len, indent));
15452 }
15453 else {
15454 /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
15455 newtok(p);
15456 if (c == '#') {
15457 int t = parser_peek_variable_name(p);
15458 if (p->heredoc_line_indent != -1) {
15459 if (p->heredoc_indent > p->heredoc_line_indent) {
15461 }
15462 p->heredoc_line_indent = -1;
15463 }
15464 if (t) return t;
15465 tokadd(p, '#');
15466 c = nextc(p);
15467 }
15468 do {
15469 pushback(p, c);
15470 enc = p->enc;
15471 if ((c = tokadd_string(p, func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
15472 if (p->eofp) goto error;
15473 goto restore;
15474 }
15475 if (c != '\n') {
15476 if (c == '\\') p->heredoc_line_indent = -1;
15477 flush:
15478 str = STR_NEW3(tok(p), toklen(p), enc, func);
15479 flush_str:
15481#ifndef RIPPER
15482 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15483#endif
15485 return tSTRING_CONTENT;
15486 }
15487 tokadd(p, nextc(p));
15488 if (p->heredoc_indent > 0) {
15489 lex_goto_eol(p);
15490 goto flush;
15491 }
15492 /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
15493 if ((c = nextc(p)) == -1) goto error;
15494 } while (!whole_match_p(p, eos, len, indent));
15495 str = STR_NEW3(tok(p), toklen(p), enc, func);
15496 }
15498#ifdef RIPPER
15499 str = ripper_new_yylval(p, ripper_token2eventid(tSTRING_CONTENT),
15500 yylval.val, str);
15501#endif
15502 heredoc_restore(p, &p->lex.strterm->u.heredoc);
15503 token_flush(p);
15504 p->lex.strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
15506#ifndef RIPPER
15507 if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
15508#endif
15509 return tSTRING_CONTENT;
15510}
15511
15512#include "lex.c"
15513
15514static int
15515arg_ambiguous(struct parser_params *p, char c)
15516{
15517#ifndef RIPPER
15518 if (c == '/') {
15519 rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
15520 }
15521 else {
15522 rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
15523 }
15524#else
15525 dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
15526#endif
15527 return TRUE;
15528}
15529
15530static ID
15531#ifndef RIPPER
15532formal_argument(struct parser_params *p, ID lhs)
15533#else
15534formal_argument(struct parser_params *p, VALUE lhs)
15535#endif
15536{
15537 switch (id_type(get_id(lhs))) {
15538 case ID_LOCAL:
15539 break;
15540#ifndef RIPPER
15541# define ERR(mesg) yyerror0(mesg)
15542#else
15543# define ERR(mesg) (dispatch2(param_error, WARN_S(mesg), lhs), ripper_error(p))
15544#endif
15545 case ID_CONST:
15546 ERR("formal argument cannot be a constant");
15547 return 0;
15548 case ID_INSTANCE:
15549 ERR("formal argument cannot be an instance variable");
15550 return 0;
15551 case ID_GLOBAL:
15552 ERR("formal argument cannot be a global variable");
15553 return 0;
15554 case ID_CLASS:
15555 ERR("formal argument cannot be a class variable");
15556 return 0;
15557 default:
15558 ERR("formal argument must be local variable");
15559 return 0;
15560#undef ERR
15561 }
15562 shadowing_lvar(p, lhs);
15563 return lhs;
15564}
15565
15566static int
15567lvar_defined(struct parser_params *p, ID id)
15568{
15569 return (dyna_in_block(p) && dvar_defined(p, id)) || local_id(p, id);
15570}
15571
15572/* emacsen -*- hack */
15573static long
15574parser_encode_length(struct parser_params *p, const char *name, long len)
15575{
15576 long nlen;
15577
15578 if (len > 5 && name[nlen = len - 5] == '-') {
15579 if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
15580 return nlen;
15581 }
15582 if (len > 4 && name[nlen = len - 4] == '-') {
15583 if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
15584 return nlen;
15585 if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
15586 !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
15587 /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
15588 return nlen;
15589 }
15590 return len;
15591}
15592
15593static void
15594parser_set_encode(struct parser_params *p, const char *name)
15595{
15596 int idx = rb_enc_find_index(name);
15598 VALUE excargs[3];
15599
15600 if (idx < 0) {
15601 excargs[1] = rb_sprintf("unknown encoding name: %s", name);
15602 error:
15603 excargs[0] = rb_eArgError;
15604 excargs[2] = rb_make_backtrace();
15606 rb_exc_raise(rb_make_exception(3, excargs));
15607 }
15608 enc = rb_enc_from_index(idx);
15609 if (!rb_enc_asciicompat(enc)) {
15610 excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
15611 goto error;
15612 }
15613 p->enc = enc;
15614#ifndef RIPPER
15615 if (p->debug_lines) {
15616 VALUE lines = p->debug_lines;
15617 long i, n = RARRAY_LEN(lines);
15618 for (i = 0; i < n; ++i) {
15619 rb_enc_associate_index(RARRAY_AREF(lines, i), idx);
15620 }
15621 }
15622#endif
15623}
15624
15625static int
15626comment_at_top(struct parser_params *p)
15627{
15628 const char *ptr = p->lex.pbeg, *ptr_end = p->lex.pcur - 1;
15629 if (p->line_count != (p->has_shebang ? 2 : 1)) return 0;
15630 while (ptr < ptr_end) {
15631 if (!ISSPACE(*ptr)) return 0;
15632 ptr++;
15633 }
15634 return 1;
15635}
15636
15637typedef long (*rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len);
15638typedef void (*rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val);
15639
15640static int parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val);
15641
15642static void
15643magic_comment_encoding(struct parser_params *p, const char *name, const char *val)
15644{
15645 if (!comment_at_top(p)) {
15646 return;
15647 }
15648 parser_set_encode(p, val);
15649}
15650
15651static int
15652parser_get_bool(struct parser_params *p, const char *name, const char *val)
15653{
15654 switch (*val) {
15655 case 't': case 'T':
15656 if (STRCASECMP(val, "true") == 0) {
15657 return TRUE;
15658 }
15659 break;
15660 case 'f': case 'F':
15661 if (STRCASECMP(val, "false") == 0) {
15662 return FALSE;
15663 }
15664 break;
15665 }
15666 return parser_invalid_pragma_value(p, name, val);
15667}
15668
15669static int
15670parser_invalid_pragma_value(struct parser_params *p, const char *name, const char *val)
15671{
15672 rb_warning2("invalid value for %s: %s", WARN_S(name), WARN_S(val));
15673 return -1;
15674}
15675
15676static void
15677parser_set_token_info(struct parser_params *p, const char *name, const char *val)
15678{
15679 int b = parser_get_bool(p, name, val);
15680 if (b >= 0) p->token_info_enabled = b;
15681}
15682
15683static void
15684parser_set_compile_option_flag(struct parser_params *p, const char *name, const char *val)
15685{
15686 int b;
15687
15688 if (p->token_seen) {
15689 rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
15690 return;
15691 }
15692
15693 b = parser_get_bool(p, name, val);
15694 if (b < 0) return;
15695
15696 if (!p->compile_option)
15699 (b ? Qtrue : Qfalse));
15700}
15701
15702static void
15703parser_set_shareable_constant_value(struct parser_params *p, const char *name, const char *val)
15704{
15705 for (const char *s = p->lex.pbeg, *e = p->lex.pcur; s < e; ++s) {
15706 if (*s == ' ' || *s == '\t') continue;
15707 if (*s == '#') break;
15708 rb_warning1("`%s' is ignored unless in comment-only line", WARN_S(name));
15709 return;
15710 }
15711
15712 switch (*val) {
15713 case 'n': case 'N':
15714 if (STRCASECMP(val, "none") == 0) {
15715 p->ctxt.shareable_constant_value = shareable_none;
15716 return;
15717 }
15718 break;
15719 case 'l': case 'L':
15720 if (STRCASECMP(val, "literal") == 0) {
15721 p->ctxt.shareable_constant_value = shareable_literal;
15722 return;
15723 }
15724 break;
15725 case 'e': case 'E':
15726 if (STRCASECMP(val, "experimental_copy") == 0) {
15727 p->ctxt.shareable_constant_value = shareable_copy;
15728 return;
15729 }
15730 if (STRCASECMP(val, "experimental_everything") == 0) {
15731 p->ctxt.shareable_constant_value = shareable_everything;
15732 return;
15733 }
15734 break;
15735 }
15736 parser_invalid_pragma_value(p, name, val);
15737}
15738
15739# if WARN_PAST_SCOPE
15740static void
15741parser_set_past_scope(struct parser_params *p, const char *name, const char *val)
15742{
15743 int b = parser_get_bool(p, name, val);
15744 if (b >= 0) p->past_scope_enabled = b;
15745}
15746# endif
15747
15748struct magic_comment {
15749 const char *name;
15752};
15753
15754static const struct magic_comment magic_comments[] = {
15755 {"coding", magic_comment_encoding, parser_encode_length},
15756 {"encoding", magic_comment_encoding, parser_encode_length},
15757 {"frozen_string_literal", parser_set_compile_option_flag},
15758 {"shareable_constant_value", parser_set_shareable_constant_value},
15759 {"warn_indent", parser_set_token_info},
15760# if WARN_PAST_SCOPE
15761 {"warn_past_scope", parser_set_past_scope},
15762# endif
15763};
15764
15765static const char *
15766magic_comment_marker(const char *str, long len)
15767{
15768 long i = 2;
15769
15770 while (i < len) {
15771 switch (str[i]) {
15772 case '-':
15773 if (str[i-1] == '*' && str[i-2] == '-') {
15774 return str + i + 1;
15775 }
15776 i += 2;
15777 break;
15778 case '*':
15779 if (i + 1 >= len) return 0;
15780 if (str[i+1] != '-') {
15781 i += 4;
15782 }
15783 else if (str[i-1] != '-') {
15784 i += 2;
15785 }
15786 else {
15787 return str + i + 2;
15788 }
15789 break;
15790 default:
15791 i += 3;
15792 break;
15793 }
15794 }
15795 return 0;
15796}
15797
15798static int
15799parser_magic_comment(struct parser_params *p, const char *str, long len)
15800{
15801 int indicator = 0;
15802 VALUE name = 0, val = 0;
15803 const char *beg, *end, *vbeg, *vend;
15804#define str_copy(_s, _p, _n) ((_s) \
15805 ? (void)(rb_str_resize((_s), (_n)), \
15806 MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
15807 : (void)((_s) = STR_NEW((_p), (_n))))
15808
15809 if (len <= 7) return FALSE;
15810 if (!!(beg = magic_comment_marker(str, len))) {
15811 if (!(end = magic_comment_marker(beg, str + len - beg)))
15812 return FALSE;
15813 indicator = TRUE;
15814 str = beg;
15815 len = end - beg - 3;
15816 }
15817
15818 /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
15819 while (len > 0) {
15820 const struct magic_comment *mc = magic_comments;
15821 char *s;
15822 int i;
15823 long n = 0;
15824
15825 for (; len > 0 && *str; str++, --len) {
15826 switch (*str) {
15827 case '\'': case '"': case ':': case ';':
15828 continue;
15829 }
15830 if (!ISSPACE(*str)) break;
15831 }
15832 for (beg = str; len > 0; str++, --len) {
15833 switch (*str) {
15834 case '\'': case '"': case ':': case ';':
15835 break;
15836 default:
15837 if (ISSPACE(*str)) break;
15838 continue;
15839 }
15840 break;
15841 }
15842 for (end = str; len > 0 && ISSPACE(*str); str++, --len);
15843 if (!len) break;
15844 if (*str != ':') {
15845 if (!indicator) return FALSE;
15846 continue;
15847 }
15848
15849 do str++; while (--len > 0 && ISSPACE(*str));
15850 if (!len) break;
15851 if (*str == '"') {
15852 for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
15853 if (*str == '\\') {
15854 --len;
15855 ++str;
15856 }
15857 }
15858 vend = str;
15859 if (len) {
15860 --len;
15861 ++str;
15862 }
15863 }
15864 else {
15865 for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
15866 vend = str;
15867 }
15868 if (indicator) {
15869 while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
15870 }
15871 else {
15872 while (len > 0 && (ISSPACE(*str))) --len, str++;
15873 if (len) return FALSE;
15874 }
15875
15876 n = end - beg;
15877 str_copy(name, beg, n);
15878 s = RSTRING_PTR(name);
15879 for (i = 0; i < n; ++i) {
15880 if (s[i] == '-') s[i] = '_';
15881 }
15882 do {
15883 if (STRNCASECMP(mc->name, s, n) == 0 && !mc->name[n]) {
15884 n = vend - vbeg;
15885 if (mc->length) {
15886 n = (*mc->length)(p, vbeg, n);
15887 }
15888 str_copy(val, vbeg, n);
15889 (*mc->func)(p, mc->name, RSTRING_PTR(val));
15890 break;
15891 }
15892 } while (++mc < magic_comments + numberof(magic_comments));
15893#ifdef RIPPER
15894 str_copy(val, vbeg, vend - vbeg);
15895 dispatch2(magic_comment, name, val);
15896#endif
15897 }
15898
15899 return TRUE;
15900}
15901
15902static void
15903set_file_encoding(struct parser_params *p, const char *str, const char *send)
15904{
15905 int sep = 0;
15906 const char *beg = str;
15907 VALUE s;
15908
15909 for (;;) {
15910 if (send - str <= 6) return;
15911 switch (str[6]) {
15912 case 'C': case 'c': str += 6; continue;
15913 case 'O': case 'o': str += 5; continue;
15914 case 'D': case 'd': str += 4; continue;
15915 case 'I': case 'i': str += 3; continue;
15916 case 'N': case 'n': str += 2; continue;
15917 case 'G': case 'g': str += 1; continue;
15918 case '=': case ':':
15919 sep = 1;
15920 str += 6;
15921 break;
15922 default:
15923 str += 6;
15924 if (ISSPACE(*str)) break;
15925 continue;
15926 }
15927 if (STRNCASECMP(str-6, "coding", 6) == 0) break;
15928 }
15929 for (;;) {
15930 do {
15931 if (++str >= send) return;
15932 } while (ISSPACE(*str));
15933 if (sep) break;
15934 if (*str != '=' && *str != ':') return;
15935 sep = 1;
15936 str++;
15937 }
15938 beg = str;
15939 while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
15940 s = rb_str_new(beg, parser_encode_length(p, beg, str - beg));
15941 parser_set_encode(p, RSTRING_PTR(s));
15942 rb_str_resize(s, 0);
15943}
15944
15945static void
15946parser_prepare(struct parser_params *p)
15947{
15948 int c = nextc(p);
15950 switch (c) {
15951 case '#':
15952 if (peek(p, '!')) p->has_shebang = 1;
15953 break;
15954 case 0xef: /* UTF-8 BOM marker */
15955 if (p->lex.pend - p->lex.pcur >= 2 &&
15956 (unsigned char)p->lex.pcur[0] == 0xbb &&
15957 (unsigned char)p->lex.pcur[1] == 0xbf) {
15958 p->enc = rb_utf8_encoding();
15959 p->lex.pcur += 2;
15960 p->lex.pbeg = p->lex.pcur;
15961 return;
15962 }
15963 break;
15964 case EOF:
15965 return;
15966 }
15967 pushback(p, c);
15968 p->enc = rb_enc_get(p->lex.lastline);
15969}
15970
15971#ifndef RIPPER
15972#define ambiguous_operator(tok, op, syn) ( \
15973 rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
15974 rb_warning0("even though it seems like "syn""))
15975#else
15976#define ambiguous_operator(tok, op, syn) \
15977 dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
15978#endif
15979#define warn_balanced(tok, op, syn) ((void) \
15980 (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
15981 space_seen && !ISSPACE(c) && \
15982 (ambiguous_operator(tok, op, syn), 0)), \
15983 (enum yytokentype)(tok))
15984
15985static VALUE
15986parse_rational(struct parser_params *p, char *str, int len, int seen_point)
15987{
15988 VALUE v;
15989 char *point = &str[seen_point];
15990 size_t fraclen = len-seen_point-1;
15991 memmove(point, point+1, fraclen+1);
15992 v = rb_cstr_to_inum(str, 10, FALSE);
15993 return rb_rational_new(v, rb_int_positive_pow(10, fraclen));
15994}
15995
15996static enum yytokentype
15997no_digits(struct parser_params *p)
15998{
15999 yyerror0("numeric literal without digits");
16000 if (peek(p, '_')) nextc(p);
16001 /* dummy 0, for tUMINUS_NUM at numeric */
16002 return set_integer_literal(p, INT2FIX(0), 0);
16003}
16004
16005static enum yytokentype
16006parse_numeric(struct parser_params *p, int c)
16007{
16008 int is_float, seen_point, seen_e, nondigit;
16009 int suffix;
16010
16011 is_float = seen_point = seen_e = nondigit = 0;
16012 SET_LEX_STATE(EXPR_END);
16013 newtok(p);
16014 if (c == '-' || c == '+') {
16015 tokadd(p, c);
16016 c = nextc(p);
16017 }
16018 if (c == '0') {
16019 int start = toklen(p);
16020 c = nextc(p);
16021 if (c == 'x' || c == 'X') {
16022 /* hexadecimal */
16023 c = nextc(p);
16024 if (c != -1 && ISXDIGIT(c)) {
16025 do {
16026 if (c == '_') {
16027 if (nondigit) break;
16028 nondigit = c;
16029 continue;
16030 }
16031 if (!ISXDIGIT(c)) break;
16032 nondigit = 0;
16033 tokadd(p, c);
16034 } while ((c = nextc(p)) != -1);
16035 }
16036 pushback(p, c);
16037 tokfix(p);
16038 if (toklen(p) == start) {
16039 return no_digits(p);
16040 }
16041 else if (nondigit) goto trailing_uc;
16042 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16043 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 16, FALSE), suffix);
16044 }
16045 if (c == 'b' || c == 'B') {
16046 /* binary */
16047 c = nextc(p);
16048 if (c == '0' || c == '1') {
16049 do {
16050 if (c == '_') {
16051 if (nondigit) break;
16052 nondigit = c;
16053 continue;
16054 }
16055 if (c != '0' && c != '1') break;
16056 nondigit = 0;
16057 tokadd(p, c);
16058 } while ((c = nextc(p)) != -1);
16059 }
16060 pushback(p, c);
16061 tokfix(p);
16062 if (toklen(p) == start) {
16063 return no_digits(p);
16064 }
16065 else if (nondigit) goto trailing_uc;
16066 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16067 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 2, FALSE), suffix);
16068 }
16069 if (c == 'd' || c == 'D') {
16070 /* decimal */
16071 c = nextc(p);
16072 if (c != -1 && ISDIGIT(c)) {
16073 do {
16074 if (c == '_') {
16075 if (nondigit) break;
16076 nondigit = c;
16077 continue;
16078 }
16079 if (!ISDIGIT(c)) break;
16080 nondigit = 0;
16081 tokadd(p, c);
16082 } while ((c = nextc(p)) != -1);
16083 }
16084 pushback(p, c);
16085 tokfix(p);
16086 if (toklen(p) == start) {
16087 return no_digits(p);
16088 }
16089 else if (nondigit) goto trailing_uc;
16090 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16091 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
16092 }
16093 if (c == '_') {
16094 /* 0_0 */
16095 goto octal_number;
16096 }
16097 if (c == 'o' || c == 'O') {
16098 /* prefixed octal */
16099 c = nextc(p);
16100 if (c == -1 || c == '_' || !ISDIGIT(c)) {
16101 return no_digits(p);
16102 }
16103 }
16104 if (c >= '0' && c <= '7') {
16105 /* octal */
16106 octal_number:
16107 do {
16108 if (c == '_') {
16109 if (nondigit) break;
16110 nondigit = c;
16111 continue;
16112 }
16113 if (c < '0' || c > '9') break;
16114 if (c > '7') goto invalid_octal;
16115 nondigit = 0;
16116 tokadd(p, c);
16117 } while ((c = nextc(p)) != -1);
16118 if (toklen(p) > start) {
16119 pushback(p, c);
16120 tokfix(p);
16121 if (nondigit) goto trailing_uc;
16122 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16123 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 8, FALSE), suffix);
16124 }
16125 if (nondigit) {
16126 pushback(p, c);
16127 goto trailing_uc;
16128 }
16129 }
16130 if (c > '7' && c <= '9') {
16131 invalid_octal:
16132 yyerror0("Invalid octal digit");
16133 }
16134 else if (c == '.' || c == 'e' || c == 'E') {
16135 tokadd(p, '0');
16136 }
16137 else {
16138 pushback(p, c);
16139 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16140 return set_integer_literal(p, INT2FIX(0), suffix);
16141 }
16142 }
16143
16144 for (;;) {
16145 switch (c) {
16146 case '0': case '1': case '2': case '3': case '4':
16147 case '5': case '6': case '7': case '8': case '9':
16148 nondigit = 0;
16149 tokadd(p, c);
16150 break;
16151
16152 case '.':
16153 if (nondigit) goto trailing_uc;
16154 if (seen_point || seen_e) {
16155 goto decode_num;
16156 }
16157 else {
16158 int c0 = nextc(p);
16159 if (c0 == -1 || !ISDIGIT(c0)) {
16160 pushback(p, c0);
16161 goto decode_num;
16162 }
16163 c = c0;
16164 }
16165 seen_point = toklen(p);
16166 tokadd(p, '.');
16167 tokadd(p, c);
16168 is_float++;
16169 nondigit = 0;
16170 break;
16171
16172 case 'e':
16173 case 'E':
16174 if (nondigit) {
16175 pushback(p, c);
16176 c = nondigit;
16177 goto decode_num;
16178 }
16179 if (seen_e) {
16180 goto decode_num;
16181 }
16182 nondigit = c;
16183 c = nextc(p);
16184 if (c != '-' && c != '+' && !ISDIGIT(c)) {
16185 pushback(p, c);
16186 nondigit = 0;
16187 goto decode_num;
16188 }
16189 tokadd(p, nondigit);
16190 seen_e++;
16191 is_float++;
16192 tokadd(p, c);
16193 nondigit = (c == '-' || c == '+') ? c : 0;
16194 break;
16195
16196 case '_': /* `_' in number just ignored */
16197 if (nondigit) goto decode_num;
16198 nondigit = c;
16199 break;
16200
16201 default:
16202 goto decode_num;
16203 }
16204 c = nextc(p);
16205 }
16206
16207 decode_num:
16208 pushback(p, c);
16209 if (nondigit) {
16210 trailing_uc:
16211 literal_flush(p, p->lex.pcur - 1);
16212 YYLTYPE loc = RUBY_INIT_YYLLOC();
16213 compile_error(p, "trailing `%c' in number", nondigit);
16214 parser_show_error_line(p, &loc);
16215 }
16216 tokfix(p);
16217 if (is_float) {
16218 enum yytokentype type = tFLOAT;
16219 VALUE v;
16220
16221 suffix = number_literal_suffix(p, seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL);
16222 if (suffix & NUM_SUFFIX_R) {
16223 type = tRATIONAL;
16224 v = parse_rational(p, tok(p), toklen(p), seen_point);
16225 }
16226 else {
16227 double d = strtod(tok(p), 0);
16228 if (errno == ERANGE) {
16229 rb_warning1("Float %s out of range", WARN_S(tok(p)));
16230 errno = 0;
16231 }
16232 v = DBL2NUM(d);
16233 }
16234 return set_number_literal(p, v, type, suffix);
16235 }
16236 suffix = number_literal_suffix(p, NUM_SUFFIX_ALL);
16237 return set_integer_literal(p, rb_cstr_to_inum(tok(p), 10, FALSE), suffix);
16238}
16239
16240static enum yytokentype
16241parse_qmark(struct parser_params *p, int space_seen)
16242{
16243 rb_encoding *enc;
16244 register int c;
16245 VALUE lit;
16246
16247 if (IS_END()) {
16249 return '?';
16250 }
16251 c = nextc(p);
16252 if (c == -1) {
16253 compile_error(p, "incomplete character syntax");
16254 return 0;
16255 }
16256 if (rb_enc_isspace(c, p->enc)) {
16257 if (!IS_ARG()) {
16258 int c2 = escaped_control_code(c);
16259 if (c2) {
16260 WARN_SPACE_CHAR(c2, "?");
16261 }
16262 }
16263 ternary:
16264 pushback(p, c);
16266 return '?';
16267 }
16268 newtok(p);
16269 enc = p->enc;
16270 if (!parser_isascii(p)) {
16271 if (tokadd_mbchar(p, c) == -1) return 0;
16272 }
16273 else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
16274 p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
16275 if (space_seen) {
16276 const char *start = p->lex.pcur - 1, *ptr = start;
16277 do {
16278 int n = parser_precise_mbclen(p, ptr);
16279 if (n < 0) return -1;
16280 ptr += n;
16281 } while (ptr < p->lex.pend && is_identchar(ptr, p->lex.pend, p->enc));
16282 rb_warn2("`?' just followed by `%.*s' is interpreted as" \
16283 " a conditional operator, put a space after `?'",
16284 WARN_I((int)(ptr - start)), WARN_S_L(start, (ptr - start)));
16285 }
16286 goto ternary;
16287 }
16288 else if (c == '\\') {
16289 if (peek(p, 'u')) {
16290 nextc(p);
16291 enc = rb_utf8_encoding();
16292 tokadd_utf8(p, &enc, -1, 0, 0);
16293 }
16294 else if (!lex_eol_p(p) && !(c = *p->lex.pcur, ISASCII(c))) {
16295 nextc(p);
16296 if (tokadd_mbchar(p, c) == -1) return 0;
16297 }
16298 else {
16299 c = read_escape(p, 0, &enc);
16300 tokadd(p, c);
16301 }
16302 }
16303 else {
16304 tokadd(p, c);
16305 }
16306 tokfix(p);
16307 lit = STR_NEW3(tok(p), toklen(p), enc, 0);
16308 set_yylval_str(lit);
16309 SET_LEX_STATE(EXPR_END);
16310 return tCHAR;
16311}
16312
16313static enum yytokentype
16314parse_percent(struct parser_params *p, const int space_seen, const enum lex_state_e last_state)
16315{
16316 register int c;
16317 const char *ptok = p->lex.pcur;
16318
16319 if (IS_BEG()) {
16320 int term;
16321 int paren;
16322
16323 c = nextc(p);
16324 quotation:
16325 if (c == -1 || !ISALNUM(c)) {
16326 term = c;
16327 if (!ISASCII(c)) goto unknown;
16328 c = 'Q';
16329 }
16330 else {
16331 term = nextc(p);
16332 if (rb_enc_isalnum(term, p->enc) || !parser_isascii(p)) {
16333 unknown:
16334 pushback(p, term);
16335 c = parser_precise_mbclen(p, p->lex.pcur);
16336 if (c < 0) return 0;
16337 p->lex.pcur += c;
16338 yyerror0("unknown type of %string");
16339 return 0;
16340 }
16341 }
16342 if (term == -1) {
16343 compile_error(p, "unterminated quoted string meets end of file");
16344 return 0;
16345 }
16346 paren = term;
16347 if (term == '(') term = ')';
16348 else if (term == '[') term = ']';
16349 else if (term == '{') term = '}';
16350 else if (term == '<') term = '>';
16351 else paren = 0;
16352
16353 p->lex.ptok = ptok-1;
16354 switch (c) {
16355 case 'Q':
16356 p->lex.strterm = NEW_STRTERM(str_dquote, term, paren);
16357 return tSTRING_BEG;
16358
16359 case 'q':
16360 p->lex.strterm = NEW_STRTERM(str_squote, term, paren);
16361 return tSTRING_BEG;
16362
16363 case 'W':
16364 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16365 return tWORDS_BEG;
16366
16367 case 'w':
16368 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16369 return tQWORDS_BEG;
16370
16371 case 'I':
16372 p->lex.strterm = NEW_STRTERM(str_dword, term, paren);
16373 return tSYMBOLS_BEG;
16374
16375 case 'i':
16376 p->lex.strterm = NEW_STRTERM(str_sword, term, paren);
16377 return tQSYMBOLS_BEG;
16378
16379 case 'x':
16380 p->lex.strterm = NEW_STRTERM(str_xquote, term, paren);
16381 return tXSTRING_BEG;
16382
16383 case 'r':
16384 p->lex.strterm = NEW_STRTERM(str_regexp, term, paren);
16385 return tREGEXP_BEG;
16386
16387 case 's':
16388 p->lex.strterm = NEW_STRTERM(str_ssym, term, paren);
16389 SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
16390 return tSYMBEG;
16391
16392 default:
16393 yyerror0("unknown type of %string");
16394 return 0;
16395 }
16396 }
16397 if ((c = nextc(p)) == '=') {
16398 set_yylval_id('%');
16399 SET_LEX_STATE(EXPR_BEG);
16400 return tOP_ASGN;
16401 }
16402 if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
16403 goto quotation;
16404 }
16405 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16406 pushback(p, c);
16407 return warn_balanced('%', "%%", "string literal");
16408}
16409
16410static int
16411tokadd_ident(struct parser_params *p, int c)
16412{
16413 do {
16414 if (tokadd_mbchar(p, c) == -1) return -1;
16415 c = nextc(p);
16416 } while (parser_is_identchar(p));
16417 pushback(p, c);
16418 return 0;
16419}
16420
16421static ID
16422tokenize_ident(struct parser_params *p, const enum lex_state_e last_state)
16423{
16424 ID ident = TOK_INTERN();
16425
16426 set_yylval_name(ident);
16427
16428 return ident;
16429}
16430
16431static int
16432parse_numvar(struct parser_params *p)
16433{
16434 size_t len;
16435 int overflow;
16436 unsigned long n = ruby_scan_digits(tok(p)+1, toklen(p)-1, 10, &len, &overflow);
16437 const unsigned long nth_ref_max =
16438 ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
16439 /* NTH_REF is left-shifted to be ORed with back-ref flag and
16440 * turned into a Fixnum, in compile.c */
16441
16442 if (overflow || n > nth_ref_max) {
16443 /* compile_error()? */
16444 rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok(p)));
16445 return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
16446 }
16447 else {
16448 return (int)n;
16449 }
16450}
16451
16452static enum yytokentype
16453parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
16454{
16455 const char *ptr = p->lex.pcur;
16456 register int c;
16457
16458 SET_LEX_STATE(EXPR_END);
16459 p->lex.ptok = ptr - 1; /* from '$' */
16460 newtok(p);
16461 c = nextc(p);
16462 switch (c) {
16463 case '_': /* $_: last read line string */
16464 c = nextc(p);
16465 if (parser_is_identchar(p)) {
16466 tokadd(p, '$');
16467 tokadd(p, '_');
16468 break;
16469 }
16470 pushback(p, c);
16471 c = '_';
16472 /* fall through */
16473 case '~': /* $~: match-data */
16474 case '*': /* $*: argv */
16475 case '$': /* $$: pid */
16476 case '?': /* $?: last status */
16477 case '!': /* $!: error string */
16478 case '@': /* $@: error position */
16479 case '/': /* $/: input record separator */
16480 case '\\': /* $\: output record separator */
16481 case ';': /* $;: field separator */
16482 case ',': /* $,: output field separator */
16483 case '.': /* $.: last read line number */
16484 case '=': /* $=: ignorecase */
16485 case ':': /* $:: load path */
16486 case '<': /* $<: reading filename */
16487 case '>': /* $>: default output handle */
16488 case '\"': /* $": already loaded files */
16489 tokadd(p, '$');
16490 tokadd(p, c);
16491 goto gvar;
16492
16493 case '-':
16494 tokadd(p, '$');
16495 tokadd(p, c);
16496 c = nextc(p);
16497 if (parser_is_identchar(p)) {
16498 if (tokadd_mbchar(p, c) == -1) return 0;
16499 }
16500 else {
16501 pushback(p, c);
16502 pushback(p, '-');
16503 return '$';
16504 }
16505 gvar:
16507 return tGVAR;
16508
16509 case '&': /* $&: last match */
16510 case '`': /* $`: string before last match */
16511 case '\'': /* $': string after last match */
16512 case '+': /* $+: string matches last paren. */
16513 if (IS_lex_state_for(last_state, EXPR_FNAME)) {
16514 tokadd(p, '$');
16515 tokadd(p, c);
16516 goto gvar;
16517 }
16518 set_yylval_node(NEW_BACK_REF(c, &_cur_loc));
16519 return tBACK_REF;
16520
16521 case '1': case '2': case '3':
16522 case '4': case '5': case '6':
16523 case '7': case '8': case '9':
16524 tokadd(p, '$');
16525 do {
16526 tokadd(p, c);
16527 c = nextc(p);
16528 } while (c != -1 && ISDIGIT(c));
16529 pushback(p, c);
16530 if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
16531 tokfix(p);
16532 c = parse_numvar(p);
16533 set_yylval_node(NEW_NTH_REF(c, &_cur_loc));
16534 return tNTH_REF;
16535
16536 default:
16537 if (!parser_is_identchar(p)) {
16538 YYLTYPE loc = RUBY_INIT_YYLLOC();
16539 if (c == -1 || ISSPACE(c)) {
16540 compile_error(p, "`$' without identifiers is not allowed as a global variable name");
16541 }
16542 else {
16543 pushback(p, c);
16544 compile_error(p, "`$%c' is not allowed as a global variable name", c);
16545 }
16546 parser_show_error_line(p, &loc);
16548 return tGVAR;
16549 }
16550 /* fall through */
16551 case '0':
16552 tokadd(p, '$');
16553 }
16554
16555 if (tokadd_ident(p, c)) return 0;
16556 SET_LEX_STATE(EXPR_END);
16557 tokenize_ident(p, last_state);
16558 return tGVAR;
16559}
16560
16561#ifndef RIPPER
16562static bool
16563parser_numbered_param(struct parser_params *p, int n)
16564{
16565 if (n < 0) return false;
16566
16568 return false;
16569 }
16570 if (p->max_numparam == ORDINAL_PARAM) {
16571 compile_error(p, "ordinary parameter is defined");
16572 return false;
16573 }
16574 struct vtable *args = p->lvtbl->args;
16575 if (p->max_numparam < n) {
16576 p->max_numparam = n;
16577 }
16578 while (n > args->pos) {
16579 vtable_add(args, NUMPARAM_IDX_TO_ID(args->pos+1));
16580 }
16581 return true;
16582}
16583#endif
16584
16585static enum yytokentype
16586parse_atmark(struct parser_params *p, const enum lex_state_e last_state)
16587{
16588 const char *ptr = p->lex.pcur;
16589 enum yytokentype result = tIVAR;
16590 register int c = nextc(p);
16591 YYLTYPE loc;
16592
16593 p->lex.ptok = ptr - 1; /* from '@' */
16594 newtok(p);
16595 tokadd(p, '@');
16596 if (c == '@') {
16597 result = tCVAR;
16598 tokadd(p, '@');
16599 c = nextc(p);
16600 }
16601 SET_LEX_STATE(IS_lex_state_for(last_state, EXPR_FNAME) ? EXPR_ENDFN : EXPR_END);
16602 if (c == -1 || !parser_is_identchar(p)) {
16603 pushback(p, c);
16604 RUBY_SET_YYLLOC(loc);
16605 if (result == tIVAR) {
16606 compile_error(p, "`@' without identifiers is not allowed as an instance variable name");
16607 }
16608 else {
16609 compile_error(p, "`@@' without identifiers is not allowed as a class variable name");
16610 }
16611 parser_show_error_line(p, &loc);
16613 SET_LEX_STATE(EXPR_END);
16614 return result;
16615 }
16616 else if (ISDIGIT(c)) {
16617 pushback(p, c);
16618 RUBY_SET_YYLLOC(loc);
16619 if (result == tIVAR) {
16620 compile_error(p, "`@%c' is not allowed as an instance variable name", c);
16621 }
16622 else {
16623 compile_error(p, "`@@%c' is not allowed as a class variable name", c);
16624 }
16625 parser_show_error_line(p, &loc);
16627 SET_LEX_STATE(EXPR_END);
16628 return result;
16629 }
16630
16631 if (tokadd_ident(p, c)) return 0;
16632 tokenize_ident(p, last_state);
16633 return result;
16634}
16635
16636static enum yytokentype
16637parse_ident(struct parser_params *p, int c, int cmd_state)
16638{
16639 enum yytokentype result;
16640 int mb = ENC_CODERANGE_7BIT;
16641 const enum lex_state_e last_state = p->lex.state;
16642 ID ident;
16643
16644 do {
16645 if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
16646 if (tokadd_mbchar(p, c) == -1) return 0;
16647 c = nextc(p);
16648 } while (parser_is_identchar(p));
16649 if ((c == '!' || c == '?') && !peek(p, '=')) {
16650 result = tFID;
16651 tokadd(p, c);
16652 }
16653 else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
16654 (!peek(p, '~') && !peek(p, '>') && (!peek(p, '=') || (peek_n(p, '>', 1))))) {
16655 result = tIDENTIFIER;
16656 tokadd(p, c);
16657 }
16658 else {
16659 result = tCONSTANT; /* assume provisionally */
16660 pushback(p, c);
16661 }
16662 tokfix(p);
16663
16664 if (IS_LABEL_POSSIBLE()) {
16665 if (IS_LABEL_SUFFIX(0)) {
16666 SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
16667 nextc(p);
16669 return tLABEL;
16670 }
16671 }
16672 if (mb == ENC_CODERANGE_7BIT && !IS_lex_state(EXPR_DOT)) {
16673 const struct kwtable *kw;
16674
16675 /* See if it is a reserved word. */
16676 kw = rb_reserved_word(tok(p), toklen(p));
16677 if (kw) {
16678 enum lex_state_e state = p->lex.state;
16679 if (IS_lex_state_for(state, EXPR_FNAME)) {
16680 SET_LEX_STATE(EXPR_ENDFN);
16682 return kw->id[0];
16683 }
16684 SET_LEX_STATE(kw->state);
16685 if (IS_lex_state(EXPR_BEG)) {
16686 p->command_start = TRUE;
16687 }
16688 if (kw->id[0] == keyword_do) {
16689 if (lambda_beginning_p()) {
16690 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE in the body of "-> do ... end" */
16691 return keyword_do_LAMBDA;
16692 }
16693 if (COND_P()) return keyword_do_cond;
16694 if (CMDARG_P() && !IS_lex_state_for(state, EXPR_CMDARG))
16695 return keyword_do_block;
16696 return keyword_do;
16697 }
16698 if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED)))
16699 return kw->id[0];
16700 else {
16701 if (kw->id[0] != kw->id[1])
16702 SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
16703 return kw->id[1];
16704 }
16705 }
16706 }
16707
16708 if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
16709 if (cmd_state) {
16710 SET_LEX_STATE(EXPR_CMDARG);
16711 }
16712 else {
16713 SET_LEX_STATE(EXPR_ARG);
16714 }
16715 }
16716 else if (p->lex.state == EXPR_FNAME) {
16717 SET_LEX_STATE(EXPR_ENDFN);
16718 }
16719 else {
16720 SET_LEX_STATE(EXPR_END);
16721 }
16722
16723 ident = tokenize_ident(p, last_state);
16724 if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
16725 if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
16726 (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
16727 lvar_defined(p, ident)) {
16728 SET_LEX_STATE(EXPR_END|EXPR_LABEL);
16729 }
16730 return result;
16731}
16732
16733static enum yytokentype
16734parser_yylex(struct parser_params *p)
16735{
16736 register int c;
16737 int space_seen = 0;
16738 int cmd_state;
16739 int label;
16740 enum lex_state_e last_state;
16741 int fallthru = FALSE;
16742 int token_seen = p->token_seen;
16743
16744 if (p->lex.strterm) {
16745 if (p->lex.strterm->flags & STRTERM_HEREDOC) {
16746 return here_document(p, &p->lex.strterm->u.heredoc);
16747 }
16748 else {
16749 token_flush(p);
16750 return parse_string(p, &p->lex.strterm->u.literal);
16751 }
16752 }
16753 cmd_state = p->command_start;
16754 p->command_start = FALSE;
16755 p->token_seen = TRUE;
16756 retry:
16757 last_state = p->lex.state;
16758#ifndef RIPPER
16759 token_flush(p);
16760#endif
16761 switch (c = nextc(p)) {
16762 case '\0': /* NUL */
16763 case '\004': /* ^D */
16764 case '\032': /* ^Z */
16765 case -1: /* end of script. */
16766 return 0;
16767
16768 /* white spaces */
16769 case '\r':
16770 if (!p->cr_seen) {
16771 p->cr_seen = TRUE;
16772 /* carried over with p->lex.nextline for nextc() */
16773 rb_warn0("encountered \\r in middle of line, treated as a mere space");
16774 }
16775 /* fall through */
16776 case ' ': case '\t': case '\f':
16777 case '\13': /* '\v' */
16778 space_seen = 1;
16779#ifdef RIPPER
16780 while ((c = nextc(p))) {
16781 switch (c) {
16782 case ' ': case '\t': case '\f': case '\r':
16783 case '\13': /* '\v' */
16784 break;
16785 default:
16786 goto outofloop;
16787 }
16788 }
16789 outofloop:
16790 pushback(p, c);
16792#endif
16793 goto retry;
16794
16795 case '#': /* it's a comment */
16796 p->token_seen = token_seen;
16797 /* no magic_comment in shebang line */
16798 if (!parser_magic_comment(p, p->lex.pcur, p->lex.pend - p->lex.pcur)) {
16799 if (comment_at_top(p)) {
16800 set_file_encoding(p, p->lex.pcur, p->lex.pend);
16801 }
16802 }
16803 lex_goto_eol(p);
16805 fallthru = TRUE;
16806 /* fall through */
16807 case '\n':
16808 p->token_seen = token_seen;
16809 c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
16810 !IS_lex_state(EXPR_LABELED));
16811 if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
16812 if (!fallthru) {
16814 }
16815 fallthru = FALSE;
16816 if (!c && p->ctxt.in_kwarg) {
16817 goto normal_newline;
16818 }
16819 goto retry;
16820 }
16821 while (1) {
16822 switch (c = nextc(p)) {
16823 case ' ': case '\t': case '\f': case '\r':
16824 case '\13': /* '\v' */
16825 space_seen = 1;
16826 break;
16827 case '#':
16828 pushback(p, c);
16829 if (space_seen) dispatch_scan_event(p, tSP);
16830 goto retry;
16831 case '&':
16832 case '.': {
16834 if (peek(p, '.') == (c == '&')) {
16835 pushback(p, c);
16837 goto retry;
16838 }
16839 }
16840 default:
16841 p->ruby_sourceline--;
16842 p->lex.nextline = p->lex.lastline;
16843 case -1: /* EOF no decrement*/
16844#ifndef RIPPER
16845 if (p->lex.prevline && !p->eofp) p->lex.lastline = p->lex.prevline;
16846 p->lex.pbeg = RSTRING_PTR(p->lex.lastline);
16847 p->lex.pend = p->lex.pcur = p->lex.pbeg + RSTRING_LEN(p->lex.lastline);
16848 pushback(p, 1); /* always pushback */
16849 p->lex.ptok = p->lex.pcur;
16850#else
16851 lex_goto_eol(p);
16852 if (c != -1) {
16853 p->lex.ptok = p->lex.pcur;
16854 }
16855#endif
16856 goto normal_newline;
16857 }
16858 }
16859 normal_newline:
16860 p->command_start = TRUE;
16861 SET_LEX_STATE(EXPR_BEG);
16862 return '\n';
16863
16864 case '*':
16865 if ((c = nextc(p)) == '*') {
16866 if ((c = nextc(p)) == '=') {
16868 SET_LEX_STATE(EXPR_BEG);
16869 return tOP_ASGN;
16870 }
16871 pushback(p, c);
16872 if (IS_SPCARG(c)) {
16873 rb_warning0("`**' interpreted as argument prefix");
16874 c = tDSTAR;
16875 }
16876 else if (IS_BEG()) {
16877 c = tDSTAR;
16878 }
16879 else {
16880 c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
16881 }
16882 }
16883 else {
16884 if (c == '=') {
16885 set_yylval_id('*');
16886 SET_LEX_STATE(EXPR_BEG);
16887 return tOP_ASGN;
16888 }
16889 pushback(p, c);
16890 if (IS_SPCARG(c)) {
16891 rb_warning0("`*' interpreted as argument prefix");
16892 c = tSTAR;
16893 }
16894 else if (IS_BEG()) {
16895 c = tSTAR;
16896 }
16897 else {
16898 c = warn_balanced('*', "*", "argument prefix");
16899 }
16900 }
16901 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16902 return c;
16903
16904 case '!':
16905 c = nextc(p);
16906 if (IS_AFTER_OPERATOR()) {
16907 SET_LEX_STATE(EXPR_ARG);
16908 if (c == '@') {
16909 return '!';
16910 }
16911 }
16912 else {
16913 SET_LEX_STATE(EXPR_BEG);
16914 }
16915 if (c == '=') {
16916 return tNEQ;
16917 }
16918 if (c == '~') {
16919 return tNMATCH;
16920 }
16921 pushback(p, c);
16922 return '!';
16923
16924 case '=':
16925 if (was_bol(p)) {
16926 /* skip embedded rd document */
16927 if (word_match_p(p, "begin", 5)) {
16928 int first_p = TRUE;
16929
16930 lex_goto_eol(p);
16932 for (;;) {
16933 lex_goto_eol(p);
16934 if (!first_p) {
16936 }
16937 first_p = FALSE;
16938 c = nextc(p);
16939 if (c == -1) {
16940 compile_error(p, "embedded document meets end of file");
16941 return 0;
16942 }
16943 if (c == '=' && word_match_p(p, "end", 3)) {
16944 break;
16945 }
16946 pushback(p, c);
16947 }
16948 lex_goto_eol(p);
16950 goto retry;
16951 }
16952 }
16953
16954 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
16955 if ((c = nextc(p)) == '=') {
16956 if ((c = nextc(p)) == '=') {
16957 return tEQQ;
16958 }
16959 pushback(p, c);
16960 return tEQ;
16961 }
16962 if (c == '~') {
16963 return tMATCH;
16964 }
16965 else if (c == '>') {
16966 return tASSOC;
16967 }
16968 pushback(p, c);
16969 return '=';
16970
16971 case '<':
16972 c = nextc(p);
16973 if (c == '<' &&
16974 !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
16975 !IS_END() &&
16976 (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
16977 int token = heredoc_identifier(p);
16978 if (token) return token < 0 ? 0 : token;
16979 }
16980 if (IS_AFTER_OPERATOR()) {
16981 SET_LEX_STATE(EXPR_ARG);
16982 }
16983 else {
16984 if (IS_lex_state(EXPR_CLASS))
16985 p->command_start = TRUE;
16986 SET_LEX_STATE(EXPR_BEG);
16987 }
16988 if (c == '=') {
16989 if ((c = nextc(p)) == '>') {
16990 return tCMP;
16991 }
16992 pushback(p, c);
16993 return tLEQ;
16994 }
16995 if (c == '<') {
16996 if ((c = nextc(p)) == '=') {
16998 SET_LEX_STATE(EXPR_BEG);
16999 return tOP_ASGN;
17000 }
17001 pushback(p, c);
17002 return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
17003 }
17004 pushback(p, c);
17005 return '<';
17006
17007 case '>':
17008 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17009 if ((c = nextc(p)) == '=') {
17010 return tGEQ;
17011 }
17012 if (c == '>') {
17013 if ((c = nextc(p)) == '=') {
17015 SET_LEX_STATE(EXPR_BEG);
17016 return tOP_ASGN;
17017 }
17018 pushback(p, c);
17019 return tRSHFT;
17020 }
17021 pushback(p, c);
17022 return '>';
17023
17024 case '"':
17025 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
17026 p->lex.strterm = NEW_STRTERM(str_dquote | label, '"', 0);
17027 p->lex.ptok = p->lex.pcur-1;
17028 return tSTRING_BEG;
17029
17030 case '`':
17031 if (IS_lex_state(EXPR_FNAME)) {
17032 SET_LEX_STATE(EXPR_ENDFN);
17033 return c;
17034 }
17035 if (IS_lex_state(EXPR_DOT)) {
17036 if (cmd_state)
17037 SET_LEX_STATE(EXPR_CMDARG);
17038 else
17039 SET_LEX_STATE(EXPR_ARG);
17040 return c;
17041 }
17042 p->lex.strterm = NEW_STRTERM(str_xquote, '`', 0);
17043 return tXSTRING_BEG;
17044
17045 case '\'':
17046 label = (IS_LABEL_POSSIBLE() ? str_label : 0);
17047 p->lex.strterm = NEW_STRTERM(str_squote | label, '\'', 0);
17048 p->lex.ptok = p->lex.pcur-1;
17049 return tSTRING_BEG;
17050
17051 case '?':
17052 return parse_qmark(p, space_seen);
17053
17054 case '&':
17055 if ((c = nextc(p)) == '&') {
17056 SET_LEX_STATE(EXPR_BEG);
17057 if ((c = nextc(p)) == '=') {
17059 SET_LEX_STATE(EXPR_BEG);
17060 return tOP_ASGN;
17061 }
17062 pushback(p, c);
17063 return tANDOP;
17064 }
17065 else if (c == '=') {
17066 set_yylval_id('&');
17067 SET_LEX_STATE(EXPR_BEG);
17068 return tOP_ASGN;
17069 }
17070 else if (c == '.') {
17072 SET_LEX_STATE(EXPR_DOT);
17073 return tANDDOT;
17074 }
17075 pushback(p, c);
17076 if (IS_SPCARG(c)) {
17077 if ((c != ':') ||
17078 (c = peekc_n(p, 1)) == -1 ||
17079 !(c == '\'' || c == '"' ||
17080 is_identchar((p->lex.pcur+1), p->lex.pend, p->enc))) {
17081 rb_warning0("`&' interpreted as argument prefix");
17082 }
17083 c = tAMPER;
17084 }
17085 else if (IS_BEG()) {
17086 c = tAMPER;
17087 }
17088 else {
17089 c = warn_balanced('&', "&", "argument prefix");
17090 }
17091 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17092 return c;
17093
17094 case '|':
17095 if ((c = nextc(p)) == '|') {
17096 SET_LEX_STATE(EXPR_BEG);
17097 if ((c = nextc(p)) == '=') {
17099 SET_LEX_STATE(EXPR_BEG);
17100 return tOP_ASGN;
17101 }
17102 pushback(p, c);
17103 if (IS_lex_state_for(last_state, EXPR_BEG)) {
17104 c = '|';
17105 pushback(p, '|');
17106 return c;
17107 }
17108 return tOROP;
17109 }
17110 if (c == '=') {
17111 set_yylval_id('|');
17112 SET_LEX_STATE(EXPR_BEG);
17113 return tOP_ASGN;
17114 }
17115 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
17116 pushback(p, c);
17117 return '|';
17118
17119 case '+':
17120 c = nextc(p);
17121 if (IS_AFTER_OPERATOR()) {
17122 SET_LEX_STATE(EXPR_ARG);
17123 if (c == '@') {
17124 return tUPLUS;
17125 }
17126 pushback(p, c);
17127 return '+';
17128 }
17129 if (c == '=') {
17130 set_yylval_id('+');
17131 SET_LEX_STATE(EXPR_BEG);
17132 return tOP_ASGN;
17133 }
17134 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '+'))) {
17135 SET_LEX_STATE(EXPR_BEG);
17136 pushback(p, c);
17137 if (c != -1 && ISDIGIT(c)) {
17138 return parse_numeric(p, '+');
17139 }
17140 return tUPLUS;
17141 }
17142 SET_LEX_STATE(EXPR_BEG);
17143 pushback(p, c);
17144 return warn_balanced('+', "+", "unary operator");
17145
17146 case '-':
17147 c = nextc(p);
17148 if (IS_AFTER_OPERATOR()) {
17149 SET_LEX_STATE(EXPR_ARG);
17150 if (c == '@') {
17151 return tUMINUS;
17152 }
17153 pushback(p, c);
17154 return '-';
17155 }
17156 if (c == '=') {
17157 set_yylval_id('-');
17158 SET_LEX_STATE(EXPR_BEG);
17159 return tOP_ASGN;
17160 }
17161 if (c == '>') {
17162 SET_LEX_STATE(EXPR_ENDFN);
17163 return tLAMBDA;
17164 }
17165 if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous(p, '-'))) {
17166 SET_LEX_STATE(EXPR_BEG);
17167 pushback(p, c);
17168 if (c != -1 && ISDIGIT(c)) {
17169 return tUMINUS_NUM;
17170 }
17171 return tUMINUS;
17172 }
17173 SET_LEX_STATE(EXPR_BEG);
17174 pushback(p, c);
17175 return warn_balanced('-', "-", "unary operator");
17176
17177 case '.': {
17178 int is_beg = IS_BEG();
17179 SET_LEX_STATE(EXPR_BEG);
17180 if ((c = nextc(p)) == '.') {
17181 if ((c = nextc(p)) == '.') {
17182 if (p->lex.paren_nest == 0 && looking_at_eol_p(p)) {
17183 rb_warn0("... at EOL, should be parenthesized?");
17184 }
17185 else if (p->lex.lpar_beg >= 0 && p->lex.lpar_beg+1 == p->lex.paren_nest) {
17186 if (IS_lex_state_for(last_state, EXPR_LABEL))
17187 return tDOT3;
17188 }
17189 return is_beg ? tBDOT3 : tDOT3;
17190 }
17191 pushback(p, c);
17192 return is_beg ? tBDOT2 : tDOT2;
17193 }
17194 pushback(p, c);
17195 if (c != -1 && ISDIGIT(c)) {
17196 char prev = p->lex.pcur-1 > p->lex.pbeg ? *(p->lex.pcur-2) : 0;
17197 parse_numeric(p, '.');
17198 if (ISDIGIT(prev)) {
17199 yyerror0("unexpected fraction part after numeric literal");
17200 }
17201 else {
17202 yyerror0("no .<digit> floating literal anymore; put 0 before dot");
17203 }
17204 SET_LEX_STATE(EXPR_END);
17205 p->lex.ptok = p->lex.pcur;
17206 goto retry;
17207 }
17208 set_yylval_id('.');
17209 SET_LEX_STATE(EXPR_DOT);
17210 return '.';
17211 }
17212
17213 case '0': case '1': case '2': case '3': case '4':
17214 case '5': case '6': case '7': case '8': case '9':
17215 return parse_numeric(p, c);
17216
17217 case ')':
17218 COND_POP();
17219 CMDARG_POP();
17220 SET_LEX_STATE(EXPR_ENDFN);
17221 p->lex.paren_nest--;
17222 return c;
17223
17224 case ']':
17225 COND_POP();
17226 CMDARG_POP();
17227 SET_LEX_STATE(EXPR_END);
17228 p->lex.paren_nest--;
17229 return c;
17230
17231 case '}':
17232 /* tSTRING_DEND does COND_POP and CMDARG_POP in the yacc's rule */
17233 if (!p->lex.brace_nest--) return tSTRING_DEND;
17234 COND_POP();
17235 CMDARG_POP();
17236 SET_LEX_STATE(EXPR_END);
17237 p->lex.paren_nest--;
17238 return c;
17239
17240 case ':':
17241 c = nextc(p);
17242 if (c == ':') {
17243 if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
17244 SET_LEX_STATE(EXPR_BEG);
17245 return tCOLON3;
17246 }
17248 SET_LEX_STATE(EXPR_DOT);
17249 return tCOLON2;
17250 }
17251 if (IS_END() || ISSPACE(c) || c == '#') {
17252 pushback(p, c);
17253 c = warn_balanced(':', ":", "symbol literal");
17254 SET_LEX_STATE(EXPR_BEG);
17255 return c;
17256 }
17257 switch (c) {
17258 case '\'':
17259 p->lex.strterm = NEW_STRTERM(str_ssym, c, 0);
17260 break;
17261 case '"':
17262 p->lex.strterm = NEW_STRTERM(str_dsym, c, 0);
17263 break;
17264 default:
17265 pushback(p, c);
17266 break;
17267 }
17268 SET_LEX_STATE(EXPR_FNAME);
17269 return tSYMBEG;
17270
17271 case '/':
17272 if (IS_BEG()) {
17273 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
17274 return tREGEXP_BEG;
17275 }
17276 if ((c = nextc(p)) == '=') {
17277 set_yylval_id('/');
17278 SET_LEX_STATE(EXPR_BEG);
17279 return tOP_ASGN;
17280 }
17281 pushback(p, c);
17282 if (IS_SPCARG(c)) {
17283 arg_ambiguous(p, '/');
17284 p->lex.strterm = NEW_STRTERM(str_regexp, '/', 0);
17285 return tREGEXP_BEG;
17286 }
17287 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17288 return warn_balanced('/', "/", "regexp literal");
17289
17290 case '^':
17291 if ((c = nextc(p)) == '=') {
17292 set_yylval_id('^');
17293 SET_LEX_STATE(EXPR_BEG);
17294 return tOP_ASGN;
17295 }
17296 SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
17297 pushback(p, c);
17298 return '^';
17299
17300 case ';':
17301 SET_LEX_STATE(EXPR_BEG);
17302 p->command_start = TRUE;
17303 return ';';
17304
17305 case ',':
17306 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17307 return ',';
17308
17309 case '~':
17310 if (IS_AFTER_OPERATOR()) {
17311 if ((c = nextc(p)) != '@') {
17312 pushback(p, c);
17313 }
17314 SET_LEX_STATE(EXPR_ARG);
17315 }
17316 else {
17317 SET_LEX_STATE(EXPR_BEG);
17318 }
17319 return '~';
17320
17321 case '(':
17322 if (IS_BEG()) {
17323 c = tLPAREN;
17324 }
17325 else if (!space_seen) {
17326 /* foo( ... ) => method call, no ambiguity */
17327 }
17328 else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
17329 c = tLPAREN_ARG;
17330 }
17331 else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
17332 rb_warning0("parentheses after method name is interpreted as "
17333 "an argument list, not a decomposed argument");
17334 }
17335 p->lex.paren_nest++;
17336 COND_PUSH(0);
17337 CMDARG_PUSH(0);
17338 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17339 return c;
17340
17341 case '[':
17342 p->lex.paren_nest++;
17343 if (IS_AFTER_OPERATOR()) {
17344 if ((c = nextc(p)) == ']') {
17345 p->lex.paren_nest--;
17346 SET_LEX_STATE(EXPR_ARG);
17347 if ((c = nextc(p)) == '=') {
17348 return tASET;
17349 }
17350 pushback(p, c);
17351 return tAREF;
17352 }
17353 pushback(p, c);
17354 SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
17355 return '[';
17356 }
17357 else if (IS_BEG()) {
17358 c = tLBRACK;
17359 }
17360 else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
17361 c = tLBRACK;
17362 }
17363 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17364 COND_PUSH(0);
17365 CMDARG_PUSH(0);
17366 return c;
17367
17368 case '{':
17369 ++p->lex.brace_nest;
17370 if (lambda_beginning_p())
17371 c = tLAMBEG;
17372 else if (IS_lex_state(EXPR_LABELED))
17373 c = tLBRACE; /* hash */
17374 else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
17375 c = '{'; /* block (primary) */
17376 else if (IS_lex_state(EXPR_ENDARG))
17377 c = tLBRACE_ARG; /* block (expr) */
17378 else
17379 c = tLBRACE; /* hash */
17380 if (c != tLBRACE) {
17381 p->command_start = TRUE;
17382 SET_LEX_STATE(EXPR_BEG);
17383 }
17384 else {
17385 SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
17386 }
17387 ++p->lex.paren_nest; /* after lambda_beginning_p() */
17388 COND_PUSH(0);
17389 CMDARG_PUSH(0);
17390 return c;
17391
17392 case '\\':
17393 c = nextc(p);
17394 if (c == '\n') {
17395 space_seen = 1;
17397 goto retry; /* skip \\n */
17398 }
17399 if (c == ' ') return tSP;
17400 if (ISSPACE(c)) return c;
17401 pushback(p, c);
17402 return '\\';
17403
17404 case '%':
17405 return parse_percent(p, space_seen, last_state);
17406
17407 case '$':
17408 return parse_gvar(p, last_state);
17409
17410 case '@':
17411 return parse_atmark(p, last_state);
17412
17413 case '_':
17414 if (was_bol(p) && whole_match_p(p, "__END__", 7, 0)) {
17415 p->ruby__end__seen = 1;
17416 p->eofp = 1;
17417#ifndef RIPPER
17418 return -1;
17419#else
17420 lex_goto_eol(p);
17422 return 0;
17423#endif
17424 }
17425 newtok(p);
17426 break;
17427
17428 default:
17429 if (!parser_is_identchar(p)) {
17430 compile_error(p, "Invalid char `\\x%02X' in expression", c);
17431 token_flush(p);
17432 goto retry;
17433 }
17434
17435 newtok(p);
17436 break;
17437 }
17438
17439 return parse_ident(p, c, cmd_state);
17440}
17441
17442static enum yytokentype
17443yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *p)
17444{
17445 enum yytokentype t;
17446
17447 p->lval = lval;
17448 lval->val = Qundef;
17449 t = parser_yylex(p);
17450
17451 if (p->lex.strterm && (p->lex.strterm->flags & STRTERM_HEREDOC))
17453 else
17454 RUBY_SET_YYLLOC(*yylloc);
17455
17456 if (has_delayed_token(p))
17458 else if (t != 0)
17460
17461 return t;
17462}
17463
17464#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
17465
17466static NODE*
17467node_newnode(struct parser_params *p, enum node_type type, VALUE a0, VALUE a1, VALUE a2, const rb_code_location_t *loc)
17468{
17469 NODE *n = rb_ast_newnode(p->ast, type);
17470
17471 rb_node_init(n, type, a0, a1, a2);
17472
17473 nd_set_loc(n, loc);
17474 nd_set_node_id(n, parser_get_node_id(p));
17475 return n;
17476}
17477
17478static NODE *
17479nd_set_loc(NODE *nd, const YYLTYPE *loc)
17480{
17481 nd->nd_loc = *loc;
17482 nd_set_line(nd, loc->beg_pos.lineno);
17483 return nd;
17484}
17485
17486#ifndef RIPPER
17487static enum node_type
17488nodetype(NODE *node) /* for debug */
17489{
17490 return (enum node_type)nd_type(node);
17491}
17492
17493static int
17494nodeline(NODE *node)
17495{
17496 return nd_line(node);
17497}
17498
17499static NODE*
17500newline_node(NODE *node)
17501{
17502 if (node) {
17503 node = remove_begin(node);
17504 node->flags |= NODE_FL_NEWLINE;
17505 }
17506 return node;
17507}
17508
17509static void
17510fixpos(NODE *node, NODE *orig)
17511{
17512 if (!node) return;
17513 if (!orig) return;
17514 nd_set_line(node, nd_line(orig));
17515}
17516
17517static void
17518parser_warning(struct parser_params *p, NODE *node, const char *mesg)
17519{
17520 rb_compile_warning(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17521}
17522
17523static void
17524parser_warn(struct parser_params *p, NODE *node, const char *mesg)
17525{
17526 rb_compile_warn(p->ruby_sourcefile, nd_line(node), "%s", mesg);
17527}
17528
17529static NODE*
17530block_append(struct parser_params *p, NODE *head, NODE *tail)
17531{
17532 NODE *end, *h = head, *nd;
17533
17534 if (tail == 0) return head;
17535
17536 if (h == 0) return tail;
17537 switch (nd_type(h)) {
17538 case NODE_LIT:
17539 case NODE_STR:
17540 case NODE_SELF:
17541 case NODE_TRUE:
17542 case NODE_FALSE:
17543 case NODE_NIL:
17544 parser_warning(p, h, "unused literal ignored");
17545 return tail;
17546 default:
17547 h = end = NEW_BLOCK(head, &head->nd_loc);
17548 end->nd_end = end;
17549 head = end;
17550 break;
17551 case NODE_BLOCK:
17552 end = h->nd_end;
17553 break;
17554 }
17555
17556 nd = end->nd_head;
17557 switch (nd_type(nd)) {
17558 case NODE_RETURN:
17559 case NODE_BREAK:
17560 case NODE_NEXT:
17561 case NODE_REDO:
17562 case NODE_RETRY:
17563 if (RTEST(ruby_verbose)) {
17564 parser_warning(p, tail, "statement not reached");
17565 }
17566 break;
17567
17568 default:
17569 break;
17570 }
17571
17572 if (nd_type(tail) != NODE_BLOCK) {
17573 tail = NEW_BLOCK(tail, &tail->nd_loc);
17574 tail->nd_end = tail;
17575 }
17576 end->nd_next = tail;
17577 h->nd_end = tail->nd_end;
17578 nd_set_last_loc(head, nd_last_loc(tail));
17579 return head;
17580}
17581
17582/* append item to the list */
17583static NODE*
17584list_append(struct parser_params *p, NODE *list, NODE *item)
17585{
17586 NODE *last;
17587
17588 if (list == 0) return NEW_LIST(item, &item->nd_loc);
17589 if (list->nd_next) {
17590 last = list->nd_next->nd_end;
17591 }
17592 else {
17593 last = list;
17594 }
17595
17596 list->nd_alen += 1;
17597 last->nd_next = NEW_LIST(item, &item->nd_loc);
17598 list->nd_next->nd_end = last->nd_next;
17599
17600 nd_set_last_loc(list, nd_last_loc(item));
17601
17602 return list;
17603}
17604
17605/* concat two lists */
17606static NODE*
17607list_concat(NODE *head, NODE *tail)
17608{
17609 NODE *last;
17610
17611 if (head->nd_next) {
17612 last = head->nd_next->nd_end;
17613 }
17614 else {
17615 last = head;
17616 }
17617
17618 head->nd_alen += tail->nd_alen;
17619 last->nd_next = tail;
17620 if (tail->nd_next) {
17621 head->nd_next->nd_end = tail->nd_next->nd_end;
17622 }
17623 else {
17624 head->nd_next->nd_end = tail;
17625 }
17626
17627 nd_set_last_loc(head, nd_last_loc(tail));
17628
17629 return head;
17630}
17631
17632static int
17633literal_concat0(struct parser_params *p, VALUE head, VALUE tail)
17634{
17635 if (NIL_P(tail)) return 1;
17636 if (!rb_enc_compatible(head, tail)) {
17637 compile_error(p, "string literal encodings differ (%s / %s)",
17638 rb_enc_name(rb_enc_get(head)),
17639 rb_enc_name(rb_enc_get(tail)));
17640 rb_str_resize(head, 0);
17641 rb_str_resize(tail, 0);
17642 return 0;
17643 }
17644 rb_str_buf_append(head, tail);
17645 return 1;
17646}
17647
17648static VALUE
17649string_literal_head(enum node_type htype, NODE *head)
17650{
17651 if (htype != NODE_DSTR) return Qfalse;
17652 if (head->nd_next) {
17653 head = head->nd_next->nd_end->nd_head;
17654 if (!head || nd_type(head) != NODE_STR) return Qfalse;
17655 }
17656 const VALUE lit = head->nd_lit;
17657 ASSUME(lit != Qfalse);
17658 return lit;
17659}
17660
17661/* concat two string literals */
17662static NODE *
17663literal_concat(struct parser_params *p, NODE *head, NODE *tail, const YYLTYPE *loc)
17664{
17665 enum node_type htype;
17666 VALUE lit;
17667
17668 if (!head) return tail;
17669 if (!tail) return head;
17670
17671 htype = nd_type(head);
17672 if (htype == NODE_EVSTR) {
17673 head = new_dstr(p, head, loc);
17674 htype = NODE_DSTR;
17675 }
17676 if (p->heredoc_indent > 0) {
17677 switch (htype) {
17678 case NODE_STR:
17679 nd_set_type(head, NODE_DSTR);
17680 case NODE_DSTR:
17681 return list_append(p, head, tail);
17682 default:
17683 break;
17684 }
17685 }
17686 switch (nd_type(tail)) {
17687 case NODE_STR:
17688 if ((lit = string_literal_head(htype, head)) != Qfalse) {
17689 htype = NODE_STR;
17690 }
17691 else {
17692 lit = head->nd_lit;
17693 }
17694 if (htype == NODE_STR) {
17695 if (!literal_concat0(p, lit, tail->nd_lit)) {
17696 error:
17697 rb_discard_node(p, head);
17698 rb_discard_node(p, tail);
17699 return 0;
17700 }
17701 rb_discard_node(p, tail);
17702 }
17703 else {
17704 list_append(p, head, tail);
17705 }
17706 break;
17707
17708 case NODE_DSTR:
17709 if (htype == NODE_STR) {
17710 if (!literal_concat0(p, head->nd_lit, tail->nd_lit))
17711 goto error;
17712 tail->nd_lit = head->nd_lit;
17713 rb_discard_node(p, head);
17714 head = tail;
17715 }
17716 else if (NIL_P(tail->nd_lit)) {
17717 append:
17718 head->nd_alen += tail->nd_alen - 1;
17719 if (!head->nd_next) {
17720 head->nd_next = tail->nd_next;
17721 }
17722 else if (tail->nd_next) {
17723 head->nd_next->nd_end->nd_next = tail->nd_next;
17724 head->nd_next->nd_end = tail->nd_next->nd_end;
17725 }
17726 rb_discard_node(p, tail);
17727 }
17728 else if ((lit = string_literal_head(htype, head)) != Qfalse) {
17729 if (!literal_concat0(p, lit, tail->nd_lit))
17730 goto error;
17731 tail->nd_lit = Qnil;
17732 goto append;
17733 }
17734 else {
17735 list_concat(head, NEW_NODE(NODE_LIST, NEW_STR(tail->nd_lit, loc), tail->nd_alen, tail->nd_next, loc));
17736 }
17737 break;
17738
17739 case NODE_EVSTR:
17740 if (htype == NODE_STR) {
17741 nd_set_type(head, NODE_DSTR);
17742 head->nd_alen = 1;
17743 }
17744 list_append(p, head, tail);
17745 break;
17746 }
17747 return head;
17748}
17749
17750static NODE *
17751evstr2dstr(struct parser_params *p, NODE *node)
17752{
17753 if (nd_type(node) == NODE_EVSTR) {
17754 node = new_dstr(p, node, &node->nd_loc);
17755 }
17756 return node;
17757}
17758
17759static NODE *
17760new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
17761{
17762 NODE *head = node;
17763
17764 if (node) {
17765 switch (nd_type(node)) {
17766 case NODE_STR:
17767 nd_set_type(node, NODE_DSTR);
17768 case NODE_DSTR: case NODE_EVSTR:
17769 return node;
17770 }
17771 }
17772 return NEW_EVSTR(head, loc);
17773}
17774
17775static NODE *
17776new_dstr(struct parser_params *p, NODE *node, const YYLTYPE *loc)
17777{
17778 VALUE lit = STR_NEW0();
17779 NODE *dstr = NEW_DSTR(lit, loc);
17780 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
17781 return list_append(p, dstr, node);
17782}
17783
17784static NODE *
17785call_bin_op(struct parser_params *p, NODE *recv, ID id, NODE *arg1,
17786 const YYLTYPE *op_loc, const YYLTYPE *loc)
17787{
17788 NODE *expr;
17789 value_expr(recv);
17790 value_expr(arg1);
17791 expr = NEW_OPCALL(recv, id, NEW_LIST(arg1, &arg1->nd_loc), loc);
17792 nd_set_line(expr, op_loc->beg_pos.lineno);
17793 return expr;
17794}
17795
17796static NODE *
17797call_uni_op(struct parser_params *p, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *loc)
17798{
17799 NODE *opcall;
17800 value_expr(recv);
17801 opcall = NEW_OPCALL(recv, id, 0, loc);
17802 nd_set_line(opcall, op_loc->beg_pos.lineno);
17803 return opcall;
17804}
17805
17806static NODE *
17807new_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *op_loc, const YYLTYPE *loc)
17808{
17809 NODE *qcall = NEW_QCALL(atype, recv, mid, args, loc);
17810 nd_set_line(qcall, op_loc->beg_pos.lineno);
17811 return qcall;
17812}
17813
17814static NODE*
17815new_command_qcall(struct parser_params* p, ID atype, NODE *recv, ID mid, NODE *args, NODE *block, const YYLTYPE *op_loc, const YYLTYPE *loc)
17816{
17817 NODE *ret;
17818 if (block) block_dup_check(p, args, block);
17819 ret = new_qcall(p, atype, recv, mid, args, op_loc, loc);
17820 if (block) ret = method_add_block(p, ret, block, loc);
17821 fixpos(ret, recv);
17822 return ret;
17823}
17824
17825#define nd_once_body(node) (nd_type(node) == NODE_ONCE ? (node)->nd_body : node)
17826static NODE*
17827match_op(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *loc)
17828{
17829 NODE *n;
17830 int line = op_loc->beg_pos.lineno;
17831
17832 value_expr(node1);
17833 value_expr(node2);
17834 if (node1 && (n = nd_once_body(node1)) != 0) {
17835 switch (nd_type(n)) {
17836 case NODE_DREGX:
17837 {
17838 NODE *match = NEW_MATCH2(node1, node2, loc);
17839 nd_set_line(match, line);
17840 return match;
17841 }
17842
17843 case NODE_LIT:
17844 if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
17845 const VALUE lit = n->nd_lit;
17846 NODE *match = NEW_MATCH2(node1, node2, loc);
17847 match->nd_args = reg_named_capture_assign(p, lit, loc);
17848 nd_set_line(match, line);
17849 return match;
17850 }
17851 }
17852 }
17853
17854 if (node2 && (n = nd_once_body(node2)) != 0) {
17855 NODE *match3;
17856
17857 switch (nd_type(n)) {
17858 case NODE_LIT:
17859 if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
17860 /* fallthru */
17861 case NODE_DREGX:
17862 match3 = NEW_MATCH3(node2, node1, loc);
17863 return match3;
17864 }
17865 }
17866
17867 n = NEW_CALL(node1, tMATCH, NEW_LIST(node2, &node2->nd_loc), loc);
17868 nd_set_line(n, line);
17869 return n;
17870}
17871
17872# if WARN_PAST_SCOPE
17873static int
17874past_dvar_p(struct parser_params *p, ID id)
17875{
17876 struct vtable *past = p->lvtbl->past;
17877 while (past) {
17878 if (vtable_included(past, id)) return 1;
17879 past = past->prev;
17880 }
17881 return 0;
17882}
17883# endif
17884
17885static int
17886numparam_nested_p(struct parser_params *p)
17887{
17888 struct local_vars *local = p->lvtbl;
17889 NODE *outer = local->numparam.outer;
17890 NODE *inner = local->numparam.inner;
17891 if (outer || inner) {
17892 NODE *used = outer ? outer : inner;
17893 compile_error(p, "numbered parameter is already used in\n"
17894 "%s:%d: %s block here",
17896 outer ? "outer" : "inner");
17897 parser_show_error_line(p, &used->nd_loc);
17898 return 1;
17899 }
17900 return 0;
17901}
17902
17903static NODE*
17904gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
17905{
17906 ID *vidp = NULL;
17907 NODE *node;
17908 switch (id) {
17909 case keyword_self:
17910 return NEW_SELF(loc);
17911 case keyword_nil:
17912 return NEW_NIL(loc);
17913 case keyword_true:
17914 return NEW_TRUE(loc);
17915 case keyword_false:
17916 return NEW_FALSE(loc);
17917 case keyword__FILE__:
17918 {
17920 if (NIL_P(file))
17921 file = rb_str_new(0, 0);
17922 else
17923 file = rb_str_dup(file);
17924 node = NEW_STR(file, loc);
17926 }
17927 return node;
17928 case keyword__LINE__:
17929 return NEW_LIT(INT2FIX(p->tokline), loc);
17931 node = NEW_LIT(rb_enc_from_encoding(p->enc), loc);
17932 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
17933 return node;
17934
17935 }
17936 switch (id_type(id)) {
17937 case ID_LOCAL:
17938 if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
17939 if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
17940 if (id == p->cur_arg) {
17941 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
17942 return 0;
17943 }
17944 if (vidp) *vidp |= LVAR_USED;
17945 node = NEW_DVAR(id, loc);
17946 return node;
17947 }
17948 if (local_id_ref(p, id, &vidp)) {
17949 if (id == p->cur_arg) {
17950 compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
17951 return 0;
17952 }
17953 if (vidp) *vidp |= LVAR_USED;
17954 node = NEW_LVAR(id, loc);
17955 return node;
17956 }
17957 if (dyna_in_block(p) && NUMPARAM_ID_P(id) &&
17958 parser_numbered_param(p, NUMPARAM_ID_TO_IDX(id))) {
17959 if (numparam_nested_p(p)) return 0;
17960 node = NEW_DVAR(id, loc);
17961 struct local_vars *local = p->lvtbl;
17962 if (!local->numparam.current) local->numparam.current = node;
17963 return node;
17964 }
17965# if WARN_PAST_SCOPE
17966 if (!p->ctxt.in_defined && RTEST(ruby_verbose) && past_dvar_p(p, id)) {
17967 rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
17968 }
17969# endif
17970 /* method call without arguments */
17971 return NEW_VCALL(id, loc);
17972 case ID_GLOBAL:
17973 return NEW_GVAR(id, loc);
17974 case ID_INSTANCE:
17975 return NEW_IVAR(id, loc);
17976 case ID_CONST:
17977 return NEW_CONST(id, loc);
17978 case ID_CLASS:
17979 return NEW_CVAR(id, loc);
17980 }
17981 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
17982 return 0;
17983}
17984
17985static NODE *
17986opt_arg_append(NODE *opt_list, NODE *opt)
17987{
17988 NODE *opts = opt_list;
17989 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
17990
17991 while (opts->nd_next) {
17992 opts = opts->nd_next;
17993 opts->nd_loc.end_pos = opt->nd_loc.end_pos;
17994 }
17995 opts->nd_next = opt;
17996
17997 return opt_list;
17998}
17999
18000static NODE *
18001kwd_append(NODE *kwlist, NODE *kw)
18002{
18003 if (kwlist) {
18004 NODE *kws = kwlist;
18005 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
18006 while (kws->nd_next) {
18007 kws = kws->nd_next;
18008 kws->nd_loc.end_pos = kw->nd_loc.end_pos;
18009 }
18010 kws->nd_next = kw;
18011 }
18012 return kwlist;
18013}
18014
18015static NODE *
18016new_defined(struct parser_params *p, NODE *expr, const YYLTYPE *loc)
18017{
18018 return NEW_DEFINED(remove_begin_all(expr), loc);
18019}
18020
18021static NODE*
18022symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
18023{
18024 enum node_type type = nd_type(symbol);
18025 switch (type) {
18026 case NODE_DSTR:
18027 nd_set_type(symbol, NODE_DSYM);
18028 break;
18029 case NODE_STR:
18030 nd_set_type(symbol, NODE_LIT);
18031 RB_OBJ_WRITTEN(p->ast, Qnil, symbol->nd_lit = rb_str_intern(symbol->nd_lit));
18032 break;
18033 default:
18034 compile_error(p, "unexpected node as symbol: %s", ruby_node_name(type));
18035 }
18036 return list_append(p, symbols, symbol);
18037}
18038
18039static NODE *
18040new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
18041{
18042 NODE *list, *prev;
18043 VALUE lit;
18044
18045 if (!node) {
18046 node = NEW_LIT(reg_compile(p, STR_NEW0(), options), loc);
18047 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit);
18048 return node;
18049 }
18050 switch (nd_type(node)) {
18051 case NODE_STR:
18052 {
18053 VALUE src = node->nd_lit;
18054 nd_set_type(node, NODE_LIT);
18055 nd_set_loc(node, loc);
18056 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
18057 }
18058 break;
18059 default:
18060 lit = STR_NEW0();
18061 node = NEW_NODE(NODE_DSTR, lit, 1, NEW_LIST(node, loc), loc);
18062 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18063 /* fall through */
18064 case NODE_DSTR:
18065 nd_set_type(node, NODE_DREGX);
18066 nd_set_loc(node, loc);
18067 node->nd_cflag = options & RE_OPTION_MASK;
18068 if (!NIL_P(node->nd_lit)) reg_fragment_check(p, node->nd_lit, options);
18069 for (list = (prev = node)->nd_next; list; list = list->nd_next) {
18070 NODE *frag = list->nd_head;
18071 enum node_type type = nd_type(frag);
18072 if (type == NODE_STR || (type == NODE_DSTR && !frag->nd_next)) {
18073 VALUE tail = frag->nd_lit;
18074 if (reg_fragment_check(p, tail, options) && prev && !NIL_P(prev->nd_lit)) {
18075 VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
18076 if (!literal_concat0(p, lit, tail)) {
18077 return NEW_NIL(loc); /* dummy node on error */
18078 }
18079 rb_str_resize(tail, 0);
18080 prev->nd_next = list->nd_next;
18081 rb_discard_node(p, list->nd_head);
18082 rb_discard_node(p, list);
18083 list = prev;
18084 }
18085 else {
18086 prev = list;
18087 }
18088 }
18089 else {
18090 prev = 0;
18091 }
18092 }
18093 if (!node->nd_next) {
18094 VALUE src = node->nd_lit;
18095 nd_set_type(node, NODE_LIT);
18096 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = reg_compile(p, src, options));
18097 }
18098 if (options & RE_OPTION_ONCE) {
18099 node = NEW_NODE(NODE_ONCE, 0, node, 0, loc);
18100 }
18101 break;
18102 }
18103 return node;
18104}
18105
18106static NODE *
18107new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc)
18108{
18109 if (!k) return 0;
18110 return NEW_KW_ARG(0, (k), loc);
18111}
18112
18113static NODE *
18114new_xstring(struct parser_params *p, NODE *node, const YYLTYPE *loc)
18115{
18116 if (!node) {
18117 VALUE lit = STR_NEW0();
18118 NODE *xstr = NEW_XSTR(lit, loc);
18119 RB_OBJ_WRITTEN(p->ast, Qnil, lit);
18120 return xstr;
18121 }
18122 switch (nd_type(node)) {
18123 case NODE_STR:
18124 nd_set_type(node, NODE_XSTR);
18125 nd_set_loc(node, loc);
18126 break;
18127 case NODE_DSTR:
18128 nd_set_type(node, NODE_DXSTR);
18129 nd_set_loc(node, loc);
18130 break;
18131 default:
18132 node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node, loc), loc);
18133 break;
18134 }
18135 return node;
18136}
18137
18138static void
18139check_literal_when(struct parser_params *p, NODE *arg, const YYLTYPE *loc)
18140{
18141 VALUE lit;
18142
18143 if (!arg || !p->case_labels) return;
18144
18146 if (lit == Qundef) return;
18147 if (nd_type(arg) == NODE_STR) {
18148 RB_OBJ_WRITTEN(p->ast, Qnil, arg->nd_lit = lit);
18149 }
18150
18151 if (NIL_P(p->case_labels)) {
18153 }
18154 else {
18155 VALUE line = rb_hash_lookup(p->case_labels, lit);
18156 if (!NIL_P(line)) {
18157 rb_warning1("duplicated `when' clause with line %d is ignored",
18158 WARN_IVAL(line));
18159 return;
18160 }
18161 }
18163}
18164
18165#else /* !RIPPER */
18166static int
18167id_is_var(struct parser_params *p, ID id)
18168{
18169 if (is_notop_id(id)) {
18170 switch (id & ID_SCOPE_MASK) {
18171 case ID_GLOBAL: case ID_INSTANCE: case ID_CONST: case ID_CLASS:
18172 return 1;
18173 case ID_LOCAL:
18174 if (dyna_in_block(p)) {
18175 if (NUMPARAM_ID_P(id) || dvar_defined(p, id)) return 1;
18176 }
18177 if (local_id(p, id)) return 1;
18178 /* method call without arguments */
18179 return 0;
18180 }
18181 }
18182 compile_error(p, "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
18183 return 0;
18184}
18185
18186static VALUE
18187new_regexp(struct parser_params *p, VALUE re, VALUE opt, const YYLTYPE *loc)
18188{
18189 VALUE src = 0, err;
18190 int options = 0;
18191 if (ripper_is_node_yylval(re)) {
18192 src = RNODE(re)->nd_cval;
18193 re = RNODE(re)->nd_rval;
18194 }
18195 if (ripper_is_node_yylval(opt)) {
18196 options = (int)RNODE(opt)->nd_tag;
18197 opt = RNODE(opt)->nd_rval;
18198 }
18199 if (src && NIL_P(parser_reg_compile(p, src, options, &err))) {
18200 compile_error(p, "%"PRIsVALUE, err);
18201 }
18202 return dispatch2(regexp_literal, re, opt);
18203}
18204#endif /* !RIPPER */
18205
18206
18207#ifndef RIPPER
18208static const char rb_parser_lex_state_names[][8] = {
18209 "BEG", "END", "ENDARG", "ENDFN", "ARG",
18210 "CMDARG", "MID", "FNAME", "DOT", "CLASS",
18211 "LABEL", "LABELED","FITEM",
18212};
18213
18214static VALUE
18215append_lex_state_name(enum lex_state_e state, VALUE buf)
18216{
18217 int i, sep = 0;
18218 unsigned int mask = 1;
18219 static const char none[] = "NONE";
18220
18221 for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
18222 if ((unsigned)state & mask) {
18223 if (sep) {
18224 rb_str_cat(buf, "|", 1);
18225 }
18226 sep = 1;
18227 rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
18228 }
18229 }
18230 if (!sep) {
18231 rb_str_cat(buf, none, sizeof(none)-1);
18232 }
18233 return buf;
18234}
18235
18236static void
18237flush_debug_buffer(struct parser_params *p, VALUE out, VALUE str)
18238{
18239 VALUE mesg = p->debug_buffer;
18240
18241 if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
18242 p->debug_buffer = Qnil;
18243 rb_io_puts(1, &mesg, out);
18244 }
18245 if (!NIL_P(str) && RSTRING_LEN(str)) {
18247 }
18248}
18249
18250enum lex_state_e
18252 enum lex_state_e to, int line)
18253{
18254 VALUE mesg;
18255 mesg = rb_str_new_cstr("lex_state: ");
18256 append_lex_state_name(from, mesg);
18257 rb_str_cat_cstr(mesg, " -> ");
18258 append_lex_state_name(to, mesg);
18259 rb_str_catf(mesg, " at line %d\n", line);
18260 flush_debug_buffer(p, p->debug_output, mesg);
18261 return to;
18262}
18263
18264VALUE
18266{
18267 return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
18268}
18269
18270static void
18271append_bitstack_value(stack_type stack, VALUE mesg)
18272{
18273 if (stack == 0) {
18274 rb_str_cat_cstr(mesg, "0");
18275 }
18276 else {
18277 stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
18278 for (; mask && !(stack & mask); mask >>= 1) continue;
18279 for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
18280 }
18281}
18282
18283void
18285 const char *name, int line)
18286{
18287 VALUE mesg = rb_sprintf("%s: ", name);
18288 append_bitstack_value(stack, mesg);
18289 rb_str_catf(mesg, " at line %d\n", line);
18290 flush_debug_buffer(p, p->debug_output, mesg);
18291}
18292
18293void
18294rb_parser_fatal(struct parser_params *p, const char *fmt, ...)
18295{
18296 va_list ap;
18297 VALUE mesg = rb_str_new_cstr("internal parser error: ");
18298
18299 va_start(ap, fmt);
18300 rb_str_vcatf(mesg, fmt, ap);
18301 va_end(ap);
18302 parser_yyerror(p, NULL, RSTRING_PTR(mesg));
18303 RB_GC_GUARD(mesg);
18304
18305 mesg = rb_str_new(0, 0);
18306 append_lex_state_name(p->lex.state, mesg);
18307 compile_error(p, "lex.state: %"PRIsVALUE, mesg);
18308 rb_str_resize(mesg, 0);
18309 append_bitstack_value(p->cond_stack, mesg);
18310 compile_error(p, "cond_stack: %"PRIsVALUE, mesg);
18311 rb_str_resize(mesg, 0);
18312 append_bitstack_value(p->cmdarg_stack, mesg);
18313 compile_error(p, "cmdarg_stack: %"PRIsVALUE, mesg);
18314 if (p->debug_output == rb_ractor_stdout())
18316 p->debug = TRUE;
18317}
18318
18319YYLTYPE *
18321{
18322 int sourceline = here->sourceline;
18323 int beg_pos = (int)here->offset - here->quote
18324 - (rb_strlen_lit("<<-") - !(here->func & STR_FUNC_INDENT));
18325 int end_pos = (int)here->offset + here->length + here->quote;
18326
18327 yylloc->beg_pos.lineno = sourceline;
18328 yylloc->beg_pos.column = beg_pos;
18329 yylloc->end_pos.lineno = sourceline;
18330 yylloc->end_pos.column = end_pos;
18331 return yylloc;
18332}
18333
18334YYLTYPE *
18336{
18337 yylloc->beg_pos.lineno = p->ruby_sourceline;
18338 yylloc->beg_pos.column = (int)(p->lex.ptok - p->lex.pbeg);
18339 yylloc->end_pos.lineno = p->ruby_sourceline;
18340 yylloc->end_pos.column = (int)(p->lex.ptok - p->lex.pbeg);
18341 return yylloc;
18342}
18343
18344YYLTYPE *
18346{
18347 yylloc->beg_pos.lineno = p->ruby_sourceline;
18348 yylloc->beg_pos.column = (int)(p->lex.ptok - p->lex.pbeg);
18349 yylloc->end_pos.lineno = p->ruby_sourceline;
18350 yylloc->end_pos.column = (int)(p->lex.pcur - p->lex.pbeg);
18351 return yylloc;
18352}
18353#endif /* !RIPPER */
18354
18355static void
18356parser_token_value_print(struct parser_params *p, enum yytokentype type, const YYSTYPE *valp)
18357{
18358 VALUE v;
18359
18360 switch (type) {
18361 case tIDENTIFIER: case tFID: case tGVAR: case tIVAR:
18362 case tCONSTANT: case tCVAR: case tLABEL: case tOP_ASGN:
18363#ifndef RIPPER
18364 v = rb_id2str(valp->id);
18365#else
18366 v = valp->node->nd_rval;
18367#endif
18368 rb_parser_printf(p, "%"PRIsVALUE, v);
18369 break;
18370 case tINTEGER: case tFLOAT: case tRATIONAL: case tIMAGINARY:
18371 case tSTRING_CONTENT: case tCHAR:
18372#ifndef RIPPER
18373 v = valp->node->nd_lit;
18374#else
18375 v = valp->val;
18376#endif
18377 rb_parser_printf(p, "%+"PRIsVALUE, v);
18378 break;
18379 case tNTH_REF:
18380#ifndef RIPPER
18381 rb_parser_printf(p, "$%ld", valp->node->nd_nth);
18382#else
18383 rb_parser_printf(p, "%"PRIsVALUE, valp->val);
18384#endif
18385 break;
18386 case tBACK_REF:
18387#ifndef RIPPER
18388 rb_parser_printf(p, "$%c", (int)valp->node->nd_nth);
18389#else
18390 rb_parser_printf(p, "%"PRIsVALUE, valp->val);
18391#endif
18392 break;
18393 default:
18394 break;
18395 }
18396}
18397
18398static int
18399assignable0(struct parser_params *p, ID id, const char **err)
18400{
18401 if (!id) return -1;
18402 switch (id) {
18403 case keyword_self:
18404 *err = "Can't change the value of self";
18405 return -1;
18406 case keyword_nil:
18407 *err = "Can't assign to nil";
18408 return -1;
18409 case keyword_true:
18410 *err = "Can't assign to true";
18411 return -1;
18412 case keyword_false:
18413 *err = "Can't assign to false";
18414 return -1;
18415 case keyword__FILE__:
18416 *err = "Can't assign to __FILE__";
18417 return -1;
18418 case keyword__LINE__:
18419 *err = "Can't assign to __LINE__";
18420 return -1;
18422 *err = "Can't assign to __ENCODING__";
18423 return -1;
18424 }
18425 switch (id_type(id)) {
18426 case ID_LOCAL:
18427 if (dyna_in_block(p)) {
18428 if (p->max_numparam > NO_PARAM && NUMPARAM_ID_P(id)) {
18429 compile_error(p, "Can't assign to numbered parameter _%d",
18430 NUMPARAM_ID_TO_IDX(id));
18431 return -1;
18432 }
18433 if (dvar_curr(p, id)) return NODE_DASGN_CURR;
18434 if (dvar_defined(p, id)) return NODE_DASGN;
18435 if (local_id(p, id)) return NODE_LASGN;
18436 dyna_var(p, id);
18437 return NODE_DASGN_CURR;
18438 }
18439 else {
18440 if (!local_id(p, id)) local_var(p, id);
18441 return NODE_LASGN;
18442 }
18443 break;
18444 case ID_GLOBAL: return NODE_GASGN;
18445 case ID_INSTANCE: return NODE_IASGN;
18446 case ID_CONST:
18447 if (!p->ctxt.in_def) return NODE_CDECL;
18448 *err = "dynamic constant assignment";
18449 return -1;
18450 case ID_CLASS: return NODE_CVASGN;
18451 default:
18452 compile_error(p, "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
18453 }
18454 return -1;
18455}
18456
18457#ifndef RIPPER
18458static NODE*
18459assignable(struct parser_params *p, ID id, NODE *val, const YYLTYPE *loc)
18460{
18461 const char *err = 0;
18462 int node_type = assignable0(p, id, &err);
18463 switch (node_type) {
18464 case NODE_DASGN_CURR: return NEW_DASGN_CURR(id, val, loc);
18465 case NODE_DASGN: return NEW_DASGN(id, val, loc);
18466 case NODE_LASGN: return NEW_LASGN(id, val, loc);
18467 case NODE_GASGN: return NEW_GASGN(id, val, loc);
18468 case NODE_IASGN: return NEW_IASGN(id, val, loc);
18469 case NODE_CDECL: return NEW_CDECL(id, val, 0, loc);
18470 case NODE_CVASGN: return NEW_CVASGN(id, val, loc);
18471 }
18472 if (err) yyerror1(loc, err);
18473 return NEW_BEGIN(0, loc);
18474}
18475#else
18476static VALUE
18477assignable(struct parser_params *p, VALUE lhs)
18478{
18479 const char *err = 0;
18480 assignable0(p, get_id(lhs), &err);
18481 if (err) lhs = assign_error(p, err, lhs);
18482 return lhs;
18483}
18484#endif
18485
18486static int
18487is_private_local_id(ID name)
18488{
18489 VALUE s;
18490 if (name == idUScore) return 1;
18491 if (!is_local_id(name)) return 0;
18492 s = rb_id2str(name);
18493 if (!s) return 0;
18494 return RSTRING_PTR(s)[0] == '_';
18495}
18496
18497static int
18498shadowing_lvar_0(struct parser_params *p, ID name)
18499{
18500 if (is_private_local_id(name)) return 1;
18501 if (dyna_in_block(p)) {
18502 if (dvar_curr(p, name)) {
18503 yyerror0("duplicated argument name");
18504 }
18505 else if (dvar_defined(p, name) || local_id(p, name)) {
18506 vtable_add(p->lvtbl->vars, name);
18507 if (p->lvtbl->used) {
18509 }
18510 return 0;
18511 }
18512 }
18513 else {
18514 if (local_id(p, name)) {
18515 yyerror0("duplicated argument name");
18516 }
18517 }
18518 return 1;
18519}
18520
18521static ID
18522shadowing_lvar(struct parser_params *p, ID name)
18523{
18524 shadowing_lvar_0(p, name);
18525 return name;
18526}
18527
18528static void
18529new_bv(struct parser_params *p, ID name)
18530{
18531 if (!name) return;
18532 if (!is_local_id(name)) {
18533 compile_error(p, "invalid local variable - %"PRIsVALUE,
18534 rb_id2str(name));
18535 return;
18536 }
18537 if (!shadowing_lvar_0(p, name)) return;
18538 dyna_var(p, name);
18539}
18540
18541#ifndef RIPPER
18542static NODE *
18543aryset(struct parser_params *p, NODE *recv, NODE *idx, const YYLTYPE *loc)
18544{
18545 return NEW_ATTRASGN(recv, tASET, idx, loc);
18546}
18547
18548static void
18549block_dup_check(struct parser_params *p, NODE *node1, NODE *node2)
18550{
18551 if (node2 && node1 && nd_type(node1) == NODE_BLOCK_PASS) {
18552 compile_error(p, "both block arg and actual block given");
18553 }
18554}
18555
18556static NODE *
18557attrset(struct parser_params *p, NODE *recv, ID atype, ID id, const YYLTYPE *loc)
18558{
18559 if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
18560 return NEW_ATTRASGN(recv, id, 0, loc);
18561}
18562
18563static void
18564rb_backref_error(struct parser_params *p, NODE *node)
18565{
18566 switch (nd_type(node)) {
18567 case NODE_NTH_REF:
18568 compile_error(p, "Can't set variable $%ld", node->nd_nth);
18569 break;
18570 case NODE_BACK_REF:
18571 compile_error(p, "Can't set variable $%c", (int)node->nd_nth);
18572 break;
18573 }
18574}
18575#else
18576static VALUE
18577backref_error(struct parser_params *p, NODE *ref, VALUE expr)
18578{
18579 VALUE mesg = rb_str_new_cstr("Can't set variable ");
18580 rb_str_append(mesg, ref->nd_cval);
18581 return dispatch2(assign_error, mesg, expr);
18582}
18583#endif
18584
18585#ifndef RIPPER
18586static NODE *
18587arg_append(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18588{
18589 if (!node1) return NEW_LIST(node2, &node2->nd_loc);
18590 switch (nd_type(node1)) {
18591 case NODE_LIST:
18592 return list_append(p, node1, node2);
18593 case NODE_BLOCK_PASS:
18594 node1->nd_head = arg_append(p, node1->nd_head, node2, loc);
18595 node1->nd_loc.end_pos = node1->nd_head->nd_loc.end_pos;
18596 return node1;
18597 case NODE_ARGSPUSH:
18598 node1->nd_body = list_append(p, NEW_LIST(node1->nd_body, &node1->nd_body->nd_loc), node2);
18599 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18600 nd_set_type(node1, NODE_ARGSCAT);
18601 return node1;
18602 case NODE_ARGSCAT:
18603 if (nd_type(node1->nd_body) != NODE_LIST) break;
18604 node1->nd_body = list_append(p, node1->nd_body, node2);
18605 node1->nd_loc.end_pos = node1->nd_body->nd_loc.end_pos;
18606 return node1;
18607 }
18608 return NEW_ARGSPUSH(node1, node2, loc);
18609}
18610
18611static NODE *
18612arg_concat(struct parser_params *p, NODE *node1, NODE *node2, const YYLTYPE *loc)
18613{
18614 if (!node2) return node1;
18615 switch (nd_type(node1)) {
18616 case NODE_BLOCK_PASS:
18617 if (node1->nd_head)
18618 node1->nd_head = arg_concat(p, node1->nd_head, node2, loc);
18619 else
18620 node1->nd_head = NEW_LIST(node2, loc);
18621 return node1;
18622 case NODE_ARGSPUSH:
18623 if (nd_type(node2) != NODE_LIST) break;
18624 node1->nd_body = list_concat(NEW_LIST(node1->nd_body, loc), node2);
18625 nd_set_type(node1, NODE_ARGSCAT);
18626 return node1;
18627 case NODE_ARGSCAT:
18628 if (nd_type(node2) != NODE_LIST ||
18629 nd_type(node1->nd_body) != NODE_LIST) break;
18630 node1->nd_body = list_concat(node1->nd_body, node2);
18631 return node1;
18632 }
18633 return NEW_ARGSCAT(node1, node2, loc);
18634}
18635
18636static NODE *
18637last_arg_append(struct parser_params *p, NODE *args, NODE *last_arg, const YYLTYPE *loc)
18638{
18639 NODE *n1;
18640 if ((n1 = splat_array(args)) != 0) {
18641 return list_append(p, n1, last_arg);
18642 }
18643 return arg_append(p, args, last_arg, loc);
18644}
18645
18646static NODE *
18647rest_arg_append(struct parser_params *p, NODE *args, NODE *rest_arg, const YYLTYPE *loc)
18648{
18649 NODE *n1;
18650 if ((nd_type(rest_arg) == NODE_LIST) && (n1 = splat_array(args)) != 0) {
18651 return list_concat(n1, rest_arg);
18652 }
18653 return arg_concat(p, args, rest_arg, loc);
18654}
18655
18656static NODE *
18657splat_array(NODE* node)
18658{
18659 if (nd_type(node) == NODE_SPLAT) node = node->nd_head;
18660 if (nd_type(node) == NODE_LIST) return node;
18661 return 0;
18662}
18663
18664static void
18665mark_lvar_used(struct parser_params *p, NODE *rhs)
18666{
18667 ID *vidp = NULL;
18668 if (!rhs) return;
18669 switch (nd_type(rhs)) {
18670 case NODE_LASGN:
18671 if (local_id_ref(p, rhs->nd_vid, &vidp)) {
18672 if (vidp) *vidp |= LVAR_USED;
18673 }
18674 break;
18675 case NODE_DASGN:
18676 case NODE_DASGN_CURR:
18677 if (dvar_defined_ref(p, rhs->nd_vid, &vidp)) {
18678 if (vidp) *vidp |= LVAR_USED;
18679 }
18680 break;
18681#if 0
18682 case NODE_MASGN:
18683 for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
18684 mark_lvar_used(p, rhs->nd_head);
18685 }
18686 break;
18687#endif
18688 }
18689}
18690
18691static NODE *
18692const_decl_path(struct parser_params *p, NODE **dest)
18693{
18694 NODE *n = *dest;
18695 if (nd_type(n) != NODE_CALL) {
18696 const YYLTYPE *loc = &n->nd_loc;
18697 VALUE path;
18698 if (n->nd_vid) {
18699 path = rb_id2str(n->nd_vid);
18700 }
18701 else {
18702 n = n->nd_else;
18703 path = rb_ary_new();
18704 for (; n && nd_type(n) == NODE_COLON2; n = n->nd_head) {
18705 rb_ary_push(path, rb_id2str(n->nd_mid));
18706 }
18707 if (n && nd_type(n) == NODE_CONST) {
18708 // Const::Name
18709 rb_ary_push(path, rb_id2str(n->nd_vid));
18710 }
18711 else if (n && nd_type(n) == NODE_COLON3) {
18712 // ::Const::Name
18713 rb_ary_push(path, rb_str_new(0, 0));
18714 }
18715 else {
18716 // expression::Name
18717 rb_ary_push(path, rb_str_new_cstr("..."));
18718 }
18719 path = rb_ary_join(rb_ary_reverse(path), rb_str_new_cstr("::"));
18720 path = rb_fstring(path);
18721 }
18722 *dest = n = NEW_LIT(path, loc);
18723 }
18724 return n;
18725}
18726
18728
18729static NODE *
18730make_shareable_node(struct parser_params *p, NODE *value, bool copy, const YYLTYPE *loc)
18731{
18732 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
18733
18734 if (copy) {
18735 return NEW_CALL(fcore, rb_intern("make_shareable_copy"),
18736 NEW_LIST(value, loc), loc);
18737 }
18738 else {
18739 return NEW_CALL(fcore, rb_intern("make_shareable"),
18740 NEW_LIST(value, loc), loc);
18741 }
18742}
18743
18744static NODE *
18745ensure_shareable_node(struct parser_params *p, NODE **dest, NODE *value, const YYLTYPE *loc)
18746{
18747 NODE *fcore = NEW_LIT(rb_mRubyVMFrozenCore, loc);
18748 NODE *args = NEW_LIST(value, loc);
18749 args = list_append(p, args, const_decl_path(p, dest));
18750 return NEW_CALL(fcore, rb_intern("ensure_shareable"), args, loc);
18751}
18752
18753static int is_static_content(NODE *node);
18754
18755static VALUE
18756shareable_literal_value(NODE *node)
18757{
18758 if (!node) return Qnil;
18759 enum node_type type = nd_type(node);
18760 switch (type) {
18761 case NODE_TRUE:
18762 return Qtrue;
18763 case NODE_FALSE:
18764 return Qfalse;
18765 case NODE_NIL:
18766 return Qnil;
18767 case NODE_LIT:
18768 return node->nd_lit;
18769 default:
18770 return Qundef;
18771 }
18772}
18773
18774#ifndef SHAREABLE_BARE_EXPRESSION
18775#define SHAREABLE_BARE_EXPRESSION 1
18776#endif
18777
18778static NODE *
18779shareable_literal_constant(struct parser_params *p, enum shareability shareable,
18780 NODE **dest, NODE *value, const YYLTYPE *loc, size_t level)
18781{
18782# define shareable_literal_constant_next(n) \
18783 shareable_literal_constant(p, shareable, dest, (n), &(n)->nd_loc, level+1)
18784 VALUE lit = Qnil;
18785
18786 if (!value) return 0;
18787 enum node_type type = nd_type(value);
18788 switch (type) {
18789 case NODE_TRUE:
18790 case NODE_FALSE:
18791 case NODE_NIL:
18792 case NODE_LIT:
18793 return value;
18794
18795 case NODE_DSTR:
18796 if (shareable == shareable_literal) {
18797 value = NEW_CALL(value, idUMinus, 0, loc);
18798 }
18799 return value;
18800
18801 case NODE_STR:
18802 lit = rb_fstring(value->nd_lit);
18803 nd_set_type(value, NODE_LIT);
18804 RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
18805 return value;
18806
18807 case NODE_ZLIST:
18808 lit = rb_ary_new();
18809 OBJ_FREEZE_RAW(lit);
18810 return NEW_LIT(lit, loc);
18811
18812 case NODE_LIST:
18813 lit = rb_ary_new();
18814 for (NODE *n = value; n; n = n->nd_next) {
18815 NODE *elt = n->nd_head;
18816 if (elt) {
18818 if (elt) {
18819 n->nd_head = elt;
18820 }
18821 else if (RTEST(lit)) {
18822 rb_ary_clear(lit);
18823 lit = Qfalse;
18824 }
18825 }
18826 if (RTEST(lit)) {
18827 VALUE e = shareable_literal_value(elt);
18828 if (e != Qundef) {
18829 rb_ary_push(lit, e);
18830 }
18831 else {
18832 rb_ary_clear(lit);
18833 lit = Qnil; /* make shareable at runtime */
18834 }
18835 }
18836 }
18837 break;
18838
18839 case NODE_HASH:
18840 if (!value->nd_brace) return 0;
18841 lit = rb_hash_new();
18842 for (NODE *n = value->nd_head; n; n = n->nd_next->nd_next) {
18843 NODE *key = n->nd_head;
18844 NODE *val = n->nd_next->nd_head;
18845 if (key) {
18847 if (key) {
18848 n->nd_head = key;
18849 }
18850 else if (RTEST(lit)) {
18851 rb_hash_clear(lit);
18852 lit = Qfalse;
18853 }
18854 }
18855 if (val) {
18857 if (val) {
18858 n->nd_next->nd_head = val;
18859 }
18860 else if (RTEST(lit)) {
18861 rb_hash_clear(lit);
18862 lit = Qfalse;
18863 }
18864 }
18865 if (RTEST(lit)) {
18866 VALUE k = shareable_literal_value(key);
18867 VALUE v = shareable_literal_value(val);
18868 if (k != Qundef && v != Qundef) {
18869 rb_hash_aset(lit, k, v);
18870 }
18871 else {
18872 rb_hash_clear(lit);
18873 lit = Qnil; /* make shareable at runtime */
18874 }
18875 }
18876 }
18877 break;
18878
18879 default:
18880 if (shareable == shareable_literal &&
18881 (SHAREABLE_BARE_EXPRESSION || level > 0)) {
18882 return ensure_shareable_node(p, dest, value, loc);
18883 }
18884 return 0;
18885 }
18886
18887 /* Array or Hash */
18888 if (!lit) return 0;
18889 if (NIL_P(lit)) {
18890 // if shareable_literal, all elements should have been ensured
18891 // as shareable
18892 value = make_shareable_node(p, value, false, loc);
18893 }
18894 else {
18895 value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
18896 }
18897
18898 return value;
18899# undef shareable_literal_constant_next
18900}
18901
18902static NODE *
18903shareable_constant_value(struct parser_params *p, enum shareability shareable,
18904 NODE *lhs, NODE *value, const YYLTYPE *loc)
18905{
18906 if (!value) return 0;
18907 switch (shareable) {
18908 case shareable_none:
18909 return value;
18910
18911 case shareable_literal:
18912 {
18913 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
18914 if (lit) return lit;
18915 return value;
18916 }
18917 break;
18918
18919 case shareable_copy:
18921 {
18922 NODE *lit = shareable_literal_constant(p, shareable, &lhs, value, loc, 0);
18923 if (lit) return lit;
18924 return make_shareable_node(p, value, shareable == shareable_copy, loc);
18925 }
18926 break;
18927
18928 default:
18930 }
18931}
18932
18933static NODE *
18934node_assign(struct parser_params *p, NODE *lhs, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
18935{
18936 if (!lhs) return 0;
18937
18938 switch (nd_type(lhs)) {
18939 case NODE_CDECL:
18940 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
18941 /* fallthru */
18942
18943 case NODE_GASGN:
18944 case NODE_IASGN:
18945 case NODE_LASGN:
18946 case NODE_DASGN:
18947 case NODE_DASGN_CURR:
18948 case NODE_MASGN:
18949 case NODE_CVASGN:
18950 lhs->nd_value = rhs;
18951 nd_set_loc(lhs, loc);
18952 break;
18953
18954 case NODE_ATTRASGN:
18955 lhs->nd_args = arg_append(p, lhs->nd_args, rhs, loc);
18956 nd_set_loc(lhs, loc);
18957 break;
18958
18959 default:
18960 /* should not happen */
18961 break;
18962 }
18963
18964 return lhs;
18965}
18966
18967static NODE *
18968value_expr_check(struct parser_params *p, NODE *node)
18969{
18970 NODE *void_node = 0, *vn;
18971
18972 if (!node) {
18973 rb_warning0("empty expression");
18974 }
18975 while (node) {
18976 switch (nd_type(node)) {
18977 case NODE_RETURN:
18978 case NODE_BREAK:
18979 case NODE_NEXT:
18980 case NODE_REDO:
18981 case NODE_RETRY:
18982 return void_node ? void_node : node;
18983
18984 case NODE_CASE3:
18985 if (!node->nd_body || nd_type(node->nd_body) != NODE_IN) {
18986 compile_error(p, "unexpected node");
18987 return NULL;
18988 }
18989 if (node->nd_body->nd_body) {
18990 return NULL;
18991 }
18992 /* single line pattern matching */
18993 return void_node ? void_node : node;
18994
18995 case NODE_BLOCK:
18996 while (node->nd_next) {
18997 node = node->nd_next;
18998 }
18999 node = node->nd_head;
19000 break;
19001
19002 case NODE_BEGIN:
19003 node = node->nd_body;
19004 break;
19005
19006 case NODE_IF:
19007 case NODE_UNLESS:
19008 if (!node->nd_body) {
19009 return NULL;
19010 }
19011 else if (!node->nd_else) {
19012 return NULL;
19013 }
19014 vn = value_expr_check(p, node->nd_body);
19015 if (!vn) return NULL;
19016 if (!void_node) void_node = vn;
19017 node = node->nd_else;
19018 break;
19019
19020 case NODE_AND:
19021 case NODE_OR:
19022 node = node->nd_1st;
19023 break;
19024
19025 case NODE_LASGN:
19026 case NODE_DASGN:
19027 case NODE_DASGN_CURR:
19028 case NODE_MASGN:
19029 mark_lvar_used(p, node);
19030 return NULL;
19031
19032 default:
19033 return NULL;
19034 }
19035 }
19036
19037 return NULL;
19038}
19039
19040static int
19041value_expr_gen(struct parser_params *p, NODE *node)
19042{
19043 NODE *void_node = value_expr_check(p, node);
19044 if (void_node) {
19045 yyerror1(&void_node->nd_loc, "void value expression");
19046 /* or "control never reach"? */
19047 return FALSE;
19048 }
19049 return TRUE;
19050}
19051static void
19052void_expr(struct parser_params *p, NODE *node)
19053{
19054 const char *useless = 0;
19055
19056 if (!RTEST(ruby_verbose)) return;
19057
19058 if (!node || !(node = nd_once_body(node))) return;
19059 switch (nd_type(node)) {
19060 case NODE_OPCALL:
19061 switch (node->nd_mid) {
19062 case '+':
19063 case '-':
19064 case '*':
19065 case '/':
19066 case '%':
19067 case tPOW:
19068 case tUPLUS:
19069 case tUMINUS:
19070 case '|':
19071 case '^':
19072 case '&':
19073 case tCMP:
19074 case '>':
19075 case tGEQ:
19076 case '<':
19077 case tLEQ:
19078 case tEQ:
19079 case tNEQ:
19080 useless = rb_id2name(node->nd_mid);
19081 break;
19082 }
19083 break;
19084
19085 case NODE_LVAR:
19086 case NODE_DVAR:
19087 case NODE_GVAR:
19088 case NODE_IVAR:
19089 case NODE_CVAR:
19090 case NODE_NTH_REF:
19091 case NODE_BACK_REF:
19092 useless = "a variable";
19093 break;
19094 case NODE_CONST:
19095 useless = "a constant";
19096 break;
19097 case NODE_LIT:
19098 case NODE_STR:
19099 case NODE_DSTR:
19100 case NODE_DREGX:
19101 useless = "a literal";
19102 break;
19103 case NODE_COLON2:
19104 case NODE_COLON3:
19105 useless = "::";
19106 break;
19107 case NODE_DOT2:
19108 useless = "..";
19109 break;
19110 case NODE_DOT3:
19111 useless = "...";
19112 break;
19113 case NODE_SELF:
19114 useless = "self";
19115 break;
19116 case NODE_NIL:
19117 useless = "nil";
19118 break;
19119 case NODE_TRUE:
19120 useless = "true";
19121 break;
19122 case NODE_FALSE:
19123 useless = "false";
19124 break;
19125 case NODE_DEFINED:
19126 useless = "defined?";
19127 break;
19128 }
19129
19130 if (useless) {
19131 rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
19132 }
19133}
19134
19135static NODE *
19136void_stmts(struct parser_params *p, NODE *node)
19137{
19138 NODE *const n = node;
19139 if (!RTEST(ruby_verbose)) return n;
19140 if (!node) return n;
19141 if (nd_type(node) != NODE_BLOCK) return n;
19142
19143 while (node->nd_next) {
19144 void_expr(p, node->nd_head);
19145 node = node->nd_next;
19146 }
19147 return n;
19148}
19149
19150static NODE *
19151remove_begin(NODE *node)
19152{
19153 NODE **n = &node, *n1 = node;
19154 while (n1 && nd_type(n1) == NODE_BEGIN && n1->nd_body) {
19155 *n = n1 = n1->nd_body;
19156 }
19157 return node;
19158}
19159
19160static NODE *
19161remove_begin_all(NODE *node)
19162{
19163 NODE **n = &node, *n1 = node;
19164 while (n1 && nd_type(n1) == NODE_BEGIN) {
19165 *n = n1 = n1->nd_body;
19166 }
19167 return node;
19168}
19169
19170static void
19171reduce_nodes(struct parser_params *p, NODE **body)
19172{
19173 NODE *node = *body;
19174
19175 if (!node) {
19176 *body = NEW_NIL(&NULL_LOC);
19177 return;
19178 }
19179#define subnodes(n1, n2) \
19180 ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
19181 (!node->n2) ? (body = &node->n1, 1) : \
19182 (reduce_nodes(p, &node->n1), body = &node->n2, 1))
19183
19184 while (node) {
19185 int newline = (int)(node->flags & NODE_FL_NEWLINE);
19186 switch (nd_type(node)) {
19187 end:
19188 case NODE_NIL:
19189 *body = 0;
19190 return;
19191 case NODE_RETURN:
19192 *body = node = node->nd_stts;
19193 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19194 continue;
19195 case NODE_BEGIN:
19196 *body = node = node->nd_body;
19197 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19198 continue;
19199 case NODE_BLOCK:
19200 body = &node->nd_end->nd_head;
19201 break;
19202 case NODE_IF:
19203 case NODE_UNLESS:
19204 if (subnodes(nd_body, nd_else)) break;
19205 return;
19206 case NODE_CASE:
19207 body = &node->nd_body;
19208 break;
19209 case NODE_WHEN:
19210 if (!subnodes(nd_body, nd_next)) goto end;
19211 break;
19212 case NODE_ENSURE:
19213 if (!subnodes(nd_head, nd_resq)) goto end;
19214 break;
19215 case NODE_RESCUE:
19216 if (node->nd_else) {
19217 body = &node->nd_resq;
19218 break;
19219 }
19220 if (!subnodes(nd_head, nd_resq)) goto end;
19221 break;
19222 default:
19223 return;
19224 }
19225 node = *body;
19226 if (newline && node) node->flags |= NODE_FL_NEWLINE;
19227 }
19228
19229#undef subnodes
19230}
19231
19232static int
19233is_static_content(NODE *node)
19234{
19235 if (!node) return 1;
19236 switch (nd_type(node)) {
19237 case NODE_HASH:
19238 if (!(node = node->nd_head)) break;
19239 case NODE_LIST:
19240 do {
19241 if (!is_static_content(node->nd_head)) return 0;
19242 } while ((node = node->nd_next) != 0);
19243 case NODE_LIT:
19244 case NODE_STR:
19245 case NODE_NIL:
19246 case NODE_TRUE:
19247 case NODE_FALSE:
19248 case NODE_ZLIST:
19249 break;
19250 default:
19251 return 0;
19252 }
19253 return 1;
19254}
19255
19256static int
19257assign_in_cond(struct parser_params *p, NODE *node)
19258{
19259 switch (nd_type(node)) {
19260 case NODE_MASGN:
19261 case NODE_LASGN:
19262 case NODE_DASGN:
19263 case NODE_DASGN_CURR:
19264 case NODE_GASGN:
19265 case NODE_IASGN:
19266 break;
19267
19268 default:
19269 return 0;
19270 }
19271
19272 if (!node->nd_value) return 1;
19273 if (is_static_content(node->nd_value)) {
19274 /* reports always */
19275 parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
19276 }
19277 return 1;
19278}
19279
19285
19286#define SWITCH_BY_COND_TYPE(t, w, arg) \
19287 switch (t) { \
19288 case COND_IN_OP: break; \
19289 case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
19290 case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
19291 }
19292
19293static NODE *cond0(struct parser_params*,NODE*,enum cond_type,const YYLTYPE*);
19294
19295static NODE*
19296range_op(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19297{
19298 enum node_type type;
19299
19300 if (node == 0) return 0;
19301
19302 type = nd_type(node);
19303 value_expr(node);
19304 if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
19305 if (!e_option_supplied(p)) parser_warn(p, node, "integer literal in flip-flop");
19306 ID lineno = rb_intern("$.");
19307 return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(lineno, loc), loc), loc);
19308 }
19309 return cond0(p, node, COND_IN_FF, loc);
19310}
19311
19312static NODE*
19313cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *loc)
19314{
19315 if (node == 0) return 0;
19316 if (!(node = nd_once_body(node))) return 0;
19317 assign_in_cond(p, node);
19318
19319 switch (nd_type(node)) {
19320 case NODE_DSTR:
19321 case NODE_EVSTR:
19322 case NODE_STR:
19323 SWITCH_BY_COND_TYPE(type, warn, "string ")
19324 break;
19325
19326 case NODE_DREGX:
19327 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warning, "regex ")
19328
19329 return NEW_MATCH2(node, NEW_GVAR(idLASTLINE, loc), loc);
19330
19331 case NODE_AND:
19332 case NODE_OR:
19333 node->nd_1st = cond0(p, node->nd_1st, COND_IN_COND, loc);
19334 node->nd_2nd = cond0(p, node->nd_2nd, COND_IN_COND, loc);
19335 break;
19336
19337 case NODE_DOT2:
19338 case NODE_DOT3:
19339 node->nd_beg = range_op(p, node->nd_beg, loc);
19340 node->nd_end = range_op(p, node->nd_end, loc);
19341 if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
19342 else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
19343 break;
19344
19345 case NODE_DSYM:
19346 SWITCH_BY_COND_TYPE(type, warning, "string ")
19347 break;
19348
19349 case NODE_LIT:
19350 if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
19351 if (!e_option_supplied(p)) SWITCH_BY_COND_TYPE(type, warn, "regex ")
19352 nd_set_type(node, NODE_MATCH);
19353 }
19354 else if (node->nd_lit == Qtrue ||
19355 node->nd_lit == Qfalse) {
19356 /* booleans are OK, e.g., while true */
19357 }
19358 else {
19359 SWITCH_BY_COND_TYPE(type, warning, "")
19360 }
19361 default:
19362 break;
19363 }
19364 return node;
19365}
19366
19367static NODE*
19368cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19369{
19370 if (node == 0) return 0;
19371 return cond0(p, node, COND_IN_COND, loc);
19372}
19373
19374static NODE*
19375method_cond(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19376{
19377 if (node == 0) return 0;
19378 return cond0(p, node, COND_IN_OP, loc);
19379}
19380
19381static NODE*
19382new_nil_at(struct parser_params *p, const rb_code_position_t *pos)
19383{
19384 YYLTYPE loc = {*pos, *pos};
19385 return NEW_NIL(&loc);
19386}
19387
19388static NODE*
19389new_if(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
19390{
19391 if (!cc) return right;
19392 cc = cond0(p, cc, COND_IN_COND, loc);
19393 return newline_node(NEW_IF(cc, left, right, loc));
19394}
19395
19396static NODE*
19397new_unless(struct parser_params *p, NODE *cc, NODE *left, NODE *right, const YYLTYPE *loc)
19398{
19399 if (!cc) return right;
19400 cc = cond0(p, cc, COND_IN_COND, loc);
19401 return newline_node(NEW_UNLESS(cc, left, right, loc));
19402}
19403
19404static NODE*
19405logop(struct parser_params *p, ID id, NODE *left, NODE *right,
19406 const YYLTYPE *op_loc, const YYLTYPE *loc)
19407{
19408 enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
19409 NODE *op;
19410 value_expr(left);
19411 if (left && (enum node_type)nd_type(left) == type) {
19412 NODE *node = left, *second;
19413 while ((second = node->nd_2nd) != 0 && (enum node_type)nd_type(second) == type) {
19414 node = second;
19415 }
19416 node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
19417 nd_set_line(node->nd_2nd, op_loc->beg_pos.lineno);
19418 left->nd_loc.end_pos = loc->end_pos;
19419 return left;
19420 }
19421 op = NEW_NODE(type, left, right, 0, loc);
19422 nd_set_line(op, op_loc->beg_pos.lineno);
19423 return op;
19424}
19425
19426static void
19427no_blockarg(struct parser_params *p, NODE *node)
19428{
19429 if (node && nd_type(node) == NODE_BLOCK_PASS) {
19430 compile_error(p, "block argument should not be given");
19431 }
19432}
19433
19434static NODE *
19435ret_args(struct parser_params *p, NODE *node)
19436{
19437 if (node) {
19438 no_blockarg(p, node);
19439 if (nd_type(node) == NODE_LIST) {
19440 if (node->nd_next == 0) {
19441 node = node->nd_head;
19442 }
19443 else {
19444 nd_set_type(node, NODE_VALUES);
19445 }
19446 }
19447 }
19448 return node;
19449}
19450
19451static NODE *
19452new_yield(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19453{
19454 if (node) no_blockarg(p, node);
19455
19456 return NEW_YIELD(node, loc);
19457}
19458
19459static VALUE
19460negate_lit(struct parser_params *p, VALUE lit)
19461{
19462 if (FIXNUM_P(lit)) {
19463 return LONG2FIX(-FIX2LONG(lit));
19464 }
19465 if (SPECIAL_CONST_P(lit)) {
19466#if USE_FLONUM
19467 if (FLONUM_P(lit)) {
19468 return DBL2NUM(-RFLOAT_VALUE(lit));
19469 }
19470#endif
19471 goto unknown;
19472 }
19473 switch (BUILTIN_TYPE(lit)) {
19474 case T_BIGNUM:
19475 BIGNUM_NEGATE(lit);
19476 lit = rb_big_norm(lit);
19477 break;
19478 case T_RATIONAL:
19479 RATIONAL_SET_NUM(lit, negate_lit(p, RRATIONAL(lit)->num));
19480 break;
19481 case T_COMPLEX:
19482 RCOMPLEX_SET_REAL(lit, negate_lit(p, RCOMPLEX(lit)->real));
19483 RCOMPLEX_SET_IMAG(lit, negate_lit(p, RCOMPLEX(lit)->imag));
19484 break;
19485 case T_FLOAT:
19486 RFLOAT(lit)->float_value = -RFLOAT_VALUE(lit);
19487 break;
19488 unknown:
19489 default:
19490 rb_parser_fatal(p, "unknown literal type (%s) passed to negate_lit",
19492 break;
19493 }
19494 return lit;
19495}
19496
19497static NODE *
19498arg_blk_pass(NODE *node1, NODE *node2)
19499{
19500 if (node2) {
19501 if (!node1) return node2;
19502 node2->nd_head = node1;
19503 nd_set_first_lineno(node2, nd_first_lineno(node1));
19504 nd_set_first_column(node2, nd_first_column(node1));
19505 return node2;
19506 }
19507 return node1;
19508}
19509
19510static bool
19511args_info_empty_p(struct rb_args_info *args)
19512{
19513 if (args->pre_args_num) return false;
19514 if (args->post_args_num) return false;
19515 if (args->rest_arg) return false;
19516 if (args->opt_args) return false;
19517 if (args->block_arg) return false;
19518 if (args->kw_args) return false;
19519 if (args->kw_rest_arg) return false;
19520 return true;
19521}
19522
19523static NODE*
19524new_args(struct parser_params *p, NODE *pre_args, NODE *opt_args, ID rest_arg, NODE *post_args, NODE *tail, const YYLTYPE *loc)
19525{
19526 int saved_line = p->ruby_sourceline;
19527 struct rb_args_info *args = tail->nd_ainfo;
19528
19529 args->pre_args_num = pre_args ? rb_long2int(pre_args->nd_plen) : 0;
19530 args->pre_init = pre_args ? pre_args->nd_next : 0;
19531
19532 args->post_args_num = post_args ? rb_long2int(post_args->nd_plen) : 0;
19533 args->post_init = post_args ? post_args->nd_next : 0;
19534 args->first_post_arg = post_args ? post_args->nd_pid : 0;
19535
19536 args->rest_arg = rest_arg;
19537
19538 args->opt_args = opt_args;
19539
19541
19542 p->ruby_sourceline = saved_line;
19543 nd_set_loc(tail, loc);
19544
19545 return tail;
19546}
19547
19548static NODE*
19549new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block, const YYLTYPE *kw_rest_loc)
19550{
19551 int saved_line = p->ruby_sourceline;
19552 NODE *node;
19553 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19554 struct rb_args_info *args = ZALLOC(struct rb_args_info);
19555 rb_imemo_tmpbuf_set_ptr(tmpbuf, args);
19556 args->imemo = tmpbuf;
19557 node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
19558 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19559 if (p->error_p) return node;
19560
19561 args->block_arg = block;
19562 args->kw_args = kw_args;
19563
19564 if (kw_args) {
19565 /*
19566 * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
19567 * variable order: k1, kr1, k2, &b, internal_id, krest
19568 * #=> <reorder>
19569 * variable order: kr1, k1, k2, internal_id, krest, &b
19570 */
19571 ID kw_bits = internal_id(p), *required_kw_vars, *kw_vars;
19572 struct vtable *vtargs = p->lvtbl->args;
19573 NODE *kwn = kw_args;
19574
19575 vtable_pop(vtargs, !!block + !!kw_rest_arg);
19576 required_kw_vars = kw_vars = &vtargs->tbl[vtargs->pos];
19577 while (kwn) {
19578 if (!NODE_REQUIRED_KEYWORD_P(kwn->nd_body))
19579 --kw_vars;
19580 --required_kw_vars;
19581 kwn = kwn->nd_next;
19582 }
19583
19584 for (kwn = kw_args; kwn; kwn = kwn->nd_next) {
19585 ID vid = kwn->nd_body->nd_vid;
19586 if (NODE_REQUIRED_KEYWORD_P(kwn->nd_body)) {
19587 *required_kw_vars++ = vid;
19588 }
19589 else {
19590 *kw_vars++ = vid;
19591 }
19592 }
19593
19594 arg_var(p, kw_bits);
19595 if (kw_rest_arg) arg_var(p, kw_rest_arg);
19596 if (block) arg_var(p, block);
19597
19598 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
19599 args->kw_rest_arg->nd_cflag = kw_bits;
19600 }
19601 else if (kw_rest_arg == idNil) {
19602 args->no_kwarg = 1;
19603 }
19604 else if (kw_rest_arg) {
19605 args->kw_rest_arg = NEW_DVAR(kw_rest_arg, kw_rest_loc);
19606 }
19607
19608 p->ruby_sourceline = saved_line;
19609 return node;
19610}
19611
19612static NODE *
19613args_with_numbered(struct parser_params *p, NODE *args, int max_numparam)
19614{
19615 if (max_numparam > NO_PARAM) {
19616 if (!args) {
19617 YYLTYPE loc = RUBY_INIT_YYLLOC();
19618 args = new_args_tail(p, 0, 0, 0, 0);
19619 nd_set_loc(args, &loc);
19620 }
19621 args->nd_ainfo->pre_args_num = max_numparam;
19622 }
19623 return args;
19624}
19625
19626static NODE*
19627new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc)
19628{
19629 struct rb_ary_pattern_info *apinfo = aryptn->nd_apinfo;
19630
19631 aryptn->nd_pconst = constant;
19632
19633 if (pre_arg) {
19634 NODE *pre_args = NEW_LIST(pre_arg, loc);
19635 if (apinfo->pre_args) {
19636 apinfo->pre_args = list_concat(pre_args, apinfo->pre_args);
19637 }
19638 else {
19639 apinfo->pre_args = pre_args;
19640 }
19641 }
19642 return aryptn;
19643}
19644
19645static NODE*
19646new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID rest_arg, NODE *post_args, const YYLTYPE *loc)
19647{
19648 int saved_line = p->ruby_sourceline;
19649 NODE *node;
19650 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19651 struct rb_ary_pattern_info *apinfo = ZALLOC(struct rb_ary_pattern_info);
19652 rb_imemo_tmpbuf_set_ptr(tmpbuf, apinfo);
19653 node = NEW_NODE(NODE_ARYPTN, 0, tmpbuf, apinfo, loc);
19654 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19655
19656 apinfo->pre_args = pre_args;
19657
19658 if (has_rest) {
19659 if (rest_arg) {
19660 apinfo->rest_arg = assignable(p, rest_arg, 0, loc);
19661 }
19662 else {
19664 }
19665 }
19666 else {
19667 apinfo->rest_arg = NULL;
19668 }
19669
19670 apinfo->post_args = post_args;
19671
19672 p->ruby_sourceline = saved_line;
19673 return node;
19674}
19675
19676static NODE*
19677new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc)
19678{
19679 fndptn->nd_pconst = constant;
19680
19681 return fndptn;
19682}
19683
19684static NODE*
19685new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc)
19686{
19687 int saved_line = p->ruby_sourceline;
19688 NODE *node;
19689 VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer();
19690 struct rb_fnd_pattern_info *fpinfo = ZALLOC(struct rb_fnd_pattern_info);
19691 rb_imemo_tmpbuf_set_ptr(tmpbuf, fpinfo);
19692 node = NEW_NODE(NODE_FNDPTN, 0, tmpbuf, fpinfo, loc);
19693 RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
19694
19695 fpinfo->pre_rest_arg = pre_rest_arg ? assignable(p, pre_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
19696 fpinfo->args = args;
19697 fpinfo->post_rest_arg = post_rest_arg ? assignable(p, post_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
19698
19699 p->ruby_sourceline = saved_line;
19700 return node;
19701}
19702
19703static NODE*
19704new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc)
19705{
19706 hshptn->nd_pconst = constant;
19707 return hshptn;
19708}
19709
19710static NODE*
19711new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc)
19712{
19713 int saved_line = p->ruby_sourceline;
19714 NODE *node, *kw_rest_arg_node;
19715
19716 if (kw_rest_arg == idNil) {
19717 kw_rest_arg_node = NODE_SPECIAL_NO_REST_KEYWORD;
19718 }
19719 else if (kw_rest_arg) {
19720 kw_rest_arg_node = assignable(p, kw_rest_arg, 0, loc);
19721 }
19722 else {
19723 kw_rest_arg_node = NULL;
19724 }
19725
19726 node = NEW_NODE(NODE_HSHPTN, 0, kw_args, kw_rest_arg_node, loc);
19727
19728 p->ruby_sourceline = saved_line;
19729 return node;
19730}
19731
19732static void
19733warn_one_line_pattern_matching(struct parser_params *p, NODE *node, NODE *pattern, bool right_assign)
19734{
19735 enum node_type type;
19736 type = nd_type(pattern);
19737
19739 !(right_assign && (type == NODE_LASGN || type == NODE_DASGN || type == NODE_DASGN_CURR)))
19740 rb_warn0L_experimental(nd_line(node), "One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!");
19741}
19742
19743static NODE*
19744dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
19745{
19746 VALUE lit;
19747
19748 if (!node) {
19749 return NEW_LIT(ID2SYM(idNULL), loc);
19750 }
19751
19752 switch (nd_type(node)) {
19753 case NODE_DSTR:
19754 nd_set_type(node, NODE_DSYM);
19755 nd_set_loc(node, loc);
19756 break;
19757 case NODE_STR:
19758 lit = node->nd_lit;
19759 RB_OBJ_WRITTEN(p->ast, Qnil, node->nd_lit = ID2SYM(rb_intern_str(lit)));
19760 nd_set_type(node, NODE_LIT);
19761 nd_set_loc(node, loc);
19762 break;
19763 default:
19764 node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node, loc), loc);
19765 break;
19766 }
19767 return node;
19768}
19769
19770static int
19771append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
19772{
19773 NODE *node = (NODE *)v;
19774 NODE **result = (NODE **)h;
19775 node->nd_alen = 2;
19776 node->nd_next->nd_end = node->nd_next;
19777 node->nd_next->nd_next = 0;
19778 if (*result)
19779 list_concat(*result, node);
19780 else
19781 *result = node;
19782 return ST_CONTINUE;
19783}
19784
19785static NODE *
19786remove_duplicate_keys(struct parser_params *p, NODE *hash)
19787{
19788 st_table *literal_keys = st_init_numtable_with_size(hash->nd_alen / 2);
19789 NODE *result = 0;
19790 rb_code_location_t loc = hash->nd_loc;
19791 while (hash && hash->nd_head && hash->nd_next) {
19792 NODE *head = hash->nd_head;
19793 NODE *value = hash->nd_next;
19794 NODE *next = value->nd_next;
19795 VALUE key = (VALUE)head;
19796 st_data_t data;
19797 if (nd_type(head) == NODE_LIT &&
19798 st_lookup(literal_keys, (key = head->nd_lit), &data)) {
19800 "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
19801 head->nd_lit, nd_line(head));
19802 head = ((NODE *)data)->nd_next;
19803 head->nd_head = block_append(p, head->nd_head, value->nd_head);
19804 }
19805 else {
19806 st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
19807 }
19808 hash = next;
19809 }
19810 st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
19811 st_free_table(literal_keys);
19812 if (hash) {
19813 if (!result) result = hash;
19814 else list_concat(result, hash);
19815 }
19816 result->nd_loc = loc;
19817 return result;
19818}
19819
19820static NODE *
19821new_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
19822{
19823 if (hash) hash = remove_duplicate_keys(p, hash);
19824 return NEW_HASH(hash, loc);
19825}
19826#endif
19827
19828static void
19829error_duplicate_pattern_variable(struct parser_params *p, ID id, const YYLTYPE *loc)
19830{
19831 if (is_private_local_id(id)) {
19832 return;
19833 }
19834 if (st_is_member(p->pvtbl, id)) {
19835 yyerror1(loc, "duplicated variable name");
19836 }
19837 else {
19838 st_insert(p->pvtbl, (st_data_t)id, 0);
19839 }
19840}
19841
19842static void
19843error_duplicate_pattern_key(struct parser_params *p, VALUE key, const YYLTYPE *loc)
19844{
19845 if (!p->pktbl) {
19846 p->pktbl = st_init_numtable();
19847 }
19848 else if (st_is_member(p->pktbl, key)) {
19849 yyerror1(loc, "duplicated key name");
19850 return;
19851 }
19852 st_insert(p->pktbl, (st_data_t)key, 0);
19853}
19854
19855#ifndef RIPPER
19856static NODE *
19857new_unique_key_hash(struct parser_params *p, NODE *hash, const YYLTYPE *loc)
19858{
19859 return NEW_HASH(hash, loc);
19860}
19861#endif /* !RIPPER */
19862
19863#ifndef RIPPER
19864static NODE *
19865new_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
19866{
19867 NODE *asgn;
19868
19869 if (lhs) {
19870 ID vid = lhs->nd_vid;
19871 YYLTYPE lhs_loc = lhs->nd_loc;
19872 int shareable = ctxt.shareable_constant_value;
19873 if (shareable) {
19874 switch (nd_type(lhs)) {
19875 case NODE_CDECL:
19876 case NODE_COLON2:
19877 case NODE_COLON3:
19878 break;
19879 default:
19880 shareable = 0;
19881 break;
19882 }
19883 }
19884 if (op == tOROP) {
19885 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
19886 lhs->nd_value = rhs;
19887 nd_set_loc(lhs, loc);
19888 asgn = NEW_OP_ASGN_OR(gettable(p, vid, &lhs_loc), lhs, loc);
19889 if (is_notop_id(vid)) {
19890 switch (id_type(vid)) {
19891 case ID_GLOBAL:
19892 case ID_INSTANCE:
19893 case ID_CLASS:
19894 asgn->nd_aid = vid;
19895 }
19896 }
19897 }
19898 else if (op == tANDOP) {
19899 if (shareable) {
19900 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
19901 }
19902 lhs->nd_value = rhs;
19903 nd_set_loc(lhs, loc);
19904 asgn = NEW_OP_ASGN_AND(gettable(p, vid, &lhs_loc), lhs, loc);
19905 }
19906 else {
19907 asgn = lhs;
19908 rhs = NEW_CALL(gettable(p, vid, &lhs_loc), op, NEW_LIST(rhs, &rhs->nd_loc), loc);
19909 if (shareable) {
19910 rhs = shareable_constant_value(p, shareable, lhs, rhs, &rhs->nd_loc);
19911 }
19912 asgn->nd_value = rhs;
19913 nd_set_loc(asgn, loc);
19914 }
19915 }
19916 else {
19917 asgn = NEW_BEGIN(0, loc);
19918 }
19919 return asgn;
19920}
19921
19922static NODE *
19923new_ary_op_assign(struct parser_params *p, NODE *ary,
19924 NODE *args, ID op, NODE *rhs, const YYLTYPE *args_loc, const YYLTYPE *loc)
19925{
19926 NODE *asgn;
19927
19928 args = make_list(args, args_loc);
19929 if (nd_type(args) == NODE_BLOCK_PASS) {
19930 args = NEW_ARGSCAT(args, rhs, loc);
19931 }
19932 else {
19933 args = arg_concat(p, args, rhs, loc);
19934 }
19935 asgn = NEW_OP_ASGN1(ary, op, args, loc);
19936 fixpos(asgn, ary);
19937 return asgn;
19938}
19939
19940static NODE *
19941new_attr_op_assign(struct parser_params *p, NODE *lhs,
19942 ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *loc)
19943{
19944 NODE *asgn;
19945
19946 asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs, loc);
19947 fixpos(asgn, lhs);
19948 return asgn;
19949}
19950
19951static NODE *
19952new_const_op_assign(struct parser_params *p, NODE *lhs, ID op, NODE *rhs, struct lex_context ctxt, const YYLTYPE *loc)
19953{
19954 NODE *asgn;
19955
19956 if (lhs) {
19957 rhs = shareable_constant_value(p, ctxt.shareable_constant_value, lhs, rhs, loc);
19958 asgn = NEW_OP_CDECL(lhs, op, rhs, loc);
19959 }
19960 else {
19961 asgn = NEW_BEGIN(0, loc);
19962 }
19963 fixpos(asgn, lhs);
19964 return asgn;
19965}
19966
19967static NODE *
19968const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc)
19969{
19970 if (p->ctxt.in_def) {
19971 yyerror1(loc, "dynamic constant assignment");
19972 }
19973 return NEW_CDECL(0, 0, (path), loc);
19974}
19975#else
19976static VALUE
19977const_decl(struct parser_params *p, VALUE path)
19978{
19979 if (p->ctxt.in_def) {
19980 path = assign_error(p, "dynamic constant assignment", path);
19981 }
19982 return path;
19983}
19984
19985static VALUE
19986assign_error(struct parser_params *p, const char *mesg, VALUE a)
19987{
19988 a = dispatch2(assign_error, ERR_MESG(), a);
19989 ripper_error(p);
19990 return a;
19991}
19992
19993static VALUE
19994var_field(struct parser_params *p, VALUE a)
19995{
19996 return ripper_new_yylval(p, get_id(a), dispatch1(var_field, a), 0);
19997}
19998#endif
19999
20000#ifndef RIPPER
20001static NODE *
20002new_bodystmt(struct parser_params *p, NODE *head, NODE *rescue, NODE *rescue_else, NODE *ensure, const YYLTYPE *loc)
20003{
20004 NODE *result = head;
20005 if (rescue) {
20006 NODE *tmp = rescue_else ? rescue_else : rescue;
20007 YYLTYPE rescue_loc = code_loc_gen(&head->nd_loc, &tmp->nd_loc);
20008
20009 result = NEW_RESCUE(head, rescue, rescue_else, &rescue_loc);
20010 nd_set_line(result, rescue->nd_loc.beg_pos.lineno);
20011 }
20012 else if (rescue_else) {
20013 result = block_append(p, result, rescue_else);
20014 }
20015 if (ensure) {
20016 result = NEW_ENSURE(result, ensure, loc);
20017 }
20018 fixpos(result, head);
20019 return result;
20020}
20021#endif
20022
20023static void
20024warn_unused_var(struct parser_params *p, struct local_vars *local)
20025{
20026 int cnt;
20027
20028 if (!local->used) return;
20029 cnt = local->used->pos;
20030 if (cnt != local->vars->pos) {
20031 rb_parser_fatal(p, "local->used->pos != local->vars->pos");
20032 }
20033#ifndef RIPPER
20034 ID *v = local->vars->tbl;
20035 ID *u = local->used->tbl;
20036 for (int i = 0; i < cnt; ++i) {
20037 if (!v[i] || (u[i] & LVAR_USED)) continue;
20038 if (is_private_local_id(v[i])) continue;
20039 rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
20040 }
20041#endif
20042}
20043
20044static void
20045local_push(struct parser_params *p, int toplevel_scope)
20046{
20047 struct local_vars *local;
20048 int inherits_dvars = toplevel_scope && compile_for_eval;
20049 int warn_unused_vars = RTEST(ruby_verbose);
20050
20051 local = ALLOC(struct local_vars);
20052 local->prev = p->lvtbl;
20053 local->args = vtable_alloc(0);
20054 local->vars = vtable_alloc(inherits_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
20055#ifndef RIPPER
20056 if (toplevel_scope && compile_for_eval) warn_unused_vars = 0;
20057 if (toplevel_scope && e_option_supplied(p)) warn_unused_vars = 0;
20058 local->numparam.outer = 0;
20059 local->numparam.inner = 0;
20060 local->numparam.current = 0;
20061#endif
20062 local->used = warn_unused_vars ? vtable_alloc(0) : 0;
20063
20064# if WARN_PAST_SCOPE
20065 local->past = 0;
20066# endif
20067 CMDARG_PUSH(0);
20068 COND_PUSH(0);
20069 p->lvtbl = local;
20070}
20071
20072static void
20073local_pop(struct parser_params *p)
20074{
20075 struct local_vars *local = p->lvtbl->prev;
20076 if (p->lvtbl->used) {
20077 warn_unused_var(p, p->lvtbl);
20078 vtable_free(p->lvtbl->used);
20079 }
20080# if WARN_PAST_SCOPE
20081 while (p->lvtbl->past) {
20082 struct vtable *past = p->lvtbl->past;
20083 p->lvtbl->past = past->prev;
20084 vtable_free(past);
20085 }
20086# endif
20087 vtable_free(p->lvtbl->args);
20088 vtable_free(p->lvtbl->vars);
20089 CMDARG_POP();
20090 COND_POP();
20091 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
20092 p->lvtbl = local;
20093}
20094
20095#ifndef RIPPER
20096static ID*
20097local_tbl(struct parser_params *p)
20098{
20099 int cnt_args = vtable_size(p->lvtbl->args);
20100 int cnt_vars = vtable_size(p->lvtbl->vars);
20101 int cnt = cnt_args + cnt_vars;
20102 int i, j;
20103 ID *buf;
20104
20105 if (cnt <= 0) return 0;
20106 buf = ALLOC_N(ID, cnt + 2);
20107 MEMCPY(buf+1, p->lvtbl->args->tbl, ID, cnt_args);
20108 /* remove IDs duplicated to warn shadowing */
20109 for (i = 0, j = cnt_args+1; i < cnt_vars; ++i) {
20110 ID id = p->lvtbl->vars->tbl[i];
20111 if (!vtable_included(p->lvtbl->args, id)) {
20112 buf[j++] = id;
20113 }
20114 }
20115 if (--j < cnt) {
20116 REALLOC_N(buf, ID, (cnt = j) + 2);
20117 }
20118 buf[0] = cnt;
20120
20121 return buf;
20122}
20123
20124static NODE*
20125node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc)
20126{
20127 ID *a0;
20128 NODE *n;
20129
20130 a0 = local_tbl(p);
20131 n = NEW_NODE(type, a0, a1, a2, loc);
20132 return n;
20133}
20134
20135#endif
20136
20137static void
20138numparam_name(struct parser_params *p, ID id)
20139{
20140 if (!NUMPARAM_ID_P(id)) return;
20141 compile_error(p, "_%d is reserved for numbered parameter",
20142 NUMPARAM_ID_TO_IDX(id));
20143}
20144
20145static void
20146arg_var(struct parser_params *p, ID id)
20147{
20148 numparam_name(p, id);
20149 vtable_add(p->lvtbl->args, id);
20150}
20151
20152static void
20153local_var(struct parser_params *p, ID id)
20154{
20155 numparam_name(p, id);
20156 vtable_add(p->lvtbl->vars, id);
20157 if (p->lvtbl->used) {
20159 }
20160}
20161
20162static int
20163local_id_ref(struct parser_params *p, ID id, ID **vidrefp)
20164{
20165 struct vtable *vars, *args, *used;
20166
20167 vars = p->lvtbl->vars;
20168 args = p->lvtbl->args;
20169 used = p->lvtbl->used;
20170
20171 while (vars && !DVARS_TERMINAL_P(vars->prev)) {
20172 vars = vars->prev;
20173 args = args->prev;
20174 if (used) used = used->prev;
20175 }
20176
20177 if (vars && vars->prev == DVARS_INHERIT) {
20178 return rb_local_defined(id, p->parent_iseq);
20179 }
20180 else if (vtable_included(args, id)) {
20181 return 1;
20182 }
20183 else {
20184 int i = vtable_included(vars, id);
20185 if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
20186 return i != 0;
20187 }
20188}
20189
20190static int
20191local_id(struct parser_params *p, ID id)
20192{
20193 return local_id_ref(p, id, NULL);
20194}
20195
20196static int
20197check_forwarding_args(struct parser_params *p)
20198{
20199 if (local_id(p, idFWD_REST) &&
20200#if idFWD_KWREST
20201 local_id(p, idFWD_KWREST) &&
20202#endif
20203 local_id(p, idFWD_BLOCK)) return TRUE;
20204 compile_error(p, "unexpected ...");
20205 return FALSE;
20206}
20207
20208static void
20209add_forwarding_args(struct parser_params *p)
20210{
20211 arg_var(p, idFWD_REST);
20212#if idFWD_KWREST
20213 arg_var(p, idFWD_KWREST);
20214#endif
20215 arg_var(p, idFWD_BLOCK);
20216}
20217
20218#ifndef RIPPER
20219static NODE *
20220new_args_forward_call(struct parser_params *p, NODE *leading, const YYLTYPE *loc, const YYLTYPE *argsloc)
20221{
20222 NODE *splat = NEW_SPLAT(NEW_LVAR(idFWD_REST, loc), loc);
20223#if idFWD_KWREST
20224 NODE *kwrest = list_append(p, NEW_LIST(0, loc), NEW_LVAR(idFWD_KWREST, loc));
20225#endif
20226 NODE *block = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, loc), loc);
20227 NODE *args = leading ? rest_arg_append(p, leading, splat, argsloc) : splat;
20228#if idFWD_KWREST
20229 args = arg_append(p, splat, new_hash(p, kwrest, loc), loc);
20230#endif
20231 return arg_blk_pass(args, block);
20232}
20233
20234static NODE *
20235new_args_forward_def(struct parser_params *p, NODE *leading, const YYLTYPE *loc)
20236{
20237 NODE *n = new_args_tail(p, Qnone, idFWD_KWREST, idFWD_BLOCK, loc);
20238 return new_args(p, leading, Qnone, idFWD_REST, Qnone, n, loc);
20239}
20240#endif
20241
20242static NODE *
20243numparam_push(struct parser_params *p)
20244{
20245#ifndef RIPPER
20246 struct local_vars *local = p->lvtbl;
20247 NODE *inner = local->numparam.inner;
20248 if (!local->numparam.outer) {
20249 local->numparam.outer = local->numparam.current;
20250 }
20251 local->numparam.inner = 0;
20252 local->numparam.current = 0;
20253 return inner;
20254#else
20255 return 0;
20256#endif
20257}
20258
20259static void
20260numparam_pop(struct parser_params *p, NODE *prev_inner)
20261{
20262#ifndef RIPPER
20263 struct local_vars *local = p->lvtbl;
20264 if (prev_inner) {
20265 /* prefer first one */
20266 local->numparam.inner = prev_inner;
20267 }
20268 else if (local->numparam.current) {
20269 /* current and inner are exclusive */
20270 local->numparam.inner = local->numparam.current;
20271 }
20272 if (p->max_numparam > NO_PARAM) {
20273 /* current and outer are exclusive */
20274 local->numparam.current = local->numparam.outer;
20275 local->numparam.outer = 0;
20276 }
20277 else {
20278 /* no numbered parameter */
20279 local->numparam.current = 0;
20280 }
20281#endif
20282}
20283
20284static const struct vtable *
20285dyna_push(struct parser_params *p)
20286{
20287 p->lvtbl->args = vtable_alloc(p->lvtbl->args);
20288 p->lvtbl->vars = vtable_alloc(p->lvtbl->vars);
20289 if (p->lvtbl->used) {
20290 p->lvtbl->used = vtable_alloc(p->lvtbl->used);
20291 }
20292 return p->lvtbl->args;
20293}
20294
20295static void
20296dyna_pop_vtable(struct parser_params *p, struct vtable **vtblp)
20297{
20298 struct vtable *tmp = *vtblp;
20299 *vtblp = tmp->prev;
20300# if WARN_PAST_SCOPE
20301 if (p->past_scope_enabled) {
20302 tmp->prev = p->lvtbl->past;
20303 p->lvtbl->past = tmp;
20304 return;
20305 }
20306# endif
20307 vtable_free(tmp);
20308}
20309
20310static void
20311dyna_pop_1(struct parser_params *p)
20312{
20313 struct vtable *tmp;
20314
20315 if ((tmp = p->lvtbl->used) != 0) {
20316 warn_unused_var(p, p->lvtbl);
20317 p->lvtbl->used = p->lvtbl->used->prev;
20318 vtable_free(tmp);
20319 }
20320 dyna_pop_vtable(p, &p->lvtbl->args);
20321 dyna_pop_vtable(p, &p->lvtbl->vars);
20322}
20323
20324static void
20325dyna_pop(struct parser_params *p, const struct vtable *lvargs)
20326{
20327 while (p->lvtbl->args != lvargs) {
20328 dyna_pop_1(p);
20329 if (!p->lvtbl->args) {
20330 struct local_vars *local = p->lvtbl->prev;
20331 ruby_sized_xfree(p->lvtbl, sizeof(*p->lvtbl));
20332 p->lvtbl = local;
20333 }
20334 }
20335 dyna_pop_1(p);
20336}
20337
20338static int
20339dyna_in_block(struct parser_params *p)
20340{
20341 return !DVARS_TERMINAL_P(p->lvtbl->vars) && p->lvtbl->vars->prev != DVARS_TOPSCOPE;
20342}
20343
20344static int
20345dvar_defined_ref(struct parser_params *p, ID id, ID **vidrefp)
20346{
20347 struct vtable *vars, *args, *used;
20348 int i;
20349
20350 args = p->lvtbl->args;
20351 vars = p->lvtbl->vars;
20352 used = p->lvtbl->used;
20353
20354 while (!DVARS_TERMINAL_P(vars)) {
20355 if (vtable_included(args, id)) {
20356 return 1;
20357 }
20358 if ((i = vtable_included(vars, id)) != 0) {
20359 if (used && vidrefp) *vidrefp = &used->tbl[i-1];
20360 return 1;
20361 }
20362 args = args->prev;
20363 vars = vars->prev;
20364 if (!vidrefp) used = 0;
20365 if (used) used = used->prev;
20366 }
20367
20368 if (vars == DVARS_INHERIT && !NUMPARAM_ID_P(id)) {
20369 return rb_dvar_defined(id, p->parent_iseq);
20370 }
20371
20372 return 0;
20373}
20374
20375static int
20376dvar_defined(struct parser_params *p, ID id)
20377{
20378 return dvar_defined_ref(p, id, NULL);
20379}
20380
20381static int
20382dvar_curr(struct parser_params *p, ID id)
20383{
20384 return (vtable_included(p->lvtbl->args, id) ||
20385 vtable_included(p->lvtbl->vars, id));
20386}
20387
20388static void
20389reg_fragment_enc_error(struct parser_params* p, VALUE str, int c)
20390{
20391 compile_error(p,
20392 "regexp encoding option '%c' differs from source encoding '%s'",
20394}
20395
20396#ifndef RIPPER
20397int
20399{
20400 int c = RE_OPTION_ENCODING_IDX(options);
20401
20402 if (c) {
20403 int opt, idx;
20404 rb_char_to_option_kcode(c, &opt, &idx);
20405 if (idx != ENCODING_GET(str) &&
20407 goto error;
20408 }
20409 ENCODING_SET(str, idx);
20410 }
20411 else if (RE_OPTION_ENCODING_NONE(options)) {
20412 if (!ENCODING_IS_ASCII8BIT(str) &&
20414 c = 'n';
20415 goto error;
20416 }
20418 }
20419 else if (p->enc == rb_usascii_encoding()) {
20421 /* raise in re.c */
20423 }
20424 else {
20426 }
20427 }
20428 return 0;
20429
20430 error:
20431 return c;
20432}
20433
20434static void
20435reg_fragment_setenc(struct parser_params* p, VALUE str, int options)
20436{
20437 int c = rb_reg_fragment_setenc(p, str, options);
20438 if (c) reg_fragment_enc_error(p, str, c);
20439}
20440
20441static int
20442reg_fragment_check(struct parser_params* p, VALUE str, int options)
20443{
20444 VALUE err;
20445 reg_fragment_setenc(p, str, options);
20447 if (err != Qnil) {
20449 compile_error(p, "%"PRIsVALUE, err);
20450 return 0;
20451 }
20452 return 1;
20453}
20454
20455typedef struct {
20456 struct parser_params* parser;
20457 rb_encoding *enc;
20458 NODE *succ_block;
20459 const YYLTYPE *loc;
20461
20462static int
20463reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
20464 int back_num, int *back_refs, OnigRegex regex, void *arg0)
20465{
20467 struct parser_params* p = arg->parser;
20468 rb_encoding *enc = arg->enc;
20469 long len = name_end - name;
20470 const char *s = (const char *)name;
20471 ID var;
20472 NODE *node, *succ;
20473
20474 if (!len) return ST_CONTINUE;
20475 if (rb_enc_symname_type(s, len, enc, (1U<<ID_LOCAL)) != ID_LOCAL)
20476 return ST_CONTINUE;
20477
20478 var = intern_cstr(s, len, enc);
20479 if (len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) {
20480 if (!lvar_defined(p, var)) return ST_CONTINUE;
20481 }
20482 node = node_assign(p, assignable(p, var, 0, arg->loc), NEW_LIT(ID2SYM(var), arg->loc), NO_LEX_CTXT, arg->loc);
20483 succ = arg->succ_block;
20484 if (!succ) succ = NEW_BEGIN(0, arg->loc);
20485 succ = block_append(p, succ, node);
20486 arg->succ_block = succ;
20487 return ST_CONTINUE;
20488}
20489
20490static NODE *
20491reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc)
20492{
20494
20495 arg.parser = p;
20496 arg.enc = rb_enc_get(regexp);
20497 arg.succ_block = 0;
20498 arg.loc = loc;
20499 onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
20500
20501 if (!arg.succ_block) return 0;
20502 return arg.succ_block->nd_next;
20503}
20504
20505static VALUE
20506parser_reg_compile(struct parser_params* p, VALUE str, int options)
20507{
20508 reg_fragment_setenc(p, str, options);
20509 return rb_parser_reg_compile(p, str, options);
20510}
20511
20512VALUE
20514{
20516}
20517
20518static VALUE
20519reg_compile(struct parser_params* p, VALUE str, int options)
20520{
20521 VALUE re;
20522 VALUE err;
20523
20524 err = rb_errinfo();
20525 re = parser_reg_compile(p, str, options);
20526 if (NIL_P(re)) {
20527 VALUE m = rb_attr_get(rb_errinfo(), idMesg);
20529 compile_error(p, "%"PRIsVALUE, m);
20530 return Qnil;
20531 }
20532 return re;
20533}
20534#else
20535static VALUE
20536parser_reg_compile(struct parser_params* p, VALUE str, int options, VALUE *errmsg)
20537{
20538 VALUE err = rb_errinfo();
20539 VALUE re;
20540 str = ripper_is_node_yylval(str) ? RNODE(str)->nd_cval : str;
20541 int c = rb_reg_fragment_setenc(p, str, options);
20542 if (c) reg_fragment_enc_error(p, str, c);
20543 re = rb_parser_reg_compile(p, str, options);
20544 if (NIL_P(re)) {
20545 *errmsg = rb_attr_get(rb_errinfo(), idMesg);
20547 }
20548 return re;
20549}
20550#endif
20551
20552#ifndef RIPPER
20553void
20554rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
20555{
20556 struct parser_params *p;
20557 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20558 p->do_print = print;
20559 p->do_loop = loop;
20560 p->do_chomp = chomp;
20561 p->do_split = split;
20562}
20563
20564static NODE *
20565parser_append_options(struct parser_params *p, NODE *node)
20566{
20567 static const YYLTYPE default_location = {{1, 0}, {1, 0}};
20568 const YYLTYPE *const LOC = &default_location;
20569
20570 if (p->do_print) {
20571 NODE *print = NEW_FCALL(rb_intern("print"),
20572 NEW_LIST(NEW_GVAR(idLASTLINE, LOC), LOC),
20573 LOC);
20574 node = block_append(p, node, print);
20575 }
20576
20577 if (p->do_loop) {
20578 if (p->do_split) {
20579 ID ifs = rb_intern("$;");
20580 ID fields = rb_intern("$F");
20581 NODE *args = NEW_LIST(NEW_GVAR(ifs, LOC), LOC);
20582 NODE *split = NEW_GASGN(fields,
20583 NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
20584 rb_intern("split"), args, LOC),
20585 LOC);
20586 node = block_append(p, split, node);
20587 }
20588 if (p->do_chomp) {
20589 NODE *chomp = NEW_CALL(NEW_GVAR(idLASTLINE, LOC),
20590 rb_intern("chomp!"), 0, LOC);
20591 node = block_append(p, chomp, node);
20592 }
20593
20594 node = NEW_WHILE(NEW_VCALL(idGets, LOC), node, 1, LOC);
20595 }
20596
20597 return node;
20598}
20599
20600void
20602{
20603 /* just to suppress unused-function warnings */
20604 (void)nodetype;
20605 (void)nodeline;
20606}
20607
20608static ID
20609internal_id(struct parser_params *p)
20610{
20611 const ID max_id = RB_ID_SERIAL_MAX & ~0xffff;
20612 ID id = (ID)vtable_size(p->lvtbl->args) + (ID)vtable_size(p->lvtbl->vars);
20613 id = max_id - id;
20614 return ID_STATIC_SYM | ID_INTERNAL | (id << ID_SCOPE_SHIFT);
20615}
20616#endif /* !RIPPER */
20617
20618static void
20619parser_initialize(struct parser_params *p)
20620{
20621 /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
20622 p->command_start = TRUE;
20624 p->lex.lpar_beg = -1; /* make lambda_beginning_p() == FALSE at first */
20625 p->node_id = 0;
20626#ifdef RIPPER
20627 p->delayed.token = Qnil;
20628 p->result = Qnil;
20629 p->parsing_thread = Qnil;
20630#else
20631 p->error_buffer = Qfalse;
20632#endif
20633 p->debug_buffer = Qnil;
20635 p->enc = rb_utf8_encoding();
20636}
20637
20638#ifdef RIPPER
20639#define parser_mark ripper_parser_mark
20640#define parser_free ripper_parser_free
20641#endif
20642
20643static void
20644parser_mark(void *ptr)
20645{
20646 struct parser_params *p = (struct parser_params*)ptr;
20647
20648 rb_gc_mark(p->lex.input);
20654 rb_gc_mark((VALUE)p->ast);
20656#ifndef RIPPER
20660#else
20661 rb_gc_mark(p->delayed.token);
20662 rb_gc_mark(p->value);
20663 rb_gc_mark(p->result);
20664 rb_gc_mark(p->parsing_thread);
20665#endif
20668#ifdef YYMALLOC
20669 rb_gc_mark((VALUE)p->heap);
20670#endif
20671}
20672
20673static void
20674parser_free(void *ptr)
20675{
20676 struct parser_params *p = (struct parser_params*)ptr;
20677 struct local_vars *local, *prev;
20678
20679 if (p->tokenbuf) {
20681 }
20682 for (local = p->lvtbl; local; local = prev) {
20683 if (local->vars) xfree(local->vars);
20684 prev = local->prev;
20685 xfree(local);
20686 }
20687 {
20688 token_info *ptinfo;
20689 while ((ptinfo = p->token_info) != 0) {
20690 p->token_info = ptinfo->next;
20691 xfree(ptinfo);
20692 }
20693 }
20694 xfree(ptr);
20695}
20696
20697static size_t
20698parser_memsize(const void *ptr)
20699{
20700 struct parser_params *p = (struct parser_params*)ptr;
20701 struct local_vars *local;
20702 size_t size = sizeof(*p);
20703
20704 size += p->toksiz;
20705 for (local = p->lvtbl; local; local = local->prev) {
20706 size += sizeof(*local);
20707 if (local->vars) size += local->vars->capa * sizeof(ID);
20708 }
20709 return size;
20710}
20711
20712static const rb_data_type_t parser_data_type = {
20713#ifndef RIPPER
20714 "parser",
20715#else
20716 "ripper",
20717#endif
20718 {
20719 parser_mark,
20720 parser_free,
20721 parser_memsize,
20722 },
20724};
20725
20726#ifndef RIPPER
20727#undef rb_reserved_word
20728
20729const struct kwtable *
20730rb_reserved_word(const char *str, unsigned int len)
20731{
20732 return reserved_word(str, len);
20733}
20734
20735VALUE
20737{
20738 struct parser_params *p;
20739 VALUE parser = TypedData_Make_Struct(0, struct parser_params,
20740 &parser_data_type, p);
20741 parser_initialize(p);
20742 return parser;
20743}
20744
20745VALUE
20746rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
20747{
20748 struct parser_params *p;
20749
20750 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20751 p->error_buffer = main ? Qfalse : Qnil;
20752 p->parent_iseq = base;
20753 return vparser;
20754}
20755#endif
20756
20757#ifdef RIPPER
20758#define rb_parser_end_seen_p ripper_parser_end_seen_p
20759#define rb_parser_encoding ripper_parser_encoding
20760#define rb_parser_get_yydebug ripper_parser_get_yydebug
20761#define rb_parser_set_yydebug ripper_parser_set_yydebug
20762#define rb_parser_get_debug_output ripper_parser_get_debug_output
20763#define rb_parser_set_debug_output ripper_parser_set_debug_output
20764static VALUE ripper_parser_end_seen_p(VALUE vparser);
20765static VALUE ripper_parser_encoding(VALUE vparser);
20766static VALUE ripper_parser_get_yydebug(VALUE self);
20767static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
20768static VALUE ripper_parser_get_debug_output(VALUE self);
20769static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output);
20770
20771/*
20772 * call-seq:
20773 * ripper.error? -> Boolean
20774 *
20775 * Return true if parsed source has errors.
20776 */
20777static VALUE
20778ripper_error_p(VALUE vparser)
20779{
20780 struct parser_params *p;
20781
20782 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20783 return p->error_p ? Qtrue : Qfalse;
20784}
20785#endif
20786
20787/*
20788 * call-seq:
20789 * ripper.end_seen? -> Boolean
20790 *
20791 * Return true if parsed source ended by +\_\_END\_\_+.
20792 */
20793VALUE
20795{
20796 struct parser_params *p;
20797
20798 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20799 return p->ruby__end__seen ? Qtrue : Qfalse;
20800}
20801
20802/*
20803 * call-seq:
20804 * ripper.encoding -> encoding
20805 *
20806 * Return encoding of the source.
20807 */
20808VALUE
20810{
20811 struct parser_params *p;
20812
20813 TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, p);
20814 return rb_enc_from_encoding(p->enc);
20815}
20816
20817#ifdef RIPPER
20818/*
20819 * call-seq:
20820 * ripper.yydebug -> true or false
20821 *
20822 * Get yydebug.
20823 */
20824VALUE
20825rb_parser_get_yydebug(VALUE self)
20826{
20827 struct parser_params *p;
20828
20829 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20830 return p->debug ? Qtrue : Qfalse;
20831}
20832#endif
20833
20834/*
20835 * call-seq:
20836 * ripper.yydebug = flag
20837 *
20838 * Set yydebug.
20839 */
20840VALUE
20842{
20843 struct parser_params *p;
20844
20845 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20846 p->debug = RTEST(flag);
20847 return flag;
20848}
20849
20850/*
20851 * call-seq:
20852 * ripper.debug_output -> obj
20853 *
20854 * Get debug output.
20855 */
20856VALUE
20858{
20859 struct parser_params *p;
20860
20861 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20862 return p->debug_output;
20863}
20864
20865/*
20866 * call-seq:
20867 * ripper.debug_output = obj
20868 *
20869 * Set debug output.
20870 */
20871VALUE
20873{
20874 struct parser_params *p;
20875
20876 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
20877 return p->debug_output = output;
20878}
20879
20880#ifndef RIPPER
20881#ifdef YYMALLOC
20882#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
20883/* Keep the order; NEWHEAP then xmalloc and ADD2HEAP to get rid of
20884 * potential memory leak */
20885#define NEWHEAP() rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
20886#define ADD2HEAP(new, cnt, ptr) ((p->heap = (new))->ptr = (ptr), \
20887 (new)->cnt = (cnt), (ptr))
20888
20889void *
20891{
20892 size_t cnt = HEAPCNT(1, size);
20894 void *ptr = xmalloc(size);
20895
20896 return ADD2HEAP(n, cnt, ptr);
20897}
20898
20899void *
20900rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
20901{
20902 size_t cnt = HEAPCNT(nelem, size);
20904 void *ptr = xcalloc(nelem, size);
20905
20906 return ADD2HEAP(n, cnt, ptr);
20907}
20908
20909void *
20910rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
20911{
20913 size_t cnt = HEAPCNT(1, size);
20914
20915 if (ptr && (n = p->heap) != NULL) {
20916 do {
20917 if (n->ptr == ptr) {
20918 n->ptr = ptr = xrealloc(ptr, size);
20919 if (n->cnt) n->cnt = cnt;
20920 return ptr;
20921 }
20922 } while ((n = n->next) != NULL);
20923 }
20924 n = NEWHEAP();
20925 ptr = xrealloc(ptr, size);
20926 return ADD2HEAP(n, cnt, ptr);
20927}
20928
20929void
20931{
20932 rb_imemo_tmpbuf_t **prev = &p->heap, *n;
20933
20934 while ((n = *prev) != NULL) {
20935 if (n->ptr == ptr) {
20936 *prev = n->next;
20938 break;
20939 }
20940 prev = &n->next;
20941 }
20942 xfree(ptr);
20943}
20944#endif
20945
20946void
20947rb_parser_printf(struct parser_params *p, const char *fmt, ...)
20948{
20949 va_list ap;
20950 VALUE mesg = p->debug_buffer;
20951
20952 if (NIL_P(mesg)) p->debug_buffer = mesg = rb_str_new(0, 0);
20953 va_start(ap, fmt);
20954 rb_str_vcatf(mesg, fmt, ap);
20955 va_end(ap);
20956 if (RSTRING_END(mesg)[-1] == '\n') {
20957 rb_io_write(p->debug_output, mesg);
20958 p->debug_buffer = Qnil;
20959 }
20960}
20961
20962static void
20963parser_compile_error(struct parser_params *p, const char *fmt, ...)
20964{
20965 va_list ap;
20966
20968 p->error_p = 1;
20969 va_start(ap, fmt);
20970 p->error_buffer =
20973 p->ruby_sourceline,
20974 rb_long2int(p->lex.pcur - p->lex.pbeg),
20975 p->enc, fmt, ap);
20976 va_end(ap);
20977}
20978
20979static size_t
20980count_char(const char *str, int c)
20981{
20982 int n = 0;
20983 while (str[n] == c) ++n;
20984 return n;
20985}
20986
20987/*
20988 * strip enclosing double-quotes, same as the default yytnamerr except
20989 * for that single-quotes matching back-quotes do not stop stripping.
20990 *
20991 * "\"`class' keyword\"" => "`class' keyword"
20992 */
20993RUBY_FUNC_EXPORTED size_t
20994rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
20995{
20996 if (*yystr == '"') {
20997 size_t yyn = 0, bquote = 0;
20998 const char *yyp = yystr;
20999
21000 while (*++yyp) {
21001 switch (*yyp) {
21002 case '`':
21003 if (!bquote) {
21004 bquote = count_char(yyp+1, '`') + 1;
21005 if (yyres) memcpy(&yyres[yyn], yyp, bquote);
21006 yyn += bquote;
21007 yyp += bquote - 1;
21008 break;
21009 }
21010 goto default_char;
21011
21012 case '\'':
21013 if (bquote && count_char(yyp+1, '\'') + 1 == bquote) {
21014 if (yyres) memcpy(yyres + yyn, yyp, bquote);
21015 yyn += bquote;
21016 yyp += bquote - 1;
21017 bquote = 0;
21018 break;
21019 }
21020 if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
21021 if (yyres) memcpy(yyres + yyn, yyp, 3);
21022 yyn += 3;
21023 yyp += 2;
21024 break;
21025 }
21026 goto do_not_strip_quotes;
21027
21028 case ',':
21029 goto do_not_strip_quotes;
21030
21031 case '\\':
21032 if (*++yyp != '\\')
21033 goto do_not_strip_quotes;
21034 /* Fall through. */
21035 default_char:
21036 default:
21037 if (yyres)
21038 yyres[yyn] = *yyp;
21039 yyn++;
21040 break;
21041
21042 case '"':
21043 case '\0':
21044 if (yyres)
21045 yyres[yyn] = '\0';
21046 return yyn;
21047 }
21048 }
21049 do_not_strip_quotes: ;
21050 }
21051
21052 if (!yyres) return strlen(yystr);
21053
21054 return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
21055}
21056#endif
21057
21058#ifdef RIPPER
21059#ifdef RIPPER_DEBUG
21060/* :nodoc: */
21061static VALUE
21062ripper_validate_object(VALUE self, VALUE x)
21063{
21064 if (x == Qfalse) return x;
21065 if (x == Qtrue) return x;
21066 if (x == Qnil) return x;
21067 if (x == Qundef)
21068 rb_raise(rb_eArgError, "Qundef given");
21069 if (FIXNUM_P(x)) return x;
21070 if (SYMBOL_P(x)) return x;
21071 switch (BUILTIN_TYPE(x)) {
21072 case T_STRING:
21073 case T_OBJECT:
21074 case T_ARRAY:
21075 case T_BIGNUM:
21076 case T_FLOAT:
21077 case T_COMPLEX:
21078 case T_RATIONAL:
21079 break;
21080 case T_NODE:
21081 if (nd_type((NODE *)x) != NODE_RIPPER) {
21082 rb_raise(rb_eArgError, "NODE given: %p", (void *)x);
21083 }
21084 x = ((NODE *)x)->nd_rval;
21085 break;
21086 default:
21087 rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
21088 (void *)x, rb_obj_classname(x));
21089 }
21090 if (!RBASIC_CLASS(x)) {
21091 rb_raise(rb_eArgError, "hidden ruby object: %p (%s)",
21092 (void *)x, rb_builtin_type_name(TYPE(x)));
21093 }
21094 return x;
21095}
21096#endif
21097
21098#define validate(x) ((x) = get_value(x))
21099
21100static VALUE
21101ripper_dispatch0(struct parser_params *p, ID mid)
21102{
21103 return rb_funcall(p->value, mid, 0);
21104}
21105
21106static VALUE
21107ripper_dispatch1(struct parser_params *p, ID mid, VALUE a)
21108{
21109 validate(a);
21110 return rb_funcall(p->value, mid, 1, a);
21111}
21112
21113static VALUE
21114ripper_dispatch2(struct parser_params *p, ID mid, VALUE a, VALUE b)
21115{
21116 validate(a);
21117 validate(b);
21118 return rb_funcall(p->value, mid, 2, a, b);
21119}
21120
21121static VALUE
21122ripper_dispatch3(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c)
21123{
21124 validate(a);
21125 validate(b);
21126 validate(c);
21127 return rb_funcall(p->value, mid, 3, a, b, c);
21128}
21129
21130static VALUE
21131ripper_dispatch4(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
21132{
21133 validate(a);
21134 validate(b);
21135 validate(c);
21136 validate(d);
21137 return rb_funcall(p->value, mid, 4, a, b, c, d);
21138}
21139
21140static VALUE
21141ripper_dispatch5(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
21142{
21143 validate(a);
21144 validate(b);
21145 validate(c);
21146 validate(d);
21147 validate(e);
21148 return rb_funcall(p->value, mid, 5, a, b, c, d, e);
21149}
21150
21151static VALUE
21152ripper_dispatch7(struct parser_params *p, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e, VALUE f, VALUE g)
21153{
21154 validate(a);
21155 validate(b);
21156 validate(c);
21157 validate(d);
21158 validate(e);
21159 validate(f);
21160 validate(g);
21161 return rb_funcall(p->value, mid, 7, a, b, c, d, e, f, g);
21162}
21163
21164static ID
21165ripper_get_id(VALUE v)
21166{
21167 NODE *nd;
21168 if (!RB_TYPE_P(v, T_NODE)) return 0;
21169 nd = (NODE *)v;
21170 if (nd_type(nd) != NODE_RIPPER) return 0;
21171 return nd->nd_vid;
21172}
21173
21174static VALUE
21175ripper_get_value(VALUE v)
21176{
21177 NODE *nd;
21178 if (v == Qundef) return Qnil;
21179 if (!RB_TYPE_P(v, T_NODE)) return v;
21180 nd = (NODE *)v;
21181 if (nd_type(nd) != NODE_RIPPER) return Qnil;
21182 return nd->nd_rval;
21183}
21184
21185static void
21186ripper_error(struct parser_params *p)
21187{
21188 p->error_p = TRUE;
21189}
21190
21191static void
21192ripper_compile_error(struct parser_params *p, const char *fmt, ...)
21193{
21194 VALUE str;
21195 va_list args;
21196
21197 va_start(args, fmt);
21198 str = rb_vsprintf(fmt, args);
21199 va_end(args);
21200 rb_funcall(p->value, rb_intern("compile_error"), 1, str);
21201 ripper_error(p);
21202}
21203
21204static VALUE
21205ripper_lex_get_generic(struct parser_params *p, VALUE src)
21206{
21207 VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
21208 if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
21210 "gets returned %"PRIsVALUE" (expected String or nil)",
21211 rb_obj_class(line));
21212 }
21213 return line;
21214}
21215
21216static VALUE
21217ripper_lex_io_get(struct parser_params *p, VALUE src)
21218{
21219 return rb_io_gets(src);
21220}
21221
21222static VALUE
21223ripper_s_allocate(VALUE klass)
21224{
21225 struct parser_params *p;
21226 VALUE self = TypedData_Make_Struct(klass, struct parser_params,
21227 &parser_data_type, p);
21228 p->value = self;
21229 return self;
21230}
21231
21232#define ripper_initialized_p(r) ((r)->lex.input != 0)
21233
21234/*
21235 * call-seq:
21236 * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
21237 *
21238 * Create a new Ripper object.
21239 * _src_ must be a String, an IO, or an Object which has #gets method.
21240 *
21241 * This method does not starts parsing.
21242 * See also Ripper#parse and Ripper.parse.
21243 */
21244static VALUE
21245ripper_initialize(int argc, VALUE *argv, VALUE self)
21246{
21247 struct parser_params *p;
21248 VALUE src, fname, lineno;
21249
21250 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21251 rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
21252 if (RB_TYPE_P(src, T_FILE)) {
21253 p->lex.gets = ripper_lex_io_get;
21254 }
21255 else if (rb_respond_to(src, id_gets)) {
21256 p->lex.gets = ripper_lex_get_generic;
21257 }
21258 else {
21259 StringValue(src);
21260 p->lex.gets = lex_get_str;
21261 }
21262 p->lex.input = src;
21263 p->eofp = 0;
21264 if (NIL_P(fname)) {
21265 fname = STR_NEW2("(ripper)");
21266 OBJ_FREEZE(fname);
21267 }
21268 else {
21269 StringValueCStr(fname);
21270 fname = rb_str_new_frozen(fname);
21271 }
21272 parser_initialize(p);
21273
21274 p->ruby_sourcefile_string = fname;
21275 p->ruby_sourcefile = RSTRING_PTR(fname);
21276 p->ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
21277
21278 return Qnil;
21279}
21280
21281static VALUE
21282ripper_parse0(VALUE parser_v)
21283{
21284 struct parser_params *p;
21285
21286 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
21287 parser_prepare(p);
21288 p->ast = rb_ast_new();
21289 ripper_yyparse((void*)p);
21290 rb_ast_dispose(p->ast);
21291 p->ast = 0;
21292 return p->result;
21293}
21294
21295static VALUE
21296ripper_ensure(VALUE parser_v)
21297{
21298 struct parser_params *p;
21299
21300 TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, p);
21301 p->parsing_thread = Qnil;
21302 return Qnil;
21303}
21304
21305/*
21306 * call-seq:
21307 * ripper.parse
21308 *
21309 * Start parsing and returns the value of the root action.
21310 */
21311static VALUE
21312ripper_parse(VALUE self)
21313{
21314 struct parser_params *p;
21315
21316 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21317 if (!ripper_initialized_p(p)) {
21318 rb_raise(rb_eArgError, "method called for uninitialized object");
21319 }
21320 if (!NIL_P(p->parsing_thread)) {
21321 if (p->parsing_thread == rb_thread_current())
21322 rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
21323 else
21324 rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
21325 }
21326 p->parsing_thread = rb_thread_current();
21327 rb_ensure(ripper_parse0, self, ripper_ensure, self);
21328
21329 return p->result;
21330}
21331
21332/*
21333 * call-seq:
21334 * ripper.column -> Integer
21335 *
21336 * Return column number of current parsing line.
21337 * This number starts from 0.
21338 */
21339static VALUE
21340ripper_column(VALUE self)
21341{
21342 struct parser_params *p;
21343 long col;
21344
21345 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21346 if (!ripper_initialized_p(p)) {
21347 rb_raise(rb_eArgError, "method called for uninitialized object");
21348 }
21349 if (NIL_P(p->parsing_thread)) return Qnil;
21350 col = p->lex.ptok - p->lex.pbeg;
21351 return LONG2NUM(col);
21352}
21353
21354/*
21355 * call-seq:
21356 * ripper.filename -> String
21357 *
21358 * Return current parsing filename.
21359 */
21360static VALUE
21361ripper_filename(VALUE self)
21362{
21363 struct parser_params *p;
21364
21365 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21366 if (!ripper_initialized_p(p)) {
21367 rb_raise(rb_eArgError, "method called for uninitialized object");
21368 }
21369 return p->ruby_sourcefile_string;
21370}
21371
21372/*
21373 * call-seq:
21374 * ripper.lineno -> Integer
21375 *
21376 * Return line number of current parsing line.
21377 * This number starts from 1.
21378 */
21379static VALUE
21380ripper_lineno(VALUE self)
21381{
21382 struct parser_params *p;
21383
21384 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21385 if (!ripper_initialized_p(p)) {
21386 rb_raise(rb_eArgError, "method called for uninitialized object");
21387 }
21388 if (NIL_P(p->parsing_thread)) return Qnil;
21389 return INT2NUM(p->ruby_sourceline);
21390}
21391
21392/*
21393 * call-seq:
21394 * ripper.state -> Integer
21395 *
21396 * Return scanner state of current token.
21397 */
21398static VALUE
21399ripper_state(VALUE self)
21400{
21401 struct parser_params *p;
21402
21403 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21404 if (!ripper_initialized_p(p)) {
21405 rb_raise(rb_eArgError, "method called for uninitialized object");
21406 }
21407 if (NIL_P(p->parsing_thread)) return Qnil;
21408 return INT2NUM(p->lex.state);
21409}
21410
21411/*
21412 * call-seq:
21413 * ripper.token -> String
21414 *
21415 * Return the current token string.
21416 */
21417static VALUE
21418ripper_token(VALUE self)
21419{
21420 struct parser_params *p;
21421 long pos, len;
21422
21423 TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
21424 if (!ripper_initialized_p(p)) {
21425 rb_raise(rb_eArgError, "method called for uninitialized object");
21426 }
21427 if (NIL_P(p->parsing_thread)) return Qnil;
21428 pos = p->lex.ptok - p->lex.pbeg;
21429 len = p->lex.pcur - p->lex.ptok;
21430 return rb_str_subseq(p->lex.lastline, pos, len);
21431}
21432
21433#ifdef RIPPER_DEBUG
21434/* :nodoc: */
21435static VALUE
21436ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
21437{
21438 StringValue(msg);
21439 if (obj == Qundef) {
21441 }
21442 return Qnil;
21443}
21444
21445/* :nodoc: */
21446static VALUE
21447ripper_value(VALUE self, VALUE obj)
21448{
21449 return ULONG2NUM(obj);
21450}
21451#endif
21452
21453/*
21454 * call-seq:
21455 * Ripper.lex_state_name(integer) -> string
21456 *
21457 * Returns a string representation of lex_state.
21458 */
21459static VALUE
21460ripper_lex_state_name(VALUE self, VALUE state)
21461{
21463}
21464
21465void
21466Init_ripper(void)
21467{
21468 ripper_init_eventids1();
21469 ripper_init_eventids2();
21470 id_warn = rb_intern_const("warn");
21471 id_warning = rb_intern_const("warning");
21472 id_gets = rb_intern_const("gets");
21473 id_assoc = rb_intern_const("=>");
21474
21475 (void)yystpcpy; /* may not used in newer bison */
21476
21477 InitVM(ripper);
21478}
21479
21480void
21481InitVM_ripper(void)
21482{
21483 VALUE Ripper;
21484
21485 Ripper = rb_define_class("Ripper", rb_cObject);
21486 /* version of Ripper */
21487 rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
21488 rb_define_alloc_func(Ripper, ripper_s_allocate);
21489 rb_define_method(Ripper, "initialize", ripper_initialize, -1);
21490 rb_define_method(Ripper, "parse", ripper_parse, 0);
21491 rb_define_method(Ripper, "column", ripper_column, 0);
21492 rb_define_method(Ripper, "filename", ripper_filename, 0);
21493 rb_define_method(Ripper, "lineno", ripper_lineno, 0);
21494 rb_define_method(Ripper, "state", ripper_state, 0);
21495 rb_define_method(Ripper, "token", ripper_token, 0);
21496 rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
21497 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
21498 rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
21499 rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
21500 rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0);
21501 rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1);
21502 rb_define_method(Ripper, "error?", ripper_error_p, 0);
21503#ifdef RIPPER_DEBUG
21504 rb_define_method(Ripper, "assert_Qundef", ripper_assert_Qundef, 2);
21505 rb_define_method(Ripper, "rawVALUE", ripper_value, 1);
21506 rb_define_method(Ripper, "validate_object", ripper_validate_object, 1);
21507#endif
21508
21509 rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
21510 rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
21511
21512 rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
21513
21514<% @exprs.each do |expr, desc| -%>
21515 /* <%=desc%> */
21516 rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
21517<% end %>
21518 ripper_init_eventids1_table(Ripper);
21519 ripper_init_eventids2_table(Ripper);
21520
21521# if 0
21522 /* Hack to let RDoc document SCRIPT_LINES__ */
21523
21524 /*
21525 * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
21526 * after the assignment will be added as an Array of lines with the file
21527 * name as the key.
21528 */
21529 rb_define_global_const("SCRIPT_LINES__", Qnil);
21530#endif
21531
21532}
21533#endif /* RIPPER */
21534
21535/*
21536 * Local variables:
21537 * mode: c
21538 * c-file-style: "ruby"
21539 * End:
21540 */
VALUE rb_ary_reverse(VALUE ary)
Definition: array.c:2998
VALUE rb_ary_push(VALUE ary, VALUE item)
Definition: array.c:1301
VALUE rb_ary_unshift(VALUE ary, VALUE item)
Definition: array.c:1654
VALUE rb_ary_new(void)
Definition: array.c:749
VALUE rb_ary_clear(VALUE ary)
Definition: array.c:4534
VALUE rb_ary_join(VALUE ary, VALUE sep)
Definition: array.c:2780
#define END(name)
Definition: asm.h:115
#define PRINTF_ARGS(decl, string_index, first_to_check)
Definition: attributes.h:112
#define UNREACHABLE_RETURN
Definition: assume.h:31
#define ASSUME
Definition: assume.h:29
VALUE rb_big_norm(VALUE x)
Definition: bignum.c:3158
VALUE rb_cstr_to_inum(const char *str, int base, int badcheck)
Definition: bignum.c:4016
#define local
Definition: blast.c:36
int main(void)
Definition: closure_fn0.c:49
int rb_dvar_defined(ID id, const rb_iseq_t *iseq)
Definition: compile.c:9772
VALUE rb_node_case_when_optimizable_literal(const NODE *const node)
Definition: compile.c:4480
int rb_local_defined(ID id, const rb_iseq_t *iseq)
Definition: compile.c:9797
Internal header for the compiler.
Internal header absorbing C compipler differences.
VALUE rb_complex_raw(VALUE x, VALUE y)
Definition: complex.c:1536
Our own, locale independent, character handling routines.
#define ISSPACE
Definition: ctype.h:38
#define ISDIGIT
Definition: ctype.h:43
#define STRCASECMP
Definition: ctype.h:52
#define ISALPHA
Definition: ctype.h:42
#define STRNCASECMP
Definition: ctype.h:53
#define ISASCII
Definition: ctype.h:35
#define ISXDIGIT
Definition: ctype.h:44
#define ISCNTRL
Definition: ctype.h:46
#define ISALNUM
Definition: ctype.h:41
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
Definition: cxxanyargs.hpp:653
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
Definition: cxxanyargs.hpp:668
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
Definition: cxxanyargs.hpp:660
VALUE rb_int_positive_pow(long x, unsigned long y)
Definition: numeric.c:4022
enum @11::@13::@14 mask
struct RIMemo * ptr
Definition: debug.c:88
#define free(x)
Definition: dln.c:52
#define RFLOAT_VALUE
Definition: double.h:28
#define DBL2NUM
Definition: double.h:29
#define rb_ascii8bit_encindex()
Definition: encindex.h:57
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
Definition: encoding.c:1230
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
Definition: encoding.c:1064
rb_encoding * rb_utf8_encoding(void)
Definition: encoding.c:1537
rb_encoding * rb_ascii8bit_encoding(void)
Definition: encoding.c:1525
rb_encoding * rb_enc_from_index(int index)
Definition: encoding.c:414
rb_encoding * rb_enc_get(VALUE obj)
Definition: encoding.c:1070
rb_encoding * rb_enc_compatible(VALUE str1, VALUE str2)
Definition: encoding.c:1172
rb_encoding * rb_usascii_encoding(void)
Definition: encoding.c:1549
VALUE rb_enc_from_encoding(rb_encoding *encoding)
Definition: encoding.c:188
VALUE rb_enc_associate_index(VALUE obj, int idx)
Definition: encoding.c:1036
int rb_enc_find_index(const char *name)
Definition: encoding.c:879
int rb_enc_codelen(int c, rb_encoding *enc)
Definition: encoding.c:1287
struct @77 g
int root
Definition: enough.c:226
big_t * num
Definition: enough.c:232
string_t out
Definition: enough.c:230
uint8_t len
Definition: escape.c:17
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
Definition: util.c:101
#define numberof(array)
Definition: etc.c:649
#define tEMBDOC
Definition: eventids2.c:9
#define tHEREDOC_BEG
Definition: eventids2.c:13
#define k__END__
Definition: eventids2.c:17
#define tCOMMENT
Definition: eventids2.c:5
#define tEMBDOC_BEG
Definition: eventids2.c:7
#define tHEREDOC_END
Definition: eventids2.c:15
#define tEMBDOC_END
Definition: eventids2.c:11
#define tIGNORED_NL
Definition: eventids2.c:3
#define RSTRING_LEN(string)
Definition: fbuffer.h:22
#define RSTRING_PTR(string)
Definition: fbuffer.h:19
#define MAYBE_UNUSED
Definition: ffi_common.h:30
#define UNLIKELY(x)
Definition: ffi_common.h:126
#define memcpy(d, s, n)
Definition: ffi_common.h:55
#define PRIsVALUE
Definition: function.c:10
void rb_gc_force_recycle(VALUE obj)
Definition: gc.c:7968
void rb_gc_mark(VALUE ptr)
Definition: gc.c:6112
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
Definition: gc.c:2412
void rb_gc_register_mark_object(VALUE obj)
Inform the garbage collector that object is a live Ruby object that should not be moved.
Definition: gc.c:8022
#define rb_intern_str(string)
Definition: generator.h:16
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
Definition: class.c:748
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
Definition: class.c:2296
#define OBJ_FREEZE_RAW
Definition: fl_type.h:135
#define OBJ_FREEZE
Definition: fl_type.h:134
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:125
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:2917
void rb_compile_warn(const char *file, int line, const char *fmt,...)
Definition: error.c:351
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
Definition: eval.c:712
void rb_set_errinfo(VALUE err)
Sets the current exception ($!) to the given value.
Definition: eval.c:1925
VALUE rb_ident_hash_new(void)
Definition: hash.c:4443
const char * rb_builtin_type_name(int t)
Definition: error.c:890
VALUE rb_eTypeError
Definition: error.c:1057
void rb_fatal(const char *fmt,...)
Definition: error.c:2968
const char * rb_builtin_class_name(VALUE x)
Definition: error.c:937
VALUE rb_make_exception(int argc, const VALUE *argv)
Make an Exception object from the list of arguments in a manner similar to Kernel#raise.
Definition: eval.c:888
VALUE rb_eRuntimeError
Definition: error.c:1055
VALUE rb_eArgError
Definition: error.c:1058
void rb_compile_warning(const char *file, int line, const char *fmt,...)
Definition: error.c:366
VALUE rb_ensure(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*e_proc)(VALUE), VALUE data2)
An equivalent to ensure clause.
Definition: eval.c:1148
VALUE rb_errinfo(void)
The current exception in the current thread.
Definition: eval.c:1911
VALUE rb_eSyntaxError
Definition: error.c:1073
bool rb_warning_category_enabled_p(rb_warning_category_t category)
Definition: error.c:182
VALUE rb_cObject
Object class.
Definition: object.c:49
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
Definition: object.c:1953
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
Definition: object.c:92
VALUE rb_obj_class(VALUE)
Definition: object.c:245
VALUE rb_obj_freeze(VALUE)
Make the object unmodifiable.
Definition: object.c:1101
unsigned char suffix[65536]
Definition: gun.c:164
unsigned char match[65280+2]
Definition: gun.c:165
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
Definition: hash.c:2901
VALUE rb_hash_lookup(VALUE hash, VALUE key)
Definition: hash.c:2072
VALUE rb_hash_clear(VALUE hash)
Definition: hash.c:2819
VALUE rb_hash_new(void)
Definition: hash.c:1538
#define tANDDOT
Definition: id.c:33
#define tNMATCH
Definition: id.c:27
#define tCOLON2
Definition: id.c:30
#define tGEQ
Definition: id.c:22
#define tUMINUS
Definition: id.c:16
#define tDOT3
Definition: id.c:14
#define tUPLUS
Definition: id.c:15
#define tPOW
Definition: id.c:17
#define tLEQ
Definition: id.c:21
#define tRSHFT
Definition: id.c:20
#define tANDOP
Definition: id.c:31
#define tEQ
Definition: id.c:23
#define tMATCH
Definition: id.c:26
#define tOROP
Definition: id.c:32
#define tNEQ
Definition: id.c:25
#define tLSHFT
Definition: id.c:19
#define tAREF
Definition: id.c:28
#define tEQQ
Definition: id.c:24
#define tASET
Definition: id.c:29
#define tDOT2
Definition: id.c:13
const char term
Definition: id.c:37
unsigned short token
Definition: id.c:36
#define tCMP
Definition: id.c:18
ruby_method_ids
Definition: id.h:78
@ idEq
Definition: id.h:96
@ idUPlus
Definition: id.h:81
@ idGE
Definition: id.h:95
@ idGTGT
Definition: id.h:91
@ idANDOP
Definition: id.h:108
@ idEqq
Definition: id.h:97
@ idOROP
Definition: id.h:109
@ idNULL
Definition: id.h:113
@ idCmp
Definition: id.h:84
@ idDot3
Definition: id.h:80
@ idCOLON2
Definition: id.h:107
@ idLTLT
Definition: id.h:90
@ idUMinus
Definition: id.h:82
@ idLE
Definition: id.h:93
@ idPow
Definition: id.h:83
@ idANDDOT
Definition: id.h:110
@ idNeq
Definition: id.h:98
@ idNeqTilde
Definition: id.h:104
#define ID_GLOBAL
Definition: id.h:35
#define ID_CLASS
Definition: id.h:38
#define ID_CONST
Definition: id.h:37
#define ID_SCOPE_SHIFT
Definition: id.h:31
#define ID_INSTANCE
Definition: id.h:34
#define ID_LOCAL
Definition: id.h:33
#define ID_SCOPE_MASK
Definition: id.h:32
#define ID_INTERNAL
Definition: id.h:40
#define ID_STATIC_SYM
Definition: id.h:30
IMEMO: Internal memo object.
@ imemo_parser_strterm
Definition: imemo.h:45
#define ENC_CODERANGE_7BIT
Definition: encoding.h:93
#define rb_enc_mbcput(c, buf, enc)
Definition: encoding.h:208
#define rb_enc_prev_char(s, p, e, enc)
Definition: encoding.h:211
int rb_enc_str_coderange(VALUE)
Definition: string.c:725
#define ENC_CODERANGE_UNKNOWN
Definition: encoding.h:92
VALUE rb_enc_str_new(const char *, long, rb_encoding *)
Definition: string.c:857
#define rb_enc_name(enc)
Definition: encoding.h:168
#define ENCODING_GET(obj)
Definition: encoding.h:51
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc)
Definition: string.c:3072
#define rb_enc_asciicompat(enc)
Definition: encoding.h:236
#define rb_enc_isalnum(c, enc)
Definition: encoding.h:226
int rb_char_to_option_kcode(int c, int *option, int *kcode)
Definition: re.c:329
long rb_str_coderange_scan_restartable(const char *, const char *, rb_encoding *, int *)
Definition: string.c:617
#define MBCLEN_CHARFOUND_P(ret)
Definition: encoding.h:182
#define ENCODING_SET(obj, i)
Definition: encoding.h:49
#define ENCODING_IS_ASCII8BIT(obj)
Definition: encoding.h:52
#define rb_enc_isspace(c, enc)
Definition: encoding.h:228
Thin wrapper to ruby/config.h.
@ RB_WARN_CATEGORY_EXPERIMENTAL
Definition: error.h:35
#define ruby_verbose
Definition: error.h:68
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
Definition: vm_eval.c:1077
VALUE rb_funcallv_public(VALUE, ID, int, const VALUE *)
Calls a method.
Definition: vm_eval.c:1137
VALUE rb_io_gets(VALUE)
Definition: io.c:3738
VALUE rb_io_write(VALUE, VALUE)
Definition: io.c:1953
VALUE rb_io_flush(VALUE)
Definition: io.c:2052
VALUE rb_io_puts(int, const VALUE *, VALUE)
Definition: io.c:7895
VALUE rb_default_rs
Definition: io.c:202
ID rb_id_attrset(ID)
Definition: symbol.c:113
#define rb_rational_raw1(x)
Definition: rational.h:31
VALUE rb_rational_new(VALUE, VALUE)
Definition: rational.c:1962
int rb_memcicmp(const void *, const void *, long)
Definition: re.c:88
VALUE rb_str_resize(VALUE, long)
Definition: string.c:2859
#define rb_str_new(str, len)
Definition: string.h:213
#define rb_str_buf_cat
Definition: string.h:283
VALUE rb_str_cat(VALUE, const char *, long)
Definition: string.c:2962
#define rb_usascii_str_new(str, len)
Definition: string.h:224
void rb_str_set_len(VALUE, long)
Definition: string.c:2842
void rb_str_modify(VALUE)
Definition: string.c:2262
VALUE rb_str_buf_new(long)
Definition: string.c:1398
VALUE rb_filesystem_str_new_cstr(const char *)
Definition: string.c:1187
#define rb_usascii_str_new2
Definition: string.h:282
VALUE rb_str_subseq(VALUE, long, long)
Definition: string.c:2624
#define rb_strlen_lit(str)
Definition: string.h:286
VALUE rb_str_append(VALUE, VALUE)
Definition: string.c:3118
VALUE rb_str_new_frozen(VALUE)
Definition: string.c:1273
VALUE rb_str_buf_append(VALUE, VALUE)
Definition: string.c:3103
VALUE rb_str_intern(VALUE)
Definition: symbol.c:840
VALUE rb_obj_as_string(VALUE)
Definition: string.c:1529
#define rb_str_cat_cstr(buf, str)
Definition: string.h:266
VALUE rb_str_dup(VALUE)
Definition: string.c:1631
#define rb_str_new_cstr(str)
Definition: string.h:219
VALUE rb_thread_current(void)
Definition: thread.c:2911
int rb_const_defined_at(VALUE, ID)
Definition: variable.c:2934
VALUE rb_const_get_at(VALUE, ID)
Definition: variable.c:2630
VALUE rb_attr_get(VALUE, ID)
Definition: variable.c:1242
int rb_respond_to(VALUE, ID)
Definition: vm_method.c:2561
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
VALUE rb_make_backtrace(void)
#define ID2SYM
Definition: symbol.h:44
const char * rb_id2name(ID)
Definition: symbol.c:944
#define SYM2ID
Definition: symbol.h:45
ID rb_intern2(const char *, long)
Definition: symbol.c:778
ID rb_intern(const char *)
Definition: symbol.c:785
#define CONST_ID
Definition: symbol.h:47
void rb_define_global_const(const char *, VALUE)
Definition: variable.c:3162
void rb_define_const(VALUE, const char *, VALUE)
Definition: variable.c:3150
void * memmove(void *, const void *, size_t)
Definition: memmove.c:7
unsigned long ruby_scan_oct(const char *, size_t, size_t *)
Definition: util.c:38
#define strtod(s, e)
Definition: util.h:45
#define scan_hex(s, l, e)
Definition: util.h:24
#define scan_oct(s, l, e)
Definition: util.h:22
#define NUM2UINT
Definition: int.h:45
#define NUM2INT
Definition: int.h:44
#define INT2NUM
Definition: int.h:43
Internal header for Complex.
#define RCOMPLEX_SET_IMAG(cmp, i)
Definition: complex.h:24
#define RCOMPLEX_SET_REAL(cmp, r)
Definition: complex.h:23
#define RCOMPLEX(obj)
Definition: complex.h:20
#define SIZED_REALLOC_N(v, T, m, n)
Definition: gc.h:159
#define ruby_sized_xfree
Definition: gc.h:166
Internal header for Hash.
Internal header for IO.
int rb_stderr_tty_p(void)
Definition: io.c:8105
Internal header for Numeric.
#define RFLOAT(obj)
Definition: numeric.h:44
Internal header for the parser.
Internal header for Rational.
#define RRATIONAL(obj)
Definition: rational.h:24
Internal header for Regexp.
VALUE rb_reg_check_preprocess(VALUE)
Definition: re.c:2718
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline)
Definition: re.c:2966
#define STATIC_ASSERT
Definition: static_assert.h:14
VALUE rb_fstring(VALUE)
Definition: string.c:353
Internal header for Thread.
VALUE rb_suppress_tracing(VALUE(*func)(VALUE), VALUE arg)
Definition: vm_trace.c:418
Internal header corresponding util.c.
#define rb_ary_new_from_args(...)
Definition: internal.h:65
#define rb_sym_intern_ascii_cstr(...)
Definition: internal.h:74
voidpf void uLong size
Definition: ioapi.h:138
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
voidpf uLong offset
Definition: ioapi.h:144
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
voidpf void * buf
Definition: ioapi.h:138
const char * ruby_node_name(int node)
Definition: iseq.c:2593
#define rb_reserved_word(str, len)
Definition: lex.c:38
Historical shim for <limits.h>.
#define CHAR_BIT
Definition: limits.h:44
#define INT2FIX
Definition: long.h:48
#define ULONG2NUM
Definition: long.h:60
#define LONG2FIX
Definition: long.h:49
#define LONG2NUM
Definition: long.h:50
#define rb_long2int
Definition: long.h:62
#define FIX2LONG
Definition: long.h:46
#define MEMCPY(p1, p2, type, n)
Definition: memory.h:129
#define REALLOC_N
Definition: memory.h:137
#define ALLOCA_N(type, n)
Definition: memory.h:112
#define ALLOC_N
Definition: memory.h:133
#define RB_GC_GUARD(v)
Definition: memory.h:91
#define MEMMOVE(p1, p2, type, n)
Definition: memory.h:130
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:56
unsigned int input
Definition: nkf.c:4325
const int id
Definition: nkf.c:209
const char * name
Definition: nkf.c:208
unsigned int last
Definition: nkf.c:4324
#define TRUE
Definition: nkf.h:175
#define FALSE
Definition: nkf.h:174
void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
Definition: node.c:1139
void rb_ast_dispose(rb_ast_t *ast)
Definition: node.c:1448
rb_ast_t * rb_ast_new(void)
Definition: node.c:1299
void rb_ast_add_mark_object(rb_ast_t *ast, VALUE obj)
Definition: node.c:1454
NODE * rb_ast_newnode(rb_ast_t *ast, enum node_type type)
Definition: node.c:1264
void rb_ast_add_local_table(rb_ast_t *ast, ID *buf)
Definition: node.c:1283
void rb_ast_delete_node(rb_ast_t *ast, NODE *n)
Definition: node.c:1291
#define NEW_DSTR(s, loc)
Definition: node.h:346
#define NEW_VCALL(m, loc)
Definition: node.h:354
#define NEW_ITER(a, b, loc)
Definition: node.h:304
#define nd_state
Definition: node.h:265
#define NEW_BLOCK(a, loc)
Definition: node.h:292
#define NEW_POSTEXE(b, loc)
Definition: node.h:382
#define NEW_CVASGN(v, val, loc)
Definition: node.h:326
#define NEW_DOT2(b, e, loc)
Definition: node.h:373
#define NEW_UNLESS(c, t, e, loc)
Definition: node.h:294
#define NEW_RETURN(s, loc)
Definition: node.h:314
#define NEW_ALIAS(n, o, loc)
Definition: node.h:365
#define NEW_MODULE(n, b, loc)
Definition: node.h:370
#define nd_first_lineno(n)
Definition: node.h:202
#define nd_set_type(n, t)
Definition: node.h:189
#define NEW_DOT3(b, e, loc)
Definition: node.h:374
#define NEW_HASH(a, loc)
Definition: node.h:318
#define NEW_BREAK(s, loc)
Definition: node.h:306
#define NEW_EVSTR(n, loc)
Definition: node.h:350
#define NEW_COLON2(c, i, loc)
Definition: node.h:371
#define nd_mid
Definition: node.h:254
#define NEW_IF(c, t, e, loc)
Definition: node.h:293
#define NEW_NIL(loc)
Definition: node.h:376
#define nd_resq
Definition: node.h:224
#define NEW_GASGN(v, val, loc)
Definition: node.h:320
#define NEW_BEGIN(b, loc)
Definition: node.h:310
#define nd_end
Definition: node.h:264
#define NEW_OPT_ARG(i, v, loc)
Definition: node.h:358
#define nd_line(n)
Definition: node.h:196
#define NEW_SPLAT(a, loc)
Definition: node.h:363
#define NEW_IASGN(v, val, loc)
Definition: node.h:324
#define NEW_ARGS_AUX(r, b, loc)
Definition: node.h:357
#define NEW_CDECL(v, val, path, loc)
Definition: node.h:325
#define nd_ainfo
Definition: node.h:256
#define NEW_SELF(loc)
Definition: node.h:375
#define NEW_CALL(r, m, a, loc)
Definition: node.h:351
#define NEW_DASGN(v, val, loc)
Definition: node.h:322
#define nd_1st
Definition: node.h:227
#define NEW_ARGSPUSH(a, b, loc)
Definition: node.h:362
#define NEW_FALSE(loc)
Definition: node.h:378
#define NEW_CASE(h, b, loc)
Definition: node.h:295
#define NEW_RETRY(loc)
Definition: node.h:309
#define nd_first_column(n)
Definition: node.h:200
node_type
Definition: node.h:21
@ NODE_OR
Definition: node.h:45
@ NODE_LVAR
Definition: node.h:72
@ NODE_SPLAT
Definition: node.h:98
@ NODE_DEFS
Definition: node.h:101
@ NODE_REDO
Definition: node.h:38
@ NODE_IN
Definition: node.h:30
@ NODE_MATCH
Definition: node.h:80
@ NODE_STR
Definition: node.h:84
@ NODE_DSYM
Definition: node.h:121
@ NODE_DASGN_CURR
Definition: node.h:49
@ NODE_LIST
Definition: node.h:66
@ NODE_CVAR
Definition: node.h:77
@ NODE_NEXT
Definition: node.h:37
@ NODE_ARGSCAT
Definition: node.h:96
@ NODE_DASGN
Definition: node.h:48
@ NODE_LASGN
Definition: node.h:47
@ NODE_AND
Definition: node.h:44
@ NODE_MASGN
Definition: node.h:46
@ NODE_CVASGN
Definition: node.h:53
@ NODE_CALL
Definition: node.h:59
@ NODE_FALSE
Definition: node.h:117
@ NODE_FLIP2
Definition: node.h:112
@ NODE_EVSTR
Definition: node.h:88
@ NODE_DVAR
Definition: node.h:73
@ NODE_ATTRASGN
Definition: node.h:122
@ NODE_BEGIN
Definition: node.h:40
@ NODE_DXSTR
Definition: node.h:87
@ NODE_IASGN
Definition: node.h:51
@ NODE_GASGN
Definition: node.h:50
@ NODE_RESCUE
Definition: node.h:41
@ NODE_SCOPE
Definition: node.h:22
@ NODE_HASH
Definition: node.h:69
@ NODE_YIELD
Definition: node.h:71
@ NODE_CDECL
Definition: node.h:52
@ NODE_BLOCK
Definition: node.h:23
@ NODE_TRUE
Definition: node.h:116
@ NODE_ARGS_AUX
Definition: node.h:92
@ NODE_CASE
Definition: node.h:26
@ NODE_RETRY
Definition: node.h:39
@ NODE_DOT3
Definition: node.h:111
@ NODE_RETURN
Definition: node.h:70
@ NODE_BACK_REF
Definition: node.h:79
@ NODE_ENSURE
Definition: node.h:43
@ NODE_SELF
Definition: node.h:114
@ NODE_DOT2
Definition: node.h:110
@ NODE_FNDPTN
Definition: node.h:126
@ NODE_LIT
Definition: node.h:83
@ NODE_FLIP3
Definition: node.h:113
@ NODE_NTH_REF
Definition: node.h:78
@ NODE_DEFN
Definition: node.h:100
@ NODE_GVAR
Definition: node.h:74
@ NODE_COLON2
Definition: node.h:108
@ NODE_IVAR
Definition: node.h:75
@ NODE_BLOCK_PASS
Definition: node.h:99
@ NODE_DREGX
Definition: node.h:89
@ NODE_DEFINED
Definition: node.h:119
@ NODE_ONCE
Definition: node.h:90
@ NODE_IF
Definition: node.h:24
@ NODE_HSHPTN
Definition: node.h:125
@ NODE_ZLIST
Definition: node.h:67
@ NODE_ARYPTN
Definition: node.h:124
@ NODE_XSTR
Definition: node.h:86
@ NODE_BREAK
Definition: node.h:36
@ NODE_UNLESS
Definition: node.h:25
@ NODE_WHEN
Definition: node.h:29
@ NODE_CASE3
Definition: node.h:28
@ NODE_COLON3
Definition: node.h:109
@ NODE_CONST
Definition: node.h:76
@ NODE_NIL
Definition: node.h:115
@ NODE_VALUES
Definition: node.h:68
@ NODE_DSTR
Definition: node.h:85
@ NODE_ARGSPUSH
Definition: node.h:97
@ NODE_OPCALL
Definition: node.h:60
@ NODE_ARGS
Definition: node.h:91
#define nd_brace
Definition: node.h:276
#define nd_2nd
Definition: node.h:228
#define NEW_SUPER(a, loc)
Definition: node.h:355
#define nd_set_node_id(n, id)
Definition: node.h:214
#define NEW_LASGN(v, val, loc)
Definition: node.h:321
#define NEW_MATCH2(n1, n2, loc)
Definition: node.h:342
#define nd_set_last_loc(n, v)
Definition: node.h:212
#define NEW_OPCALL(r, m, a, loc)
Definition: node.h:352
#define NEW_SCOPE(a, b, loc)
Definition: node.h:291
#define NEW_MATCH3(r, n2, loc)
Definition: node.h:343
#define NEW_LIST(a, loc)
Definition: node.h:316
#define NEW_XSTR(s, loc)
Definition: node.h:347
#define NEW_CASE2(b, loc)
Definition: node.h:296
#define RNODE(obj)
Definition: node.h:176
#define nd_last_loc(n)
Definition: node.h:211
#define NEW_UNTIL(c, b, n, loc)
Definition: node.h:301
#define NEW_OP_ASGN_OR(i, val, loc)
Definition: node.h:330
#define NEW_OP_ASGN1(p, id, a, loc)
Definition: node.h:327
#define NEW_SCLASS(r, b, loc)
Definition: node.h:369
#define nd_set_first_lineno(n, v)
Definition: node.h:203
#define NEW_DEFINED(e, loc)
Definition: node.h:380
#define NEW_REDO(loc)
Definition: node.h:308
#define NEW_CONST(v, loc)
Definition: node.h:337
#define NEW_DVAR(v, loc)
Definition: node.h:335
#define NEW_FOR_MASGN(v, loc)
Definition: node.h:303
#define NODE_SPECIAL_REQUIRED_KEYWORD
Definition: node.h:385
#define nd_args
Definition: node.h:255
#define NEW_RESCUE(b, res, e, loc)
Definition: node.h:311
#define NEW_TRUE(loc)
Definition: node.h:377
#define NEW_YIELD(a, loc)
Definition: node.h:315
#define NEW_MASGN(l, r, loc)
Definition: node.h:319
#define NEW_NEXT(s, loc)
Definition: node.h:307
#define NEW_BLOCK_PASS(b, loc)
Definition: node.h:364
#define nd_else
Definition: node.h:222
#define NODE_SPECIAL_NO_REST_KEYWORD
Definition: node.h:390
#define NEW_FCALL(m, a, loc)
Definition: node.h:353
#define NEW_OP_ASGN_AND(i, val, loc)
Definition: node.h:331
#define nd_lit
Definition: node.h:246
#define NEW_CLASS(n, b, s, loc)
Definition: node.h:368
#define nd_head
Definition: node.h:216
#define NEW_LVAR(v, loc)
Definition: node.h:334
#define nd_set_line(n, l)
Definition: node.h:197
#define NODE_FL_NEWLINE
Definition: node.h:183
#define NEW_LAMBDA(a, b, loc)
Definition: node.h:305
#define NEW_WHILE(c, b, n, loc)
Definition: node.h:300
#define NODE_REQUIRED_KEYWORD_P(node)
Definition: node.h:386
#define NEW_FOR(i, b, loc)
Definition: node.h:302
#define NEW_RESBODY(a, ex, n, loc)
Definition: node.h:312
#define NEW_IN(c, t, e, loc)
Definition: node.h:299
#define nd_beg
Definition: node.h:263
#define NEW_ZSUPER(loc)
Definition: node.h:356
#define NEW_CASE3(h, b, loc)
Definition: node.h:297
#define NEW_WHEN(c, t, e, loc)
Definition: node.h:298
#define NEW_GVAR(v, loc)
Definition: node.h:333
#define nd_set_first_column(n, v)
Definition: node.h:201
#define NEW_OP_CDECL(v, op, val, loc)
Definition: node.h:332
#define NEW_UNDEF(i, loc)
Definition: node.h:367
#define NEW_COLON3(i, loc)
Definition: node.h:372
#define NEW_BACK_REF(n, loc)
Definition: node.h:340
#define nd_type(n)
Definition: node.h:188
#define NEW_IVAR(v, loc)
Definition: node.h:336
#define NEW_VALIAS(n, o, loc)
Definition: node.h:366
#define nd_set_first_loc(n, v)
Definition: node.h:205
#define nd_body
Definition: node.h:221
#define NEW_POSTARG(i, v, loc)
Definition: node.h:360
#define nd_value
Definition: node.h:243
#define NEW_NODE(t, a0, a1, a2, loc)
Definition: node.h:286
#define NEW_ENSURE(b, en, loc)
Definition: node.h:313
#define nd_defn
Definition: node.h:258
#define NODE_SPECIAL_NO_NAME_REST
Definition: node.h:387
#define NEW_CVAR(v, loc)
Definition: node.h:338
#define NODE_SPECIAL_EXCESSIVE_COMMA
Definition: node.h:389
#define NEW_KW_ARG(i, v, loc)
Definition: node.h:359
#define NEW_STR(s, loc)
Definition: node.h:345
#define nd_next
Definition: node.h:218
#define NEW_ARGSCAT(a, b, loc)
Definition: node.h:361
#define NEW_DASGN_CURR(v, val, loc)
Definition: node.h:323
#define NEW_ATTRASGN(r, m, a, loc)
Definition: node.h:383
#define NEW_OP_ASGN2(r, t, i, o, val, loc)
Definition: node.h:328
#define NEW_LIT(l, loc)
Definition: node.h:344
#define NEW_ERRINFO(loc)
Definition: node.h:379
#define NEW_NTH_REF(n, loc)
Definition: node.h:339
#define nd_plen
Definition: node.h:251
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:766
enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int)
Definition: parse.c:18251
#define NUM_SUFFIX_I
Definition: parse.c:15272
#define HERETERM_LENGTH_BITS
Definition: parse.c:792
#define Qnull
Definition: parse.c:1062
void rb_parser_fatal(struct parser_params *p, const char *fmt,...)
Definition: parse.c:18294
#define yyerror0(msg)
Definition: parse.c:458
#define DEF_EXPR(n)
Definition: parse.c:199
#define dispatch_delayed_token(p, t)
Definition: parse.c:13344
#define IS_LABEL_POSSIBLE()
Definition: parse.c:14916
#define has_delayed_token(p)
Definition: parse.c:13345
#define set_yylval_name(x)
Definition: parse.c:13321
#define DVARS_TOPSCOPE
Definition: parse.c:295
#define idFWD_REST
Definition: parse.c:756
#define IS_BEG()
Definition: parse.c:14914
#define DVARS_TERMINAL_P(tbl)
Definition: parse.c:296
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: parse.c:1945
#define YYMAXDEPTH
Definition: parse.c:6353
VALUE rb_mRubyVMFrozenCore
Definition: vm.c:375
#define STR_NEW2(ptr)
Definition: parse.c:423
VALUE rb_parser_new(void)
Definition: parse.c:20736
#define RUBY_DTRACE_PARSE_HOOK(name)
#define rb_warn0L_experimental(l, fmt)
Definition: parse.c:1126
#define YYSTACK_FREE
Definition: parse.c:2018
#define STR_FUNC_QWORDS
Definition: parse.c:14022
#define DVARS_INHERIT
Definition: parse.c:294
#define LVAR_USED
Definition: parse.c:17464
yysymbol_kind_t
Definition: parse.c:1355
@ YYSYMBOL_none
Definition: parse.c:1780
@ YYSYMBOL_137_
Definition: parse.c:1494
@ YYSYMBOL_exc_var
Definition: parse.c:1690
@ YYSYMBOL_keyword_redo
Definition: parse.c:1380
@ YYSYMBOL_command_call
Definition: parse.c:1543
@ YYSYMBOL_if_tail
Definition: parse.c:1615
@ YYSYMBOL_k_if
Definition: parse.c:1595
@ YYSYMBOL_keyword_not
Definition: parse.c:1396
@ YYSYMBOL_68_
Definition: parse.c:1425
@ YYSYMBOL_tAMPER
Definition: parse.c:1466
@ YYSYMBOL_74_escaped_vertical_tab_
Definition: parse.c:1431
@ YYSYMBOL_assocs
Definition: parse.c:1764
@ YYSYMBOL_fitem
Definition: parse.c:1559
@ YYSYMBOL_f_no_kwarg
Definition: parse.c:1750
@ YYSYMBOL_k_case
Definition: parse.c:1599
@ YYSYMBOL_mlhs_head
Definition: parse.c:1552
@ YYSYMBOL_operation3
Definition: parse.c:1768
@ YYSYMBOL_undef_list
Definition: parse.c:1560
@ YYSYMBOL_method_call
Definition: parse.c:1641
@ YYSYMBOL_405_49
Definition: parse.c:1762
@ YYSYMBOL_mrhs
Definition: parse.c:1582
@ YYSYMBOL_keyword_module
Definition: parse.c:1361
@ YYSYMBOL_f_kwrest
Definition: parse.c:1751
@ YYSYMBOL_restarg_mark
Definition: parse.c:1756
@ YYSYMBOL_168_4
Definition: parse.c:1525
@ YYSYMBOL_excessed_comma
Definition: parse.c:1625
@ YYSYMBOL_k_def
Definition: parse.c:1603
@ YYSYMBOL_tASET
Definition: parse.c:1450
@ YYSYMBOL_tNMATCH
Definition: parse.c:1444
@ YYSYMBOL_stmt
Definition: parse.c:1524
@ YYSYMBOL_YYUNDEF
Definition: parse.c:1359
@ YYSYMBOL_expr_value_do
Definition: parse.c:1540
@ YYSYMBOL_152_
Definition: parse.c:1509
@ YYSYMBOL_trailer
Definition: parse.c:1777
@ YYSYMBOL_expr_value
Definition: parse.c:1539
@ YYSYMBOL_356_43
Definition: parse.c:1713
@ YYSYMBOL_176_9
Definition: parse.c:1533
@ YYSYMBOL_tSTRING_DEND
Definition: parse.c:1477
@ YYSYMBOL_tWORDS_BEG
Definition: parse.c:1472
@ YYSYMBOL_69_backslash_
Definition: parse.c:1426
@ YYSYMBOL_288_31
Definition: parse.c:1645
@ YYSYMBOL_359_46
Definition: parse.c:1716
@ YYSYMBOL_tSTRING_DBEG
Definition: parse.c:1478
@ YYSYMBOL_call_op2
Definition: parse.c:1771
@ YYSYMBOL_k_module
Definition: parse.c:1602
@ YYSYMBOL_k_ensure
Definition: parse.c:1607
@ YYSYMBOL_tLOWEST
Definition: parse.c:1482
@ YYSYMBOL_tAREF
Definition: parse.c:1449
@ YYSYMBOL_tSTRING_END
Definition: parse.c:1476
@ YYSYMBOL_tCOLON3
Definition: parse.c:1455
@ YYSYMBOL_289_32
Definition: parse.c:1646
@ YYSYMBOL_keyword_end
Definition: parse.c:1367
@ YYSYMBOL_147_
Definition: parse.c:1504
@ YYSYMBOL_tREGEXP_END
Definition: parse.c:1424
@ YYSYMBOL_354_41
Definition: parse.c:1711
@ YYSYMBOL_regexp
Definition: parse.c:1697
@ YYSYMBOL_208_15
Definition: parse.c:1565
@ YYSYMBOL_tQSYMBOLS_BEG
Definition: parse.c:1475
@ YYSYMBOL_args_forward
Definition: parse.c:1738
@ YYSYMBOL_p_args_tail
Definition: parse.c:1671
@ YYSYMBOL_p_expr
Definition: parse.c:1661
@ YYSYMBOL_tLABEL_END
Definition: parse.c:1481
@ YYSYMBOL_k_else
Definition: parse.c:1609
@ YYSYMBOL_do_body
Definition: parse.c:1647
@ YYSYMBOL_357_44
Definition: parse.c:1714
@ YYSYMBOL_primary
Definition: parse.c:1583
@ YYSYMBOL_k_do_block
Definition: parse.c:1605
@ YYSYMBOL_blkarg_mark
Definition: parse.c:1758
@ YYSYMBOL_tNTH_REF
Definition: parse.c:1421
@ YYSYMBOL_tDSTAR
Definition: parse.c:1465
@ YYSYMBOL_tANDDOT
Definition: parse.c:1453
@ YYSYMBOL_keyword_while
Definition: parse.c:1375
@ YYSYMBOL_p_rest
Definition: parse.c:1673
@ YYSYMBOL_73_escaped_carriage_return_
Definition: parse.c:1430
@ YYSYMBOL_138_
Definition: parse.c:1495
@ YYSYMBOL_185_13
Definition: parse.c:1542
@ YYSYMBOL_p_any_kwrest
Definition: parse.c:1682
@ YYSYMBOL_f_block_opt
Definition: parse.c:1753
@ YYSYMBOL_235_25
Definition: parse.c:1592
@ YYSYMBOL_keyword_else
Definition: parse.c:1372
@ YYSYMBOL_f_arg_asgn
Definition: parse.c:1741
@ YYSYMBOL_literal
Definition: parse.c:1692
@ YYSYMBOL_keyword_do
Definition: parse.c:1383
@ YYSYMBOL_block_args_tail
Definition: parse.c:1623
@ YYSYMBOL_keyword_false
Definition: parse.c:1393
@ YYSYMBOL_131_
Definition: parse.c:1488
@ YYSYMBOL_symbol_list
Definition: parse.c:1702
@ YYSYMBOL_rel_expr
Definition: parse.c:1567
@ YYSYMBOL_p_case_body
Definition: parse.c:1654
@ YYSYMBOL_opt_block_args_tail
Definition: parse.c:1624
@ YYSYMBOL_tUMINUS_NUM
Definition: parse.c:1496
@ YYSYMBOL_lhs
Definition: parse.c:1555
@ YYSYMBOL_p_cases
Definition: parse.c:1658
@ YYSYMBOL_YYerror
Definition: parse.c:1358
@ YYSYMBOL_modifier_unless
Definition: parse.c:1398
@ YYSYMBOL_modifier_if
Definition: parse.c:1397
@ YYSYMBOL_keyword_def
Definition: parse.c:1362
@ YYSYMBOL_word
Definition: parse.c:1700
@ YYSYMBOL_numeric
Definition: parse.c:1722
@ YYSYMBOL_keyword_do_LAMBDA
Definition: parse.c:1386
@ YYSYMBOL_181_11
Definition: parse.c:1538
@ YYSYMBOL_f_larglist
Definition: parse.c:1637
@ YYSYMBOL_p_variable
Definition: parse.c:1685
@ YYSYMBOL_p_expr_basic
Definition: parse.c:1666
@ YYSYMBOL_operation
Definition: parse.c:1766
@ YYSYMBOL_tSYMBOLS_BEG
Definition: parse.c:1474
@ YYSYMBOL_keyword_case
Definition: parse.c:1373
@ YYSYMBOL_modifier_until
Definition: parse.c:1400
@ YYSYMBOL_p_find
Definition: parse.c:1672
@ YYSYMBOL_bv_decls
Definition: parse.c:1630
@ YYSYMBOL_tOROP
Definition: parse.c:1442
@ YYSYMBOL_127_
Definition: parse.c:1484
@ YYSYMBOL_p_args
Definition: parse.c:1669
@ YYSYMBOL_299_37
Definition: parse.c:1656
@ YYSYMBOL_tRPAREN
Definition: parse.c:1460
@ YYSYMBOL_k_unless
Definition: parse.c:1596
@ YYSYMBOL_k_while
Definition: parse.c:1597
@ YYSYMBOL_f_arglist
Definition: parse.c:1733
@ YYSYMBOL_opt_bv_decl
Definition: parse.c:1629
@ YYSYMBOL_p_arg
Definition: parse.c:1675
@ YYSYMBOL_keyword_BEGIN
Definition: parse.c:1404
@ YYSYMBOL_dot_or_colon
Definition: parse.c:1769
@ YYSYMBOL_p_const
Definition: parse.c:1687
@ YYSYMBOL_p_lbracket
Definition: parse.c:1665
@ YYSYMBOL_words
Definition: parse.c:1698
@ YYSYMBOL_modifier_rescue
Definition: parse.c:1401
@ YYSYMBOL_p_value
Definition: parse.c:1683
@ YYSYMBOL_f_optarg
Definition: parse.c:1755
@ YYSYMBOL_355_42
Definition: parse.c:1712
@ YYSYMBOL_assoc
Definition: parse.c:1765
@ YYSYMBOL_dsym
Definition: parse.c:1721
@ YYSYMBOL_opt_block_arg
Definition: parse.c:1579
@ YYSYMBOL_tLABEL
Definition: parse.c:1415
@ YYSYMBOL_bodystmt
Definition: parse.c:1518
@ YYSYMBOL_tCVAR
Definition: parse.c:1414
@ YYSYMBOL_300_38
Definition: parse.c:1657
@ YYSYMBOL_tFID
Definition: parse.c:1410
@ YYSYMBOL_373_47
Definition: parse.c:1730
@ YYSYMBOL_opt_terms
Definition: parse.c:1772
@ YYSYMBOL_310_39
Definition: parse.c:1667
@ YYSYMBOL_311_40
Definition: parse.c:1668
@ YYSYMBOL_tLBRACK
Definition: parse.c:1461
@ YYSYMBOL_keyword_break
Definition: parse.c:1378
@ YYSYMBOL_expr
Definition: parse.c:1528
@ YYSYMBOL_p_primitive
Definition: parse.c:1684
@ YYSYMBOL_293_35
Definition: parse.c:1650
@ YYSYMBOL_xstring_contents
Definition: parse.c:1708
@ YYSYMBOL_string_dvar
Definition: parse.c:1717
@ YYSYMBOL_tREGEXP_BEG
Definition: parse.c:1471
@ YYSYMBOL_p_top_expr_body
Definition: parse.c:1660
@ YYSYMBOL_233_23
Definition: parse.c:1590
@ YYSYMBOL_tSTRING_BEG
Definition: parse.c:1469
@ YYSYMBOL_tLPAREN_ARG
Definition: parse.c:1459
@ YYSYMBOL_assoc_list
Definition: parse.c:1763
@ YYSYMBOL_tLBRACE
Definition: parse.c:1462
@ YYSYMBOL_129_
Definition: parse.c:1486
@ YYSYMBOL_287_30
Definition: parse.c:1644
@ YYSYMBOL_aref_args
Definition: parse.c:1570
@ YYSYMBOL_278_28
Definition: parse.c:1635
@ YYSYMBOL_f_rest_marg
Definition: parse.c:1621
@ YYSYMBOL_tSTAR
Definition: parse.c:1464
@ YYSYMBOL_150_
Definition: parse.c:1507
@ YYSYMBOL_tIMAGINARY
Definition: parse.c:1419
@ YYSYMBOL_lambda_body
Definition: parse.c:1638
@ YYSYMBOL_k_end
Definition: parse.c:1611
@ YYSYMBOL_146_
Definition: parse.c:1503
@ YYSYMBOL_command_asgn
Definition: parse.c:1526
@ YYSYMBOL_tIDENTIFIER
Definition: parse.c:1409
@ YYSYMBOL_command_args
Definition: parse.c:1576
@ YYSYMBOL_136_
Definition: parse.c:1493
@ YYSYMBOL_p_var_ref
Definition: parse.c:1686
@ YYSYMBOL_130_
Definition: parse.c:1487
@ YYSYMBOL_block_call
Definition: parse.c:1640
@ YYSYMBOL_defs_head
Definition: parse.c:1537
@ YYSYMBOL_block_param
Definition: parse.c:1626
@ YYSYMBOL_f_arg_item
Definition: parse.c:1742
@ YYSYMBOL_args_tail
Definition: parse.c:1735
@ YYSYMBOL_tRATIONAL
Definition: parse.c:1418
@ YYSYMBOL_block_param_def
Definition: parse.c:1628
@ YYSYMBOL_172_5
Definition: parse.c:1529
@ YYSYMBOL_symbol
Definition: parse.c:1718
@ YYSYMBOL_tRSHFT
Definition: parse.c:1452
@ YYSYMBOL_fcall
Definition: parse.c:1546
@ YYSYMBOL_keyword_when
Definition: parse.c:1374
@ YYSYMBOL_133_
Definition: parse.c:1490
@ YYSYMBOL_singleton
Definition: parse.c:1761
@ YYSYMBOL_keyword__LINE__
Definition: parse.c:1406
@ YYSYMBOL_k_rescue
Definition: parse.c:1606
@ YYSYMBOL_tLPAREN
Definition: parse.c:1458
@ YYSYMBOL_p_kwarg
Definition: parse.c:1677
@ YYSYMBOL_relop
Definition: parse.c:1566
@ YYSYMBOL_k_until
Definition: parse.c:1598
@ YYSYMBOL_keyword_or
Definition: parse.c:1395
@ YYSYMBOL_k_return
Definition: parse.c:1612
@ YYSYMBOL_op
Definition: parse.c:1562
@ YYSYMBOL_tASSOC
Definition: parse.c:1457
@ YYSYMBOL_simple_numeric
Definition: parse.c:1723
@ YYSYMBOL_291_33
Definition: parse.c:1648
@ YYSYMBOL_tSTRING_CONTENT
Definition: parse.c:1423
@ YYSYMBOL_f_block_kwarg
Definition: parse.c:1747
@ YYSYMBOL_p_top_expr
Definition: parse.c:1659
@ YYSYMBOL_f_block_kw
Definition: parse.c:1746
@ YYSYMBOL_f_bad_arg
Definition: parse.c:1739
@ YYSYMBOL_mlhs_node
Definition: parse.c:1554
@ YYSYMBOL_166_3
Definition: parse.c:1523
@ YYSYMBOL_tNEQ
Definition: parse.c:1438
@ YYSYMBOL_keyword_variable
Definition: parse.c:1725
@ YYSYMBOL_regexp_contents
Definition: parse.c:1709
@ YYSYMBOL_opt_args_tail
Definition: parse.c:1736
@ YYSYMBOL_keyword_undef
Definition: parse.c:1363
@ YYSYMBOL_k_begin
Definition: parse.c:1594
@ YYSYMBOL_do_block
Definition: parse.c:1639
@ YYSYMBOL_modifier_while
Definition: parse.c:1399
@ YYSYMBOL_f_arg
Definition: parse.c:1743
@ YYSYMBOL_backref
Definition: parse.c:1728
@ YYSYMBOL_tCMP
Definition: parse.c:1435
@ YYSYMBOL_keyword_unless
Definition: parse.c:1369
@ YYSYMBOL_tQWORDS_BEG
Definition: parse.c:1473
@ YYSYMBOL_keyword_alias
Definition: parse.c:1402
@ YYSYMBOL_220_16
Definition: parse.c:1577
@ YYSYMBOL_brace_block
Definition: parse.c:1642
@ YYSYMBOL_string
Definition: parse.c:1694
@ YYSYMBOL_mrhs_arg
Definition: parse.c:1581
@ YYSYMBOL_230_20
Definition: parse.c:1587
@ YYSYMBOL_lambda
Definition: parse.c:1632
@ YYSYMBOL_args
Definition: parse.c:1580
@ YYSYMBOL_f_label
Definition: parse.c:1744
@ YYSYMBOL_tFLOAT
Definition: parse.c:1417
@ YYSYMBOL_keyword_do_cond
Definition: parse.c:1384
@ YYSYMBOL_128_
Definition: parse.c:1485
@ YYSYMBOL_377_48
Definition: parse.c:1734
@ YYSYMBOL_cmd_brace_block
Definition: parse.c:1545
@ YYSYMBOL_tBDOT3
Definition: parse.c:1448
@ YYSYMBOL_block_command
Definition: parse.c:1544
@ YYSYMBOL_top_stmts
Definition: parse.c:1515
@ YYSYMBOL_keyword_true
Definition: parse.c:1392
@ YYSYMBOL_qsym_list
Definition: parse.c:1706
@ YYSYMBOL_strings
Definition: parse.c:1693
@ YYSYMBOL_tBACK_REF
Definition: parse.c:1422
@ YYSYMBOL_p_kwrest
Definition: parse.c:1680
@ YYSYMBOL_keyword__ENCODING__
Definition: parse.c:1408
@ YYSYMBOL_141_
Definition: parse.c:1498
@ YYSYMBOL_keyword_in
Definition: parse.c:1382
@ YYSYMBOL_tLSHFT
Definition: parse.c:1451
@ YYSYMBOL_keyword_yield
Definition: parse.c:1388
@ YYSYMBOL_228_18
Definition: parse.c:1585
@ YYSYMBOL_135_
Definition: parse.c:1492
@ YYSYMBOL_tLAST_TOKEN
Definition: parse.c:1499
@ YYSYMBOL_string_content
Definition: parse.c:1710
@ YYSYMBOL_tEQ
Definition: parse.c:1436
@ YYSYMBOL_keyword_then
Definition: parse.c:1370
@ YYSYMBOL_top_compstmt
Definition: parse.c:1514
@ YYSYMBOL_292_34
Definition: parse.c:1649
@ YYSYMBOL_exc_list
Definition: parse.c:1689
@ YYSYMBOL_stmt_or_begin
Definition: parse.c:1522
@ YYSYMBOL_call_op
Definition: parse.c:1770
@ YYSYMBOL_rbrace
Definition: parse.c:1776
@ YYSYMBOL_229_19
Definition: parse.c:1586
@ YYSYMBOL_compstmt
Definition: parse.c:1520
@ YYSYMBOL_p_args_head
Definition: parse.c:1670
@ YYSYMBOL_kwrest_mark
Definition: parse.c:1749
@ YYSYMBOL_keyword_class
Definition: parse.c:1360
@ YYSYMBOL_keyword_retry
Definition: parse.c:1381
@ YYSYMBOL_var_ref
Definition: parse.c:1726
@ YYSYMBOL_keyword_ensure
Definition: parse.c:1366
@ YYSYMBOL_qsymbols
Definition: parse.c:1704
@ YYSYMBOL_204_14
Definition: parse.c:1561
@ YYSYMBOL_symbols
Definition: parse.c:1701
@ YYSYMBOL_paren_args
Definition: parse.c:1572
@ YYSYMBOL_arg
Definition: parse.c:1564
@ YYSYMBOL_opt_ensure
Definition: parse.c:1691
@ YYSYMBOL_keyword_rescue
Definition: parse.c:1365
@ YYSYMBOL_227_17
Definition: parse.c:1584
@ YYSYMBOL_keyword_until
Definition: parse.c:1376
@ YYSYMBOL_277_27
Definition: parse.c:1634
@ YYSYMBOL_do
Definition: parse.c:1614
@ YYSYMBOL_term
Definition: parse.c:1778
@ YYSYMBOL_p_args_post
Definition: parse.c:1674
@ YYSYMBOL_for_var
Definition: parse.c:1617
@ YYSYMBOL_arg_rhs
Definition: parse.c:1571
@ YYSYMBOL_then
Definition: parse.c:1613
@ YYSYMBOL_f_block_arg
Definition: parse.c:1759
@ YYSYMBOL_276_26
Definition: parse.c:1633
@ YYSYMBOL_YYACCEPT
Definition: parse.c:1511
@ YYSYMBOL_cpath
Definition: parse.c:1557
@ YYSYMBOL_173_6
Definition: parse.c:1530
@ YYSYMBOL_keyword_for
Definition: parse.c:1377
@ YYSYMBOL_140_
Definition: parse.c:1497
@ YYSYMBOL_keyword_next
Definition: parse.c:1379
@ YYSYMBOL_153_n_
Definition: parse.c:1510
@ YYSYMBOL_fname
Definition: parse.c:1558
@ YYSYMBOL_f_block_optarg
Definition: parse.c:1754
@ YYSYMBOL_begin_block
Definition: parse.c:1517
@ YYSYMBOL_keyword_super
Definition: parse.c:1389
@ YYSYMBOL_148_
Definition: parse.c:1505
@ YYSYMBOL_opt_f_block_arg
Definition: parse.c:1760
@ YYSYMBOL_tGVAR
Definition: parse.c:1411
@ YYSYMBOL_134_
Definition: parse.c:1491
@ YYSYMBOL_arg_value
Definition: parse.c:1569
@ YYSYMBOL_298_36
Definition: parse.c:1655
@ YYSYMBOL_tUPLUS
Definition: parse.c:1432
@ YYSYMBOL_tIVAR
Definition: parse.c:1412
@ YYSYMBOL_tOP_ASGN
Definition: parse.c:1456
@ YYSYMBOL_174_7
Definition: parse.c:1531
@ YYSYMBOL_case_args
Definition: parse.c:1651
@ YYSYMBOL_keyword_if
Definition: parse.c:1368
@ YYSYMBOL_tCONSTANT
Definition: parse.c:1413
@ YYSYMBOL_f_opt_paren_args
Definition: parse.c:1731
@ YYSYMBOL_terms
Definition: parse.c:1779
@ YYSYMBOL_358_45
Definition: parse.c:1715
@ YYSYMBOL_tSYMBEG
Definition: parse.c:1468
@ YYSYMBOL_keyword_END
Definition: parse.c:1405
@ YYSYMBOL_f_norm_arg
Definition: parse.c:1740
@ YYSYMBOL_f_margs
Definition: parse.c:1620
@ YYSYMBOL_YYEOF
Definition: parse.c:1357
@ YYSYMBOL_p_as
Definition: parse.c:1662
@ YYSYMBOL_mlhs_post
Definition: parse.c:1553
@ YYSYMBOL_opt_else
Definition: parse.c:1616
@ YYSYMBOL_case_body
Definition: parse.c:1652
@ YYSYMBOL_rparen
Definition: parse.c:1774
@ YYSYMBOL_opt_nl
Definition: parse.c:1773
@ YYSYMBOL_primary_value
Definition: parse.c:1593
@ YYSYMBOL_qwords
Definition: parse.c:1703
@ YYSYMBOL_keyword_elsif
Definition: parse.c:1371
@ YYSYMBOL_tEQQ
Definition: parse.c:1437
@ YYSYMBOL_tLAMBDA
Definition: parse.c:1467
@ YYSYMBOL_reswords
Definition: parse.c:1563
@ YYSYMBOL_mlhs_basic
Definition: parse.c:1550
@ YYSYMBOL_ssym
Definition: parse.c:1719
@ YYSYMBOL_k_when
Definition: parse.c:1608
@ YYSYMBOL_177_10
Definition: parse.c:1534
@ YYSYMBOL_def_name
Definition: parse.c:1535
@ YYSYMBOL_mlhs
Definition: parse.c:1548
@ YYSYMBOL_p_alt
Definition: parse.c:1663
@ YYSYMBOL_151_
Definition: parse.c:1508
@ YYSYMBOL_f_marg
Definition: parse.c:1618
@ YYSYMBOL_k_class
Definition: parse.c:1601
@ YYSYMBOL_231_21
Definition: parse.c:1588
@ YYSYMBOL_keyword_self
Definition: parse.c:1390
@ YYSYMBOL_143_
Definition: parse.c:1500
@ YYSYMBOL_p_kwargs
Definition: parse.c:1676
@ YYSYMBOL_145_
Definition: parse.c:1502
@ YYSYMBOL_p_kwnorest
Definition: parse.c:1681
@ YYSYMBOL_program
Definition: parse.c:1512
@ YYSYMBOL_tANDOP
Definition: parse.c:1441
@ YYSYMBOL_tINTEGER
Definition: parse.c:1416
@ YYSYMBOL_f_marg_list
Definition: parse.c:1619
@ YYSYMBOL_k_do
Definition: parse.c:1604
@ YYSYMBOL_162_2
Definition: parse.c:1519
@ YYSYMBOL_sym
Definition: parse.c:1720
@ YYSYMBOL_opt_call_args
Definition: parse.c:1574
@ YYSYMBOL_f_kwarg
Definition: parse.c:1748
@ YYSYMBOL_279_29
Definition: parse.c:1636
@ YYSYMBOL_operation2
Definition: parse.c:1767
@ YYSYMBOL_p_lparen
Definition: parse.c:1664
@ YYSYMBOL_132_
Definition: parse.c:1489
@ YYSYMBOL_tLBRACE_ARG
Definition: parse.c:1463
@ YYSYMBOL_f_opt
Definition: parse.c:1752
@ YYSYMBOL_k_elsif
Definition: parse.c:1610
@ YYSYMBOL_cases
Definition: parse.c:1653
@ YYSYMBOL_keyword_defined
Definition: parse.c:1403
@ YYSYMBOL_keyword_begin
Definition: parse.c:1364
@ YYSYMBOL_user_variable
Definition: parse.c:1724
@ YYSYMBOL_tBDOT2
Definition: parse.c:1447
@ YYSYMBOL_mlhs_inner
Definition: parse.c:1549
@ YYSYMBOL_p_kw
Definition: parse.c:1678
@ YYSYMBOL_keyword_return
Definition: parse.c:1387
@ YYSYMBOL_tUMINUS
Definition: parse.c:1433
@ YYSYMBOL_word_list
Definition: parse.c:1699
@ YYSYMBOL_defn_head
Definition: parse.c:1536
@ YYSYMBOL_YYEMPTY
Definition: parse.c:1356
@ YYSYMBOL_tMATCH
Definition: parse.c:1443
@ YYSYMBOL_tDOT2
Definition: parse.c:1445
@ YYSYMBOL_opt_block_param
Definition: parse.c:1627
@ YYSYMBOL_f_paren_args
Definition: parse.c:1732
@ YYSYMBOL_234_24
Definition: parse.c:1591
@ YYSYMBOL_156_1
Definition: parse.c:1513
@ YYSYMBOL_tSTRING_DVAR
Definition: parse.c:1479
@ YYSYMBOL_f_kw
Definition: parse.c:1745
@ YYSYMBOL_top_stmt
Definition: parse.c:1516
@ YYSYMBOL_tSP
Definition: parse.c:1427
@ YYSYMBOL_brace_body
Definition: parse.c:1643
@ YYSYMBOL_126_
Definition: parse.c:1483
@ YYSYMBOL_qword_list
Definition: parse.c:1705
@ YYSYMBOL_tLEQ
Definition: parse.c:1440
@ YYSYMBOL_175_8
Definition: parse.c:1532
@ YYSYMBOL_149_
Definition: parse.c:1506
@ YYSYMBOL_tCOLON2
Definition: parse.c:1454
@ YYSYMBOL_keyword__FILE__
Definition: parse.c:1407
@ YYSYMBOL_tCHAR
Definition: parse.c:1420
@ YYSYMBOL_mlhs_item
Definition: parse.c:1551
@ YYSYMBOL_cname
Definition: parse.c:1556
@ YYSYMBOL_superclass
Definition: parse.c:1729
@ YYSYMBOL_tGEQ
Definition: parse.c:1439
@ YYSYMBOL_p_kw_label
Definition: parse.c:1679
@ YYSYMBOL_string_contents
Definition: parse.c:1707
@ YYSYMBOL_144_
Definition: parse.c:1501
@ YYSYMBOL_lex_ctxt
Definition: parse.c:1568
@ YYSYMBOL_string1
Definition: parse.c:1695
@ YYSYMBOL_stmts
Definition: parse.c:1521
@ YYSYMBOL_opt_paren_args
Definition: parse.c:1573
@ YYSYMBOL_keyword_and
Definition: parse.c:1394
@ YYSYMBOL_tPOW
Definition: parse.c:1434
@ YYSYMBOL_tXSTRING_BEG
Definition: parse.c:1470
@ YYSYMBOL_xstring
Definition: parse.c:1696
@ YYSYMBOL_f_rest_arg
Definition: parse.c:1757
@ YYSYMBOL_f_args
Definition: parse.c:1737
@ YYSYMBOL_tDOT3
Definition: parse.c:1446
@ YYSYMBOL_command
Definition: parse.c:1547
@ YYSYMBOL_bvar
Definition: parse.c:1631
@ YYSYMBOL_k_for
Definition: parse.c:1600
@ YYSYMBOL_block_arg
Definition: parse.c:1578
@ YYSYMBOL_184_12
Definition: parse.c:1541
@ YYSYMBOL_232_22
Definition: parse.c:1589
@ YYSYMBOL_var_lhs
Definition: parse.c:1727
@ YYSYMBOL_opt_rescue
Definition: parse.c:1688
@ YYSYMBOL_f_any_kwrest
Definition: parse.c:1622
@ YYSYMBOL_command_rhs
Definition: parse.c:1527
@ YYSYMBOL_keyword_do_block
Definition: parse.c:1385
@ YYSYMBOL_call_args
Definition: parse.c:1575
@ YYSYMBOL_72_escaped_form_feed_
Definition: parse.c:1429
@ YYSYMBOL_keyword_nil
Definition: parse.c:1391
@ YYSYMBOL_tLAMBEG
Definition: parse.c:1480
@ YYSYMBOL_rbracket
Definition: parse.c:1775
@ YYSYMBOL_71_escaped_horizontal_tab_
Definition: parse.c:1428
#define yyerrok
Definition: parse.c:5893
#define add_delayed_token(p, tok, end)
Definition: parse.c:14082
#define STRTERM_HEREDOC
Definition: parse.c:816
#define YY_ASSERT(E)
Definition: parse.c:1976
#define NUMPARAM_ID_P(id)
Definition: parse.c:282
#define str_copy(_s, _p, _n)
#define YY_(Msgid)
Definition: parse.c:1910
#define get_value(val)
Definition: parse.c:642
#define YYNOMEM
Definition: parse.c:5899
#define SWITCH_BY_COND_TYPE(t, w, arg)
Definition: parse.c:19286
#define make_list(list, loc)
Definition: parse.c:621
#define rb_warn1L(l, fmt, a)
Definition: parse.c:1081
void * rb_parser_malloc(struct parser_params *p, size_t size)
Definition: parse.c:20890
#define dispatch_heredoc_end(p)
Definition: parse.c:15343
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: parse.c:1950
#define YYNSTATES
Definition: parse.c:2120
VALUE rb_io_gets_internal(VALUE io)
Definition: io.c:3744
rb_ast_t * rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
Definition: parse.c:13963
void(* rb_magic_comment_setter_t)(struct parser_params *p, const char *name, const char *val)
Definition: parse.c:15638
#define NEW_STRTERM(func, term, paren)
Definition: parse.c:14827
#define YY_IGNORE_USELESS_CAST_END
Definition: parse.c:1967
#define lex_goto_eol(p)
Definition: parse.c:14058
#define literal_flush(p, ptr)
Definition: parse.c:13342
#define IS_END()
Definition: parse.c:14913
#define RE_OPTION_MASK
Definition: parse.c:769
#define yyerror(yylloc, p, msg)
Definition: parse.c:460
void rb_parser_printf(struct parser_params *p, const char *fmt,...)
Definition: parse.c:20947
#define NO_LEX_CTXT
Definition: parse.c:134
#define WARN_S(s)
Definition: parse.c:1118
#define tok(p)
Definition: parse.c:14163
#define KWD2EID(t, v)
Definition: parse.c:1012
#define ESCAPE_CONTROL
Definition: parse.c:14369
#define YYABORT
Definition: parse.c:5897
#define idFWD_KWREST
Definition: parse.c:760
VALUE rb_parser_reg_compile(struct parser_params *p, VALUE str, int options)
Definition: parse.c:20513
#define tokcopy(p, n)
Definition: parse.c:14233
#define PRIsWARN
Definition: parse.c:1122
@ EXPR_END_ANY
Definition: parse.c:216
@ EXPR_VALUE
Definition: parse.c:213
@ EXPR_NONE
Definition: parse.c:217
@ EXPR_BEG_ANY
Definition: parse.c:214
@ EXPR_ARG_ANY
Definition: parse.c:215
#define IS_lex_state(ls)
Definition: parse.c:221
YYLTYPE * rb_parser_set_location(struct parser_params *p, YYLTYPE *yylloc)
Definition: parse.c:18345
yytype_int16 yy_state_t
Definition: parse.c:1897
#define WARN_SPACE_CHAR(c, prefix)
Definition: parse.c:14262
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: parse.c:155
#define intern_cstr(n, l, en)
Definition: parse.c:419
#define TAB_WIDTH
Definition: parse.c:142
#define CMDARG_POP()
Definition: parse.c:250
#define YY_REDUCE_PRINT(Rule)
Definition: parse.c:6336
#define ERR(mesg)
rb_ast_t * rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
Definition: parse.c:13969
#define YY_CAST(Type, Val)
Definition: parse.c:1144
void rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
Definition: parse.c:20554
#define vtable_alloc(prev)
Definition: parse.c:13710
VALUE rb_parser_set_context(VALUE vparser, const struct rb_iseq_struct *base, int main)
Definition: parse.c:20746
#define was_bol(p)
Definition: parse.c:14160
#define IS_lex_state_for(x, ls)
Definition: parse.c:219
#define WARN_S_L(s, l)
Definition: parse.c:1117
#define dispatch_scan_event(p, t)
Definition: parse.c:13343
#define YYCASE_(N, S)
#define set_yylval_id(x)
Definition: parse.c:13320
#define NUM_SUFFIX_R
Definition: parse.c:15271
#define NEW_QCALL(q, r, m, a, loc)
Definition: parse.c:479
long(* rb_magic_comment_length_t)(struct parser_params *p, const char *name, long len)
Definition: parse.c:15637
#define warn_balanced(tok, op, syn)
Definition: parse.c:15979
#define YY_NULLPTR
Definition: parse.c:1154
const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20+31)/32]
Definition: parse.c:14855
#define RE_OPTION_ENCODING_NONE(o)
Definition: parse.c:768
YYLTYPE * rb_parser_set_location_from_strterm_heredoc(struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
Definition: parse.c:18320
#define STR_FUNC_TERM
Definition: parse.c:14027
#define set_yylval_literal(x)
Definition: parse.c:13314
#define set_yylval_str(x)
Definition: parse.c:13309
#define YYFINAL
Definition: parse.c:2109
rb_ast_t * rb_parser_compile_generic(VALUE vparser, VALUE(*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
Definition: parse.c:14004
#define RUBY_INIT_YYLLOC()
Definition: parse.c:175
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: parse.c:2261
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: parse.c:6334
void rb_init_parse(void)
Definition: parse.c:20601
#define YY_INITIAL_VALUE(Value)
Definition: parse.c:1960
#define TOK_INTERN()
Definition: parse.c:425
#define vtable_free(tbl)
Definition: parse.c:13728
#define CALL_Q_P(q)
Definition: parse.c:477
#define yyparse
Definition: parse.c:533
#define STR_NEW3(ptr, len, e, func)
Definition: parse.c:424
#define yylval
Definition: parse.c:13295
#define YYNTOKENS
Definition: parse.c:2114
VALUE rb_parser_encoding(VALUE vparser)
Definition: parse.c:20809
int rb_reg_fragment_setenc(struct parser_params *, VALUE, int)
Definition: parse.c:20398
#define yytnamerr(yyres, yystr)
Definition: parse.c:838
VALUE rb_parser_get_debug_output(VALUE self)
Definition: parse.c:20857
int_least16_t yytype_int16
Definition: parse.c:1819
#define Qnone
Definition: parse.c:1061
#define peek(p, c)
Definition: parse.c:14061
#define YY_STACK_PRINT(Bottom, Top)
Definition: parse.c:6335
#define compile_for_eval
Definition: parse.c:472
@ YYENOMEM
Definition: parse.c:5891
@ EXPR_ENDARG_bit
Definition: parse.c:184
@ EXPR_ENDFN_bit
Definition: parse.c:185
@ EXPR_MAX_STATE
Definition: parse.c:195
@ EXPR_END_bit
Definition: parse.c:183
@ EXPR_FNAME_bit
Definition: parse.c:189
@ EXPR_LABEL_bit
Definition: parse.c:192
@ EXPR_FITEM_bit
Definition: parse.c:194
@ EXPR_CLASS_bit
Definition: parse.c:191
@ EXPR_MID_bit
Definition: parse.c:188
@ EXPR_CMDARG_bit
Definition: parse.c:187
@ EXPR_LABELED_bit
Definition: parse.c:193
@ EXPR_ARG_bit
Definition: parse.c:186
@ EXPR_DOT_bit
Definition: parse.c:190
@ EXPR_BEG_bit
Definition: parse.c:182
#define rb_warning2(fmt, a, b)
Definition: parse.c:1077
#define STR_NEW(ptr, len)
Definition: parse.c:421
#define lambda_beginning_p()
Definition: parse.c:481
#define YYSIZE_T
Definition: parse.c:1881
#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current)
Definition: parse.c:169
#define YYSTACK_ALLOC_MAXIMUM
Definition: parse.c:2020
#define IS_lex_state_all(ls)
Definition: parse.c:222
#define yydebug
Definition: parse.c:144
#define NUMPARAM_IDX_TO_ID(idx)
Definition: parse.c:284
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: parse.c:1964
@ NUMPARAM_MAX
Definition: parse.c:279
@ ORDINAL_PARAM
Definition: parse.c:277
@ NO_PARAM
Definition: parse.c:278
shareability
Definition: parse.c:117
@ shareable_none
Definition: parse.c:118
@ shareable_copy
Definition: parse.c:120
@ shareable_literal
Definition: parse.c:119
@ shareable_everything
Definition: parse.c:121
#define IS_SPCARG(c)
Definition: parse.c:14915
void rb_strterm_mark(VALUE obj)
Definition: parse.c:828
#define rb_warn2(fmt, a, b)
Definition: parse.c:1072
uint_least16_t yytype_uint16
Definition: parse.c:1851
void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int)
Definition: parse.c:18284
#define IS_ARG()
Definition: parse.c:14912
#define value_expr(node)
Definition: parse.c:550
#define RE_OPTION_ONCE
Definition: parse.c:764
#define ADD2HEAP(new, cnt, ptr)
Definition: parse.c:20886
#define SHAREABLE_BARE_EXPRESSION
Definition: parse.c:18775
#define YYPTRDIFF_T
Definition: parse.c:1869
#define NEWHEAP()
Definition: parse.c:20885
#define WARN_EOL(tok)
Definition: parse.c:1134
#define mixed_escape(beg, enc1, enc2)
#define COND_POP()
Definition: parse.c:243
#define lex_eol_p(p)
Definition: parse.c:14059
#define RE_OPTION_ENCODING_IDX(o)
Definition: parse.c:767
#define vtable_pop(tbl, n)
Definition: parse.c:13767
#define WARN_ID(i)
Definition: parse.c:1120
#define set_yylval_noname()
Definition: parse.c:13339
size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr)
Definition: parse.c:20994
void * rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
Definition: parse.c:20910
VALUE rb_parser_set_debug_output(VALUE self, VALUE output)
Definition: parse.c:20872
#define rb_warn1(fmt, a)
Definition: parse.c:1071
#define set_yylval_node(x)
Definition: parse.c:13304
VALUE rb_parser_set_yydebug(VALUE self, VALUE flag)
Definition: parse.c:20841
VALUE rb_parser_end_seen_p(VALUE vparser)
Definition: parse.c:20794
#define RUBY_SET_YYLLOC(Current)
Definition: parse.c:173
#define WARN_IVAL(i)
Definition: parse.c:1121
#define YYACCEPT
Definition: parse.c:5896
#define ID2VAL(id)
Definition: parse.c:1010
#define yytable_value_is_error(Yyn)
Definition: parse.c:2369
#define toklen(p)
Definition: parse.c:14164
#define new_nil(loc)
Definition: parse.c:537
struct rb_strterm_literal_struct rb_strterm_literal_t
#define YYTRANSLATE(YYX)
Definition: parse.c:2128
#define shareable_literal_constant_next(n)
#define subnodes(n1, n2)
#define HERETERM_LENGTH_MAX
Definition: parse.c:803
#define rb_warn0(fmt)
Definition: parse.c:1070
YYLTYPE * rb_parser_set_location_of_none(struct parser_params *p, YYLTYPE *yylloc)
Definition: parse.c:18335
#define STR_FUNC_LIST
Definition: parse.c:14026
#define YY_ATTRIBUTE_UNUSED
Definition: parse.c:1925
#define STR_FUNC_ESCAPE
Definition: parse.c:14019
#define ifndef_ripper(x)
Definition: parse.c:1063
#define STR_FUNC_SYMBOL
Definition: parse.c:14023
#define CMDARG_PUSH(n)
Definition: parse.c:249
int_least8_t yytype_int8
Definition: parse.c:1811
#define peekc(p)
Definition: parse.c:14063
void rb_parser_free(struct parser_params *p, void *ptr)
Definition: parse.c:20930
#define CMDARG_P()
Definition: parse.c:251
#define STR_FUNC_LABEL
Definition: parse.c:14025
#define rb_warning0(fmt)
Definition: parse.c:1075
#define STR_FUNC_INDENT
Definition: parse.c:14024
#define peek_n(p, c, n)
Definition: parse.c:14062
#define COND_P()
Definition: parse.c:244
#define ESCAPE_META
Definition: parse.c:14370
#define METHOD_NOT
Definition: parse.c:753
rb_ast_t * rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
Definition: parse.c:13984
#define NUMPARAM_ID_TO_IDX(id)
Definition: parse.c:283
#define HEAPCNT(n, size)
Definition: parse.c:20882
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition: parse.c:1900
#define SET_LEX_STATE(ls)
Definition: parse.c:224
#define STR_FUNC_REGEXP
Definition: parse.c:14021
#define RUBY_SET_YYLLOC_OF_NONE(Current)
Definition: parse.c:171
#define idFWD_BLOCK
Definition: parse.c:762
#define vtable_add(tbl, id)
Definition: parse.c:13750
#define WARN_I(i)
Definition: parse.c:1119
#define COND_PUSH(n)
Definition: parse.c:242
#define token_flush(ptr)
Definition: parse.c:461
#define get_id(id)
Definition: parse.c:641
@ str_dsym
Definition: parse.c:14038
@ str_dword
Definition: parse.c:14036
@ str_label
Definition: parse.c:14030
@ str_ssym
Definition: parse.c:14037
@ str_xquote
Definition: parse.c:14033
@ str_dquote
Definition: parse.c:14032
@ str_regexp
Definition: parse.c:14034
@ str_squote
Definition: parse.c:14031
@ str_sword
Definition: parse.c:14035
#define mixed_error(enc1, enc2)
#define dyna_var(p, id)
Definition: parse.c:740
#define rb_node_newnode(type, a1, a2, a3, loc)
Definition: parse.c:509
#define IS_LABEL_SUFFIX(n)
Definition: parse.c:14919
#define nd_once_body(node)
Definition: parse.c:17825
#define yyerror1(loc, msg)
Definition: parse.c:459
#define tokfix(p)
Definition: parse.c:14162
#define YYLAST
Definition: parse.c:2111
#define NUM_SUFFIX_ALL
Definition: parse.c:15273
VALUE stack_type
Definition: parse.c:230
#define yypact_value_is_default(Yyn)
Definition: parse.c:2364
@ COND_IN_COND
Definition: parse.c:19282
@ COND_IN_OP
Definition: parse.c:19281
@ COND_IN_FF
Definition: parse.c:19283
#define YYINITDEPTH
Definition: parse.c:6342
#define flush_string_content(p, enc)
Definition: parse.c:14852
#define CSI_BEGIN
#define STR_NEW0()
Definition: parse.c:422
uint_least8_t yytype_uint8
Definition: parse.c:1840
#define rb_warn3L(l, fmt, a, b, c)
Definition: parse.c:1083
#define CSI_SGR
#define STR_FUNC_EXPAND
Definition: parse.c:14020
#define rb_warning1(fmt, a)
Definition: parse.c:1076
#define YYERROR
Definition: parse.c:5898
void * rb_parser_calloc(struct parser_params *p, size_t nelem, size_t size)
Definition: parse.c:20900
#define YYSIZEOF(X)
Definition: parse.c:1893
#define YYFPRINTF
Definition: parse.c:150
#define YYSTACK_ALLOC
Definition: parse.c:2017
#define YYDPRINTF(Args)
Definition: parse.c:6333
VALUE rb_parser_lex_state_name(enum lex_state_e state)
Definition: parse.c:18265
#define peekc_n(p, n)
Definition: parse.c:14064
#define compile_error
Definition: parse.c:1131
#define IS_AFTER_OPERATOR()
Definition: parse.c:14920
#define YY_USE(E)
Definition: parse.c:1933
yytokentype
Definition: parse.h:52
@ tBACK_REF
Definition: parse.h:119
@ 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
@ tSTRING_DEND
Definition: parse.h:168
@ tCHAR
Definition: parse.h:117
@ keyword_return
Definition: parse.h:84
@ tCONSTANT
Definition: parse.h:110
@ tFLOAT
Definition: parse.h:114
@ tLABEL_END
Definition: parse.h:172
@ keyword_module
Definition: parse.h:58
@ tLAMBEG
Definition: parse.h:171
@ tCVAR
Definition: parse.h:111
@ tSTRING_DVAR
Definition: parse.h:170
@ keyword_undef
Definition: parse.h:60
@ 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
@ 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
@ keyword_if
Definition: parse.h:65
@ keyword_BEGIN
Definition: parse.h:101
@ tIMAGINARY
Definition: parse.h:116
@ 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
@ 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
@ 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
@ tRATIONAL
Definition: parse.h:115
@ tUMINUS_NUM
Definition: parse.h:174
@ keyword_unless
Definition: parse.h:66
@ tDSTAR
Definition: parse.h:156
@ 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
@ 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
@ 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
enum yytokentype yytoken_kind_t
Definition: parse.h:177
#define RARRAY_AREF(a, i)
Definition: psych_emitter.c:7
VALUE rb_ractor_stderr(void)
Definition: ractor.c:2148
VALUE rb_ractor_stdout(void)
Definition: ractor.c:2136
VALUE rb_ractor_make_shareable(VALUE obj)
Definition: ractor.c:2499
#define RARRAY_LEN
Definition: rarray.h:52
#define RBASIC(obj)
Definition: rbasic.h:34
#define RBASIC_CLASS
Definition: rbasic.h:35
#define BEG(no)
Definition: re.c:33
#define NULL
Definition: regenc.h:69
#define RB_OBJ_WRITE(a, slot, b)
WB for new reference from ‘a’ to ‘b’.
Definition: rgengc.h:107
#define RB_OBJ_WRITTEN(a, oldv, b)
WB for new reference from ‘a’ to ‘b’.
Definition: rgengc.h:114
yysymbol_kind_t
Definition: ripper.c:1352
lex_state_e
Definition: ripper.c:198
yytype_int16 yy_state_t
Definition: ripper.c:1894
int_least16_t yytype_int16
Definition: ripper.c:1816
lex_state_bits
Definition: ripper.c:181
shareability
Definition: ripper.c:117
int_least8_t yytype_int8
Definition: ripper.c:1808
int yy_state_fast_t
Definition: ripper.c:1897
string_type
Definition: ripper.c:14074
VALUE stack_type
Definition: ripper.c:230
cond_type
Definition: ripper.c:19325
uint_least8_t yytype_uint8
Definition: ripper.c:1837
#define RREGEXP_PTR(obj)
Definition: rregexp.h:32
#define StringValue(v)
Definition: rstring.h:50
#define RSTRING_GETMEM(str, ptrvar, lenvar)
Definition: rstring.h:211
#define StringValueCStr(v)
Definition: rstring.h:52
#define TypedData_Get_Struct(obj, type, data_type, sval)
Definition: rtypeddata.h:130
@ RUBY_TYPED_FREE_IMMEDIATELY
Definition: rtypeddata.h:62
#define TypedData_Make_Struct(klass, type, data_type, sval)
Definition: rtypeddata.h:122
const char * rb_obj_classname(VALUE)
Definition: variable.c:308
#define InitVM(ext)
Definition: ruby.h:112
int argc
Definition: ruby.c:240
char ** argv
Definition: ruby.c:241
unsigned char uint8_t
Definition: sha2.h:100
rb_atomic_t cnt[RUBY_NSIG]
Definition: signal.c:508
#define Qundef
#define SPECIAL_CONST_P
#define Qtrue
#define RTEST
#define Qnil
#define Qfalse
#define NIL_P
#define FIXNUM_P
#define f
VALUE rb_vsprintf(const char *, va_list)
Definition: sprintf.c:1197
VALUE rb_str_vcatf(VALUE, const char *, va_list)
Definition: sprintf.c:1216
VALUE rb_str_catf(VALUE, const char *,...)
Definition: sprintf.c:1243
VALUE rb_sprintf(const char *,...)
Definition: sprintf.c:1203
#define malloc
Definition: st.c:170
@ ST_CONTINUE
Definition: st.h:99
unsigned long st_data_t
Definition: st.h:22
#define st_init_numtable_with_size
Definition: st.h:108
#define st_is_member(table, key)
Definition: st.h:97
#define st_foreach
Definition: st.h:142
#define st_init_numtable
Definition: st.h:106
#define st_lookup
Definition: st.h:128
#define st_insert
Definition: st.h:124
#define st_free_table
Definition: st.h:156
size_t strlen(const char *)
Definition: node.h:149
rb_code_location_t nd_loc
Definition: node.h:172
VALUE flags
Definition: node.h:150
Definition: parse.h:205
int last_line
Definition: parse.h:208
int first_column
Definition: parse.h:207
int first_line
Definition: parse.h:206
int last_column
Definition: parse.h:209
Definition: inftree9.h:24
Definition: gzappend.c:170
Definition: lex.c:34
short id[2]
Definition: lex.c:34
short state
Definition: lex.c:34
unsigned int in_kwarg
Definition: ripper.c:126
BITFIELD(enum shareability, shareable_constant_value, 2)
unsigned int in_defined
Definition: ripper.c:125
unsigned int in_class
Definition: ripper.c:128
unsigned int in_def
Definition: ripper.c:127
struct local_vars * prev
Definition: ripper.c:268
struct local_vars::@65 numparam
NODE * current
Definition: ripper.c:271
struct vtable * vars
Definition: ripper.c:263
NODE * outer
Definition: ripper.c:271
NODE * inner
Definition: ripper.c:271
struct vtable * args
Definition: ripper.c:262
struct vtable * used
Definition: ripper.c:264
rb_magic_comment_length_t length
Definition: ripper.c:15796
rb_magic_comment_setter_t func
Definition: ripper.c:15795
const char * name
Definition: ripper.c:15794
VALUE(* gets)(struct parser_params *, VALUE)
Definition: ripper.c:324
int brace_nest
Definition: ripper.c:343
VALUE compile_option
Definition: ripper.c:364
rb_strterm_t * strterm
Definition: ripper.c:323
st_table * pktbl
Definition: ripper.c:356
const char * ruby_sourcefile
Definition: ripper.c:359
int heredoc_line_indent
Definition: ripper.c:352
unsigned int debug
Definition: ripper.c:381
unsigned int ruby__end__seen
Definition: ripper.c:380
YYSTYPE * lval
Definition: ripper.c:320
unsigned int has_shebang
Definition: ripper.c:382
VALUE(* call)(VALUE, int)
Definition: ripper.c:335
int lpar_beg
Definition: ripper.c:341
int heredoc_end
Definition: ripper.c:350
st_table * pvtbl
Definition: ripper.c:355
int tokline
Definition: ripper.c:349
int line_count
Definition: ripper.c:357
rb_encoding * enc
Definition: ripper.c:361
token_info * token_info
Definition: ripper.c:362
unsigned int do_chomp
Definition: ripper.c:396
VALUE input
Definition: ripper.c:325
char * tokenbuf
Definition: ripper.c:353
VALUE nextline
Definition: ripper.c:328
const char * ptok
Definition: ripper.c:332
rb_imemo_tmpbuf_t * heap
Definition: ripper.c:318
unsigned int token_seen
Definition: ripper.c:383
VALUE debug_lines
Definition: ripper.c:402
unsigned int command_start
Definition: ripper.c:378
enum lex_state_e state
Definition: ripper.c:337
struct parser_params::@66 lex
VALUE lastline
Definition: ripper.c:327
stack_type cond_stack
Definition: ripper.c:345
int node_id
Definition: ripper.c:372
NODE * eval_tree
Definition: ripper.c:400
const char * pend
Definition: ripper.c:331
unsigned int eofp
Definition: ripper.c:379
unsigned int error_p
Definition: ripper.c:388
union parser_params::@66::@67 gets_
int heredoc_indent
Definition: ripper.c:351
VALUE case_labels
Definition: ripper.c:363
int max_numparam
Definition: ripper.c:374
unsigned int do_loop
Definition: ripper.c:395
VALUE debug_buffer
Definition: ripper.c:366
struct lex_context ctxt
Definition: ripper.c:376
const char * pbeg
Definition: ripper.c:329
long ptr
Definition: ripper.c:334
rb_ast_t * ast
Definition: ripper.c:371
const struct rb_iseq_struct * parent_iseq
Definition: ripper.c:403
int ruby_sourceline
Definition: ripper.c:358
unsigned int do_split
Definition: ripper.c:397
unsigned int do_print
Definition: ripper.c:394
NODE * eval_tree_begin
Definition: ripper.c:399
stack_type cmdarg_stack
Definition: ripper.c:346
VALUE error_buffer
Definition: ripper.c:401
VALUE debug_output
Definition: ripper.c:367
unsigned int token_info_enabled
Definition: ripper.c:384
VALUE ruby_sourcefile_string
Definition: ripper.c:360
int paren_nest
Definition: ripper.c:339
int tokidx
Definition: ripper.c:347
const char * pcur
Definition: ripper.c:330
VALUE prevline
Definition: ripper.c:326
int toksiz
Definition: ripper.c:348
struct local_vars * lvtbl
Definition: ripper.c:354
unsigned int cr_seen
Definition: ripper.c:389
Definition: zran.c:68
ID block_arg
Definition: node.h:446
NODE * pre_init
Definition: node.h:437
int post_args_num
Definition: node.h:441
ID first_post_arg
Definition: node.h:443
NODE * kw_args
Definition: node.h:448
unsigned int ruby2_keywords
Definition: node.h:453
VALUE imemo
Definition: node.h:455
NODE * opt_args
Definition: node.h:451
ID rest_arg
Definition: node.h:445
NODE * kw_rest_arg
Definition: node.h:449
NODE * post_init
Definition: node.h:438
unsigned int no_kwarg
Definition: node.h:452
int pre_args_num
Definition: node.h:440
NODE * rest_arg
Definition: node.h:460
NODE * post_args
Definition: node.h:461
NODE * pre_args
Definition: node.h:459
const NODE * root
Definition: node.h:399
VALUE compile_option
Definition: node.h:400
rb_ast_body_t body
Definition: node.h:406
rb_code_position_t beg_pos
Definition: node.h:136
rb_code_position_t end_pos
Definition: node.h:137
NODE * post_rest_arg
Definition: node.h:467
NODE * pre_rest_arg
Definition: node.h:465
struct rb_imemo_tmpbuf_struct * next
Definition: imemo.h:97
union rb_strterm_literal_struct::@68 u0
union rb_strterm_literal_struct::@71 u3
union rb_strterm_literal_struct::@70 u2
union rb_strterm_literal_struct::@69 u1
rb_strterm_literal_t literal
Definition: ripper.c:821
union rb_strterm_struct::@72 u
rb_strterm_heredoc_t heredoc
Definition: ripper.c:822
const YYLTYPE * loc
Definition: ripper.c:20504
struct parser_params * parser
Definition: ripper.c:20501
Definition: st.h:79
Definition: blast.c:41
int nonspc
Definition: ripper.c:302
int indent
Definition: ripper.c:301
rb_code_position_t beg
Definition: ripper.c:300
const char * token
Definition: ripper.c:299
struct token_info * next
Definition: ripper.c:303
Definition: ripper.c:254
ID * tbl
Definition: ripper.c:255
int capa
Definition: ripper.c:257
struct vtable * prev
Definition: ripper.c:258
int pos
Definition: ripper.c:256
yysymbol_kind_t yytoken
Definition: ripper.c:6358
yy_state_t * yyssp
Definition: ripper.c:6357
#define t
Definition: symbol.c:253
#define is_identchar(p, e, enc)
Definition: symbol.c:45
int rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset)
Definition: symbol.c:365
#define is_attrset_id(id)
Definition: symbol.h:39
#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
struct lex_context ctxt
Definition: parse.h:192
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
void error(const char *msg)
Definition: untgz.c:593
#define ALLOC(size)
Definition: unzip.c:112
unsigned long VALUE
Definition: value.h:38
#define SIZEOF_VALUE
Definition: value.h:41
unsigned long ID
Definition: value.h:39
#define T_COMPLEX
Definition: value_type.h:58
#define TYPE(_)
Definition: value_type.h:105
#define T_FILE
Definition: value_type.h:61
#define T_STRING
Definition: value_type.h:77
#define T_FLOAT
Definition: value_type.h:63
#define T_BIGNUM
Definition: value_type.h:56
#define T_NODE
Definition: value_type.h:72
#define T_RATIONAL
Definition: value_type.h:75
#define T_HASH
Definition: value_type.h:64
#define T_ARRAY
Definition: value_type.h:55
#define T_OBJECT
Definition: value_type.h:74
#define BUILTIN_TYPE
Definition: value_type.h:84
#define SYMBOL_P
Definition: value_type.h:87
#define T_REGEXP
Definition: value_type.h:76
#define rb_id2str(id)
Definition: vm_backtrace.c:30
#define EOF
Definition: vsnprintf.c:203
int err
Definition: win32.c:142
if((ID)(DISPID) nameid !=nameid)
Definition: win32ole.c:357
void rb_write_error_str(VALUE mesg)
Definition: io.c:8083
#define xfree
Definition: xmalloc.h:49
#define xrealloc
Definition: xmalloc.h:47
#define xmalloc
Definition: xmalloc.h:44
#define xcalloc
Definition: xmalloc.h:46
#define MAX_WORD_LENGTH
Definition: zonetab.h:45
#define ZALLOC(strm, items, size)
Definition: zutil.h:266