Coverage Report

Created: 2025-10-13 06:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/jq/src/parser.c
Line
Count
Source
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 1 "src/parser.y"
71
72
#include <assert.h>
73
#include <math.h>
74
#include <stdio.h>
75
#include <string.h>
76
#include "compile.h"
77
#include "jv_alloc.h"
78
#include "builtin.h"
79
#define YYMALLOC jv_mem_alloc
80
491
#define YYFREE jv_mem_free
81
82
#line 83 "src/parser.c"
83
84
# ifndef YY_CAST
85
#  ifdef __cplusplus
86
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
87
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
88
#  else
89
22.4M
#   define YY_CAST(Type, Val) ((Type) (Val))
90
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
91
#  endif
92
# endif
93
# ifndef YY_NULLPTR
94
#  if defined __cplusplus
95
#   if 201103L <= __cplusplus
96
#    define YY_NULLPTR nullptr
97
#   else
98
#    define YY_NULLPTR 0
99
#   endif
100
#  else
101
159k
#   define YY_NULLPTR ((void*)0)
102
#  endif
103
# endif
104
105
/* Use api.header.include to #include this header
106
   instead of duplicating it here.  */
107
#ifndef YY_YY_SRC_PARSER_H_INCLUDED
108
# define YY_YY_SRC_PARSER_H_INCLUDED
109
/* Debug traces.  */
110
#ifndef YYDEBUG
111
# define YYDEBUG 0
112
#endif
113
#if YYDEBUG
114
extern int yydebug;
115
#endif
116
/* "%code requires" blocks.  */
117
#line 12 "src/parser.y"
118
119
#include "locfile.h"
120
struct lexer_param;
121
122
13.8k
#define YYLTYPE location
123
#define YYLLOC_DEFAULT(Loc, Rhs, N)             \
124
6.65M
  do {                                          \
125
6.65M
    if (N) {                                    \
126
6.52M
      (Loc).start = YYRHSLOC(Rhs, 1).start;     \
127
6.52M
      (Loc).end = YYRHSLOC(Rhs, N).end;         \
128
6.52M
    } else {                                    \
129
129k
      (Loc).start = YYRHSLOC(Rhs, 0).end;       \
130
129k
      (Loc).end = YYRHSLOC(Rhs, 0).end;         \
131
129k
    }                                           \
132
6.65M
  } while (0)
133
134
#line 135 "src/parser.c"
135
136
/* Token kinds.  */
137
#ifndef YYTOKENTYPE
138
# define YYTOKENTYPE
139
  enum yytokentype
140
  {
141
    YYEMPTY = -2,
142
    YYEOF = 0,                     /* "end of file"  */
143
    YYerror = 256,                 /* error  */
144
    YYUNDEF = 257,                 /* "invalid token"  */
145
    INVALID_CHARACTER = 258,       /* INVALID_CHARACTER  */
146
    IDENT = 259,                   /* IDENT  */
147
    FIELD = 260,                   /* FIELD  */
148
    BINDING = 261,                 /* BINDING  */
149
    LITERAL = 262,                 /* LITERAL  */
150
    FORMAT = 263,                  /* FORMAT  */
151
    REC = 264,                     /* ".."  */
152
    SETMOD = 265,                  /* "%="  */
153
    EQ = 266,                      /* "=="  */
154
    NEQ = 267,                     /* "!="  */
155
    DEFINEDOR = 268,               /* "//"  */
156
    AS = 269,                      /* "as"  */
157
    DEF = 270,                     /* "def"  */
158
    MODULE = 271,                  /* "module"  */
159
    IMPORT = 272,                  /* "import"  */
160
    INCLUDE = 273,                 /* "include"  */
161
    IF = 274,                      /* "if"  */
162
    THEN = 275,                    /* "then"  */
163
    ELSE = 276,                    /* "else"  */
164
    ELSE_IF = 277,                 /* "elif"  */
165
    REDUCE = 278,                  /* "reduce"  */
166
    FOREACH = 279,                 /* "foreach"  */
167
    END = 280,                     /* "end"  */
168
    AND = 281,                     /* "and"  */
169
    OR = 282,                      /* "or"  */
170
    TRY = 283,                     /* "try"  */
171
    CATCH = 284,                   /* "catch"  */
172
    LABEL = 285,                   /* "label"  */
173
    BREAK = 286,                   /* "break"  */
174
    LOC = 287,                     /* "$__loc__"  */
175
    SETPIPE = 288,                 /* "|="  */
176
    SETPLUS = 289,                 /* "+="  */
177
    SETMINUS = 290,                /* "-="  */
178
    SETMULT = 291,                 /* "*="  */
179
    SETDIV = 292,                  /* "/="  */
180
    SETDEFINEDOR = 293,            /* "//="  */
181
    LESSEQ = 294,                  /* "<="  */
182
    GREATEREQ = 295,               /* ">="  */
183
    ALTERNATION = 296,             /* "?//"  */
184
    QQSTRING_START = 297,          /* QQSTRING_START  */
185
    QQSTRING_TEXT = 298,           /* QQSTRING_TEXT  */
186
    QQSTRING_INTERP_START = 299,   /* QQSTRING_INTERP_START  */
187
    QQSTRING_INTERP_END = 300,     /* QQSTRING_INTERP_END  */
188
    QQSTRING_END = 301,            /* QQSTRING_END  */
189
    FUNCDEF = 302,                 /* FUNCDEF  */
190
    NONOPT = 303                   /* NONOPT  */
191
  };
192
  typedef enum yytokentype yytoken_kind_t;
193
#endif
194
/* Token kinds.  */
195
15.1M
#define YYEMPTY -2
196
9.91M
#define YYEOF 0
197
8.13M
#define YYerror 256
198
0
#define YYUNDEF 257
199
#define INVALID_CHARACTER 258
200
#define IDENT 259
201
#define FIELD 260
202
#define BINDING 261
203
10.3M
#define LITERAL 262
204
#define FORMAT 263
205
#define REC 264
206
#define SETMOD 265
207
49.8k
#define EQ 266
208
10.2k
#define NEQ 267
209
#define DEFINEDOR 268
210
#define AS 269
211
#define DEF 270
212
#define MODULE 271
213
#define IMPORT 272
214
#define INCLUDE 273
215
#define IF 274
216
#define THEN 275
217
#define ELSE 276
218
#define ELSE_IF 277
219
#define REDUCE 278
220
#define FOREACH 279
221
#define END 280
222
#define AND 281
223
#define OR 282
224
#define TRY 283
225
#define CATCH 284
226
#define LABEL 285
227
#define BREAK 286
228
#define LOC 287
229
#define SETPIPE 288
230
#define SETPLUS 289
231
#define SETMINUS 290
232
#define SETMULT 291
233
#define SETDIV 292
234
#define SETDEFINEDOR 293
235
7.11k
#define LESSEQ 294
236
3.41k
#define GREATEREQ 295
237
#define ALTERNATION 296
238
#define QQSTRING_START 297
239
4.75M
#define QQSTRING_TEXT 298
240
#define QQSTRING_INTERP_START 299
241
#define QQSTRING_INTERP_END 300
242
#define QQSTRING_END 301
243
#define FUNCDEF 302
244
#define NONOPT 303
245
246
/* Value type.  */
247
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
248
union YYSTYPE
249
{
250
#line 32 "src/parser.y"
251
252
  jv literal;
253
  block blk;
254
255
#line 256 "src/parser.c"
256
257
};
258
typedef union YYSTYPE YYSTYPE;
259
# define YYSTYPE_IS_TRIVIAL 1
260
# define YYSTYPE_IS_DECLARED 1
261
#endif
262
263
/* Location type.  */
264
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
265
typedef struct YYLTYPE YYLTYPE;
266
struct YYLTYPE
267
{
268
  int first_line;
269
  int first_column;
270
  int last_line;
271
  int last_column;
272
};
273
# define YYLTYPE_IS_DECLARED 1
274
# define YYLTYPE_IS_TRIVIAL 1
275
#endif
276
277
278
279
280
int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr);
281
282
283
#endif /* !YY_YY_SRC_PARSER_H_INCLUDED  */
284
/* Symbol kind.  */
285
enum yysymbol_kind_t
286
{
287
  YYSYMBOL_YYEMPTY = -2,
288
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
289
  YYSYMBOL_YYerror = 1,                    /* error  */
290
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
291
  YYSYMBOL_INVALID_CHARACTER = 3,          /* INVALID_CHARACTER  */
292
  YYSYMBOL_IDENT = 4,                      /* IDENT  */
293
  YYSYMBOL_FIELD = 5,                      /* FIELD  */
294
  YYSYMBOL_BINDING = 6,                    /* BINDING  */
295
  YYSYMBOL_LITERAL = 7,                    /* LITERAL  */
296
  YYSYMBOL_FORMAT = 8,                     /* FORMAT  */
297
  YYSYMBOL_REC = 9,                        /* ".."  */
298
  YYSYMBOL_SETMOD = 10,                    /* "%="  */
299
  YYSYMBOL_EQ = 11,                        /* "=="  */
300
  YYSYMBOL_NEQ = 12,                       /* "!="  */
301
  YYSYMBOL_DEFINEDOR = 13,                 /* "//"  */
302
  YYSYMBOL_AS = 14,                        /* "as"  */
303
  YYSYMBOL_DEF = 15,                       /* "def"  */
304
  YYSYMBOL_MODULE = 16,                    /* "module"  */
305
  YYSYMBOL_IMPORT = 17,                    /* "import"  */
306
  YYSYMBOL_INCLUDE = 18,                   /* "include"  */
307
  YYSYMBOL_IF = 19,                        /* "if"  */
308
  YYSYMBOL_THEN = 20,                      /* "then"  */
309
  YYSYMBOL_ELSE = 21,                      /* "else"  */
310
  YYSYMBOL_ELSE_IF = 22,                   /* "elif"  */
311
  YYSYMBOL_REDUCE = 23,                    /* "reduce"  */
312
  YYSYMBOL_FOREACH = 24,                   /* "foreach"  */
313
  YYSYMBOL_END = 25,                       /* "end"  */
314
  YYSYMBOL_AND = 26,                       /* "and"  */
315
  YYSYMBOL_OR = 27,                        /* "or"  */
316
  YYSYMBOL_TRY = 28,                       /* "try"  */
317
  YYSYMBOL_CATCH = 29,                     /* "catch"  */
318
  YYSYMBOL_LABEL = 30,                     /* "label"  */
319
  YYSYMBOL_BREAK = 31,                     /* "break"  */
320
  YYSYMBOL_LOC = 32,                       /* "$__loc__"  */
321
  YYSYMBOL_SETPIPE = 33,                   /* "|="  */
322
  YYSYMBOL_SETPLUS = 34,                   /* "+="  */
323
  YYSYMBOL_SETMINUS = 35,                  /* "-="  */
324
  YYSYMBOL_SETMULT = 36,                   /* "*="  */
325
  YYSYMBOL_SETDIV = 37,                    /* "/="  */
326
  YYSYMBOL_SETDEFINEDOR = 38,              /* "//="  */
327
  YYSYMBOL_LESSEQ = 39,                    /* "<="  */
328
  YYSYMBOL_GREATEREQ = 40,                 /* ">="  */
329
  YYSYMBOL_ALTERNATION = 41,               /* "?//"  */
330
  YYSYMBOL_QQSTRING_START = 42,            /* QQSTRING_START  */
331
  YYSYMBOL_QQSTRING_TEXT = 43,             /* QQSTRING_TEXT  */
332
  YYSYMBOL_QQSTRING_INTERP_START = 44,     /* QQSTRING_INTERP_START  */
333
  YYSYMBOL_QQSTRING_INTERP_END = 45,       /* QQSTRING_INTERP_END  */
334
  YYSYMBOL_QQSTRING_END = 46,              /* QQSTRING_END  */
335
  YYSYMBOL_FUNCDEF = 47,                   /* FUNCDEF  */
336
  YYSYMBOL_48_ = 48,                       /* '|'  */
337
  YYSYMBOL_49_ = 49,                       /* ','  */
338
  YYSYMBOL_50_ = 50,                       /* '='  */
339
  YYSYMBOL_51_ = 51,                       /* '<'  */
340
  YYSYMBOL_52_ = 52,                       /* '>'  */
341
  YYSYMBOL_53_ = 53,                       /* '+'  */
342
  YYSYMBOL_54_ = 54,                       /* '-'  */
343
  YYSYMBOL_55_ = 55,                       /* '*'  */
344
  YYSYMBOL_56_ = 56,                       /* '/'  */
345
  YYSYMBOL_57_ = 57,                       /* '%'  */
346
  YYSYMBOL_NONOPT = 58,                    /* NONOPT  */
347
  YYSYMBOL_59_ = 59,                       /* '?'  */
348
  YYSYMBOL_60_ = 60,                       /* '.'  */
349
  YYSYMBOL_61_ = 61,                       /* '['  */
350
  YYSYMBOL_62_ = 62,                       /* ';'  */
351
  YYSYMBOL_63_ = 63,                       /* ':'  */
352
  YYSYMBOL_64_ = 64,                       /* '('  */
353
  YYSYMBOL_65_ = 65,                       /* ')'  */
354
  YYSYMBOL_66_ = 66,                       /* ']'  */
355
  YYSYMBOL_67_ = 67,                       /* '{'  */
356
  YYSYMBOL_68_ = 68,                       /* '}'  */
357
  YYSYMBOL_69_ = 69,                       /* '$'  */
358
  YYSYMBOL_YYACCEPT = 70,                  /* $accept  */
359
  YYSYMBOL_TopLevel = 71,                  /* TopLevel  */
360
  YYSYMBOL_Module = 72,                    /* Module  */
361
  YYSYMBOL_Imports = 73,                   /* Imports  */
362
  YYSYMBOL_FuncDefs = 74,                  /* FuncDefs  */
363
  YYSYMBOL_Query = 75,                     /* Query  */
364
  YYSYMBOL_Expr = 76,                      /* Expr  */
365
  YYSYMBOL_Import = 77,                    /* Import  */
366
  YYSYMBOL_ImportWhat = 78,                /* ImportWhat  */
367
  YYSYMBOL_ImportFrom = 79,                /* ImportFrom  */
368
  YYSYMBOL_FuncDef = 80,                   /* FuncDef  */
369
  YYSYMBOL_Params = 81,                    /* Params  */
370
  YYSYMBOL_Param = 82,                     /* Param  */
371
  YYSYMBOL_StringStart = 83,               /* StringStart  */
372
  YYSYMBOL_String = 84,                    /* String  */
373
  YYSYMBOL_QQString = 85,                  /* QQString  */
374
  YYSYMBOL_ElseBody = 86,                  /* ElseBody  */
375
  YYSYMBOL_Term = 87,                      /* Term  */
376
  YYSYMBOL_Args = 88,                      /* Args  */
377
  YYSYMBOL_Arg = 89,                       /* Arg  */
378
  YYSYMBOL_RepPatterns = 90,               /* RepPatterns  */
379
  YYSYMBOL_Patterns = 91,                  /* Patterns  */
380
  YYSYMBOL_Pattern = 92,                   /* Pattern  */
381
  YYSYMBOL_ArrayPats = 93,                 /* ArrayPats  */
382
  YYSYMBOL_ObjPats = 94,                   /* ObjPats  */
383
  YYSYMBOL_ObjPat = 95,                    /* ObjPat  */
384
  YYSYMBOL_Keyword = 96,                   /* Keyword  */
385
  YYSYMBOL_DictPairs = 97,                 /* DictPairs  */
386
  YYSYMBOL_DictPair = 98,                  /* DictPair  */
387
  YYSYMBOL_DictExpr = 99                   /* DictExpr  */
388
};
389
typedef enum yysymbol_kind_t yysymbol_kind_t;
390
391
392
/* Second part of user prologue.  */
393
#line 127 "src/parser.y"
394
395
#include "lexer.h"
396
struct lexer_param {
397
  yyscan_t lexer;
398
};
399
#define FAIL(loc, msg)                                             \
400
244k
  do {                                                             \
401
244k
    location l = loc;                                              \
402
244k
    yyerror(&l, answer, errors, locations, lexer_param_ptr, msg);  \
403
244k
    /*YYERROR*/;                                                   \
404
244k
  } while (0)
405
406
void yyerror(YYLTYPE* loc, block* answer, int* errors,
407
299k
             struct locfile* locations, struct lexer_param* lexer_param_ptr, const char *s){
408
299k
  (*errors)++;
409
299k
  locfile_locate(locations, *loc, "jq: error: %s", s);
410
299k
}
411
412
int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors,
413
5.17M
          struct locfile* locations, struct lexer_param* lexer_param_ptr) {
414
5.17M
  yyscan_t lexer = lexer_param_ptr->lexer;
415
5.17M
  int tok = jq_yylex(yylval, yylloc, lexer);
416
5.17M
  if ((tok == LITERAL || tok == QQSTRING_TEXT) && !jv_is_valid(yylval->literal)) {
417
204k
    jv msg = jv_invalid_get_msg(jv_copy(yylval->literal));
418
204k
    if (jv_get_kind(msg) == JV_KIND_STRING) {
419
204k
      FAIL(*yylloc, jv_string_value(msg));
420
204k
    } else {
421
0
      FAIL(*yylloc, "Invalid literal");
422
0
    }
423
204k
    jv_free(msg);
424
204k
    jv_free(yylval->literal);
425
204k
    yylval->literal = jv_null();
426
204k
  }
427
5.17M
  return tok;
428
5.17M
}
429
430
/* Returns string message if the block is a constant that is not valid as an
431
 * object key. */
432
3.21k
static jv check_object_key(block k) {
433
3.21k
  if (block_is_const(k) && block_const_kind(k) != JV_KIND_STRING) {
434
631
    char errbuf[15];
435
631
    return jv_string_fmt("Cannot use %s (%s) as object key",
436
631
        jv_kind_name(block_const_kind(k)),
437
631
        jv_dump_string_trunc(block_const(k), errbuf, sizeof(errbuf)));
438
631
  }
439
2.58k
  return jv_invalid();
440
3.21k
}
441
442
58.4k
static block gen_index(block obj, block key) {
443
58.4k
  return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX));
444
58.4k
}
445
446
1.41k
static block gen_index_opt(block obj, block key) {
447
1.41k
  return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX_OPT));
448
1.41k
}
449
450
6.00k
static block gen_slice_index(block obj, block start, block end, opcode idx_op) {
451
6.00k
  block key = BLOCK(gen_subexp(gen_const(jv_object())),
452
6.00k
                    gen_subexp(gen_const(jv_string("start"))),
453
6.00k
                    gen_subexp(start),
454
6.00k
                    gen_op_simple(INSERT),
455
6.00k
                    gen_subexp(gen_const(jv_string("end"))),
456
6.00k
                    gen_subexp(end),
457
6.00k
                    gen_op_simple(INSERT));
458
6.00k
  return BLOCK(key, obj, gen_op_simple(idx_op));
459
6.00k
}
460
461
452k
static block constant_fold(block a, block b, int op) {
462
452k
  if (!block_is_single(a) || !block_is_const(a) ||
463
246k
      !block_is_single(b) || !block_is_const(b))
464
217k
    return gen_noop();
465
466
235k
  jv jv_a = block_const(a);
467
235k
  block_free(a);
468
235k
  jv jv_b = block_const(b);
469
235k
  block_free(b);
470
471
235k
  jv res = jv_invalid();
472
235k
  switch (op) {
473
124k
  case '+': res = binop_plus(jv_a, jv_b); break;
474
26.2k
  case '-': res = binop_minus(jv_a, jv_b); break;
475
28.9k
  case '*': res = binop_multiply(jv_a, jv_b); break;
476
27.2k
  case '/': res = binop_divide(jv_a, jv_b); break;
477
7.38k
  case '%': res = binop_mod(jv_a, jv_b); break;
478
2.84k
  case EQ: res = binop_equal(jv_a, jv_b); break;
479
1.58k
  case NEQ: res = binop_notequal(jv_a, jv_b); break;
480
2.81k
  case '<': res = binop_less(jv_a, jv_b); break;
481
12.5k
  case '>': res = binop_greater(jv_a, jv_b); break;
482
749
  case LESSEQ: res = binop_lesseq(jv_a, jv_b); break;
483
1.19k
  case GREATEREQ: res = binop_greatereq(jv_a, jv_b); break;
484
235k
  }
485
486
235k
  if (jv_is_valid(res))
487
224k
    return gen_const(res);
488
489
11.0k
  return gen_error(jv_invalid_get_msg(res));
490
235k
}
491
492
452k
static block gen_binop(block a, block b, int op) {
493
452k
  block folded = constant_fold(a, b, op);
494
452k
  if (!block_is_noop(folded))
495
235k
    return folded;
496
497
217k
  const char* funcname = 0;
498
217k
  switch (op) {
499
111k
  case '+': funcname = "_plus"; break;
500
30.9k
  case '-': funcname = "_minus"; break;
501
10.2k
  case '*': funcname = "_multiply"; break;
502
17.2k
  case '/': funcname = "_divide"; break;
503
3.65k
  case '%': funcname = "_mod"; break;
504
22.1k
  case EQ: funcname = "_equal"; break;
505
3.55k
  case NEQ: funcname = "_notequal"; break;
506
4.11k
  case '<': funcname = "_less"; break;
507
10.1k
  case '>': funcname = "_greater"; break;
508
2.80k
  case LESSEQ: funcname = "_lesseq"; break;
509
511
  case GREATEREQ: funcname = "_greatereq"; break;
510
217k
  }
511
217k
  assert(funcname);
512
513
217k
  return gen_call(funcname, BLOCK(gen_lambda(a), gen_lambda(b)));
514
217k
}
515
516
4.56k
static block gen_format(block a, jv fmt) {
517
4.56k
  return BLOCK(a, gen_call("format", gen_lambda(gen_const(fmt))));
518
4.56k
}
519
520
962
static block gen_definedor_assign(block object, block val) {
521
962
  block tmp = gen_op_var_fresh(STOREV, "tmp");
522
962
  return BLOCK(gen_op_simple(DUP),
523
962
               val, tmp,
524
962
               gen_call("_modify", BLOCK(gen_lambda(object),
525
962
                                         gen_lambda(gen_definedor(gen_noop(),
526
962
                                                                  gen_op_bound(LOADV, tmp))))));
527
962
}
528
529
41.8k
static block gen_update(block object, block val, int optype) {
530
41.8k
  block tmp = gen_op_var_fresh(STOREV, "tmp");
531
41.8k
  return BLOCK(gen_op_simple(DUP),
532
41.8k
               val,
533
41.8k
               tmp,
534
41.8k
               gen_call("_modify", BLOCK(gen_lambda(object),
535
41.8k
                                         gen_lambda(gen_binop(gen_noop(),
536
41.8k
                                                              gen_op_bound(LOADV, tmp),
537
41.8k
                                                              optype)))));
538
41.8k
}
539
540
0
static block gen_loc_object(location *loc, struct locfile *locations) {
541
0
  return gen_const(JV_OBJECT(jv_string("file"), jv_copy(locations->fname),
542
0
                             jv_string("line"), jv_number(locfile_get_line(locations, loc->start) + 1)));
543
0
}
544
545
546
#line 547 "src/parser.c"
547
548
549
#ifdef short
550
# undef short
551
#endif
552
553
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
554
   <limits.h> and (if available) <stdint.h> are included
555
   so that the code can choose integer types of a good width.  */
556
557
#ifndef __PTRDIFF_MAX__
558
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
559
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
560
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
561
#  define YY_STDINT_H
562
# endif
563
#endif
564
565
/* Narrow types that promote to a signed type and that can represent a
566
   signed or unsigned integer of at least N bits.  In tables they can
567
   save space and decrease cache pressure.  Promoting to a signed type
568
   helps avoid bugs in integer arithmetic.  */
569
570
#ifdef __INT_LEAST8_MAX__
571
typedef __INT_LEAST8_TYPE__ yytype_int8;
572
#elif defined YY_STDINT_H
573
typedef int_least8_t yytype_int8;
574
#else
575
typedef signed char yytype_int8;
576
#endif
577
578
#ifdef __INT_LEAST16_MAX__
579
typedef __INT_LEAST16_TYPE__ yytype_int16;
580
#elif defined YY_STDINT_H
581
typedef int_least16_t yytype_int16;
582
#else
583
typedef short yytype_int16;
584
#endif
585
586
/* Work around bug in HP-UX 11.23, which defines these macros
587
   incorrectly for preprocessor constants.  This workaround can likely
588
   be removed in 2023, as HPE has promised support for HP-UX 11.23
589
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
590
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
591
#ifdef __hpux
592
# undef UINT_LEAST8_MAX
593
# undef UINT_LEAST16_MAX
594
# define UINT_LEAST8_MAX 255
595
# define UINT_LEAST16_MAX 65535
596
#endif
597
598
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
599
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
600
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
601
       && UINT_LEAST8_MAX <= INT_MAX)
602
typedef uint_least8_t yytype_uint8;
603
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
604
typedef unsigned char yytype_uint8;
605
#else
606
typedef short yytype_uint8;
607
#endif
608
609
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
610
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
611
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
612
       && UINT_LEAST16_MAX <= INT_MAX)
613
typedef uint_least16_t yytype_uint16;
614
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
615
typedef unsigned short yytype_uint16;
616
#else
617
typedef int yytype_uint16;
618
#endif
619
620
#ifndef YYPTRDIFF_T
621
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
622
175k
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
623
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
624
# elif defined PTRDIFF_MAX
625
#  ifndef ptrdiff_t
626
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
627
#  endif
628
#  define YYPTRDIFF_T ptrdiff_t
629
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
630
# else
631
#  define YYPTRDIFF_T long
632
#  define YYPTRDIFF_MAXIMUM LONG_MAX
633
# endif
634
#endif
635
636
#ifndef YYSIZE_T
637
# ifdef __SIZE_TYPE__
638
#  define YYSIZE_T __SIZE_TYPE__
639
# elif defined size_t
640
#  define YYSIZE_T size_t
641
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
642
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
643
#  define YYSIZE_T size_t
644
# else
645
#  define YYSIZE_T unsigned
646
# endif
647
#endif
648
649
#define YYSIZE_MAXIMUM                                  \
650
104k
  YY_CAST (YYPTRDIFF_T,                                 \
651
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
652
            ? YYPTRDIFF_MAXIMUM                         \
653
            : YY_CAST (YYSIZE_T, -1)))
654
655
4.41k
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
656
657
658
/* Stored state numbers (used for stacks). */
659
typedef yytype_int16 yy_state_t;
660
661
/* State numbers in computations.  */
662
typedef int yy_state_fast_t;
663
664
#ifndef YY_
665
# if defined YYENABLE_NLS && YYENABLE_NLS
666
#  if ENABLE_NLS
667
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
668
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
669
#  endif
670
# endif
671
# ifndef YY_
672
55.1k
#  define YY_(Msgid) Msgid
673
# endif
674
#endif
675
676
677
#ifndef YY_ATTRIBUTE_PURE
678
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
679
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
680
# else
681
#  define YY_ATTRIBUTE_PURE
682
# endif
683
#endif
684
685
#ifndef YY_ATTRIBUTE_UNUSED
686
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
687
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
688
# else
689
#  define YY_ATTRIBUTE_UNUSED
690
# endif
691
#endif
692
693
/* Suppress unused-variable warnings by "using" E.  */
694
#if ! defined lint || defined __GNUC__
695
21.9M
# define YY_USE(E) ((void) (E))
696
#else
697
# define YY_USE(E) /* empty */
698
#endif
699
700
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
701
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
702
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
703
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
704
    _Pragma ("GCC diagnostic push")                                     \
705
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
706
# else
707
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
708
    _Pragma ("GCC diagnostic push")                                     \
709
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
710
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
711
# endif
712
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
713
    _Pragma ("GCC diagnostic pop")
714
#else
715
4.62k
# define YY_INITIAL_VALUE(Value) Value
716
#endif
717
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
718
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
719
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
720
#endif
721
#ifndef YY_INITIAL_VALUE
722
# define YY_INITIAL_VALUE(Value) /* Nothing. */
723
#endif
724
725
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
726
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
727
    _Pragma ("GCC diagnostic push")                            \
728
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
729
# define YY_IGNORE_USELESS_CAST_END            \
730
    _Pragma ("GCC diagnostic pop")
731
#endif
732
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
733
# define YY_IGNORE_USELESS_CAST_BEGIN
734
# define YY_IGNORE_USELESS_CAST_END
735
#endif
736
737
738
10.1M
#define YY_ASSERT(E) ((void) (0 && (E)))
739
740
#if 1
741
742
/* The parser invokes alloca or malloc; define the necessary symbols.  */
743
744
# ifdef YYSTACK_USE_ALLOCA
745
#  if YYSTACK_USE_ALLOCA
746
#   ifdef __GNUC__
747
#    define YYSTACK_ALLOC __builtin_alloca
748
#   elif defined __BUILTIN_VA_ARG_INCR
749
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
750
#   elif defined _AIX
751
#    define YYSTACK_ALLOC __alloca
752
#   elif defined _MSC_VER
753
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
754
#    define alloca _alloca
755
#   else
756
#    define YYSTACK_ALLOC alloca
757
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
758
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
759
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
760
#     ifndef EXIT_SUCCESS
761
#      define EXIT_SUCCESS 0
762
#     endif
763
#    endif
764
#   endif
765
#  endif
766
# endif
767
768
# ifdef YYSTACK_ALLOC
769
   /* Pacify GCC's 'empty if-body' warning.  */
770
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
771
#  ifndef YYSTACK_ALLOC_MAXIMUM
772
    /* The OS might guarantee only one guard page at the bottom of the stack,
773
       and a page size can be as small as 4096 bytes.  So we cannot safely
774
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
775
       to allow for a few compiler-allocated temporary stack slots.  */
776
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
777
#  endif
778
# else
779
#  define YYSTACK_ALLOC YYMALLOC
780
491
#  define YYSTACK_FREE YYFREE
781
#  ifndef YYSTACK_ALLOC_MAXIMUM
782
104k
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
783
#  endif
784
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
785
       && ! ((defined YYMALLOC || defined malloc) \
786
             && (defined YYFREE || defined free)))
787
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
788
#   ifndef EXIT_SUCCESS
789
#    define EXIT_SUCCESS 0
790
#   endif
791
#  endif
792
#  ifndef YYMALLOC
793
#   define YYMALLOC malloc
794
#   if ! defined malloc && ! defined EXIT_SUCCESS
795
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
796
#   endif
797
#  endif
798
#  ifndef YYFREE
799
#   define YYFREE free
800
#   if ! defined free && ! defined EXIT_SUCCESS
801
void free (void *); /* INFRINGES ON USER NAME SPACE */
802
#   endif
803
#  endif
804
# endif
805
#endif /* 1 */
806
807
#if (! defined yyoverflow \
808
     && (! defined __cplusplus \
809
         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
810
             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
811
812
/* A type that is properly aligned for any stack member.  */
813
union yyalloc
814
{
815
  yy_state_t yyss_alloc;
816
  YYSTYPE yyvs_alloc;
817
  YYLTYPE yyls_alloc;
818
};
819
820
/* The size of the maximum gap between one aligned stack and the next.  */
821
1.47k
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
822
823
/* The size of an array large to enough to hold all stacks, each with
824
   N elements.  */
825
# define YYSTACK_BYTES(N) \
826
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
827
             + YYSIZEOF (YYLTYPE)) \
828
      + 2 * YYSTACK_GAP_MAXIMUM)
829
830
# define YYCOPY_NEEDED 1
831
832
/* Relocate STACK from its old location to the new one.  The
833
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
834
   elements in the stack, and YYPTR gives the new location of the
835
   stack.  Advance YYPTR to a properly aligned location for the next
836
   stack.  */
837
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
838
1.47k
    do                                                                  \
839
1.47k
      {                                                                 \
840
1.47k
        YYPTRDIFF_T yynewbytes;                                         \
841
1.47k
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
842
1.47k
        Stack = &yyptr->Stack_alloc;                                    \
843
1.47k
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
844
1.47k
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
845
1.47k
      }                                                                 \
846
1.47k
    while (0)
847
848
#endif
849
850
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
851
/* Copy COUNT objects from SRC to DST.  The source and destination do
852
   not overlap.  */
853
# ifndef YYCOPY
854
#  if defined __GNUC__ && 1 < __GNUC__
855
#   define YYCOPY(Dst, Src, Count) \
856
1.47k
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
857
#  else
858
#   define YYCOPY(Dst, Src, Count)              \
859
      do                                        \
860
        {                                       \
861
          YYPTRDIFF_T yyi;                      \
862
          for (yyi = 0; yyi < (Count); yyi++)   \
863
            (Dst)[yyi] = (Src)[yyi];            \
864
        }                                       \
865
      while (0)
866
#  endif
867
# endif
868
#endif /* !YYCOPY_NEEDED */
869
870
/* YYFINAL -- State number of the termination state.  */
871
10.1M
#define YYFINAL  31
872
/* YYLAST -- Last index in YYTABLE.  */
873
24.1M
#define YYLAST   1226
874
875
/* YYNTOKENS -- Number of terminals.  */
876
4.97M
#define YYNTOKENS  70
877
/* YYNNTS -- Number of nonterminals.  */
878
#define YYNNTS  30
879
/* YYNRULES -- Number of rules.  */
880
#define YYNRULES  168
881
/* YYNSTATES -- Number of states.  */
882
#define YYNSTATES  312
883
884
/* YYMAXUTOK -- Last valid token kind.  */
885
9.92M
#define YYMAXUTOK   303
886
887
888
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
889
   as returned by yylex, with out-of-bounds checking.  */
890
#define YYTRANSLATE(YYX)                                \
891
11.7M
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
892
11.7M
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
893
11.7M
   : YYSYMBOL_YYUNDEF)
894
895
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
896
   as returned by yylex.  */
897
static const yytype_int8 yytranslate[] =
898
{
899
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
900
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
901
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
902
       2,     2,     2,     2,     2,     2,    69,    57,     2,     2,
903
      64,    65,    55,    53,    49,    54,    60,    56,     2,     2,
904
       2,     2,     2,     2,     2,     2,     2,     2,    63,    62,
905
      51,    50,    52,    59,     2,     2,     2,     2,     2,     2,
906
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
907
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
908
       2,    61,     2,    66,     2,     2,     2,     2,     2,     2,
909
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
910
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
911
       2,     2,     2,    67,    48,    68,     2,     2,     2,     2,
912
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
913
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
914
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
915
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
916
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
917
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
918
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
919
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
920
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
921
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
922
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
923
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
924
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
925
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
926
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
927
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
928
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
929
      45,    46,    47,    58
930
};
931
932
#if YYDEBUG
933
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
934
static const yytype_int16 yyrline[] =
935
{
936
       0,   282,   282,   285,   290,   293,   308,   311,   316,   319,
937
     325,   328,   331,   337,   340,   343,   349,   352,   355,   358,
938
     361,   364,   367,   370,   373,   376,   379,   382,   385,   388,
939
     391,   394,   397,   400,   403,   406,   409,   412,   415,   421,
940
     424,   441,   450,   457,   465,   476,   481,   487,   490,   495,
941
     499,   506,   509,   515,   522,   525,   528,   534,   537,   540,
942
     546,   549,   552,   560,   564,   567,   570,   573,   576,   579,
943
     582,   585,   588,   592,   598,   601,   604,   607,   610,   613,
944
     616,   619,   622,   625,   628,   631,   634,   637,   640,   643,
945
     646,   649,   652,   655,   658,   661,   664,   671,   674,   677,
946
     680,   683,   687,   690,   694,   712,   716,   720,   723,   735,
947
     740,   741,   742,   743,   746,   749,   754,   759,   762,   767,
948
     770,   775,   779,   782,   787,   790,   795,   798,   803,   806,
949
     809,   812,   815,   818,   826,   832,   835,   838,   841,   844,
950
     847,   850,   853,   856,   859,   862,   865,   868,   871,   874,
951
     877,   880,   883,   889,   892,   895,   900,   903,   906,   909,
952
     913,   918,   922,   926,   930,   934,   942,   948,   951
953
};
954
#endif
955
956
/** Accessing symbol of state STATE.  */
957
1.97M
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
958
959
#if 1
960
/* The user-facing name of the symbol whose (internal) number is
961
   YYSYMBOL.  No bounds checking.  */
962
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
963
964
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
965
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
966
static const char *const yytname[] =
967
{
968
  "\"end of file\"", "error", "\"invalid token\"", "INVALID_CHARACTER",
969
  "IDENT", "FIELD", "BINDING", "LITERAL", "FORMAT", "\"..\"", "\"%=\"",
970
  "\"==\"", "\"!=\"", "\"//\"", "\"as\"", "\"def\"", "\"module\"",
971
  "\"import\"", "\"include\"", "\"if\"", "\"then\"", "\"else\"",
972
  "\"elif\"", "\"reduce\"", "\"foreach\"", "\"end\"", "\"and\"", "\"or\"",
973
  "\"try\"", "\"catch\"", "\"label\"", "\"break\"", "\"$__loc__\"",
974
  "\"|=\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", "\"//=\"", "\"<=\"",
975
  "\">=\"", "\"?//\"", "QQSTRING_START", "QQSTRING_TEXT",
976
  "QQSTRING_INTERP_START", "QQSTRING_INTERP_END", "QQSTRING_END",
977
  "FUNCDEF", "'|'", "','", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'",
978
  "'%'", "NONOPT", "'?'", "'.'", "'['", "';'", "':'", "'('", "')'", "']'",
979
  "'{'", "'}'", "'$'", "$accept", "TopLevel", "Module", "Imports",
980
  "FuncDefs", "Query", "Expr", "Import", "ImportWhat", "ImportFrom",
981
  "FuncDef", "Params", "Param", "StringStart", "String", "QQString",
982
  "ElseBody", "Term", "Args", "Arg", "RepPatterns", "Patterns", "Pattern",
983
  "ArrayPats", "ObjPats", "ObjPat", "Keyword", "DictPairs", "DictPair",
984
  "DictExpr", YY_NULLPTR
985
};
986
987
static const char *
988
yysymbol_name (yysymbol_kind_t yysymbol)
989
0
{
990
0
  return yytname[yysymbol];
991
0
}
992
#endif
993
994
13.7M
#define YYPACT_NINF (-146)
995
996
#define yypact_value_is_default(Yyn) \
997
13.7M
  ((Yyn) == YYPACT_NINF)
998
999
266k
#define YYTABLE_NINF (-154)
1000
1001
#define yytable_value_is_error(Yyn) \
1002
266k
  ((Yyn) == YYTABLE_NINF)
1003
1004
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1005
   STATE-NUM.  */
1006
static const yytype_int16 yypact[] =
1007
{
1008
      31,   890,    44,    35,    11,     9,  -146,  -146,    38,  -146,
1009
      85,   890,   956,   956,   956,   112,    26,  -146,  -146,   956,
1010
     279,   345,   412,   608,    59,    25,  1040,   890,  -146,  -146,
1011
      -2,  -146,     4,     4,   890,    35,   692,   890,  -146,  -146,
1012
      20,   -18,  1073,  1105,   131,    86,  -146,  -146,    -2,  -146,
1013
     164,    38,   108,   107,  -146,    22,   104,     0,   -34,   121,
1014
     124,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,
1015
    -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,
1016
     890,   135,   137,   134,   126,   141,   890,   890,  -146,   956,
1017
     956,   956,   956,    -5,   956,   956,   956,   956,   956,   956,
1018
     956,   956,   956,   956,   956,   956,   956,   956,   956,   956,
1019
     956,   956,    84,   177,   147,  -146,     3,   173,   199,  -146,
1020
    -146,  -146,    84,   890,  -146,  -146,   114,    84,    77,  -146,
1021
     890,    13,   479,    -5,    -5,   546,   890,  -146,  -146,  -146,
1022
    -146,  -146,  -146,   956,  -146,   956,   956,    78,   956,   956,
1023
    -146,   663,   220,    84,  -146,  1169,   505,   505,  1137,  -146,
1024
      -5,  1018,   187,   166,   188,   606,   205,  1169,  1169,  1169,
1025
    1169,  1169,  1169,   505,   505,  1169,   505,   505,   208,   208,
1026
    -146,  -146,  -146,  -146,   890,  -146,  -146,   758,   176,   175,
1027
     890,   184,     6,    57,  -146,  -146,   890,  -146,   123,  -146,
1028
    -146,    83,  -146,  -146,    18,   185,   189,  -146,  -146,    84,
1029
    1137,   200,   200,   200,   203,   200,   200,   206,  -146,  -146,
1030
    -146,   -42,   207,   209,   210,   890,   212,   -45,  -146,   213,
1031
      -5,   890,    33,   193,    28,  -146,  -146,    71,  -146,   824,
1032
     218,  -146,  -146,  -146,  -146,    13,   215,   890,   890,  -146,
1033
    -146,   890,   890,   956,   956,    -5,  -146,    -5,    -5,    -5,
1034
     103,    -5,  1018,  -146,    -5,   227,    84,  -146,  -146,   222,
1035
     223,   226,    74,  -146,  -146,   890,    -7,     2,   160,   163,
1036
     200,   200,  -146,  -146,  -146,  -146,   225,  -146,  -146,  -146,
1037
    -146,  -146,  -146,   235,   170,  -146,   890,   890,   890,    -5,
1038
    -146,  -146,    18,   105,    76,  -146,  -146,  -146,   890,  -146,
1039
     142,  -146
1040
};
1041
1042
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1043
   Performed when YYTABLE does not specify something else to do.  Zero
1044
   means the default is an error.  */
1045
static const yytype_uint8 yydefact[] =
1046
{
1047
       4,     0,     0,     6,   108,    69,   106,    89,    91,    61,
1048
       0,     0,     0,     0,     0,     0,     0,   107,    52,     0,
1049
       0,     0,     0,     0,     0,     0,    15,     0,    54,    90,
1050
      38,     1,     0,     0,     8,     6,     0,     0,    65,    51,
1051
       0,     0,     0,     0,   104,     0,    63,    62,    92,    72,
1052
       0,     0,    71,     0,    95,     0,     0,     0,     0,   162,
1053
     161,   135,   136,   137,   138,   139,   140,   141,   142,   143,
1054
     144,   145,   146,   147,   148,   149,   150,   151,   152,   163,
1055
       0,   159,   164,     0,   154,     0,     0,     0,     5,     0,
1056
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1057
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1058
       0,     0,    10,     0,    68,    88,     0,     0,     0,    44,
1059
      43,     3,     2,     8,     7,    39,     0,   116,     0,   114,
1060
       0,     0,     0,     0,     0,     0,     0,    73,    67,   111,
1061
      94,   110,    93,     0,   113,     0,     0,     0,     0,     0,
1062
      96,     0,     0,    13,    14,    31,    32,    33,    16,   121,
1063
       0,     0,     0,     0,   120,    19,    18,    21,    23,    25,
1064
      27,    30,    20,    36,    37,    17,    34,    35,    22,    24,
1065
      26,    28,    29,    55,     0,    53,    64,     0,    70,     0,
1066
       0,    79,     0,     0,     9,    40,     0,   109,     0,    50,
1067
      49,     0,    47,   101,     0,     0,     0,   103,   102,    12,
1068
     168,   166,   156,   160,     0,   158,   157,     0,   155,   105,
1069
     124,     0,     0,     0,   128,     0,     0,     0,   126,     0,
1070
       0,     0,     0,    81,     0,    66,   112,     0,    78,     0,
1071
      75,    42,    41,   115,    45,     0,     0,     0,     0,    59,
1072
     100,     0,     0,     0,     0,     0,   122,     0,     0,     0,
1073
       0,     0,     0,   123,     0,   119,    11,    56,    80,    77,
1074
      87,    86,     0,    74,    48,     0,     0,     0,     0,     0,
1075
     167,   165,   125,   134,   130,   129,     0,   132,   127,   131,
1076
      76,    84,    83,    85,     0,    58,     0,     0,     0,     0,
1077
      82,    46,     0,     0,     0,   133,    57,    97,     0,    99,
1078
       0,    98
1079
};
1080
1081
/* YYPGOTO[NTERM-NUM].  */
1082
static const yytype_int16 yypgoto[] =
1083
{
1084
    -146,  -146,  -146,   236,   179,    -1,     1,  -146,  -146,   253,
1085
      -8,  -146,    53,  -146,     5,  -146,     7,   284,  -146,   115,
1086
    -146,    60,  -100,  -146,  -146,    48,  -145,   169,  -146,  -140
1087
};
1088
1089
/* YYDEFGOTO[NTERM-NUM].  */
1090
static const yytype_uint8 yydefgoto[] =
1091
{
1092
       0,     2,     3,    34,   121,   112,    26,    35,    36,   118,
1093
      27,   201,   202,    28,    29,   113,   250,    30,   128,   129,
1094
     162,   163,   164,   221,   227,   228,    82,    83,    84,   211
1095
};
1096
1097
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
1098
   positive, shift that token.  If negative, reduce the rule whose
1099
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
1100
static const yytype_int16 yytable[] =
1101
{
1102
      25,   159,   132,   114,   262,   212,   213,   255,   215,   216,
1103
      41,    51,    51,    42,    43,    44,   229,   199,   295,   200,
1104
      55,    57,   296,   263,   256,    52,   123,    46,    81,   143,
1105
      86,    87,    47,   122,   144,   126,   127,   119,   119,   247,
1106
     248,    86,    87,   249,    31,    18,    18,     1,    86,    87,
1107
      86,    87,    32,    33,    86,    87,   160,   115,   116,   117,
1108
     220,   241,   161,   242,   187,   142,    86,    87,    38,   239,
1109
      86,    87,   240,    86,    87,    37,    86,    87,   267,   147,
1110
      39,    86,    87,   130,   131,   153,   154,    88,   140,    40,
1111
     155,   156,   157,   158,   269,   165,   166,   167,   168,   169,
1112
     170,   171,   172,   173,   174,   175,   176,   177,   178,   179,
1113
     180,   181,   182,   280,   281,   123,   192,   229,    45,    86,
1114
      87,   188,    86,    87,    86,    87,    86,    87,    85,   198,
1115
     265,   204,    86,    87,   136,   209,   208,   270,   308,   196,
1116
     293,   309,   197,   214,   210,   245,   210,   210,   246,   210,
1117
     210,    86,    87,    86,    87,   282,    81,   283,   284,   285,
1118
     135,   287,    86,    87,   289,   137,   226,   138,   286,   141,
1119
     307,    86,    87,   139,   189,   151,   195,     4,     5,     6,
1120
       7,     8,     9,   232,   145,   244,   234,   146,    10,   237,
1121
      86,    87,    11,   205,   206,   127,    12,    13,   148,   305,
1122
     149,    14,   150,    15,    16,    17,   186,   311,    86,    87,
1123
     152,    86,    87,   193,   231,    18,    90,    91,    86,    87,
1124
     183,   184,   297,   185,   260,   298,   219,    19,   230,  -118,
1125
     266,    94,   301,    20,    21,   235,   190,    22,   272,   191,
1126
      23,   236,    24,   238,   102,   103,   276,   277,   253,   251,
1127
     278,   279,   268,   252,   210,   210,   105,   106,   107,   108,
1128
     109,   110,   111,   109,   110,   111,   254,   226,  -117,   143,
1129
     257,   124,   258,   259,   294,   261,   264,   273,   275,   -60,
1130
      49,   290,   291,    50,   -60,   292,   120,    51,   299,   -60,
1131
     -60,   -60,   -60,   -60,   300,   302,   303,   304,   274,   -60,
1132
     -60,   -60,   194,    48,   -60,   -60,   -60,   310,   -60,   306,
1133
     288,   243,   -60,   -60,   -60,   -60,   -60,   -60,   -60,   -60,
1134
     218,    18,     0,     0,   -60,     0,     0,   -60,   -60,   -60,
1135
     -60,   -60,   -60,   -60,   -60,   -60,   -60,     0,   -60,   -60,
1136
     -60,   -60,   -60,     0,   -60,   -60,    53,   -60,     0,     4,
1137
       5,     6,     7,     8,     9,     0,     0,     0,     0,     0,
1138
      10,     0,     0,     0,    11,     0,     0,     0,    12,    13,
1139
       0,     0,     0,    14,     0,    15,    16,    17,     0,     0,
1140
       0,     0,     0,     0,     0,     0,     0,    18,     0,     0,
1141
       0,     0,     0,     0,     0,     0,     0,     0,     0,    19,
1142
       0,     0,     0,     0,     0,    20,    21,     0,     0,    22,
1143
       0,    54,    23,    56,    24,     0,     4,     5,     6,     7,
1144
       8,     9,     0,     0,     0,     0,     0,    10,     0,     0,
1145
       0,    11,     0,     0,     0,    12,    13,     0,     0,     0,
1146
      14,     0,    15,    16,    17,     0,     0,     0,     0,     0,
1147
       0,     0,     0,     0,    18,     0,     0,     0,     0,     0,
1148
       0,     0,     0,     0,     0,     0,    19,     0,     0,     0,
1149
       0,     0,    20,    21,     0,     0,    22,     0,     0,    23,
1150
     203,    24,     0,     4,     5,     6,     7,     8,     9,     0,
1151
       0,     0,     0,     0,    10,     0,     0,     0,    11,     0,
1152
       0,     0,    12,    13,     0,     0,     0,    14,     0,    15,
1153
      16,    17,     0,     0,     0,     0,  -154,  -154,     0,     0,
1154
       0,    18,     0,     0,     0,     0,     0,     0,     0,     0,
1155
       0,     0,     0,    19,     0,     0,     0,     0,     0,    20,
1156
      21,     0,     0,    22,  -154,  -154,    23,   207,    24,     0,
1157
       4,     5,     6,     7,     8,     9,  -154,  -154,   107,   108,
1158
     109,   110,   111,     0,     0,    11,     0,     0,     0,    12,
1159
      13,     0,     0,     0,    14,     0,     0,    16,    17,     0,
1160
       0,     0,     0,     0,     0,     0,     0,     0,    18,     0,
1161
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1162
      19,     0,     0,     0,     0,     0,    20,    21,     0,    58,
1163
      22,     0,    59,    23,    60,    24,    51,    90,    91,     0,
1164
       0,     0,    61,    62,    63,    64,    65,    66,    67,    68,
1165
      69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
1166
      79,     0,     0,     0,     0,   102,   103,     0,     0,     0,
1167
      18,     0,     0,     0,     0,     0,     0,   105,   106,   107,
1168
     108,   109,   110,   111,   217,     0,     0,    59,     0,    60,
1169
       0,    51,    80,     0,     0,     0,  -153,    61,    62,    63,
1170
      64,    65,    66,    67,    68,    69,    70,    71,    72,    73,
1171
      74,    75,    76,    77,    78,    79,     4,     5,     6,     7,
1172
       8,     9,     0,     0,     0,    18,     0,    10,     0,     0,
1173
       0,    11,     0,     0,     0,    12,    13,     0,     0,     0,
1174
      14,     0,    15,    16,    17,     0,     0,    80,     0,     0,
1175
       0,  -153,     0,     0,    18,     0,     0,     0,     0,     0,
1176
       0,     0,     0,     0,     0,     0,    19,     0,     0,     0,
1177
       0,     0,    20,    21,   125,     0,    22,     0,     0,    23,
1178
       0,    24,     4,     5,     6,     7,     8,     9,     0,     0,
1179
       0,     0,     0,    10,     0,     0,     0,    11,     0,     0,
1180
       0,    12,    13,     0,     0,     0,    14,     0,    15,    16,
1181
      17,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1182
      18,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1183
       0,     0,    19,     0,     0,     0,     0,     0,    20,    21,
1184
       0,     0,    22,     0,   233,    23,     0,    24,     4,     5,
1185
       6,     7,     8,     9,     0,     0,     0,     0,     0,    10,
1186
       0,     0,     0,    11,     0,     0,     0,    12,    13,     0,
1187
       0,     0,    14,     0,    15,    16,    17,     0,     0,     0,
1188
       0,     0,     0,     0,     0,     0,    18,     0,     0,     0,
1189
       0,     0,     0,     0,     0,     0,     0,     0,    19,     0,
1190
       0,     0,     0,     0,    20,    21,     0,     0,    22,     0,
1191
     271,    23,     0,    24,     4,     5,     6,     7,     8,     9,
1192
       0,     0,     0,     0,     0,    10,     0,     0,     0,    11,
1193
       0,     0,     0,    12,    13,     0,     0,     0,    14,     0,
1194
      15,    16,    17,     0,     0,     0,     0,     0,     0,     0,
1195
       0,     0,    18,     0,     0,     0,     0,     0,     0,     0,
1196
       0,     0,     0,     0,    19,     0,     0,     0,     0,     0,
1197
      20,    21,     0,     0,    22,     0,     0,    23,     0,    24,
1198
       4,     5,     6,     7,     8,     9,     0,     0,     0,     0,
1199
       0,     0,     0,     0,     0,    11,     0,     0,     0,    12,
1200
      13,     0,     0,     0,    14,     0,     0,    16,    17,     0,
1201
       0,     0,     0,     0,     0,     0,     0,     0,    18,     0,
1202
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1203
      19,     0,     0,     0,     0,     0,    20,    21,     0,   222,
1204
      22,     0,   223,    23,   224,    24,    51,     0,     0,     0,
1205
       0,     0,    61,    62,    63,    64,    65,    66,    67,    68,
1206
      69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
1207
      89,    90,    91,    92,    93,     0,     0,     0,     0,     0,
1208
      18,     0,     0,     0,     0,     0,    94,    95,     0,     0,
1209
       0,     0,     0,    96,    97,    98,    99,   100,   101,   102,
1210
     103,     0,   225,    89,    90,    91,    92,   133,     0,     0,
1211
     104,   105,   106,   107,   108,   109,   110,   111,     0,    94,
1212
      95,     0,     0,     0,     0,     0,    96,    97,    98,    99,
1213
     100,   101,   102,   103,     0,    89,    90,    91,    92,   134,
1214
       0,     0,     0,   104,   105,   106,   107,   108,   109,   110,
1215
     111,    94,    95,     0,     0,     0,     0,     0,    96,    97,
1216
      98,    99,   100,   101,   102,   103,     0,    89,    90,    91,
1217
      92,     0,     0,     0,     0,   104,   105,   106,   107,   108,
1218
     109,   110,   111,    94,    95,     0,     0,     0,     0,     0,
1219
      96,    97,    98,    99,   100,   101,   102,   103,     0,  -154,
1220
      90,    91,     0,     0,     0,     0,     0,   104,   105,   106,
1221
     107,   108,   109,   110,   111,    94,    95,     0,     0,     0,
1222
       0,     0,  -154,  -154,  -154,  -154,  -154,  -154,   102,   103,
1223
       0,     0,     0,     0,     0,     0,     0,     0,     0,  -154,
1224
     105,   106,   107,   108,   109,   110,   111
1225
};
1226
1227
static const yytype_int16 yycheck[] =
1228
{
1229
       1,     6,    20,     5,    49,   145,   146,    49,   148,   149,
1230
      11,     8,     8,    12,    13,    14,   161,     4,    25,     6,
1231
      21,    22,    20,    68,    66,    20,    34,     1,    23,    63,
1232
      48,    49,     6,    34,    68,    36,    37,    32,    33,    21,
1233
      22,    48,    49,    25,     0,    42,    42,    16,    48,    49,
1234
      48,    49,    17,    18,    48,    49,    61,    59,    60,    61,
1235
     160,     4,    67,     6,    61,    65,    48,    49,    59,    63,
1236
      48,    49,    66,    48,    49,    64,    48,    49,    45,    80,
1237
      42,    48,    49,    63,    64,    86,    87,    62,    66,     4,
1238
      89,    90,    91,    92,    66,    94,    95,    96,    97,    98,
1239
      99,   100,   101,   102,   103,   104,   105,   106,   107,   108,
1240
     109,   110,   111,   253,   254,   123,   117,   262,     6,    48,
1241
      49,   116,    48,    49,    48,    49,    48,    49,    69,   130,
1242
     230,   132,    48,    49,    48,   136,   135,    66,    62,    62,
1243
      66,    65,    65,    65,   143,    62,   145,   146,    65,   148,
1244
     149,    48,    49,    48,    49,   255,   151,   257,   258,   259,
1245
      29,   261,    48,    49,   264,     1,   161,    59,    65,    65,
1246
      65,    48,    49,    66,     1,    49,    62,     4,     5,     6,
1247
       7,     8,     9,   184,    63,    62,   187,    63,    15,   190,
1248
      48,    49,    19,   133,   134,   196,    23,    24,    63,   299,
1249
      63,    28,    68,    30,    31,    32,    59,    65,    48,    49,
1250
      69,    48,    49,    14,    48,    42,    11,    12,    48,    49,
1251
      43,    44,    62,    46,   225,    62,     6,    54,    41,    41,
1252
     231,    26,    62,    60,    61,    59,    63,    64,   239,    66,
1253
      67,    66,    69,    59,    39,    40,   247,   248,    48,    64,
1254
     251,   252,    59,    64,   253,   254,    51,    52,    53,    54,
1255
      55,    56,    57,    55,    56,    57,    63,   262,    41,    63,
1256
      63,    35,    63,    63,   275,    63,    63,    59,    63,     0,
1257
       1,    59,    59,     4,     5,    59,    33,     8,    63,    10,
1258
      11,    12,    13,    14,    59,   296,   297,   298,   245,    20,
1259
      21,    22,   123,    19,    25,    26,    27,   308,    29,   302,
1260
     262,   196,    33,    34,    35,    36,    37,    38,    39,    40,
1261
     151,    42,    -1,    -1,    45,    -1,    -1,    48,    49,    50,
1262
      51,    52,    53,    54,    55,    56,    57,    -1,    59,    60,
1263
      61,    62,    63,    -1,    65,    66,     1,    68,    -1,     4,
1264
       5,     6,     7,     8,     9,    -1,    -1,    -1,    -1,    -1,
1265
      15,    -1,    -1,    -1,    19,    -1,    -1,    -1,    23,    24,
1266
      -1,    -1,    -1,    28,    -1,    30,    31,    32,    -1,    -1,
1267
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    42,    -1,    -1,
1268
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    54,
1269
      -1,    -1,    -1,    -1,    -1,    60,    61,    -1,    -1,    64,
1270
      -1,    66,    67,     1,    69,    -1,     4,     5,     6,     7,
1271
       8,     9,    -1,    -1,    -1,    -1,    -1,    15,    -1,    -1,
1272
      -1,    19,    -1,    -1,    -1,    23,    24,    -1,    -1,    -1,
1273
      28,    -1,    30,    31,    32,    -1,    -1,    -1,    -1,    -1,
1274
      -1,    -1,    -1,    -1,    42,    -1,    -1,    -1,    -1,    -1,
1275
      -1,    -1,    -1,    -1,    -1,    -1,    54,    -1,    -1,    -1,
1276
      -1,    -1,    60,    61,    -1,    -1,    64,    -1,    -1,    67,
1277
       1,    69,    -1,     4,     5,     6,     7,     8,     9,    -1,
1278
      -1,    -1,    -1,    -1,    15,    -1,    -1,    -1,    19,    -1,
1279
      -1,    -1,    23,    24,    -1,    -1,    -1,    28,    -1,    30,
1280
      31,    32,    -1,    -1,    -1,    -1,    11,    12,    -1,    -1,
1281
      -1,    42,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1282
      -1,    -1,    -1,    54,    -1,    -1,    -1,    -1,    -1,    60,
1283
      61,    -1,    -1,    64,    39,    40,    67,     1,    69,    -1,
1284
       4,     5,     6,     7,     8,     9,    51,    52,    53,    54,
1285
      55,    56,    57,    -1,    -1,    19,    -1,    -1,    -1,    23,
1286
      24,    -1,    -1,    -1,    28,    -1,    -1,    31,    32,    -1,
1287
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    42,    -1,
1288
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1289
      54,    -1,    -1,    -1,    -1,    -1,    60,    61,    -1,     1,
1290
      64,    -1,     4,    67,     6,    69,     8,    11,    12,    -1,
1291
      -1,    -1,    14,    15,    16,    17,    18,    19,    20,    21,
1292
      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
1293
      32,    -1,    -1,    -1,    -1,    39,    40,    -1,    -1,    -1,
1294
      42,    -1,    -1,    -1,    -1,    -1,    -1,    51,    52,    53,
1295
      54,    55,    56,    57,     1,    -1,    -1,     4,    -1,     6,
1296
      -1,     8,    64,    -1,    -1,    -1,    68,    14,    15,    16,
1297
      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1298
      27,    28,    29,    30,    31,    32,     4,     5,     6,     7,
1299
       8,     9,    -1,    -1,    -1,    42,    -1,    15,    -1,    -1,
1300
      -1,    19,    -1,    -1,    -1,    23,    24,    -1,    -1,    -1,
1301
      28,    -1,    30,    31,    32,    -1,    -1,    64,    -1,    -1,
1302
      -1,    68,    -1,    -1,    42,    -1,    -1,    -1,    -1,    -1,
1303
      -1,    -1,    -1,    -1,    -1,    -1,    54,    -1,    -1,    -1,
1304
      -1,    -1,    60,    61,    62,    -1,    64,    -1,    -1,    67,
1305
      -1,    69,     4,     5,     6,     7,     8,     9,    -1,    -1,
1306
      -1,    -1,    -1,    15,    -1,    -1,    -1,    19,    -1,    -1,
1307
      -1,    23,    24,    -1,    -1,    -1,    28,    -1,    30,    31,
1308
      32,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1309
      42,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1310
      -1,    -1,    54,    -1,    -1,    -1,    -1,    -1,    60,    61,
1311
      -1,    -1,    64,    -1,    66,    67,    -1,    69,     4,     5,
1312
       6,     7,     8,     9,    -1,    -1,    -1,    -1,    -1,    15,
1313
      -1,    -1,    -1,    19,    -1,    -1,    -1,    23,    24,    -1,
1314
      -1,    -1,    28,    -1,    30,    31,    32,    -1,    -1,    -1,
1315
      -1,    -1,    -1,    -1,    -1,    -1,    42,    -1,    -1,    -1,
1316
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    54,    -1,
1317
      -1,    -1,    -1,    -1,    60,    61,    -1,    -1,    64,    -1,
1318
      66,    67,    -1,    69,     4,     5,     6,     7,     8,     9,
1319
      -1,    -1,    -1,    -1,    -1,    15,    -1,    -1,    -1,    19,
1320
      -1,    -1,    -1,    23,    24,    -1,    -1,    -1,    28,    -1,
1321
      30,    31,    32,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1322
      -1,    -1,    42,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1323
      -1,    -1,    -1,    -1,    54,    -1,    -1,    -1,    -1,    -1,
1324
      60,    61,    -1,    -1,    64,    -1,    -1,    67,    -1,    69,
1325
       4,     5,     6,     7,     8,     9,    -1,    -1,    -1,    -1,
1326
      -1,    -1,    -1,    -1,    -1,    19,    -1,    -1,    -1,    23,
1327
      24,    -1,    -1,    -1,    28,    -1,    -1,    31,    32,    -1,
1328
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    42,    -1,
1329
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1330
      54,    -1,    -1,    -1,    -1,    -1,    60,    61,    -1,     1,
1331
      64,    -1,     4,    67,     6,    69,     8,    -1,    -1,    -1,
1332
      -1,    -1,    14,    15,    16,    17,    18,    19,    20,    21,
1333
      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
1334
      10,    11,    12,    13,    14,    -1,    -1,    -1,    -1,    -1,
1335
      42,    -1,    -1,    -1,    -1,    -1,    26,    27,    -1,    -1,
1336
      -1,    -1,    -1,    33,    34,    35,    36,    37,    38,    39,
1337
      40,    -1,    64,    10,    11,    12,    13,    14,    -1,    -1,
1338
      50,    51,    52,    53,    54,    55,    56,    57,    -1,    26,
1339
      27,    -1,    -1,    -1,    -1,    -1,    33,    34,    35,    36,
1340
      37,    38,    39,    40,    -1,    10,    11,    12,    13,    14,
1341
      -1,    -1,    -1,    50,    51,    52,    53,    54,    55,    56,
1342
      57,    26,    27,    -1,    -1,    -1,    -1,    -1,    33,    34,
1343
      35,    36,    37,    38,    39,    40,    -1,    10,    11,    12,
1344
      13,    -1,    -1,    -1,    -1,    50,    51,    52,    53,    54,
1345
      55,    56,    57,    26,    27,    -1,    -1,    -1,    -1,    -1,
1346
      33,    34,    35,    36,    37,    38,    39,    40,    -1,    10,
1347
      11,    12,    -1,    -1,    -1,    -1,    -1,    50,    51,    52,
1348
      53,    54,    55,    56,    57,    26,    27,    -1,    -1,    -1,
1349
      -1,    -1,    33,    34,    35,    36,    37,    38,    39,    40,
1350
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    50,
1351
      51,    52,    53,    54,    55,    56,    57
1352
};
1353
1354
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1355
   state STATE-NUM.  */
1356
static const yytype_int8 yystos[] =
1357
{
1358
       0,    16,    71,    72,     4,     5,     6,     7,     8,     9,
1359
      15,    19,    23,    24,    28,    30,    31,    32,    42,    54,
1360
      60,    61,    64,    67,    69,    75,    76,    80,    83,    84,
1361
      87,     0,    17,    18,    73,    77,    78,    64,    59,    42,
1362
       4,    75,    76,    76,    76,     6,     1,     6,    87,     1,
1363
       4,     8,    84,     1,    66,    75,     1,    75,     1,     4,
1364
       6,    14,    15,    16,    17,    18,    19,    20,    21,    22,
1365
      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
1366
      64,    84,    96,    97,    98,    69,    48,    49,    62,    10,
1367
      11,    12,    13,    14,    26,    27,    33,    34,    35,    36,
1368
      37,    38,    39,    40,    50,    51,    52,    53,    54,    55,
1369
      56,    57,    75,    85,     5,    59,    60,    61,    79,    84,
1370
      79,    74,    75,    80,    73,    62,    75,    75,    88,    89,
1371
      63,    64,    20,    14,    14,    29,    48,     1,    59,    66,
1372
      66,    65,    65,    63,    68,    63,    63,    75,    63,    63,
1373
      68,    49,    69,    75,    75,    76,    76,    76,    76,     6,
1374
      61,    67,    90,    91,    92,    76,    76,    76,    76,    76,
1375
      76,    76,    76,    76,    76,    76,    76,    76,    76,    76,
1376
      76,    76,    76,    43,    44,    46,    59,    61,    84,     1,
1377
      63,    66,    75,    14,    74,    62,    62,    65,    75,     4,
1378
       6,    81,    82,     1,    75,    91,    91,     1,    76,    75,
1379
      76,    99,    99,    99,    65,    99,    99,     1,    97,     6,
1380
      92,    93,     1,     4,     6,    64,    84,    94,    95,    96,
1381
      41,    48,    75,    66,    75,    59,    66,    75,    59,    63,
1382
      66,     4,     6,    89,    62,    62,    65,    21,    22,    25,
1383
      86,    64,    64,    48,    63,    49,    66,    63,    63,    63,
1384
      75,    63,    49,    68,    63,    92,    75,    45,    59,    66,
1385
      66,    66,    75,    59,    82,    63,    75,    75,    75,    75,
1386
      99,    99,    92,    92,    92,    92,    65,    92,    95,    92,
1387
      59,    59,    59,    66,    75,    25,    20,    62,    62,    63,
1388
      59,    62,    75,    75,    75,    92,    86,    65,    62,    65,
1389
      75,    65
1390
};
1391
1392
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
1393
static const yytype_int8 yyr1[] =
1394
{
1395
       0,    70,    71,    71,    72,    72,    73,    73,    74,    74,
1396
      75,    75,    75,    75,    75,    75,    76,    76,    76,    76,
1397
      76,    76,    76,    76,    76,    76,    76,    76,    76,    76,
1398
      76,    76,    76,    76,    76,    76,    76,    76,    76,    77,
1399
      77,    78,    78,    78,    79,    80,    80,    81,    81,    82,
1400
      82,    83,    83,    84,    85,    85,    85,    86,    86,    86,
1401
      87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
1402
      87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
1403
      87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
1404
      87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
1405
      87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
1406
      87,    87,    87,    87,    88,    88,    89,    90,    90,    91,
1407
      91,    92,    92,    92,    93,    93,    94,    94,    95,    95,
1408
      95,    95,    95,    95,    95,    96,    96,    96,    96,    96,
1409
      96,    96,    96,    96,    96,    96,    96,    96,    96,    96,
1410
      96,    96,    96,    97,    97,    97,    98,    98,    98,    98,
1411
      98,    98,    98,    98,    98,    98,    98,    99,    99
1412
};
1413
1414
/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
1415
static const yytype_int8 yyr2[] =
1416
{
1417
       0,     2,     3,     3,     0,     3,     0,     2,     0,     2,
1418
       2,     5,     4,     3,     3,     1,     3,     3,     3,     3,
1419
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1420
       3,     3,     3,     3,     3,     3,     3,     3,     1,     2,
1421
       3,     4,     4,     2,     1,     5,     8,     1,     3,     1,
1422
       1,     2,     1,     3,     0,     2,     4,     5,     3,     1,
1423
       1,     1,     2,     2,     3,     2,     4,     3,     2,     1,
1424
       3,     2,     2,     3,     5,     4,     6,     5,     4,     3,
1425
       5,     4,     7,     6,     6,     6,     5,     5,     2,     1,
1426
       1,     1,     2,     3,     3,     2,     3,     9,    11,     9,
1427
       5,     4,     4,     4,     2,     4,     1,     1,     1,     4,
1428
       3,     3,     4,     3,     1,     3,     1,     3,     1,     3,
1429
       1,     1,     3,     3,     1,     3,     1,     3,     1,     3,
1430
       3,     3,     3,     5,     3,     1,     1,     1,     1,     1,
1431
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1432
       1,     1,     1,     0,     1,     3,     3,     3,     3,     1,
1433
       3,     1,     1,     1,     1,     5,     3,     3,     1
1434
};
1435
1436
1437
enum { YYENOMEM = -2 };
1438
1439
#define yyerrok         (yyerrstatus = 0)
1440
#define yyclearin       (yychar = YYEMPTY)
1441
1442
1.17k
#define YYACCEPT        goto yyacceptlab
1443
1.13k
#define YYABORT         goto yyabortlab
1444
0
#define YYERROR         goto yyerrorlab
1445
1
#define YYNOMEM         goto yyexhaustedlab
1446
1447
1448
#define YYRECOVERING()  (!!yyerrstatus)
1449
1450
#define YYBACKUP(Token, Value)                                    \
1451
  do                                                              \
1452
    if (yychar == YYEMPTY)                                        \
1453
      {                                                           \
1454
        yychar = (Token);                                         \
1455
        yylval = (Value);                                         \
1456
        YYPOPSTACK (yylen);                                       \
1457
        yystate = *yyssp;                                         \
1458
        goto yybackup;                                            \
1459
      }                                                           \
1460
    else                                                          \
1461
      {                                                           \
1462
        yyerror (&yylloc, answer, errors, locations, lexer_param_ptr, YY_("syntax error: cannot back up")); \
1463
        YYERROR;                                                  \
1464
      }                                                           \
1465
  while (0)
1466
1467
/* Backward compatibility with an undocumented macro.
1468
   Use YYerror or YYUNDEF. */
1469
#define YYERRCODE YYUNDEF
1470
1471
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1472
   If N is 0, then set CURRENT to the empty location which ends
1473
   the previous symbol: RHS[0] (always defined).  */
1474
1475
#ifndef YYLLOC_DEFAULT
1476
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
1477
    do                                                                  \
1478
      if (N)                                                            \
1479
        {                                                               \
1480
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
1481
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
1482
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
1483
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
1484
        }                                                               \
1485
      else                                                              \
1486
        {                                                               \
1487
          (Current).first_line   = (Current).last_line   =              \
1488
            YYRHSLOC (Rhs, 0).last_line;                                \
1489
          (Current).first_column = (Current).last_column =              \
1490
            YYRHSLOC (Rhs, 0).last_column;                              \
1491
        }                                                               \
1492
    while (0)
1493
#endif
1494
1495
13.3M
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1496
1497
1498
/* Enable debugging if requested.  */
1499
#if YYDEBUG
1500
1501
# ifndef YYFPRINTF
1502
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1503
#  define YYFPRINTF fprintf
1504
# endif
1505
1506
# define YYDPRINTF(Args)                        \
1507
do {                                            \
1508
  if (yydebug)                                  \
1509
    YYFPRINTF Args;                             \
1510
} while (0)
1511
1512
1513
/* YYLOCATION_PRINT -- Print the location on the stream.
1514
   This macro was not mandated originally: define only if we know
1515
   we won't break user code: when these are the locations we know.  */
1516
1517
# ifndef YYLOCATION_PRINT
1518
1519
#  if defined YY_LOCATION_PRINT
1520
1521
   /* Temporary convenience wrapper in case some people defined the
1522
      undocumented and private YY_LOCATION_PRINT macros.  */
1523
#   define YYLOCATION_PRINT(File, Loc)  YY_LOCATION_PRINT(File, *(Loc))
1524
1525
#  elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1526
1527
/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
1528
1529
YY_ATTRIBUTE_UNUSED
1530
static int
1531
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1532
{
1533
  int res = 0;
1534
  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1535
  if (0 <= yylocp->first_line)
1536
    {
1537
      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1538
      if (0 <= yylocp->first_column)
1539
        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1540
    }
1541
  if (0 <= yylocp->last_line)
1542
    {
1543
      if (yylocp->first_line < yylocp->last_line)
1544
        {
1545
          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1546
          if (0 <= end_col)
1547
            res += YYFPRINTF (yyo, ".%d", end_col);
1548
        }
1549
      else if (0 <= end_col && yylocp->first_column < end_col)
1550
        res += YYFPRINTF (yyo, "-%d", end_col);
1551
    }
1552
  return res;
1553
}
1554
1555
#   define YYLOCATION_PRINT  yy_location_print_
1556
1557
    /* Temporary convenience wrapper in case some people defined the
1558
       undocumented and private YY_LOCATION_PRINT macros.  */
1559
#   define YY_LOCATION_PRINT(File, Loc)  YYLOCATION_PRINT(File, &(Loc))
1560
1561
#  else
1562
1563
#   define YYLOCATION_PRINT(File, Loc) ((void) 0)
1564
    /* Temporary convenience wrapper in case some people defined the
1565
       undocumented and private YY_LOCATION_PRINT macros.  */
1566
#   define YY_LOCATION_PRINT  YYLOCATION_PRINT
1567
1568
#  endif
1569
# endif /* !defined YYLOCATION_PRINT */
1570
1571
1572
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
1573
do {                                                                      \
1574
  if (yydebug)                                                            \
1575
    {                                                                     \
1576
      YYFPRINTF (stderr, "%s ", Title);                                   \
1577
      yy_symbol_print (stderr,                                            \
1578
                  Kind, Value, Location, answer, errors, locations, lexer_param_ptr); \
1579
      YYFPRINTF (stderr, "\n");                                           \
1580
    }                                                                     \
1581
} while (0)
1582
1583
1584
/*-----------------------------------.
1585
| Print this symbol's value on YYO.  |
1586
`-----------------------------------*/
1587
1588
static void
1589
yy_symbol_value_print (FILE *yyo,
1590
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)
1591
{
1592
  FILE *yyoutput = yyo;
1593
  YY_USE (yyoutput);
1594
  YY_USE (yylocationp);
1595
  YY_USE (answer);
1596
  YY_USE (errors);
1597
  YY_USE (locations);
1598
  YY_USE (lexer_param_ptr);
1599
  if (!yyvaluep)
1600
    return;
1601
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1602
  YY_USE (yykind);
1603
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1604
}
1605
1606
1607
/*---------------------------.
1608
| Print this symbol on YYO.  |
1609
`---------------------------*/
1610
1611
static void
1612
yy_symbol_print (FILE *yyo,
1613
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)
1614
{
1615
  YYFPRINTF (yyo, "%s %s (",
1616
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1617
1618
  YYLOCATION_PRINT (yyo, yylocationp);
1619
  YYFPRINTF (yyo, ": ");
1620
  yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, answer, errors, locations, lexer_param_ptr);
1621
  YYFPRINTF (yyo, ")");
1622
}
1623
1624
/*------------------------------------------------------------------.
1625
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1626
| TOP (included).                                                   |
1627
`------------------------------------------------------------------*/
1628
1629
static void
1630
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1631
{
1632
  YYFPRINTF (stderr, "Stack now");
1633
  for (; yybottom <= yytop; yybottom++)
1634
    {
1635
      int yybot = *yybottom;
1636
      YYFPRINTF (stderr, " %d", yybot);
1637
    }
1638
  YYFPRINTF (stderr, "\n");
1639
}
1640
1641
# define YY_STACK_PRINT(Bottom, Top)                            \
1642
do {                                                            \
1643
  if (yydebug)                                                  \
1644
    yy_stack_print ((Bottom), (Top));                           \
1645
} while (0)
1646
1647
1648
/*------------------------------------------------.
1649
| Report that the YYRULE is going to be reduced.  |
1650
`------------------------------------------------*/
1651
1652
static void
1653
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1654
                 int yyrule, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)
1655
{
1656
  int yylno = yyrline[yyrule];
1657
  int yynrhs = yyr2[yyrule];
1658
  int yyi;
1659
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1660
             yyrule - 1, yylno);
1661
  /* The symbols being reduced.  */
1662
  for (yyi = 0; yyi < yynrhs; yyi++)
1663
    {
1664
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1665
      yy_symbol_print (stderr,
1666
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1667
                       &yyvsp[(yyi + 1) - (yynrhs)],
1668
                       &(yylsp[(yyi + 1) - (yynrhs)]), answer, errors, locations, lexer_param_ptr);
1669
      YYFPRINTF (stderr, "\n");
1670
    }
1671
}
1672
1673
# define YY_REDUCE_PRINT(Rule)          \
1674
do {                                    \
1675
  if (yydebug)                          \
1676
    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, answer, errors, locations, lexer_param_ptr); \
1677
} while (0)
1678
1679
/* Nonzero means print parse trace.  It is left uninitialized so that
1680
   multiple parsers can coexist.  */
1681
int yydebug;
1682
#else /* !YYDEBUG */
1683
15.3M
# define YYDPRINTF(Args) ((void) 0)
1684
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1685
# define YY_STACK_PRINT(Bottom, Top)
1686
# define YY_REDUCE_PRINT(Rule)
1687
#endif /* !YYDEBUG */
1688
1689
1690
/* YYINITDEPTH -- initial size of the parser's stacks.  */
1691
#ifndef YYINITDEPTH
1692
2.31k
# define YYINITDEPTH 200
1693
#endif
1694
1695
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1696
   if the built-in stack extension method is used).
1697
1698
   Do not make this value too large; the results are undefined if
1699
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1700
   evaluated with infinite-precision integer arithmetic.  */
1701
1702
#ifndef YYMAXDEPTH
1703
993
# define YYMAXDEPTH 10000
1704
#endif
1705
1706
1707
/* Context of a parse error.  */
1708
typedef struct
1709
{
1710
  yy_state_t *yyssp;
1711
  yysymbol_kind_t yytoken;
1712
  YYLTYPE *yylloc;
1713
} yypcontext_t;
1714
1715
/* Put in YYARG at most YYARGN of the expected tokens given the
1716
   current YYCTX, and return the number of tokens stored in YYARG.  If
1717
   YYARG is null, return the number of expected tokens (guaranteed to
1718
   be less than YYNTOKENS).  Return YYENOMEM on memory exhaustion.
1719
   Return 0 if there are more than YYARGN expected tokens, yet fill
1720
   YYARG up to YYARGN. */
1721
static int
1722
yypcontext_expected_tokens (const yypcontext_t *yyctx,
1723
                            yysymbol_kind_t yyarg[], int yyargn)
1724
55.1k
{
1725
  /* Actual size of YYARG. */
1726
55.1k
  int yycount = 0;
1727
55.1k
  int yyn = yypact[+*yyctx->yyssp];
1728
55.1k
  if (!yypact_value_is_default (yyn))
1729
55.1k
    {
1730
      /* Start YYX at -YYN if negative to avoid negative indexes in
1731
         YYCHECK.  In other words, skip the first -YYN actions for
1732
         this state because they are default actions.  */
1733
55.1k
      int yyxbegin = yyn < 0 ? -yyn : 0;
1734
      /* Stay within bounds of both yycheck and yytname.  */
1735
55.1k
      int yychecklim = YYLAST - yyn + 1;
1736
55.1k
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1737
55.1k
      int yyx;
1738
2.76M
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1739
2.73M
        if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1740
162k
            && !yytable_value_is_error (yytable[yyx + yyn]))
1741
148k
          {
1742
148k
            if (!yyarg)
1743
0
              ++yycount;
1744
148k
            else if (yycount == yyargn)
1745
19.9k
              return 0;
1746
128k
            else
1747
128k
              yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1748
148k
          }
1749
55.1k
    }
1750
35.2k
  if (yyarg && yycount == 0 && 0 < yyargn)
1751
236
    yyarg[0] = YYSYMBOL_YYEMPTY;
1752
35.2k
  return yycount;
1753
55.1k
}
1754
1755
1756
1757
1758
#ifndef yystrlen
1759
# if defined __GLIBC__ && defined _STRING_H
1760
154k
#  define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1761
# else
1762
/* Return the length of YYSTR.  */
1763
static YYPTRDIFF_T
1764
yystrlen (const char *yystr)
1765
{
1766
  YYPTRDIFF_T yylen;
1767
  for (yylen = 0; yystr[yylen]; yylen++)
1768
    continue;
1769
  return yylen;
1770
}
1771
# endif
1772
#endif
1773
1774
#ifndef yystpcpy
1775
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1776
99.3k
#  define yystpcpy stpcpy
1777
# else
1778
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1779
   YYDEST.  */
1780
static char *
1781
yystpcpy (char *yydest, const char *yysrc)
1782
{
1783
  char *yyd = yydest;
1784
  const char *yys = yysrc;
1785
1786
  while ((*yyd++ = *yys++) != '\0')
1787
    continue;
1788
1789
  return yyd - 1;
1790
}
1791
# endif
1792
#endif
1793
1794
#ifndef yytnamerr
1795
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1796
   quotes and backslashes, so that it's suitable for yyerror.  The
1797
   heuristic is that double-quoting is unnecessary unless the string
1798
   contains an apostrophe, a comma, or backslash (other than
1799
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1800
   null, do not copy; instead, return the length of what the result
1801
   would have been.  */
1802
static YYPTRDIFF_T
1803
yytnamerr (char *yyres, const char *yystr)
1804
208k
{
1805
208k
  if (*yystr == '"')
1806
9.70k
    {
1807
9.70k
      YYPTRDIFF_T yyn = 0;
1808
9.70k
      char const *yyp = yystr;
1809
9.70k
      for (;;)
1810
43.9k
        switch (*++yyp)
1811
43.9k
          {
1812
0
          case '\'':
1813
0
          case ',':
1814
0
            goto do_not_strip_quotes;
1815
1816
0
          case '\\':
1817
0
            if (*++yyp != '\\')
1818
0
              goto do_not_strip_quotes;
1819
0
            else
1820
0
              goto append;
1821
1822
0
          append:
1823
34.2k
          default:
1824
34.2k
            if (yyres)
1825
17.1k
              yyres[yyn] = *yyp;
1826
34.2k
            yyn++;
1827
34.2k
            break;
1828
1829
9.70k
          case '"':
1830
9.70k
            if (yyres)
1831
4.85k
              yyres[yyn] = '\0';
1832
9.70k
            return yyn;
1833
43.9k
          }
1834
0
    do_not_strip_quotes: ;
1835
0
    }
1836
1837
198k
  if (yyres)
1838
99.3k
    return yystpcpy (yyres, yystr) - yyres;
1839
99.3k
  else
1840
99.3k
    return yystrlen (yystr);
1841
198k
}
1842
#endif
1843
1844
1845
static int
1846
yy_syntax_error_arguments (const yypcontext_t *yyctx,
1847
                           yysymbol_kind_t yyarg[], int yyargn)
1848
55.1k
{
1849
  /* Actual size of YYARG. */
1850
55.1k
  int yycount = 0;
1851
  /* There are many possibilities here to consider:
1852
     - If this state is a consistent state with a default action, then
1853
       the only way this function was invoked is if the default action
1854
       is an error action.  In that case, don't check for expected
1855
       tokens because there are none.
1856
     - The only way there can be no lookahead present (in yychar) is if
1857
       this state is a consistent state with a default action.  Thus,
1858
       detecting the absence of a lookahead is sufficient to determine
1859
       that there is no unexpected or expected token to report.  In that
1860
       case, just report a simple "syntax error".
1861
     - Don't assume there isn't a lookahead just because this state is a
1862
       consistent state with a default action.  There might have been a
1863
       previous inconsistent state, consistent state with a non-default
1864
       action, or user semantic action that manipulated yychar.
1865
     - Of course, the expected token list depends on states to have
1866
       correct lookahead information, and it depends on the parser not
1867
       to perform extra reductions after fetching a lookahead from the
1868
       scanner and before detecting a syntax error.  Thus, state merging
1869
       (from LALR or IELR) and default reductions corrupt the expected
1870
       token list.  However, the list is correct for canonical LR with
1871
       one exception: it will still contain any token that will not be
1872
       accepted due to an error action in a later state.
1873
  */
1874
55.1k
  if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1875
55.1k
    {
1876
55.1k
      int yyn;
1877
55.1k
      if (yyarg)
1878
55.1k
        yyarg[yycount] = yyctx->yytoken;
1879
55.1k
      ++yycount;
1880
55.1k
      yyn = yypcontext_expected_tokens (yyctx,
1881
55.1k
                                        yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1882
55.1k
      if (yyn == YYENOMEM)
1883
0
        return YYENOMEM;
1884
55.1k
      else
1885
55.1k
        yycount += yyn;
1886
55.1k
    }
1887
55.1k
  return yycount;
1888
55.1k
}
1889
1890
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1891
   about the unexpected token YYTOKEN for the state stack whose top is
1892
   YYSSP.
1893
1894
   Return 0 if *YYMSG was successfully written.  Return -1 if *YYMSG is
1895
   not large enough to hold the message.  In that case, also set
1896
   *YYMSG_ALLOC to the required number of bytes.  Return YYENOMEM if the
1897
   required number of bytes is too large to store.  */
1898
static int
1899
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1900
                const yypcontext_t *yyctx)
1901
55.1k
{
1902
55.1k
  enum { YYARGS_MAX = 5 };
1903
  /* Internationalized format string. */
1904
55.1k
  const char *yyformat = YY_NULLPTR;
1905
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1906
     one per "expected"). */
1907
55.1k
  yysymbol_kind_t yyarg[YYARGS_MAX];
1908
  /* Cumulated lengths of YYARG.  */
1909
55.1k
  YYPTRDIFF_T yysize = 0;
1910
1911
  /* Actual size of YYARG. */
1912
55.1k
  int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1913
55.1k
  if (yycount == YYENOMEM)
1914
0
    return YYENOMEM;
1915
1916
55.1k
  switch (yycount)
1917
55.1k
    {
1918
0
#define YYCASE_(N, S)                       \
1919
55.1k
      case N:                               \
1920
55.1k
        yyformat = S;                       \
1921
55.1k
        break
1922
0
    default: /* Avoid compiler warnings. */
1923
0
      YYCASE_(0, YY_("syntax error"));
1924
20.1k
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1925
28.0k
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1926
1.49k
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1927
3.81k
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1928
55.1k
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1929
55.1k
#undef YYCASE_
1930
55.1k
    }
1931
1932
  /* Compute error message size.  Don't count the "%s"s, but reserve
1933
     room for the terminator.  */
1934
55.1k
  yysize = yystrlen (yyformat) - 2 * yycount + 1;
1935
55.1k
  {
1936
55.1k
    int yyi;
1937
159k
    for (yyi = 0; yyi < yycount; ++yyi)
1938
104k
      {
1939
104k
        YYPTRDIFF_T yysize1
1940
104k
          = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1941
104k
        if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1942
104k
          yysize = yysize1;
1943
0
        else
1944
0
          return YYENOMEM;
1945
104k
      }
1946
55.1k
  }
1947
1948
55.1k
  if (*yymsg_alloc < yysize)
1949
0
    {
1950
0
      *yymsg_alloc = 2 * yysize;
1951
0
      if (! (yysize <= *yymsg_alloc
1952
0
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1953
0
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1954
0
      return -1;
1955
0
    }
1956
1957
  /* Avoid sprintf, as that infringes on the user's name space.
1958
     Don't have undefined behavior even if the translation
1959
     produced a string with the wrong number of "%s"s.  */
1960
55.1k
  {
1961
55.1k
    char *yyp = *yymsg;
1962
55.1k
    int yyi = 0;
1963
2.01M
    while ((*yyp = *yyformat) != '\0')
1964
1.95M
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1965
104k
        {
1966
104k
          yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1967
104k
          yyformat += 2;
1968
104k
        }
1969
1.85M
      else
1970
1.85M
        {
1971
1.85M
          ++yyp;
1972
1.85M
          ++yyformat;
1973
1.85M
        }
1974
55.1k
  }
1975
55.1k
  return 0;
1976
55.1k
}
1977
1978
1979
/*-----------------------------------------------.
1980
| Release the memory associated to this symbol.  |
1981
`-----------------------------------------------*/
1982
1983
static void
1984
yydestruct (const char *yymsg,
1985
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)
1986
3.65M
{
1987
3.65M
  YY_USE (yyvaluep);
1988
3.65M
  YY_USE (yylocationp);
1989
3.65M
  YY_USE (answer);
1990
3.65M
  YY_USE (errors);
1991
3.65M
  YY_USE (locations);
1992
3.65M
  YY_USE (lexer_param_ptr);
1993
3.65M
  if (!yymsg)
1994
0
    yymsg = "Deleting";
1995
3.65M
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1996
1997
3.65M
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1998
3.65M
  switch (yykind)
1999
3.65M
    {
2000
65.7k
    case YYSYMBOL_IDENT: /* IDENT  */
2001
65.7k
#line 37 "src/parser.y"
2002
65.7k
            { jv_free(((*yyvaluep).literal)); }
2003
65.7k
#line 2004 "src/parser.c"
2004
65.7k
        break;
2005
2006
1.14k
    case YYSYMBOL_FIELD: /* FIELD  */
2007
1.14k
#line 37 "src/parser.y"
2008
1.14k
            { jv_free(((*yyvaluep).literal)); }
2009
1.14k
#line 2010 "src/parser.c"
2010
1.14k
        break;
2011
2012
3.76k
    case YYSYMBOL_BINDING: /* BINDING  */
2013
3.76k
#line 37 "src/parser.y"
2014
3.76k
            { jv_free(((*yyvaluep).literal)); }
2015
3.76k
#line 2016 "src/parser.c"
2016
3.76k
        break;
2017
2018
72.5k
    case YYSYMBOL_LITERAL: /* LITERAL  */
2019
72.5k
#line 37 "src/parser.y"
2020
72.5k
            { jv_free(((*yyvaluep).literal)); }
2021
72.5k
#line 2022 "src/parser.c"
2022
72.5k
        break;
2023
2024
1.03k
    case YYSYMBOL_FORMAT: /* FORMAT  */
2025
1.03k
#line 37 "src/parser.y"
2026
1.03k
            { jv_free(((*yyvaluep).literal)); }
2027
1.03k
#line 2028 "src/parser.c"
2028
1.03k
        break;
2029
2030
309k
    case YYSYMBOL_QQSTRING_TEXT: /* QQSTRING_TEXT  */
2031
309k
#line 37 "src/parser.y"
2032
309k
            { jv_free(((*yyvaluep).literal)); }
2033
309k
#line 2034 "src/parser.c"
2034
309k
        break;
2035
2036
910
    case YYSYMBOL_Module: /* Module  */
2037
910
#line 38 "src/parser.y"
2038
910
            { block_free(((*yyvaluep).blk)); }
2039
910
#line 2040 "src/parser.c"
2040
910
        break;
2041
2042
903
    case YYSYMBOL_Imports: /* Imports  */
2043
903
#line 38 "src/parser.y"
2044
903
            { block_free(((*yyvaluep).blk)); }
2045
903
#line 2046 "src/parser.c"
2046
903
        break;
2047
2048
0
    case YYSYMBOL_FuncDefs: /* FuncDefs  */
2049
0
#line 38 "src/parser.y"
2050
0
            { block_free(((*yyvaluep).blk)); }
2051
0
#line 2052 "src/parser.c"
2052
0
        break;
2053
2054
15.4k
    case YYSYMBOL_Query: /* Query  */
2055
15.4k
#line 38 "src/parser.y"
2056
15.4k
            { block_free(((*yyvaluep).blk)); }
2057
15.4k
#line 2058 "src/parser.c"
2058
15.4k
        break;
2059
2060
18.4k
    case YYSYMBOL_Expr: /* Expr  */
2061
18.4k
#line 38 "src/parser.y"
2062
18.4k
            { block_free(((*yyvaluep).blk)); }
2063
18.4k
#line 2064 "src/parser.c"
2064
18.4k
        break;
2065
2066
712
    case YYSYMBOL_Import: /* Import  */
2067
712
#line 38 "src/parser.y"
2068
712
            { block_free(((*yyvaluep).blk)); }
2069
712
#line 2070 "src/parser.c"
2070
712
        break;
2071
2072
6
    case YYSYMBOL_ImportWhat: /* ImportWhat  */
2073
6
#line 38 "src/parser.y"
2074
6
            { block_free(((*yyvaluep).blk)); }
2075
6
#line 2076 "src/parser.c"
2076
6
        break;
2077
2078
1
    case YYSYMBOL_ImportFrom: /* ImportFrom  */
2079
1
#line 38 "src/parser.y"
2080
1
            { block_free(((*yyvaluep).blk)); }
2081
1
#line 2082 "src/parser.c"
2082
1
        break;
2083
2084
0
    case YYSYMBOL_FuncDef: /* FuncDef  */
2085
0
#line 38 "src/parser.y"
2086
0
            { block_free(((*yyvaluep).blk)); }
2087
0
#line 2088 "src/parser.c"
2088
0
        break;
2089
2090
0
    case YYSYMBOL_Params: /* Params  */
2091
0
#line 38 "src/parser.y"
2092
0
            { block_free(((*yyvaluep).blk)); }
2093
0
#line 2094 "src/parser.c"
2094
0
        break;
2095
2096
0
    case YYSYMBOL_Param: /* Param  */
2097
0
#line 38 "src/parser.y"
2098
0
            { block_free(((*yyvaluep).blk)); }
2099
0
#line 2100 "src/parser.c"
2100
0
        break;
2101
2102
523
    case YYSYMBOL_StringStart: /* StringStart  */
2103
523
#line 37 "src/parser.y"
2104
523
            { jv_free(((*yyvaluep).literal)); }
2105
523
#line 2106 "src/parser.c"
2106
523
        break;
2107
2108
259
    case YYSYMBOL_String: /* String  */
2109
259
#line 38 "src/parser.y"
2110
259
            { block_free(((*yyvaluep).blk)); }
2111
259
#line 2112 "src/parser.c"
2112
259
        break;
2113
2114
523
    case YYSYMBOL_QQString: /* QQString  */
2115
523
#line 38 "src/parser.y"
2116
523
            { block_free(((*yyvaluep).blk)); }
2117
523
#line 2118 "src/parser.c"
2118
523
        break;
2119
2120
0
    case YYSYMBOL_ElseBody: /* ElseBody  */
2121
0
#line 38 "src/parser.y"
2122
0
            { block_free(((*yyvaluep).blk)); }
2123
0
#line 2124 "src/parser.c"
2124
0
        break;
2125
2126
10.7k
    case YYSYMBOL_Term: /* Term  */
2127
10.7k
#line 38 "src/parser.y"
2128
10.7k
            { block_free(((*yyvaluep).blk)); }
2129
10.7k
#line 2130 "src/parser.c"
2130
10.7k
        break;
2131
2132
132
    case YYSYMBOL_Args: /* Args  */
2133
132
#line 38 "src/parser.y"
2134
132
            { block_free(((*yyvaluep).blk)); }
2135
132
#line 2136 "src/parser.c"
2136
132
        break;
2137
2138
0
    case YYSYMBOL_Arg: /* Arg  */
2139
0
#line 38 "src/parser.y"
2140
0
            { block_free(((*yyvaluep).blk)); }
2141
0
#line 2142 "src/parser.c"
2142
0
        break;
2143
2144
276
    case YYSYMBOL_RepPatterns: /* RepPatterns  */
2145
276
#line 38 "src/parser.y"
2146
276
            { block_free(((*yyvaluep).blk)); }
2147
276
#line 2148 "src/parser.c"
2148
276
        break;
2149
2150
527
    case YYSYMBOL_Patterns: /* Patterns  */
2151
527
#line 38 "src/parser.y"
2152
527
            { block_free(((*yyvaluep).blk)); }
2153
527
#line 2154 "src/parser.c"
2154
527
        break;
2155
2156
0
    case YYSYMBOL_Pattern: /* Pattern  */
2157
0
#line 38 "src/parser.y"
2158
0
            { block_free(((*yyvaluep).blk)); }
2159
0
#line 2160 "src/parser.c"
2160
0
        break;
2161
2162
192
    case YYSYMBOL_ArrayPats: /* ArrayPats  */
2163
192
#line 38 "src/parser.y"
2164
192
            { block_free(((*yyvaluep).blk)); }
2165
192
#line 2166 "src/parser.c"
2166
192
        break;
2167
2168
1.89k
    case YYSYMBOL_ObjPats: /* ObjPats  */
2169
1.89k
#line 38 "src/parser.y"
2170
1.89k
            { block_free(((*yyvaluep).blk)); }
2171
1.89k
#line 2172 "src/parser.c"
2172
1.89k
        break;
2173
2174
0
    case YYSYMBOL_ObjPat: /* ObjPat  */
2175
0
#line 38 "src/parser.y"
2176
0
            { block_free(((*yyvaluep).blk)); }
2177
0
#line 2178 "src/parser.c"
2178
0
        break;
2179
2180
824
    case YYSYMBOL_Keyword: /* Keyword  */
2181
824
#line 37 "src/parser.y"
2182
824
            { jv_free(((*yyvaluep).literal)); }
2183
824
#line 2184 "src/parser.c"
2184
824
        break;
2185
2186
42.8k
    case YYSYMBOL_DictPairs: /* DictPairs  */
2187
42.8k
#line 38 "src/parser.y"
2188
42.8k
            { block_free(((*yyvaluep).blk)); }
2189
42.8k
#line 2190 "src/parser.c"
2190
42.8k
        break;
2191
2192
5.52k
    case YYSYMBOL_DictPair: /* DictPair  */
2193
5.52k
#line 38 "src/parser.y"
2194
5.52k
            { block_free(((*yyvaluep).blk)); }
2195
5.52k
#line 2196 "src/parser.c"
2196
5.52k
        break;
2197
2198
2.94k
    case YYSYMBOL_DictExpr: /* DictExpr  */
2199
2.94k
#line 38 "src/parser.y"
2200
2.94k
            { block_free(((*yyvaluep).blk)); }
2201
2.94k
#line 2202 "src/parser.c"
2202
2.94k
        break;
2203
2204
3.09M
      default:
2205
3.09M
        break;
2206
3.65M
    }
2207
3.65M
  YY_IGNORE_MAYBE_UNINITIALIZED_END
2208
3.65M
}
2209
2210
2211
2212
2213
2214
2215
/*----------.
2216
| yyparse.  |
2217
`----------*/
2218
2219
int
2220
yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)
2221
2.31k
{
2222
/* Lookahead token kind.  */
2223
2.31k
int yychar;
2224
2225
2226
/* The semantic value of the lookahead symbol.  */
2227
/* Default value used for initialization, for pacifying older GCCs
2228
   or non-GCC compilers.  */
2229
2.31k
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
2230
2.31k
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
2231
2232
/* Location data for the lookahead symbol.  */
2233
2.31k
static YYLTYPE yyloc_default
2234
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2235
  = { 1, 1, 1, 1 }
2236
# endif
2237
2.31k
;
2238
2.31k
YYLTYPE yylloc = yyloc_default;
2239
2240
    /* Number of syntax errors so far.  */
2241
2.31k
    int yynerrs = 0;
2242
2243
2.31k
    yy_state_fast_t yystate = 0;
2244
    /* Number of tokens to shift before error messages enabled.  */
2245
2.31k
    int yyerrstatus = 0;
2246
2247
    /* Refer to the stacks through separate pointers, to allow yyoverflow
2248
       to reallocate them elsewhere.  */
2249
2250
    /* Their size.  */
2251
2.31k
    YYPTRDIFF_T yystacksize = YYINITDEPTH;
2252
2253
    /* The state stack: array, bottom, top.  */
2254
2.31k
    yy_state_t yyssa[YYINITDEPTH];
2255
2.31k
    yy_state_t *yyss = yyssa;
2256
2.31k
    yy_state_t *yyssp = yyss;
2257
2258
    /* The semantic value stack: array, bottom, top.  */
2259
2.31k
    YYSTYPE yyvsa[YYINITDEPTH];
2260
2.31k
    YYSTYPE *yyvs = yyvsa;
2261
2.31k
    YYSTYPE *yyvsp = yyvs;
2262
2263
    /* The location stack: array, bottom, top.  */
2264
2.31k
    YYLTYPE yylsa[YYINITDEPTH];
2265
2.31k
    YYLTYPE *yyls = yylsa;
2266
2.31k
    YYLTYPE *yylsp = yyls;
2267
2268
2.31k
  int yyn;
2269
  /* The return value of yyparse.  */
2270
2.31k
  int yyresult;
2271
  /* Lookahead symbol kind.  */
2272
2.31k
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
2273
  /* The variables used to return semantic value and location from the
2274
     action routines.  */
2275
2.31k
  YYSTYPE yyval;
2276
2.31k
  YYLTYPE yyloc;
2277
2278
  /* The locations where the error started and ended.  */
2279
2.31k
  YYLTYPE yyerror_range[3];
2280
2281
  /* Buffer for error messages, and its allocated size.  */
2282
2.31k
  char yymsgbuf[128];
2283
2.31k
  char *yymsg = yymsgbuf;
2284
2.31k
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
2285
2286
6.84M
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
2287
2288
  /* The number of symbols on the RHS of the reduced rule.
2289
     Keep to zero when no symbol should be popped.  */
2290
2.31k
  int yylen = 0;
2291
2292
2.31k
  YYDPRINTF ((stderr, "Starting parse\n"));
2293
2294
2.31k
  yychar = YYEMPTY; /* Cause a token to be read.  */
2295
2296
2.31k
  yylsp[0] = yylloc;
2297
2.31k
  goto yysetstate;
2298
2299
2300
/*------------------------------------------------------------.
2301
| yynewstate -- push a new state, which is found in yystate.  |
2302
`------------------------------------------------------------*/
2303
10.1M
yynewstate:
2304
  /* In all cases, when you get here, the value and location stacks
2305
     have just been pushed.  So pushing a state here evens the stacks.  */
2306
10.1M
  yyssp++;
2307
2308
2309
/*--------------------------------------------------------------------.
2310
| yysetstate -- set current state (the top of the stack) to yystate.  |
2311
`--------------------------------------------------------------------*/
2312
10.1M
yysetstate:
2313
10.1M
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2314
10.1M
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
2315
10.1M
  YY_IGNORE_USELESS_CAST_BEGIN
2316
10.1M
  *yyssp = YY_CAST (yy_state_t, yystate);
2317
10.1M
  YY_IGNORE_USELESS_CAST_END
2318
10.1M
  YY_STACK_PRINT (yyss, yyssp);
2319
2320
10.1M
  if (yyss + yystacksize - 1 <= yyssp)
2321
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
2322
    YYNOMEM;
2323
#else
2324
492
    {
2325
      /* Get the current used size of the three stacks, in elements.  */
2326
492
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
2327
2328
# if defined yyoverflow
2329
      {
2330
        /* Give user a chance to reallocate the stack.  Use copies of
2331
           these so that the &'s don't force the real ones into
2332
           memory.  */
2333
        yy_state_t *yyss1 = yyss;
2334
        YYSTYPE *yyvs1 = yyvs;
2335
        YYLTYPE *yyls1 = yyls;
2336
2337
        /* Each stack pointer address is followed by the size of the
2338
           data in use in that stack, in bytes.  This used to be a
2339
           conditional around just the two extra args, but that might
2340
           be undefined if yyoverflow is a macro.  */
2341
        yyoverflow (YY_("memory exhausted"),
2342
                    &yyss1, yysize * YYSIZEOF (*yyssp),
2343
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
2344
                    &yyls1, yysize * YYSIZEOF (*yylsp),
2345
                    &yystacksize);
2346
        yyss = yyss1;
2347
        yyvs = yyvs1;
2348
        yyls = yyls1;
2349
      }
2350
# else /* defined YYSTACK_RELOCATE */
2351
      /* Extend the stack our own way.  */
2352
492
      if (YYMAXDEPTH <= yystacksize)
2353
1
        YYNOMEM;
2354
491
      yystacksize *= 2;
2355
491
      if (YYMAXDEPTH < yystacksize)
2356
10
        yystacksize = YYMAXDEPTH;
2357
2358
491
      {
2359
491
        yy_state_t *yyss1 = yyss;
2360
491
        union yyalloc *yyptr =
2361
491
          YY_CAST (union yyalloc *,
2362
491
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
2363
491
        if (! yyptr)
2364
0
          YYNOMEM;
2365
491
        YYSTACK_RELOCATE (yyss_alloc, yyss);
2366
491
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2367
491
        YYSTACK_RELOCATE (yyls_alloc, yyls);
2368
491
#  undef YYSTACK_RELOCATE
2369
491
        if (yyss1 != yyssa)
2370
261
          YYSTACK_FREE (yyss1);
2371
491
      }
2372
0
# endif
2373
2374
0
      yyssp = yyss + yysize - 1;
2375
491
      yyvsp = yyvs + yysize - 1;
2376
491
      yylsp = yyls + yysize - 1;
2377
2378
491
      YY_IGNORE_USELESS_CAST_BEGIN
2379
491
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
2380
491
                  YY_CAST (long, yystacksize)));
2381
491
      YY_IGNORE_USELESS_CAST_END
2382
2383
491
      if (yyss + yystacksize - 1 <= yyssp)
2384
0
        YYABORT;
2385
491
    }
2386
10.1M
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
2387
2388
2389
10.1M
  if (yystate == YYFINAL)
2390
1.17k
    YYACCEPT;
2391
2392
10.1M
  goto yybackup;
2393
2394
2395
/*-----------.
2396
| yybackup.  |
2397
`-----------*/
2398
10.1M
yybackup:
2399
  /* Do appropriate processing given the current state.  Read a
2400
     lookahead token if we need one and don't already have one.  */
2401
2402
  /* First try to decide what to do without reference to lookahead token.  */
2403
10.1M
  yyn = yypact[yystate];
2404
10.1M
  if (yypact_value_is_default (yyn))
2405
1.96M
    goto yydefault;
2406
2407
  /* Not known => get a lookahead token if don't already have one.  */
2408
2409
  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
2410
8.18M
  if (yychar == YYEMPTY)
2411
5.17M
    {
2412
5.17M
      YYDPRINTF ((stderr, "Reading a token\n"));
2413
5.17M
      yychar = yylex (&yylval, &yylloc, answer, errors, locations, lexer_param_ptr);
2414
5.17M
    }
2415
2416
8.18M
  if (yychar <= YYEOF)
2417
44.8k
    {
2418
44.8k
      yychar = YYEOF;
2419
44.8k
      yytoken = YYSYMBOL_YYEOF;
2420
44.8k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
2421
44.8k
    }
2422
8.13M
  else if (yychar == YYerror)
2423
0
    {
2424
      /* The scanner already issued an error message, process directly
2425
         to error recovery.  But do not keep the error token as
2426
         lookahead, it is too special and may lead us to an endless
2427
         loop in error recovery. */
2428
0
      yychar = YYUNDEF;
2429
0
      yytoken = YYSYMBOL_YYerror;
2430
0
      yyerror_range[1] = yylloc;
2431
0
      goto yyerrlab1;
2432
0
    }
2433
8.13M
  else
2434
8.13M
    {
2435
8.13M
      yytoken = YYTRANSLATE (yychar);
2436
8.13M
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2437
8.13M
    }
2438
2439
  /* If the proper action on seeing token YYTOKEN is to reduce or to
2440
     detect an error, take that action.  */
2441
8.18M
  yyn += yytoken;
2442
8.18M
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2443
4.59M
    goto yydefault;
2444
3.59M
  yyn = yytable[yyn];
2445
3.59M
  if (yyn <= 0)
2446
103k
    {
2447
103k
      if (yytable_value_is_error (yyn))
2448
2.11k
        goto yyerrlab;
2449
101k
      yyn = -yyn;
2450
101k
      goto yyreduce;
2451
103k
    }
2452
2453
  /* Count tokens shifted since error; after three, turn off error
2454
     status.  */
2455
3.48M
  if (yyerrstatus)
2456
233k
    yyerrstatus--;
2457
2458
  /* Shift the lookahead token.  */
2459
3.48M
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2460
3.48M
  yystate = yyn;
2461
3.48M
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2462
3.48M
  *++yyvsp = yylval;
2463
3.48M
  YY_IGNORE_MAYBE_UNINITIALIZED_END
2464
3.48M
  *++yylsp = yylloc;
2465
2466
  /* Discard the shifted token.  */
2467
3.48M
  yychar = YYEMPTY;
2468
3.48M
  goto yynewstate;
2469
2470
2471
/*-----------------------------------------------------------.
2472
| yydefault -- do the default action for the current state.  |
2473
`-----------------------------------------------------------*/
2474
6.55M
yydefault:
2475
6.55M
  yyn = yydefact[yystate];
2476
6.55M
  if (yyn == 0)
2477
1.78M
    goto yyerrlab;
2478
4.76M
  goto yyreduce;
2479
2480
2481
/*-----------------------------.
2482
| yyreduce -- do a reduction.  |
2483
`-----------------------------*/
2484
4.86M
yyreduce:
2485
  /* yyn is the number of a rule to reduce with.  */
2486
4.86M
  yylen = yyr2[yyn];
2487
2488
  /* If YYLEN is nonzero, implement the default value of the action:
2489
     '$$ = $1'.
2490
2491
     Otherwise, the following line sets YYVAL to garbage.
2492
     This behavior is undocumented and Bison
2493
     users should not rely upon it.  Assigning to YYVAL
2494
     unconditionally makes the parser a bit smaller, and it avoids a
2495
     GCC warning that YYVAL may be used uninitialized.  */
2496
4.86M
  yyval = yyvsp[1-yylen];
2497
2498
  /* Default location. */
2499
4.86M
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2500
4.86M
  yyerror_range[1] = yyloc;
2501
4.86M
  YY_REDUCE_PRINT (yyn);
2502
4.86M
  switch (yyn)
2503
4.86M
    {
2504
824
  case 2: /* TopLevel: Module Imports Query  */
2505
824
#line 282 "src/parser.y"
2506
824
                     {
2507
824
  *answer = BLOCK((yyvsp[-2].blk), (yyvsp[-1].blk), gen_op_simple(TOP), (yyvsp[0].blk));
2508
824
}
2509
824
#line 2510 "src/parser.c"
2510
824
    break;
2511
2512
578
  case 3: /* TopLevel: Module Imports FuncDefs  */
2513
578
#line 285 "src/parser.y"
2514
578
                        {
2515
578
  *answer = BLOCK((yyvsp[-2].blk), (yyvsp[-1].blk), (yyvsp[0].blk));
2516
578
}
2517
578
#line 2518 "src/parser.c"
2518
578
    break;
2519
2520
2.31k
  case 4: /* Module: %empty  */
2521
2.31k
#line 290 "src/parser.y"
2522
2.31k
       {
2523
2.31k
  (yyval.blk) = gen_noop();
2524
2.31k
}
2525
2.31k
#line 2526 "src/parser.c"
2526
2.31k
    break;
2527
2528
0
  case 5: /* Module: "module" Query ';'  */
2529
0
#line 293 "src/parser.y"
2530
0
                   {
2531
0
  if (!block_is_const((yyvsp[-1].blk))) {
2532
0
    FAIL((yylsp[-1]), "Module metadata must be constant");
2533
0
    (yyval.blk) = gen_noop();
2534
0
    block_free((yyvsp[-1].blk));
2535
0
  } else if (block_const_kind((yyvsp[-1].blk)) != JV_KIND_OBJECT) {
2536
0
    FAIL((yylsp[-1]), "Module metadata must be an object");
2537
0
    (yyval.blk) = gen_noop();
2538
0
    block_free((yyvsp[-1].blk));
2539
0
  } else {
2540
0
    (yyval.blk) = gen_module((yyvsp[-1].blk));
2541
0
  }
2542
0
}
2543
0
#line 2544 "src/parser.c"
2544
0
    break;
2545
2546
2.30k
  case 6: /* Imports: %empty  */
2547
2.30k
#line 308 "src/parser.y"
2548
2.30k
       {
2549
2.30k
  (yyval.blk) = gen_noop();
2550
2.30k
}
2551
2.30k
#line 2552 "src/parser.c"
2552
2.30k
    break;
2553
2554
696
  case 7: /* Imports: Import Imports  */
2555
696
#line 311 "src/parser.y"
2556
696
               {
2557
696
  (yyval.blk) = BLOCK((yyvsp[-1].blk), (yyvsp[0].blk));
2558
696
}
2559
696
#line 2560 "src/parser.c"
2560
696
    break;
2561
2562
578
  case 8: /* FuncDefs: %empty  */
2563
578
#line 316 "src/parser.y"
2564
578
       {
2565
578
  (yyval.blk) = gen_noop();
2566
578
}
2567
578
#line 2568 "src/parser.c"
2568
578
    break;
2569
2570
59.3k
  case 9: /* FuncDefs: FuncDef FuncDefs  */
2571
59.3k
#line 319 "src/parser.y"
2572
59.3k
                 {
2573
59.3k
  (yyval.blk) = block_join((yyvsp[-1].blk), (yyvsp[0].blk));
2574
59.3k
}
2575
59.3k
#line 2576 "src/parser.c"
2576
59.3k
    break;
2577
2578
3.92k
  case 10: /* Query: FuncDef Query  */
2579
3.92k
#line 325 "src/parser.y"
2580
3.92k
                            {
2581
3.92k
  (yyval.blk) = block_bind_referenced((yyvsp[-1].blk), (yyvsp[0].blk), OP_IS_CALL_PSEUDO);
2582
3.92k
}
2583
3.92k
#line 2584 "src/parser.c"
2584
3.92k
    break;
2585
2586
15.0k
  case 11: /* Query: Expr "as" Patterns '|' Query  */
2587
15.0k
#line 328 "src/parser.y"
2588
15.0k
                             {
2589
15.0k
  (yyval.blk) = gen_destructure((yyvsp[-4].blk), (yyvsp[-2].blk), (yyvsp[0].blk));
2590
15.0k
}
2591
15.0k
#line 2592 "src/parser.c"
2592
15.0k
    break;
2593
2594
2.34k
  case 12: /* Query: "label" BINDING '|' Query  */
2595
2.34k
#line 331 "src/parser.y"
2596
2.34k
                          {
2597
2.34k
  jv v = jv_string_fmt("*label-%s", jv_string_value((yyvsp[-2].literal)));
2598
2.34k
  (yyval.blk) = gen_location((yyloc), locations, gen_label(jv_string_value(v), (yyvsp[0].blk)));
2599
2.34k
  jv_free((yyvsp[-2].literal));
2600
2.34k
  jv_free(v);
2601
2.34k
}
2602
2.34k
#line 2603 "src/parser.c"
2603
2.34k
    break;
2604
2605
74.7k
  case 13: /* Query: Query '|' Query  */
2606
74.7k
#line 337 "src/parser.y"
2607
74.7k
                {
2608
74.7k
  (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk));
2609
74.7k
}
2610
74.7k
#line 2611 "src/parser.c"
2611
74.7k
    break;
2612
2613
88.5k
  case 14: /* Query: Query ',' Query  */
2614
88.5k
#line 340 "src/parser.y"
2615
88.5k
                {
2616
88.5k
  (yyval.blk) = gen_both((yyvsp[-2].blk), (yyvsp[0].blk));
2617
88.5k
}
2618
88.5k
#line 2619 "src/parser.c"
2619
88.5k
    break;
2620
2621
614k
  case 15: /* Query: Expr  */
2622
614k
#line 343 "src/parser.y"
2623
614k
     {
2624
614k
  (yyval.blk) = (yyvsp[0].blk);
2625
614k
}
2626
614k
#line 2627 "src/parser.c"
2627
614k
    break;
2628
2629
30.0k
  case 16: /* Expr: Expr "//" Expr  */
2630
30.0k
#line 349 "src/parser.y"
2631
30.0k
               {
2632
30.0k
  (yyval.blk) = gen_definedor((yyvsp[-2].blk), (yyvsp[0].blk));
2633
30.0k
}
2634
30.0k
#line 2635 "src/parser.c"
2635
30.0k
    break;
2636
2637
11.6k
  case 17: /* Expr: Expr '=' Expr  */
2638
11.6k
#line 352 "src/parser.y"
2639
11.6k
              {
2640
11.6k
  (yyval.blk) = gen_call("_assign", BLOCK(gen_lambda((yyvsp[-2].blk)), gen_lambda((yyvsp[0].blk))));
2641
11.6k
}
2642
11.6k
#line 2643 "src/parser.c"
2643
11.6k
    break;
2644
2645
2.09k
  case 18: /* Expr: Expr "or" Expr  */
2646
2.09k
#line 355 "src/parser.y"
2647
2.09k
               {
2648
2.09k
  (yyval.blk) = gen_or((yyvsp[-2].blk), (yyvsp[0].blk));
2649
2.09k
}
2650
2.09k
#line 2651 "src/parser.c"
2651
2.09k
    break;
2652
2653
8.74k
  case 19: /* Expr: Expr "and" Expr  */
2654
8.74k
#line 358 "src/parser.y"
2655
8.74k
                {
2656
8.74k
  (yyval.blk) = gen_and((yyvsp[-2].blk), (yyvsp[0].blk));
2657
8.74k
}
2658
8.74k
#line 2659 "src/parser.c"
2659
8.74k
    break;
2660
2661
962
  case 20: /* Expr: Expr "//=" Expr  */
2662
962
#line 361 "src/parser.y"
2663
962
                {
2664
962
  (yyval.blk) = gen_definedor_assign((yyvsp[-2].blk), (yyvsp[0].blk));
2665
962
}
2666
962
#line 2667 "src/parser.c"
2667
962
    break;
2668
2669
731
  case 21: /* Expr: Expr "|=" Expr  */
2670
731
#line 364 "src/parser.y"
2671
731
               {
2672
731
  (yyval.blk) = gen_call("_modify", BLOCK(gen_lambda((yyvsp[-2].blk)), gen_lambda((yyvsp[0].blk))));
2673
731
}
2674
731
#line 2675 "src/parser.c"
2675
731
    break;
2676
2677
25.9k
  case 22: /* Expr: Expr '+' Expr  */
2678
25.9k
#line 367 "src/parser.y"
2679
25.9k
              {
2680
25.9k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '+');
2681
25.9k
}
2682
25.9k
#line 2683 "src/parser.c"
2683
25.9k
    break;
2684
2685
28.7k
  case 23: /* Expr: Expr "+=" Expr  */
2686
28.7k
#line 370 "src/parser.y"
2687
28.7k
               {
2688
28.7k
  (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '+');
2689
28.7k
}
2690
28.7k
#line 2691 "src/parser.c"
2691
28.7k
    break;
2692
2693
56.0k
  case 24: /* Expr: Expr '-' Expr  */
2694
56.0k
#line 373 "src/parser.y"
2695
56.0k
              {
2696
56.0k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '-');
2697
56.0k
}
2698
56.0k
#line 2699 "src/parser.c"
2699
56.0k
    break;
2700
2701
1.15k
  case 25: /* Expr: Expr "-=" Expr  */
2702
1.15k
#line 376 "src/parser.y"
2703
1.15k
               {
2704
1.15k
  (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '-');
2705
1.15k
}
2706
1.15k
#line 2707 "src/parser.c"
2707
1.15k
    break;
2708
2709
39.1k
  case 26: /* Expr: Expr '*' Expr  */
2710
39.1k
#line 379 "src/parser.y"
2711
39.1k
              {
2712
39.1k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '*');
2713
39.1k
}
2714
39.1k
#line 2715 "src/parser.c"
2715
39.1k
    break;
2716
2717
34
  case 27: /* Expr: Expr "*=" Expr  */
2718
34
#line 382 "src/parser.y"
2719
34
               {
2720
34
  (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '*');
2721
34
}
2722
34
#line 2723 "src/parser.c"
2723
34
    break;
2724
2725
33.5k
  case 28: /* Expr: Expr '/' Expr  */
2726
33.5k
#line 385 "src/parser.y"
2727
33.5k
              {
2728
33.5k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '/');
2729
33.5k
}
2730
33.5k
#line 2731 "src/parser.c"
2731
33.5k
    break;
2732
2733
10.1k
  case 29: /* Expr: Expr '%' Expr  */
2734
10.1k
#line 388 "src/parser.y"
2735
10.1k
              {
2736
10.1k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '%');
2737
10.1k
}
2738
10.1k
#line 2739 "src/parser.c"
2739
10.1k
    break;
2740
2741
11.0k
  case 30: /* Expr: Expr "/=" Expr  */
2742
11.0k
#line 391 "src/parser.y"
2743
11.0k
               {
2744
11.0k
  (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '/');
2745
11.0k
}
2746
11.0k
#line 2747 "src/parser.c"
2747
11.0k
    break;
2748
2749
903
  case 31: /* Expr: Expr "%=" Expr  */
2750
903
#line 394 "src/parser.y"
2751
903
                 {
2752
903
  (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '%');
2753
903
}
2754
903
#line 2755 "src/parser.c"
2755
903
    break;
2756
2757
24.9k
  case 32: /* Expr: Expr "==" Expr  */
2758
24.9k
#line 397 "src/parser.y"
2759
24.9k
               {
2760
24.9k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), EQ);
2761
24.9k
}
2762
24.9k
#line 2763 "src/parser.c"
2763
24.9k
    break;
2764
2765
5.13k
  case 33: /* Expr: Expr "!=" Expr  */
2766
5.13k
#line 400 "src/parser.y"
2767
5.13k
               {
2768
5.13k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), NEQ);
2769
5.13k
}
2770
5.13k
#line 2771 "src/parser.c"
2771
5.13k
    break;
2772
2773
6.93k
  case 34: /* Expr: Expr '<' Expr  */
2774
6.93k
#line 403 "src/parser.y"
2775
6.93k
              {
2776
6.93k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '<');
2777
6.93k
}
2778
6.93k
#line 2779 "src/parser.c"
2779
6.93k
    break;
2780
2781
22.6k
  case 35: /* Expr: Expr '>' Expr  */
2782
22.6k
#line 406 "src/parser.y"
2783
22.6k
              {
2784
22.6k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '>');
2785
22.6k
}
2786
22.6k
#line 2787 "src/parser.c"
2787
22.6k
    break;
2788
2789
3.55k
  case 36: /* Expr: Expr "<=" Expr  */
2790
3.55k
#line 409 "src/parser.y"
2791
3.55k
               {
2792
3.55k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), LESSEQ);
2793
3.55k
}
2794
3.55k
#line 2795 "src/parser.c"
2795
3.55k
    break;
2796
2797
1.70k
  case 37: /* Expr: Expr ">=" Expr  */
2798
1.70k
#line 412 "src/parser.y"
2799
1.70k
               {
2800
1.70k
  (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), GREATEREQ);
2801
1.70k
}
2802
1.70k
#line 2803 "src/parser.c"
2803
1.70k
    break;
2804
2805
1.11M
  case 38: /* Expr: Term  */
2806
1.11M
#line 415 "src/parser.y"
2807
1.11M
                  {
2808
1.11M
  (yyval.blk) = (yyvsp[0].blk);
2809
1.11M
}
2810
1.11M
#line 2811 "src/parser.c"
2811
1.11M
    break;
2812
2813
319
  case 39: /* Import: ImportWhat ';'  */
2814
319
#line 421 "src/parser.y"
2815
319
               {
2816
319
  (yyval.blk) = (yyvsp[-1].blk);
2817
319
}
2818
319
#line 2819 "src/parser.c"
2819
319
    break;
2820
2821
1.08k
  case 40: /* Import: ImportWhat Query ';'  */
2822
1.08k
#line 424 "src/parser.y"
2823
1.08k
                     {
2824
1.08k
  if (!block_is_const((yyvsp[-1].blk))) {
2825
499
    FAIL((yylsp[-1]), "Module metadata must be constant");
2826
499
    (yyval.blk) = gen_noop();
2827
499
    block_free((yyvsp[-2].blk));
2828
499
    block_free((yyvsp[-1].blk));
2829
590
  } else if (block_const_kind((yyvsp[-1].blk)) != JV_KIND_OBJECT) {
2830
193
    FAIL((yylsp[-1]), "Module metadata must be an object");
2831
193
    (yyval.blk) = gen_noop();
2832
193
    block_free((yyvsp[-2].blk));
2833
193
    block_free((yyvsp[-1].blk));
2834
397
  } else {
2835
397
    (yyval.blk) = gen_import_meta((yyvsp[-2].blk), (yyvsp[-1].blk));
2836
397
  }
2837
1.08k
}
2838
1.08k
#line 2839 "src/parser.c"
2839
1.08k
    break;
2840
2841
0
  case 41: /* ImportWhat: "import" ImportFrom "as" BINDING  */
2842
0
#line 441 "src/parser.y"
2843
0
                                 {
2844
0
  jv v = block_const((yyvsp[-2].blk));
2845
  // XXX Make gen_import take only blocks and the int is_data so we
2846
  // don't have to free so much stuff here
2847
0
  (yyval.blk) = gen_import(jv_string_value(v), jv_string_value((yyvsp[0].literal)), 1);
2848
0
  block_free((yyvsp[-2].blk));
2849
0
  jv_free((yyvsp[0].literal));
2850
0
  jv_free(v);
2851
0
}
2852
0
#line 2853 "src/parser.c"
2853
0
    break;
2854
2855
32
  case 42: /* ImportWhat: "import" ImportFrom "as" IDENT  */
2856
32
#line 450 "src/parser.y"
2857
32
                               {
2858
32
  jv v = block_const((yyvsp[-2].blk));
2859
32
  (yyval.blk) = gen_import(jv_string_value(v), jv_string_value((yyvsp[0].literal)), 0);
2860
32
  block_free((yyvsp[-2].blk));
2861
32
  jv_free((yyvsp[0].literal));
2862
32
  jv_free(v);
2863
32
}
2864
32
#line 2865 "src/parser.c"
2865
32
    break;
2866
2867
1.38k
  case 43: /* ImportWhat: "include" ImportFrom  */
2868
1.38k
#line 457 "src/parser.y"
2869
1.38k
                     {
2870
1.38k
  jv v = block_const((yyvsp[0].blk));
2871
1.38k
  (yyval.blk) = gen_import(jv_string_value(v), NULL, 0);
2872
1.38k
  block_free((yyvsp[0].blk));
2873
1.38k
  jv_free(v);
2874
1.38k
}
2875
1.38k
#line 2876 "src/parser.c"
2876
1.38k
    break;
2877
2878
1.41k
  case 44: /* ImportFrom: String  */
2879
1.41k
#line 465 "src/parser.y"
2880
1.41k
       {
2881
1.41k
  if (!block_is_const((yyvsp[0].blk))) {
2882
19
    FAIL((yylsp[0]), "Import path must be constant");
2883
19
    (yyval.blk) = gen_const(jv_string(""));
2884
19
    block_free((yyvsp[0].blk));
2885
1.39k
  } else {
2886
1.39k
    (yyval.blk) = (yyvsp[0].blk);
2887
1.39k
  }
2888
1.41k
}
2889
1.41k
#line 2890 "src/parser.c"
2890
1.41k
    break;
2891
2892
23.5k
  case 45: /* FuncDef: "def" IDENT ':' Query ';'  */
2893
23.5k
#line 476 "src/parser.y"
2894
23.5k
                          {
2895
23.5k
  (yyval.blk) = gen_function(jv_string_value((yyvsp[-3].literal)), gen_noop(), (yyvsp[-1].blk));
2896
23.5k
  jv_free((yyvsp[-3].literal));
2897
23.5k
}
2898
23.5k
#line 2899 "src/parser.c"
2899
23.5k
    break;
2900
2901
39.7k
  case 46: /* FuncDef: "def" IDENT '(' Params ')' ':' Query ';'  */
2902
39.7k
#line 481 "src/parser.y"
2903
39.7k
                                         {
2904
39.7k
  (yyval.blk) = gen_function(jv_string_value((yyvsp[-6].literal)), (yyvsp[-4].blk), (yyvsp[-1].blk));
2905
39.7k
  jv_free((yyvsp[-6].literal));
2906
39.7k
}
2907
39.7k
#line 2908 "src/parser.c"
2908
39.7k
    break;
2909
2910
39.7k
  case 47: /* Params: Param  */
2911
39.7k
#line 487 "src/parser.y"
2912
39.7k
      {
2913
39.7k
  (yyval.blk) = (yyvsp[0].blk);
2914
39.7k
}
2915
39.7k
#line 2916 "src/parser.c"
2916
39.7k
    break;
2917
2918
17.9k
  case 48: /* Params: Params ';' Param  */
2919
17.9k
#line 490 "src/parser.y"
2920
17.9k
                 {
2921
17.9k
  (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk));
2922
17.9k
}
2923
17.9k
#line 2924 "src/parser.c"
2924
17.9k
    break;
2925
2926
20.7k
  case 49: /* Param: BINDING  */
2927
20.7k
#line 495 "src/parser.y"
2928
20.7k
        {
2929
20.7k
  (yyval.blk) = gen_param_regular(jv_string_value((yyvsp[0].literal)));
2930
20.7k
  jv_free((yyvsp[0].literal));
2931
20.7k
}
2932
20.7k
#line 2933 "src/parser.c"
2933
20.7k
    break;
2934
2935
36.9k
  case 50: /* Param: IDENT  */
2936
36.9k
#line 499 "src/parser.y"
2937
36.9k
      {
2938
36.9k
  (yyval.blk) = gen_param(jv_string_value((yyvsp[0].literal)));
2939
36.9k
  jv_free((yyvsp[0].literal));
2940
36.9k
}
2941
36.9k
#line 2942 "src/parser.c"
2942
36.9k
    break;
2943
2944
727
  case 51: /* StringStart: FORMAT QQSTRING_START  */
2945
727
#line 506 "src/parser.y"
2946
727
                      {
2947
727
  (yyval.literal) = (yyvsp[-1].literal);
2948
727
}
2949
727
#line 2950 "src/parser.c"
2950
727
    break;
2951
2952
93.4k
  case 52: /* StringStart: QQSTRING_START  */
2953
93.4k
#line 509 "src/parser.y"
2954
93.4k
               {
2955
93.4k
  (yyval.literal) = jv_string("text");
2956
93.4k
}
2957
93.4k
#line 2958 "src/parser.c"
2958
93.4k
    break;
2959
2960
93.6k
  case 53: /* String: StringStart QQString QQSTRING_END  */
2961
93.6k
#line 515 "src/parser.y"
2962
93.6k
                                  {
2963
93.6k
  (yyval.blk) = (yyvsp[-1].blk);
2964
93.6k
  jv_free((yyvsp[-2].literal));
2965
93.6k
}
2966
93.6k
#line 2967 "src/parser.c"
2967
93.6k
    break;
2968
2969
94.2k
  case 54: /* QQString: %empty  */
2970
94.2k
#line 522 "src/parser.y"
2971
94.2k
       {
2972
94.2k
  (yyval.blk) = gen_const(jv_string(""));
2973
94.2k
}
2974
94.2k
#line 2975 "src/parser.c"
2975
94.2k
    break;
2976
2977
180k
  case 55: /* QQString: QQString QQSTRING_TEXT  */
2978
180k
#line 525 "src/parser.y"
2979
180k
                       {
2980
180k
  (yyval.blk) = gen_binop((yyvsp[-1].blk), gen_const((yyvsp[0].literal)), '+');
2981
180k
}
2982
180k
#line 2983 "src/parser.c"
2983
180k
    break;
2984
2985
604
  case 56: /* QQString: QQString QQSTRING_INTERP_START Query QQSTRING_INTERP_END  */
2986
604
#line 528 "src/parser.y"
2987
604
                                                         {
2988
604
  (yyval.blk) = gen_binop((yyvsp[-3].blk), gen_format((yyvsp[-1].blk), jv_copy((yyvsp[-4].literal))), '+');
2989
604
}
2990
604
#line 2991 "src/parser.c"
2991
604
    break;
2992
2993
7.12k
  case 57: /* ElseBody: "elif" Query "then" Query ElseBody  */
2994
7.12k
#line 534 "src/parser.y"
2995
7.12k
                                   {
2996
7.12k
  (yyval.blk) = gen_cond((yyvsp[-3].blk), (yyvsp[-1].blk), (yyvsp[0].blk));
2997
7.12k
}
2998
7.12k
#line 2999 "src/parser.c"
2999
7.12k
    break;
3000
3001
16.2k
  case 58: /* ElseBody: "else" Query "end"  */
3002
16.2k
#line 537 "src/parser.y"
3003
16.2k
                   {
3004
16.2k
  (yyval.blk) = (yyvsp[-1].blk);
3005
16.2k
}
3006
16.2k
#line 3007 "src/parser.c"
3007
16.2k
    break;
3008
3009
1.43k
  case 59: /* ElseBody: "end"  */
3010
1.43k
#line 540 "src/parser.y"
3011
1.43k
      {
3012
1.43k
  (yyval.blk) = gen_noop();
3013
1.43k
}
3014
1.43k
#line 3015 "src/parser.c"
3015
1.43k
    break;
3016
3017
68.0k
  case 60: /* Term: '.'  */
3018
68.0k
#line 546 "src/parser.y"
3019
68.0k
    {
3020
68.0k
  (yyval.blk) = gen_noop();
3021
68.0k
}
3022
68.0k
#line 3023 "src/parser.c"
3023
68.0k
    break;
3024
3025
1.60k
  case 61: /* Term: ".."  */
3026
1.60k
#line 549 "src/parser.y"
3027
1.60k
    {
3028
1.60k
  (yyval.blk) = gen_call("recurse", gen_noop());
3029
1.60k
}
3030
1.60k
#line 3031 "src/parser.c"
3031
1.60k
    break;
3032
3033
2.29k
  case 62: /* Term: "break" BINDING  */
3034
2.29k
#line 552 "src/parser.y"
3035
2.29k
              {
3036
2.29k
  jv v = jv_string_fmt("*label-%s", jv_string_value((yyvsp[0].literal)));     // impossible symbol
3037
2.29k
  (yyval.blk) = gen_location((yyloc), locations,
3038
2.29k
                    BLOCK(gen_op_unbound(LOADV, jv_string_value(v)),
3039
2.29k
                    gen_call("error", gen_noop())));
3040
2.29k
  jv_free(v);
3041
2.29k
  jv_free((yyvsp[0].literal));
3042
2.29k
}
3043
2.29k
#line 3044 "src/parser.c"
3044
2.29k
    break;
3045
3046
161
  case 63: /* Term: "break" error  */
3047
161
#line 560 "src/parser.y"
3048
161
            {
3049
161
  FAIL((yyloc), "break requires a label to break to");
3050
161
  (yyval.blk) = gen_noop();
3051
161
}
3052
161
#line 3053 "src/parser.c"
3053
161
    break;
3054
3055
322
  case 64: /* Term: Term FIELD '?'  */
3056
322
#line 564 "src/parser.y"
3057
322
               {
3058
322
  (yyval.blk) = gen_index_opt((yyvsp[-2].blk), gen_const((yyvsp[-1].literal)));
3059
322
}
3060
322
#line 3061 "src/parser.c"
3061
322
    break;
3062
3063
132
  case 65: /* Term: FIELD '?'  */
3064
132
#line 567 "src/parser.y"
3065
132
          {
3066
132
  (yyval.blk) = gen_index_opt(gen_noop(), gen_const((yyvsp[-1].literal)));
3067
132
}
3068
132
#line 3069 "src/parser.c"
3069
132
    break;
3070
3071
62
  case 66: /* Term: Term '.' String '?'  */
3072
62
#line 570 "src/parser.y"
3073
62
                    {
3074
62
  (yyval.blk) = gen_index_opt((yyvsp[-3].blk), (yyvsp[-1].blk));
3075
62
}
3076
62
#line 3077 "src/parser.c"
3077
62
    break;
3078
3079
1
  case 67: /* Term: '.' String '?'  */
3080
1
#line 573 "src/parser.y"
3081
1
               {
3082
1
  (yyval.blk) = gen_index_opt(gen_noop(), (yyvsp[-1].blk));
3083
1
}
3084
1
#line 3085 "src/parser.c"
3085
1
    break;
3086
3087
1.02k
  case 68: /* Term: Term FIELD  */
3088
1.02k
#line 576 "src/parser.y"
3089
1.02k
                        {
3090
1.02k
  (yyval.blk) = gen_index((yyvsp[-1].blk), gen_const((yyvsp[0].literal)));
3091
1.02k
}
3092
1.02k
#line 3093 "src/parser.c"
3093
1.02k
    break;
3094
3095
17.7k
  case 69: /* Term: FIELD  */
3096
17.7k
#line 579 "src/parser.y"
3097
17.7k
                   {
3098
17.7k
  (yyval.blk) = gen_index(gen_noop(), gen_const((yyvsp[0].literal)));
3099
17.7k
}
3100
17.7k
#line 3101 "src/parser.c"
3101
17.7k
    break;
3102
3103
256
  case 70: /* Term: Term '.' String  */
3104
256
#line 582 "src/parser.y"
3105
256
                             {
3106
256
  (yyval.blk) = gen_index((yyvsp[-2].blk), (yyvsp[0].blk));
3107
256
}
3108
256
#line 3109 "src/parser.c"
3109
256
    break;
3110
3111
1.87k
  case 71: /* Term: '.' String  */
3112
1.87k
#line 585 "src/parser.y"
3113
1.87k
                        {
3114
1.87k
  (yyval.blk) = gen_index(gen_noop(), (yyvsp[0].blk));
3115
1.87k
}
3116
1.87k
#line 3117 "src/parser.c"
3117
1.87k
    break;
3118
3119
1.84k
  case 72: /* Term: '.' error  */
3120
1.84k
#line 588 "src/parser.y"
3121
1.84k
          {
3122
1.84k
  FAIL((yyloc), "try .[\"field\"] instead of .field for unusually named fields");
3123
1.84k
  (yyval.blk) = gen_noop();
3124
1.84k
}
3125
1.84k
#line 3126 "src/parser.c"
3126
1.84k
    break;
3127
3128
236
  case 73: /* Term: '.' IDENT error  */
3129
236
#line 592 "src/parser.y"
3130
236
                {
3131
236
  jv_free((yyvsp[-1].literal));
3132
236
  FAIL((yyloc), "try .[\"field\"] instead of .field for unusually named fields");
3133
236
  (yyval.blk) = gen_noop();
3134
236
}
3135
236
#line 3136 "src/parser.c"
3136
236
    break;
3137
3138
580
  case 74: /* Term: Term '[' Query ']' '?'  */
3139
580
#line 598 "src/parser.y"
3140
580
                       {
3141
580
  (yyval.blk) = gen_index_opt((yyvsp[-4].blk), (yyvsp[-2].blk));
3142
580
}
3143
580
#line 3144 "src/parser.c"
3144
580
    break;
3145
3146
24.6k
  case 75: /* Term: Term '[' Query ']'  */
3147
24.6k
#line 601 "src/parser.y"
3148
24.6k
                                {
3149
24.6k
  (yyval.blk) = gen_index((yyvsp[-3].blk), (yyvsp[-1].blk));
3150
24.6k
}
3151
24.6k
#line 3152 "src/parser.c"
3152
24.6k
    break;
3153
3154
313
  case 76: /* Term: Term '.' '[' Query ']' '?'  */
3155
313
#line 604 "src/parser.y"
3156
313
                           {
3157
313
  (yyval.blk) = gen_index_opt((yyvsp[-5].blk), (yyvsp[-2].blk));
3158
313
}
3159
313
#line 3160 "src/parser.c"
3160
313
    break;
3161
3162
987
  case 77: /* Term: Term '.' '[' Query ']'  */
3163
987
#line 607 "src/parser.y"
3164
987
                                    {
3165
987
  (yyval.blk) = gen_index((yyvsp[-4].blk), (yyvsp[-1].blk));
3166
987
}
3167
987
#line 3168 "src/parser.c"
3168
987
    break;
3169
3170
1.98k
  case 78: /* Term: Term '[' ']' '?'  */
3171
1.98k
#line 610 "src/parser.y"
3172
1.98k
                 {
3173
1.98k
  (yyval.blk) = block_join((yyvsp[-3].blk), gen_op_simple(EACH_OPT));
3174
1.98k
}
3175
1.98k
#line 3176 "src/parser.c"
3176
1.98k
    break;
3177
3178
11.4k
  case 79: /* Term: Term '[' ']'  */
3179
11.4k
#line 613 "src/parser.y"
3180
11.4k
                          {
3181
11.4k
  (yyval.blk) = block_join((yyvsp[-2].blk), gen_op_simple(EACH));
3182
11.4k
}
3183
11.4k
#line 3184 "src/parser.c"
3184
11.4k
    break;
3185
3186
225
  case 80: /* Term: Term '.' '[' ']' '?'  */
3187
225
#line 616 "src/parser.y"
3188
225
                     {
3189
225
  (yyval.blk) = block_join((yyvsp[-4].blk), gen_op_simple(EACH_OPT));
3190
225
}
3191
225
#line 3192 "src/parser.c"
3192
225
    break;
3193
3194
270
  case 81: /* Term: Term '.' '[' ']'  */
3195
270
#line 619 "src/parser.y"
3196
270
                              {
3197
270
  (yyval.blk) = block_join((yyvsp[-3].blk), gen_op_simple(EACH));
3198
270
}
3199
270
#line 3200 "src/parser.c"
3200
270
    break;
3201
3202
288
  case 82: /* Term: Term '[' Query ':' Query ']' '?'  */
3203
288
#line 622 "src/parser.y"
3204
288
                                 {
3205
288
  (yyval.blk) = gen_slice_index((yyvsp[-6].blk), (yyvsp[-4].blk), (yyvsp[-2].blk), INDEX_OPT);
3206
288
}
3207
288
#line 3208 "src/parser.c"
3208
288
    break;
3209
3210
370
  case 83: /* Term: Term '[' Query ':' ']' '?'  */
3211
370
#line 625 "src/parser.y"
3212
370
                           {
3213
370
  (yyval.blk) = gen_slice_index((yyvsp[-5].blk), (yyvsp[-3].blk), gen_const(jv_null()), INDEX_OPT);
3214
370
}
3215
370
#line 3216 "src/parser.c"
3216
370
    break;
3217
3218
231
  case 84: /* Term: Term '[' ':' Query ']' '?'  */
3219
231
#line 628 "src/parser.y"
3220
231
                           {
3221
231
  (yyval.blk) = gen_slice_index((yyvsp[-5].blk), gen_const(jv_null()), (yyvsp[-2].blk), INDEX_OPT);
3222
231
}
3223
231
#line 3224 "src/parser.c"
3224
231
    break;
3225
3226
909
  case 85: /* Term: Term '[' Query ':' Query ']'  */
3227
909
#line 631 "src/parser.y"
3228
909
                                          {
3229
909
  (yyval.blk) = gen_slice_index((yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk), INDEX);
3230
909
}
3231
909
#line 3232 "src/parser.c"
3232
909
    break;
3233
3234
2.93k
  case 86: /* Term: Term '[' Query ':' ']'  */
3235
2.93k
#line 634 "src/parser.y"
3236
2.93k
                                    {
3237
2.93k
  (yyval.blk) = gen_slice_index((yyvsp[-4].blk), (yyvsp[-2].blk), gen_const(jv_null()), INDEX);
3238
2.93k
}
3239
2.93k
#line 3240 "src/parser.c"
3240
2.93k
    break;
3241
3242
1.27k
  case 87: /* Term: Term '[' ':' Query ']'  */
3243
1.27k
#line 637 "src/parser.y"
3244
1.27k
                                    {
3245
1.27k
  (yyval.blk) = gen_slice_index((yyvsp[-4].blk), gen_const(jv_null()), (yyvsp[-1].blk), INDEX);
3246
1.27k
}
3247
1.27k
#line 3248 "src/parser.c"
3248
1.27k
    break;
3249
3250
2.12k
  case 88: /* Term: Term '?'  */
3251
2.12k
#line 640 "src/parser.y"
3252
2.12k
         {
3253
2.12k
  (yyval.blk) = gen_try((yyvsp[-1].blk), gen_op_simple(BACKTRACK));
3254
2.12k
}
3255
2.12k
#line 3256 "src/parser.c"
3256
2.12k
    break;
3257
3258
346k
  case 89: /* Term: LITERAL  */
3259
346k
#line 643 "src/parser.y"
3260
346k
        {
3261
346k
  (yyval.blk) = gen_const((yyvsp[0].literal));
3262
346k
}
3263
346k
#line 3264 "src/parser.c"
3264
346k
    break;
3265
3266
60.5k
  case 90: /* Term: String  */
3267
60.5k
#line 646 "src/parser.y"
3268
60.5k
       {
3269
60.5k
  (yyval.blk) = (yyvsp[0].blk);
3270
60.5k
}
3271
60.5k
#line 3272 "src/parser.c"
3272
60.5k
    break;
3273
3274
3.96k
  case 91: /* Term: FORMAT  */
3275
3.96k
#line 649 "src/parser.y"
3276
3.96k
       {
3277
3.96k
  (yyval.blk) = gen_format(gen_noop(), (yyvsp[0].literal));
3278
3.96k
}
3279
3.96k
#line 3280 "src/parser.c"
3280
3.96k
    break;
3281
3282
15.4k
  case 92: /* Term: '-' Term  */
3283
15.4k
#line 652 "src/parser.y"
3284
15.4k
         {
3285
15.4k
  (yyval.blk) = BLOCK((yyvsp[0].blk), gen_call("_negate", gen_noop()));
3286
15.4k
}
3287
15.4k
#line 3288 "src/parser.c"
3288
15.4k
    break;
3289
3290
24.6k
  case 93: /* Term: '(' Query ')'  */
3291
24.6k
#line 655 "src/parser.y"
3292
24.6k
              {
3293
24.6k
  (yyval.blk) = (yyvsp[-1].blk);
3294
24.6k
}
3295
24.6k
#line 3296 "src/parser.c"
3296
24.6k
    break;
3297
3298
118k
  case 94: /* Term: '[' Query ']'  */
3299
118k
#line 658 "src/parser.y"
3300
118k
              {
3301
118k
  (yyval.blk) = gen_collect((yyvsp[-1].blk));
3302
118k
}
3303
118k
#line 3304 "src/parser.c"
3304
118k
    break;
3305
3306
14.5k
  case 95: /* Term: '[' ']'  */
3307
14.5k
#line 661 "src/parser.y"
3308
14.5k
        {
3309
14.5k
  (yyval.blk) = gen_const(jv_array());
3310
14.5k
}
3311
14.5k
#line 3312 "src/parser.c"
3312
14.5k
    break;
3313
3314
79.5k
  case 96: /* Term: '{' DictPairs '}'  */
3315
79.5k
#line 664 "src/parser.y"
3316
79.5k
                  {
3317
79.5k
  block o = gen_const_object((yyvsp[-1].blk));
3318
79.5k
  if (o.first != NULL)
3319
67.6k
    (yyval.blk) = o;
3320
11.9k
  else
3321
11.9k
    (yyval.blk) = BLOCK(gen_subexp(gen_const(jv_object())), (yyvsp[-1].blk), gen_op_simple(POP));
3322
79.5k
}
3323
79.5k
#line 3324 "src/parser.c"
3324
79.5k
    break;
3325
3326
6.72k
  case 97: /* Term: "reduce" Expr "as" Patterns '(' Query ';' Query ')'  */
3327
6.72k
#line 671 "src/parser.y"
3328
6.72k
                                                    {
3329
6.72k
  (yyval.blk) = gen_reduce((yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk));
3330
6.72k
}
3331
6.72k
#line 3332 "src/parser.c"
3332
6.72k
    break;
3333
3334
1.68k
  case 98: /* Term: "foreach" Expr "as" Patterns '(' Query ';' Query ';' Query ')'  */
3335
1.68k
#line 674 "src/parser.y"
3336
1.68k
                                                               {
3337
1.68k
  (yyval.blk) = gen_foreach((yyvsp[-9].blk), (yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk));
3338
1.68k
}
3339
1.68k
#line 3340 "src/parser.c"
3340
1.68k
    break;
3341
3342
560
  case 99: /* Term: "foreach" Expr "as" Patterns '(' Query ';' Query ')'  */
3343
560
#line 677 "src/parser.y"
3344
560
                                                     {
3345
560
  (yyval.blk) = gen_foreach((yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk), gen_noop());
3346
560
}
3347
560
#line 3348 "src/parser.c"
3348
560
    break;
3349
3350
17.6k
  case 100: /* Term: "if" Query "then" Query ElseBody  */
3351
17.6k
#line 680 "src/parser.y"
3352
17.6k
                                 {
3353
17.6k
  (yyval.blk) = gen_cond((yyvsp[-3].blk), (yyvsp[-1].blk), (yyvsp[0].blk));
3354
17.6k
}
3355
17.6k
#line 3356 "src/parser.c"
3356
17.6k
    break;
3357
3358
2.39k
  case 101: /* Term: "if" Query "then" error  */
3359
2.39k
#line 683 "src/parser.y"
3360
2.39k
                        {
3361
2.39k
  FAIL((yyloc), "Possibly unterminated 'if' statement");
3362
2.39k
  (yyval.blk) = (yyvsp[-2].blk);
3363
2.39k
}
3364
2.39k
#line 3365 "src/parser.c"
3365
2.39k
    break;
3366
3367
780
  case 102: /* Term: "try" Expr "catch" Expr  */
3368
780
#line 687 "src/parser.y"
3369
780
                        {
3370
780
  (yyval.blk) = gen_try((yyvsp[-2].blk), (yyvsp[0].blk));
3371
780
}
3372
780
#line 3373 "src/parser.c"
3373
780
    break;
3374
3375
190
  case 103: /* Term: "try" Expr "catch" error  */
3376
190
#line 690 "src/parser.y"
3377
190
                         {
3378
190
  FAIL((yyloc), "Possibly unterminated 'try' statement");
3379
190
  (yyval.blk) = (yyvsp[-2].blk);
3380
190
}
3381
190
#line 3382 "src/parser.c"
3382
190
    break;
3383
3384
215
  case 104: /* Term: "try" Expr  */
3385
215
#line 694 "src/parser.y"
3386
215
           {
3387
215
  (yyval.blk) = gen_try((yyvsp[0].blk), gen_op_simple(BACKTRACK));
3388
215
}
3389
215
#line 3390 "src/parser.c"
3390
215
    break;
3391
3392
1.88k
  case 105: /* Term: '$' '$' '$' BINDING  */
3393
1.88k
#line 712 "src/parser.y"
3394
1.88k
                    {
3395
1.88k
  (yyval.blk) = gen_location((yyloc), locations, gen_op_unbound(LOADVN, jv_string_value((yyvsp[0].literal))));
3396
1.88k
  jv_free((yyvsp[0].literal));
3397
1.88k
}
3398
1.88k
#line 3399 "src/parser.c"
3399
1.88k
    break;
3400
3401
81.9k
  case 106: /* Term: BINDING  */
3402
81.9k
#line 716 "src/parser.y"
3403
81.9k
        {
3404
81.9k
  (yyval.blk) = gen_location((yyloc), locations, gen_op_unbound(LOADV, jv_string_value((yyvsp[0].literal))));
3405
81.9k
  jv_free((yyvsp[0].literal));
3406
81.9k
}
3407
81.9k
#line 3408 "src/parser.c"
3408
81.9k
    break;
3409
3410
0
  case 107: /* Term: "$__loc__"  */
3411
0
#line 720 "src/parser.y"
3412
0
           {
3413
0
  (yyval.blk) = gen_loc_object(&(yyloc), locations);
3414
0
}
3415
0
#line 3416 "src/parser.c"
3416
0
    break;
3417
3418
168k
  case 108: /* Term: IDENT  */
3419
168k
#line 723 "src/parser.y"
3420
168k
      {
3421
168k
  const char *s = jv_string_value((yyvsp[0].literal));
3422
168k
  if (strcmp(s, "false") == 0)
3423
1.88k
    (yyval.blk) = gen_const(jv_false());
3424
166k
  else if (strcmp(s, "true") == 0)
3425
1.58k
    (yyval.blk) = gen_const(jv_true());
3426
165k
  else if (strcmp(s, "null") == 0)
3427
12.3k
    (yyval.blk) = gen_const(jv_null());
3428
152k
  else
3429
152k
    (yyval.blk) = gen_location((yyloc), locations, gen_call(s, gen_noop()));
3430
168k
  jv_free((yyvsp[0].literal));
3431
168k
}
3432
168k
#line 3433 "src/parser.c"
3433
168k
    break;
3434
3435
69.5k
  case 109: /* Term: IDENT '(' Args ')'  */
3436
69.5k
#line 735 "src/parser.y"
3437
69.5k
                   {
3438
69.5k
  (yyval.blk) = gen_call(jv_string_value((yyvsp[-3].literal)), (yyvsp[-1].blk));
3439
69.5k
  (yyval.blk) = gen_location((yylsp[-3]), locations, (yyval.blk));
3440
69.5k
  jv_free((yyvsp[-3].literal));
3441
69.5k
}
3442
69.5k
#line 3443 "src/parser.c"
3443
69.5k
    break;
3444
3445
3.58k
  case 110: /* Term: '(' error ')'  */
3446
3.58k
#line 740 "src/parser.y"
3447
3.58k
              { (yyval.blk) = gen_noop(); }
3448
3.58k
#line 3449 "src/parser.c"
3449
3.58k
    break;
3450
3451
7.84k
  case 111: /* Term: '[' error ']'  */
3452
7.84k
#line 741 "src/parser.y"
3453
7.84k
              { (yyval.blk) = gen_noop(); }
3454
7.84k
#line 3455 "src/parser.c"
3455
7.84k
    break;
3456
3457
4.55k
  case 112: /* Term: Term '[' error ']'  */
3458
4.55k
#line 742 "src/parser.y"
3459
4.55k
                   { (yyval.blk) = (yyvsp[-3].blk); }
3460
4.55k
#line 3461 "src/parser.c"
3461
4.55k
    break;
3462
3463
16.3k
  case 113: /* Term: '{' error '}'  */
3464
16.3k
#line 743 "src/parser.y"
3465
16.3k
              { (yyval.blk) = gen_noop(); }
3466
16.3k
#line 3467 "src/parser.c"
3467
16.3k
    break;
3468
3469
69.6k
  case 114: /* Args: Arg  */
3470
69.6k
#line 746 "src/parser.y"
3471
69.6k
    {
3472
69.6k
  (yyval.blk) = (yyvsp[0].blk);
3473
69.6k
}
3474
69.6k
#line 3475 "src/parser.c"
3475
69.6k
    break;
3476
3477
32.9k
  case 115: /* Args: Args ';' Arg  */
3478
32.9k
#line 749 "src/parser.y"
3479
32.9k
             {
3480
32.9k
  (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk));
3481
32.9k
}
3482
32.9k
#line 3483 "src/parser.c"
3483
32.9k
    break;
3484
3485
102k
  case 116: /* Arg: Query  */
3486
102k
#line 754 "src/parser.y"
3487
102k
      {
3488
102k
  (yyval.blk) = gen_lambda((yyvsp[0].blk));
3489
102k
}
3490
102k
#line 3491 "src/parser.c"
3491
102k
    break;
3492
3493
1.06k
  case 117: /* RepPatterns: RepPatterns "?//" Pattern  */
3494
1.06k
#line 759 "src/parser.y"
3495
1.06k
                          {
3496
1.06k
  (yyval.blk) = BLOCK((yyvsp[-2].blk), gen_destructure_alt((yyvsp[0].blk)));
3497
1.06k
}
3498
1.06k
#line 3499 "src/parser.c"
3499
1.06k
    break;
3500
3501
2.28k
  case 118: /* RepPatterns: Pattern  */
3502
2.28k
#line 762 "src/parser.y"
3503
2.28k
        {
3504
2.28k
  (yyval.blk) = gen_destructure_alt((yyvsp[0].blk));
3505
2.28k
}
3506
2.28k
#line 3507 "src/parser.c"
3507
2.28k
    break;
3508
3509
2.00k
  case 119: /* Patterns: RepPatterns "?//" Pattern  */
3510
2.00k
#line 767 "src/parser.y"
3511
2.00k
                          {
3512
2.00k
  (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk));
3513
2.00k
}
3514
2.00k
#line 3515 "src/parser.c"
3515
2.00k
    break;
3516
3517
22.5k
  case 120: /* Patterns: Pattern  */
3518
22.5k
#line 770 "src/parser.y"
3519
22.5k
        {
3520
22.5k
  (yyval.blk) = (yyvsp[0].blk);
3521
22.5k
}
3522
22.5k
#line 3523 "src/parser.c"
3523
22.5k
    break;
3524
3525
29.7k
  case 121: /* Pattern: BINDING  */
3526
29.7k
#line 775 "src/parser.y"
3527
29.7k
        {
3528
29.7k
  (yyval.blk) = gen_op_unbound(STOREV, jv_string_value((yyvsp[0].literal)));
3529
29.7k
  jv_free((yyvsp[0].literal));
3530
29.7k
}
3531
29.7k
#line 3532 "src/parser.c"
3532
29.7k
    break;
3533
3534
170
  case 122: /* Pattern: '[' ArrayPats ']'  */
3535
170
#line 779 "src/parser.y"
3536
170
                  {
3537
170
  (yyval.blk) = BLOCK((yyvsp[-1].blk), gen_op_simple(POP));
3538
170
}
3539
170
#line 3540 "src/parser.c"
3540
170
    break;
3541
3542
1.17k
  case 123: /* Pattern: '{' ObjPats '}'  */
3543
1.17k
#line 782 "src/parser.y"
3544
1.17k
                {
3545
1.17k
  (yyval.blk) = BLOCK((yyvsp[-1].blk), gen_op_simple(POP));
3546
1.17k
}
3547
1.17k
#line 3548 "src/parser.c"
3548
1.17k
    break;
3549
3550
362
  case 124: /* ArrayPats: Pattern  */
3551
362
#line 787 "src/parser.y"
3552
362
        {
3553
362
  (yyval.blk) = gen_array_matcher(gen_noop(), (yyvsp[0].blk));
3554
362
}
3555
362
#line 3556 "src/parser.c"
3556
362
    break;
3557
3558
0
  case 125: /* ArrayPats: ArrayPats ',' Pattern  */
3559
0
#line 790 "src/parser.y"
3560
0
                      {
3561
0
  (yyval.blk) = gen_array_matcher((yyvsp[-2].blk), (yyvsp[0].blk));
3562
0
}
3563
0
#line 3564 "src/parser.c"
3564
0
    break;
3565
3566
3.06k
  case 126: /* ObjPats: ObjPat  */
3567
3.06k
#line 795 "src/parser.y"
3568
3.06k
       {
3569
3.06k
  (yyval.blk) = (yyvsp[0].blk);
3570
3.06k
}
3571
3.06k
#line 3572 "src/parser.c"
3572
3.06k
    break;
3573
3574
1.49k
  case 127: /* ObjPats: ObjPats ',' ObjPat  */
3575
1.49k
#line 798 "src/parser.y"
3576
1.49k
                   {
3577
1.49k
  (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk));
3578
1.49k
}
3579
1.49k
#line 3580 "src/parser.c"
3580
1.49k
    break;
3581
3582
1.80k
  case 128: /* ObjPat: BINDING  */
3583
1.80k
#line 803 "src/parser.y"
3584
1.80k
        {
3585
1.80k
  (yyval.blk) = gen_object_matcher(gen_const((yyvsp[0].literal)), gen_op_unbound(STOREV, jv_string_value((yyvsp[0].literal))));
3586
1.80k
}
3587
1.80k
#line 3588 "src/parser.c"
3588
1.80k
    break;
3589
3590
331
  case 129: /* ObjPat: BINDING ':' Pattern  */
3591
331
#line 806 "src/parser.y"
3592
331
                    {
3593
331
  (yyval.blk) = gen_object_matcher(gen_const((yyvsp[-2].literal)), BLOCK(gen_op_simple(DUP), gen_op_unbound(STOREV, jv_string_value((yyvsp[-2].literal))), (yyvsp[0].blk)));
3594
331
}
3595
331
#line 3596 "src/parser.c"
3596
331
    break;
3597
3598
268
  case 130: /* ObjPat: IDENT ':' Pattern  */
3599
268
#line 809 "src/parser.y"
3600
268
                  {
3601
268
  (yyval.blk) = gen_object_matcher(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk));
3602
268
}
3603
268
#line 3604 "src/parser.c"
3604
268
    break;
3605
3606
315
  case 131: /* ObjPat: Keyword ':' Pattern  */
3607
315
#line 812 "src/parser.y"
3608
315
                    {
3609
315
  (yyval.blk) = gen_object_matcher(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk));
3610
315
}
3611
315
#line 3612 "src/parser.c"
3612
315
    break;
3613
3614
179
  case 132: /* ObjPat: String ':' Pattern  */
3615
179
#line 815 "src/parser.y"
3616
179
                   {
3617
179
  (yyval.blk) = gen_object_matcher((yyvsp[-2].blk), (yyvsp[0].blk));
3618
179
}
3619
179
#line 3620 "src/parser.c"
3620
179
    break;
3621
3622
447
  case 133: /* ObjPat: '(' Query ')' ':' Pattern  */
3623
447
#line 818 "src/parser.y"
3624
447
                          {
3625
447
  jv msg = check_object_key((yyvsp[-3].blk));
3626
447
  if (jv_is_valid(msg)) {
3627
176
    FAIL((yylsp[-3]), jv_string_value(msg));
3628
176
  }
3629
447
  jv_free(msg);
3630
447
  (yyval.blk) = gen_object_matcher((yyvsp[-3].blk), (yyvsp[0].blk));
3631
447
}
3632
447
#line 3633 "src/parser.c"
3633
447
    break;
3634
3635
1.22k
  case 134: /* ObjPat: error ':' Pattern  */
3636
1.22k
#line 826 "src/parser.y"
3637
1.22k
                  {
3638
1.22k
  FAIL((yyloc), "May need parentheses around object key expression");
3639
1.22k
  (yyval.blk) = (yyvsp[0].blk);
3640
1.22k
}
3641
1.22k
#line 3642 "src/parser.c"
3642
1.22k
    break;
3643
3644
1.00k
  case 135: /* Keyword: "as"  */
3645
1.00k
#line 832 "src/parser.y"
3646
1.00k
     {
3647
1.00k
  (yyval.literal) = jv_string("as");
3648
1.00k
}
3649
1.00k
#line 3650 "src/parser.c"
3650
1.00k
    break;
3651
3652
128
  case 136: /* Keyword: "def"  */
3653
128
#line 835 "src/parser.y"
3654
128
      {
3655
128
  (yyval.literal) = jv_string("def");
3656
128
}
3657
128
#line 3658 "src/parser.c"
3658
128
    break;
3659
3660
325
  case 137: /* Keyword: "module"  */
3661
325
#line 838 "src/parser.y"
3662
325
         {
3663
325
  (yyval.literal) = jv_string("module");
3664
325
}
3665
325
#line 3666 "src/parser.c"
3666
325
    break;
3667
3668
194
  case 138: /* Keyword: "import"  */
3669
194
#line 841 "src/parser.y"
3670
194
         {
3671
194
  (yyval.literal) = jv_string("import");
3672
194
}
3673
194
#line 3674 "src/parser.c"
3674
194
    break;
3675
3676
194
  case 139: /* Keyword: "include"  */
3677
194
#line 844 "src/parser.y"
3678
194
          {
3679
194
  (yyval.literal) = jv_string("include");
3680
194
}
3681
194
#line 3682 "src/parser.c"
3682
194
    break;
3683
3684
8
  case 140: /* Keyword: "if"  */
3685
8
#line 847 "src/parser.y"
3686
8
     {
3687
8
  (yyval.literal) = jv_string("if");
3688
8
}
3689
8
#line 3690 "src/parser.c"
3690
8
    break;
3691
3692
487
  case 141: /* Keyword: "then"  */
3693
487
#line 850 "src/parser.y"
3694
487
       {
3695
487
  (yyval.literal) = jv_string("then");
3696
487
}
3697
487
#line 3698 "src/parser.c"
3698
487
    break;
3699
3700
137
  case 142: /* Keyword: "else"  */
3701
137
#line 853 "src/parser.y"
3702
137
       {
3703
137
  (yyval.literal) = jv_string("else");
3704
137
}
3705
137
#line 3706 "src/parser.c"
3706
137
    break;
3707
3708
184
  case 143: /* Keyword: "elif"  */
3709
184
#line 856 "src/parser.y"
3710
184
       {
3711
184
  (yyval.literal) = jv_string("elif");
3712
184
}
3713
184
#line 3714 "src/parser.c"
3714
184
    break;
3715
3716
0
  case 144: /* Keyword: "reduce"  */
3717
0
#line 859 "src/parser.y"
3718
0
         {
3719
0
  (yyval.literal) = jv_string("reduce");
3720
0
}
3721
0
#line 3722 "src/parser.c"
3722
0
    break;
3723
3724
0
  case 145: /* Keyword: "foreach"  */
3725
0
#line 862 "src/parser.y"
3726
0
          {
3727
0
  (yyval.literal) = jv_string("foreach");
3728
0
}
3729
0
#line 3730 "src/parser.c"
3730
0
    break;
3731
3732
578
  case 146: /* Keyword: "end"  */
3733
578
#line 865 "src/parser.y"
3734
578
      {
3735
578
  (yyval.literal) = jv_string("end");
3736
578
}
3737
578
#line 3738 "src/parser.c"
3738
578
    break;
3739
3740
215
  case 147: /* Keyword: "and"  */
3741
215
#line 868 "src/parser.y"
3742
215
      {
3743
215
  (yyval.literal) = jv_string("and");
3744
215
}
3745
215
#line 3746 "src/parser.c"
3746
215
    break;
3747
3748
221
  case 148: /* Keyword: "or"  */
3749
221
#line 871 "src/parser.y"
3750
221
     {
3751
221
  (yyval.literal) = jv_string("or");
3752
221
}
3753
221
#line 3754 "src/parser.c"
3754
221
    break;
3755
3756
174
  case 149: /* Keyword: "try"  */
3757
174
#line 874 "src/parser.y"
3758
174
      {
3759
174
  (yyval.literal) = jv_string("try");
3760
174
}
3761
174
#line 3762 "src/parser.c"
3762
174
    break;
3763
3764
1.36k
  case 150: /* Keyword: "catch"  */
3765
1.36k
#line 877 "src/parser.y"
3766
1.36k
        {
3767
1.36k
  (yyval.literal) = jv_string("catch");
3768
1.36k
}
3769
1.36k
#line 3770 "src/parser.c"
3770
1.36k
    break;
3771
3772
62
  case 151: /* Keyword: "label"  */
3773
62
#line 880 "src/parser.y"
3774
62
        {
3775
62
  (yyval.literal) = jv_string("label");
3776
62
}
3777
62
#line 3778 "src/parser.c"
3778
62
    break;
3779
3780
268
  case 152: /* Keyword: "break"  */
3781
268
#line 883 "src/parser.y"
3782
268
        {
3783
268
  (yyval.literal) = jv_string("break");
3784
268
}
3785
268
#line 3786 "src/parser.c"
3786
268
    break;
3787
3788
30.3k
  case 153: /* DictPairs: %empty  */
3789
30.3k
#line 889 "src/parser.y"
3790
30.3k
       {
3791
30.3k
  (yyval.blk) = gen_noop();
3792
30.3k
}
3793
30.3k
#line 3794 "src/parser.c"
3794
30.3k
    break;
3795
3796
92.0k
  case 154: /* DictPairs: DictPair  */
3797
92.0k
#line 892 "src/parser.y"
3798
92.0k
         {
3799
92.0k
  (yyval.blk) = (yyvsp[0].blk);
3800
92.0k
}
3801
92.0k
#line 3802 "src/parser.c"
3802
92.0k
    break;
3803
3804
37.2k
  case 155: /* DictPairs: DictPair ',' DictPairs  */
3805
37.2k
#line 895 "src/parser.y"
3806
37.2k
                       {
3807
37.2k
  (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk));
3808
37.2k
}
3809
37.2k
#line 3810 "src/parser.c"
3810
37.2k
    break;
3811
3812
57.1k
  case 156: /* DictPair: IDENT ':' DictExpr  */
3813
57.1k
#line 900 "src/parser.y"
3814
57.1k
                   {
3815
57.1k
  (yyval.blk) = gen_dictpair(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk));
3816
57.1k
}
3817
57.1k
#line 3818 "src/parser.c"
3818
57.1k
    break;
3819
3820
1.13k
  case 157: /* DictPair: Keyword ':' DictExpr  */
3821
1.13k
#line 903 "src/parser.y"
3822
1.13k
                     {
3823
1.13k
  (yyval.blk) = gen_dictpair(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk));
3824
1.13k
}
3825
1.13k
#line 3826 "src/parser.c"
3826
1.13k
    break;
3827
3828
28.7k
  case 158: /* DictPair: String ':' DictExpr  */
3829
28.7k
#line 906 "src/parser.y"
3830
28.7k
                    {
3831
28.7k
  (yyval.blk) = gen_dictpair((yyvsp[-2].blk), (yyvsp[0].blk));
3832
28.7k
}
3833
28.7k
#line 3834 "src/parser.c"
3834
28.7k
    break;
3835
3836
303
  case 159: /* DictPair: String  */
3837
303
#line 909 "src/parser.y"
3838
303
       {
3839
303
  (yyval.blk) = gen_dictpair((yyvsp[0].blk), BLOCK(gen_op_simple(POP), gen_op_simple(DUP2),
3840
303
                              gen_op_simple(DUP2), gen_op_simple(INDEX)));
3841
303
}
3842
303
#line 3843 "src/parser.c"
3843
303
    break;
3844
3845
424
  case 160: /* DictPair: BINDING ':' DictExpr  */
3846
424
#line 913 "src/parser.y"
3847
424
                     {
3848
424
  (yyval.blk) = gen_dictpair(gen_location((yyloc), locations, gen_op_unbound(LOADV, jv_string_value((yyvsp[-2].literal)))),
3849
424
                    (yyvsp[0].blk));
3850
424
  jv_free((yyvsp[-2].literal));
3851
424
}
3852
424
#line 3853 "src/parser.c"
3853
424
    break;
3854
3855
162
  case 161: /* DictPair: BINDING  */
3856
162
#line 918 "src/parser.y"
3857
162
        {
3858
162
  (yyval.blk) = gen_dictpair(gen_const((yyvsp[0].literal)),
3859
162
                    gen_location((yyloc), locations, gen_op_unbound(LOADV, jv_string_value((yyvsp[0].literal)))));
3860
162
}
3861
162
#line 3862 "src/parser.c"
3862
162
    break;
3863
3864
8.57k
  case 162: /* DictPair: IDENT  */
3865
8.57k
#line 922 "src/parser.y"
3866
8.57k
      {
3867
8.57k
  (yyval.blk) = gen_dictpair(gen_const(jv_copy((yyvsp[0].literal))),
3868
8.57k
                    gen_index(gen_noop(), gen_const((yyvsp[0].literal))));
3869
8.57k
}
3870
8.57k
#line 3871 "src/parser.c"
3871
8.57k
    break;
3872
3873
0
  case 163: /* DictPair: "$__loc__"  */
3874
0
#line 926 "src/parser.y"
3875
0
           {
3876
0
  (yyval.blk) = gen_dictpair(gen_const(jv_string("__loc__")),
3877
0
                    gen_loc_object(&(yyloc), locations));
3878
0
}
3879
0
#line 3880 "src/parser.c"
3880
0
    break;
3881
3882
3.27k
  case 164: /* DictPair: Keyword  */
3883
3.27k
#line 930 "src/parser.y"
3884
3.27k
        {
3885
3.27k
  (yyval.blk) = gen_dictpair(gen_const(jv_copy((yyvsp[0].literal))),
3886
3.27k
                    gen_index(gen_noop(), gen_const((yyvsp[0].literal))));
3887
3.27k
}
3888
3.27k
#line 3889 "src/parser.c"
3889
3.27k
    break;
3890
3891
2.77k
  case 165: /* DictPair: '(' Query ')' ':' DictExpr  */
3892
2.77k
#line 934 "src/parser.y"
3893
2.77k
                           {
3894
2.77k
  jv msg = check_object_key((yyvsp[-3].blk));
3895
2.77k
  if (jv_is_valid(msg)) {
3896
455
    FAIL((yylsp[-3]), jv_string_value(msg));
3897
455
  }
3898
2.77k
  jv_free(msg);
3899
2.77k
  (yyval.blk) = gen_dictpair((yyvsp[-3].blk), (yyvsp[0].blk));
3900
2.77k
}
3901
2.77k
#line 3902 "src/parser.c"
3902
2.77k
    break;
3903
3904
32.2k
  case 166: /* DictPair: error ':' DictExpr  */
3905
32.2k
#line 942 "src/parser.y"
3906
32.2k
                   {
3907
32.2k
  FAIL((yylsp[-2]), "May need parentheses around object key expression");
3908
32.2k
  (yyval.blk) = (yyvsp[0].blk);
3909
32.2k
}
3910
32.2k
#line 3911 "src/parser.c"
3911
32.2k
    break;
3912
3913
975
  case 167: /* DictExpr: DictExpr '|' DictExpr  */
3914
975
#line 948 "src/parser.y"
3915
975
                      {
3916
975
  (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk));
3917
975
}
3918
975
#line 3919 "src/parser.c"
3919
975
    break;
3920
3921
126k
  case 168: /* DictExpr: Expr  */
3922
126k
#line 951 "src/parser.y"
3923
126k
     {
3924
126k
  (yyval.blk) = (yyvsp[0].blk);
3925
126k
}
3926
126k
#line 3927 "src/parser.c"
3927
126k
    break;
3928
3929
3930
0
#line 3931 "src/parser.c"
3931
3932
0
      default: break;
3933
4.86M
    }
3934
  /* User semantic actions sometimes alter yychar, and that requires
3935
     that yytoken be updated with the new translation.  We take the
3936
     approach of translating immediately before every use of yytoken.
3937
     One alternative is translating here after every semantic action,
3938
     but that translation would be missed if the semantic action invokes
3939
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3940
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
3941
     incorrect destructor might then be invoked immediately.  In the
3942
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
3943
     to an incorrect destructor call or verbose syntax error message
3944
     before the lookahead is translated.  */
3945
4.86M
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
3946
3947
4.86M
  YYPOPSTACK (yylen);
3948
4.86M
  yylen = 0;
3949
3950
4.86M
  *++yyvsp = yyval;
3951
4.86M
  *++yylsp = yyloc;
3952
3953
  /* Now 'shift' the result of the reduction.  Determine what state
3954
     that goes to, based on the state we popped back to and the rule
3955
     number reduced by.  */
3956
4.86M
  {
3957
4.86M
    const int yylhs = yyr1[yyn] - YYNTOKENS;
3958
4.86M
    const int yyi = yypgoto[yylhs] + *yyssp;
3959
4.86M
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
3960
4.86M
               ? yytable[yyi]
3961
4.86M
               : yydefgoto[yylhs]);
3962
4.86M
  }
3963
3964
4.86M
  goto yynewstate;
3965
3966
3967
/*--------------------------------------.
3968
| yyerrlab -- here on detecting error.  |
3969
`--------------------------------------*/
3970
1.78M
yyerrlab:
3971
  /* Make sure we have latest lookahead translation.  See comments at
3972
     user semantic actions for why this is necessary.  */
3973
1.78M
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
3974
  /* If not already recovering from an error, report this error.  */
3975
1.78M
  if (!yyerrstatus)
3976
55.1k
    {
3977
55.1k
      ++yynerrs;
3978
55.1k
      {
3979
55.1k
        yypcontext_t yyctx
3980
55.1k
          = {yyssp, yytoken, &yylloc};
3981
55.1k
        char const *yymsgp = YY_("syntax error");
3982
55.1k
        int yysyntax_error_status;
3983
55.1k
        yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
3984
55.1k
        if (yysyntax_error_status == 0)
3985
55.1k
          yymsgp = yymsg;
3986
0
        else if (yysyntax_error_status == -1)
3987
0
          {
3988
0
            if (yymsg != yymsgbuf)
3989
0
              YYSTACK_FREE (yymsg);
3990
0
            yymsg = YY_CAST (char *,
3991
0
                             YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
3992
0
            if (yymsg)
3993
0
              {
3994
0
                yysyntax_error_status
3995
0
                  = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
3996
0
                yymsgp = yymsg;
3997
0
              }
3998
0
            else
3999
0
              {
4000
0
                yymsg = yymsgbuf;
4001
0
                yymsg_alloc = sizeof yymsgbuf;
4002
0
                yysyntax_error_status = YYENOMEM;
4003
0
              }
4004
0
          }
4005
55.1k
        yyerror (&yylloc, answer, errors, locations, lexer_param_ptr, yymsgp);
4006
55.1k
        if (yysyntax_error_status == YYENOMEM)
4007
0
          YYNOMEM;
4008
55.1k
      }
4009
55.1k
    }
4010
4011
1.78M
  yyerror_range[1] = yylloc;
4012
1.78M
  if (yyerrstatus == 3)
4013
1.68M
    {
4014
      /* If just tried and failed to reuse lookahead token after an
4015
         error, discard it.  */
4016
4017
1.68M
      if (yychar <= YYEOF)
4018
709
        {
4019
          /* Return failure if at end of input.  */
4020
709
          if (yychar == YYEOF)
4021
709
            YYABORT;
4022
709
        }
4023
1.68M
      else
4024
1.68M
        {
4025
1.68M
          yydestruct ("Error: discarding",
4026
1.68M
                      yytoken, &yylval, &yylloc, answer, errors, locations, lexer_param_ptr);
4027
1.68M
          yychar = YYEMPTY;
4028
1.68M
        }
4029
1.68M
    }
4030
4031
  /* Else will try to reuse lookahead token after shifting the error
4032
     token.  */
4033
1.78M
  goto yyerrlab1;
4034
4035
4036
/*---------------------------------------------------.
4037
| yyerrorlab -- error raised explicitly by YYERROR.  |
4038
`---------------------------------------------------*/
4039
1.78M
yyerrorlab:
4040
  /* Pacify compilers when the user code never invokes YYERROR and the
4041
     label yyerrorlab therefore never appears in user code.  */
4042
0
  if (0)
4043
0
    YYERROR;
4044
0
  ++yynerrs;
4045
4046
  /* Do not reclaim the symbols of the rule whose action triggered
4047
     this YYERROR.  */
4048
0
  YYPOPSTACK (yylen);
4049
0
  yylen = 0;
4050
0
  YY_STACK_PRINT (yyss, yyssp);
4051
0
  yystate = *yyssp;
4052
0
  goto yyerrlab1;
4053
4054
4055
/*-------------------------------------------------------------.
4056
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
4057
`-------------------------------------------------------------*/
4058
1.78M
yyerrlab1:
4059
1.78M
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
4060
4061
  /* Pop stack until we find a state that shifts the error token.  */
4062
1.78M
  for (;;)
4063
3.58M
    {
4064
3.58M
      yyn = yypact[yystate];
4065
3.58M
      if (!yypact_value_is_default (yyn))
4066
3.58M
        {
4067
3.58M
          yyn += YYSYMBOL_YYerror;
4068
3.58M
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
4069
1.78M
            {
4070
1.78M
              yyn = yytable[yyn];
4071
1.78M
              if (0 < yyn)
4072
1.78M
                break;
4073
1.78M
            }
4074
3.58M
        }
4075
4076
      /* Pop the current state because it cannot handle the error token.  */
4077
1.80M
      if (yyssp == yyss)
4078
425
        YYABORT;
4079
4080
1.79M
      yyerror_range[1] = *yylsp;
4081
1.79M
      yydestruct ("Error: popping",
4082
1.79M
                  YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, answer, errors, locations, lexer_param_ptr);
4083
1.79M
      YYPOPSTACK (1);
4084
1.79M
      yystate = *yyssp;
4085
1.79M
      YY_STACK_PRINT (yyss, yyssp);
4086
1.79M
    }
4087
4088
1.78M
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
4089
1.78M
  *++yyvsp = yylval;
4090
1.78M
  YY_IGNORE_MAYBE_UNINITIALIZED_END
4091
4092
1.78M
  yyerror_range[2] = yylloc;
4093
1.78M
  ++yylsp;
4094
1.78M
  YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
4095
4096
  /* Shift the error token.  */
4097
1.78M
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
4098
4099
1.78M
  yystate = yyn;
4100
1.78M
  goto yynewstate;
4101
4102
4103
/*-------------------------------------.
4104
| yyacceptlab -- YYACCEPT comes here.  |
4105
`-------------------------------------*/
4106
1.17k
yyacceptlab:
4107
1.17k
  yyresult = 0;
4108
1.17k
  goto yyreturnlab;
4109
4110
4111
/*-----------------------------------.
4112
| yyabortlab -- YYABORT comes here.  |
4113
`-----------------------------------*/
4114
1.13k
yyabortlab:
4115
1.13k
  yyresult = 1;
4116
1.13k
  goto yyreturnlab;
4117
4118
4119
/*-----------------------------------------------------------.
4120
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
4121
`-----------------------------------------------------------*/
4122
1
yyexhaustedlab:
4123
1
  yyerror (&yylloc, answer, errors, locations, lexer_param_ptr, YY_("memory exhausted"));
4124
1
  yyresult = 2;
4125
1
  goto yyreturnlab;
4126
4127
4128
/*----------------------------------------------------------.
4129
| yyreturnlab -- parsing is finished, clean up and return.  |
4130
`----------------------------------------------------------*/
4131
2.31k
yyreturnlab:
4132
2.31k
  if (yychar != YYEMPTY)
4133
1.13k
    {
4134
      /* Make sure we have latest lookahead translation.  See comments at
4135
         user semantic actions for why this is necessary.  */
4136
1.13k
      yytoken = YYTRANSLATE (yychar);
4137
1.13k
      yydestruct ("Cleanup: discarding lookahead",
4138
1.13k
                  yytoken, &yylval, &yylloc, answer, errors, locations, lexer_param_ptr);
4139
1.13k
    }
4140
  /* Do not reclaim the symbols of the rule whose action triggered
4141
     this YYABORT or YYACCEPT.  */
4142
2.31k
  YYPOPSTACK (yylen);
4143
2.31k
  YY_STACK_PRINT (yyss, yyssp);
4144
172k
  while (yyssp != yyss)
4145
170k
    {
4146
170k
      yydestruct ("Cleanup: popping",
4147
170k
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, answer, errors, locations, lexer_param_ptr);
4148
170k
      YYPOPSTACK (1);
4149
170k
    }
4150
2.31k
#ifndef yyoverflow
4151
2.31k
  if (yyss != yyssa)
4152
230
    YYSTACK_FREE (yyss);
4153
2.31k
#endif
4154
2.31k
  if (yymsg != yymsgbuf)
4155
0
    YYSTACK_FREE (yymsg);
4156
2.31k
  return yyresult;
4157
1.78M
}
4158
4159
#line 954 "src/parser.y"
4160
4161
4162
2.31k
int jq_parse(struct locfile* locations, block* answer) {
4163
2.31k
  struct lexer_param scanner;
4164
2.31k
  YY_BUFFER_STATE buf;
4165
2.31k
  jq_yylex_init_extra(0, &scanner.lexer);
4166
2.31k
  buf = jq_yy_scan_bytes(locations->data, locations->length, scanner.lexer);
4167
2.31k
  int errors = 0;
4168
2.31k
  *answer = gen_noop();
4169
2.31k
  yyparse(answer, &errors, locations, &scanner);
4170
2.31k
  jq_yy_delete_buffer(buf, scanner.lexer);
4171
2.31k
  jq_yylex_destroy(scanner.lexer);
4172
2.31k
  if (errors > 0) {
4173
1.16k
    block_free(*answer);
4174
1.16k
    *answer = gen_noop();
4175
1.16k
  }
4176
2.31k
  return errors;
4177
2.31k
}
4178
4179
560
int jq_parse_library(struct locfile* locations, block* answer) {
4180
560
  int errs = jq_parse(locations, answer);
4181
560
  if (errs) return errs;
4182
560
  if (block_has_main(*answer)) {
4183
0
    locfile_locate(locations, UNKNOWN_LOCATION, "jq: error: library should only have function definitions, not a main expression");
4184
0
    return 1;
4185
0
  }
4186
560
  assert(block_has_only_binders_and_imports(*answer, OP_IS_CALL_PSEUDO));
4187
560
  return 0;
4188
560
}