summaryrefslogtreecommitdiff
path: root/src/prebuilt/wasm-ast-parser-gen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/prebuilt/wasm-ast-parser-gen.c')
-rw-r--r--src/prebuilt/wasm-ast-parser-gen.c2120
1 files changed, 1302 insertions, 818 deletions
diff --git a/src/prebuilt/wasm-ast-parser-gen.c b/src/prebuilt/wasm-ast-parser-gen.c
index 503ffd57..a87794b2 100644
--- a/src/prebuilt/wasm-ast-parser-gen.c
+++ b/src/prebuilt/wasm-ast-parser-gen.c
@@ -119,6 +119,15 @@
#define USE_NATURAL_ALIGNMENT (~0)
+static WasmExprList join_exprs1(WasmLocation* loc, WasmExpr* expr1);
+static WasmExprList join_exprs2(WasmLocation* loc, WasmExprList* expr1,
+ WasmExpr* expr2);
+static WasmExprList join_exprs3(WasmLocation* loc, WasmExprList* expr1,
+ WasmExprList* expr2, WasmExpr* expr3);
+static WasmExprList join_exprs4(WasmLocation* loc, WasmExprList* expr1,
+ WasmExprList* expr2, WasmExprList* expr3,
+ WasmExpr* expr4);
+
static WasmFuncField* new_func_field(WasmAllocator* allocator) {
return wasm_alloc_zero(allocator, sizeof(WasmFuncField), WASM_DEFAULT_ALIGN);
}
@@ -166,7 +175,7 @@ static void on_read_binary_error(uint32_t offset, const char* error,
#define wasm_ast_parser_lex wasm_ast_lexer_lex
-#line 170 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:339 */
+#line 179 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -219,52 +228,54 @@ extern int wasm_ast_parser_debug;
WASM_TOKEN_TYPE_VAR = 264,
WASM_TOKEN_TYPE_VALUE_TYPE = 265,
WASM_TOKEN_TYPE_NOP = 266,
- WASM_TOKEN_TYPE_BLOCK = 267,
- WASM_TOKEN_TYPE_IF = 268,
- WASM_TOKEN_TYPE_THEN = 269,
- WASM_TOKEN_TYPE_ELSE = 270,
- WASM_TOKEN_TYPE_LOOP = 271,
- WASM_TOKEN_TYPE_BR = 272,
- WASM_TOKEN_TYPE_BR_IF = 273,
- WASM_TOKEN_TYPE_BR_TABLE = 274,
- WASM_TOKEN_TYPE_CASE = 275,
- WASM_TOKEN_TYPE_CALL = 276,
- WASM_TOKEN_TYPE_CALL_IMPORT = 277,
- WASM_TOKEN_TYPE_CALL_INDIRECT = 278,
- WASM_TOKEN_TYPE_RETURN = 279,
- WASM_TOKEN_TYPE_GET_LOCAL = 280,
- WASM_TOKEN_TYPE_SET_LOCAL = 281,
- WASM_TOKEN_TYPE_LOAD = 282,
- WASM_TOKEN_TYPE_STORE = 283,
- WASM_TOKEN_TYPE_OFFSET = 284,
- WASM_TOKEN_TYPE_ALIGN = 285,
- WASM_TOKEN_TYPE_CONST = 286,
- WASM_TOKEN_TYPE_UNARY = 287,
- WASM_TOKEN_TYPE_BINARY = 288,
- WASM_TOKEN_TYPE_COMPARE = 289,
- WASM_TOKEN_TYPE_CONVERT = 290,
- WASM_TOKEN_TYPE_SELECT = 291,
- WASM_TOKEN_TYPE_FUNC = 292,
- WASM_TOKEN_TYPE_START = 293,
- WASM_TOKEN_TYPE_TYPE = 294,
- WASM_TOKEN_TYPE_PARAM = 295,
- WASM_TOKEN_TYPE_RESULT = 296,
- WASM_TOKEN_TYPE_LOCAL = 297,
- WASM_TOKEN_TYPE_MODULE = 298,
- WASM_TOKEN_TYPE_MEMORY = 299,
- WASM_TOKEN_TYPE_SEGMENT = 300,
- WASM_TOKEN_TYPE_IMPORT = 301,
- WASM_TOKEN_TYPE_EXPORT = 302,
- WASM_TOKEN_TYPE_TABLE = 303,
- WASM_TOKEN_TYPE_UNREACHABLE = 304,
- WASM_TOKEN_TYPE_CURRENT_MEMORY = 305,
- WASM_TOKEN_TYPE_GROW_MEMORY = 306,
- WASM_TOKEN_TYPE_ASSERT_INVALID = 307,
- WASM_TOKEN_TYPE_ASSERT_RETURN = 308,
- WASM_TOKEN_TYPE_ASSERT_RETURN_NAN = 309,
- WASM_TOKEN_TYPE_ASSERT_TRAP = 310,
- WASM_TOKEN_TYPE_INVOKE = 311,
- WASM_TOKEN_TYPE_LOW = 312
+ WASM_TOKEN_TYPE_DROP = 267,
+ WASM_TOKEN_TYPE_BLOCK = 268,
+ WASM_TOKEN_TYPE_END = 269,
+ WASM_TOKEN_TYPE_IF = 270,
+ WASM_TOKEN_TYPE_THEN = 271,
+ WASM_TOKEN_TYPE_ELSE = 272,
+ WASM_TOKEN_TYPE_LOOP = 273,
+ WASM_TOKEN_TYPE_BR = 274,
+ WASM_TOKEN_TYPE_BR_IF = 275,
+ WASM_TOKEN_TYPE_BR_TABLE = 276,
+ WASM_TOKEN_TYPE_CALL = 277,
+ WASM_TOKEN_TYPE_CALL_IMPORT = 278,
+ WASM_TOKEN_TYPE_CALL_INDIRECT = 279,
+ WASM_TOKEN_TYPE_RETURN = 280,
+ WASM_TOKEN_TYPE_GET_LOCAL = 281,
+ WASM_TOKEN_TYPE_SET_LOCAL = 282,
+ WASM_TOKEN_TYPE_TEE_LOCAL = 283,
+ WASM_TOKEN_TYPE_LOAD = 284,
+ WASM_TOKEN_TYPE_STORE = 285,
+ WASM_TOKEN_TYPE_OFFSET = 286,
+ WASM_TOKEN_TYPE_ALIGN = 287,
+ WASM_TOKEN_TYPE_CONST = 288,
+ WASM_TOKEN_TYPE_UNARY = 289,
+ WASM_TOKEN_TYPE_BINARY = 290,
+ WASM_TOKEN_TYPE_COMPARE = 291,
+ WASM_TOKEN_TYPE_CONVERT = 292,
+ WASM_TOKEN_TYPE_SELECT = 293,
+ WASM_TOKEN_TYPE_UNREACHABLE = 294,
+ WASM_TOKEN_TYPE_CURRENT_MEMORY = 295,
+ WASM_TOKEN_TYPE_GROW_MEMORY = 296,
+ WASM_TOKEN_TYPE_FUNC = 297,
+ WASM_TOKEN_TYPE_START = 298,
+ WASM_TOKEN_TYPE_TYPE = 299,
+ WASM_TOKEN_TYPE_PARAM = 300,
+ WASM_TOKEN_TYPE_RESULT = 301,
+ WASM_TOKEN_TYPE_LOCAL = 302,
+ WASM_TOKEN_TYPE_MODULE = 303,
+ WASM_TOKEN_TYPE_MEMORY = 304,
+ WASM_TOKEN_TYPE_SEGMENT = 305,
+ WASM_TOKEN_TYPE_IMPORT = 306,
+ WASM_TOKEN_TYPE_EXPORT = 307,
+ WASM_TOKEN_TYPE_TABLE = 308,
+ WASM_TOKEN_TYPE_ASSERT_INVALID = 309,
+ WASM_TOKEN_TYPE_ASSERT_RETURN = 310,
+ WASM_TOKEN_TYPE_ASSERT_RETURN_NAN = 311,
+ WASM_TOKEN_TYPE_ASSERT_TRAP = 312,
+ WASM_TOKEN_TYPE_INVOKE = 313,
+ WASM_TOKEN_TYPE_LOW = 314
};
#endif
@@ -297,7 +308,7 @@ int wasm_ast_parser_parse (WasmAstLexer* lexer, WasmAstParser* parser);
/* Copy the second part of user declarations. */
-#line 301 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:358 */
+#line 312 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -541,21 +552,21 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 8
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 373
+#define YYLAST 689
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 58
+#define YYNTOKENS 60
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 46
+#define YYNNTS 47
/* YYNRULES -- Number of rules. */
-#define YYNRULES 122
+#define YYNRULES 154
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 274
+#define YYNSTATES 344
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 312
+#define YYMAXUTOK 314
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -595,26 +606,29 @@ static const yytype_uint8 yytranslate[] =
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57
+ 55, 56, 57, 58, 59
};
#if WASM_AST_PARSER_DEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 203, 203, 209, 222, 223, 229, 230, 234, 238,
- 245, 249, 253, 260, 272, 279, 280, 286, 290, 306,
- 313, 314, 318, 319, 329, 330, 341, 344, 347, 352,
- 357, 363, 369, 377, 382, 388, 394, 400, 405, 409,
- 416, 423, 429, 435, 442, 446, 451, 458, 466, 478,
- 483, 489, 495, 501, 506, 509, 513, 519, 520, 523,
- 527, 535, 536, 541, 542, 548, 554, 564, 570, 576,
- 586, 589, 644, 653, 663, 670, 681, 682, 689, 693,
- 706, 714, 715, 722, 734, 745, 751, 760, 764, 771,
- 775, 782, 790, 796, 806, 813, 819, 822, 861, 882,
- 899, 907, 915, 933, 941, 952, 986, 995, 1019, 1025,
- 1032, 1038, 1046, 1053, 1063, 1064, 1072, 1084, 1085, 1088,
- 1089, 1096, 1105
+ 0, 212, 212, 218, 231, 232, 238, 239, 243, 247,
+ 254, 265, 269, 273, 280, 292, 299, 300, 306, 310,
+ 326, 333, 334, 336, 339, 340, 350, 351, 362, 363,
+ 366, 369, 372, 375, 380, 385, 394, 399, 404, 410,
+ 413, 418, 425, 428, 432, 436, 440, 444, 448, 452,
+ 458, 464, 476, 480, 484, 488, 492, 495, 500, 503,
+ 506, 509, 515, 521, 531, 537, 543, 549, 555, 562,
+ 569, 573, 577, 582, 588, 594, 602, 608, 612, 617,
+ 622, 627, 632, 637, 642, 649, 656, 669, 674, 679,
+ 684, 689, 693, 699, 700, 710, 711, 717, 723, 733,
+ 739, 745, 755, 758, 813, 822, 832, 839, 850, 851,
+ 858, 862, 875, 883, 884, 891, 903, 914, 920, 929,
+ 933, 940, 944, 951, 959, 965, 975, 982, 988, 991,
+ 1030, 1051, 1068, 1076, 1084, 1102, 1110, 1121, 1155, 1164,
+ 1188, 1194, 1201, 1207, 1215, 1222, 1232, 1233, 1241, 1253,
+ 1254, 1257, 1258, 1265, 1274
};
#endif
@@ -624,23 +638,23 @@ static const yytype_uint16 yyrline[] =
static const char *const yytname[] =
{
"\"EOF\"", "error", "$undefined", "\"(\"", "\")\"", "NAT", "INT",
- "FLOAT", "TEXT", "VAR", "VALUE_TYPE", "NOP", "BLOCK", "IF", "THEN",
- "ELSE", "LOOP", "BR", "BR_IF", "BR_TABLE", "CASE", "CALL", "CALL_IMPORT",
- "CALL_INDIRECT", "RETURN", "GET_LOCAL", "SET_LOCAL", "LOAD", "STORE",
- "OFFSET", "ALIGN", "CONST", "UNARY", "BINARY", "COMPARE", "CONVERT",
- "SELECT", "FUNC", "START", "TYPE", "PARAM", "RESULT", "LOCAL", "MODULE",
- "MEMORY", "SEGMENT", "IMPORT", "EXPORT", "TABLE", "UNREACHABLE",
- "CURRENT_MEMORY", "GROW_MEMORY", "ASSERT_INVALID", "ASSERT_RETURN",
- "ASSERT_RETURN_NAN", "ASSERT_TRAP", "INVOKE", "LOW", "$accept",
- "text_list", "value_type_list", "func_type", "literal", "var",
- "var_list", "bind_var", "quoted_text", "segment_contents", "labeling",
- "offset", "align", "expr", "expr1", "expr_opt", "non_empty_expr_list",
- "expr_list", "func_fields", "func_body", "type_use", "func_info", "func",
- "export_opt", "start", "segment_address", "segment", "segment_list",
- "initial_pages", "max_pages", "memory", "type_def", "table", "import",
- "export", "export_memory", "module_fields", "raw_module", "module",
- "cmd", "cmd_list", "const", "const_opt", "const_list", "script",
- "script_start", YY_NULLPTR
+ "FLOAT", "TEXT", "VAR", "VALUE_TYPE", "NOP", "DROP", "BLOCK", "END",
+ "IF", "THEN", "ELSE", "LOOP", "BR", "BR_IF", "BR_TABLE", "CALL",
+ "CALL_IMPORT", "CALL_INDIRECT", "RETURN", "GET_LOCAL", "SET_LOCAL",
+ "TEE_LOCAL", "LOAD", "STORE", "OFFSET", "ALIGN", "CONST", "UNARY",
+ "BINARY", "COMPARE", "CONVERT", "SELECT", "UNREACHABLE",
+ "CURRENT_MEMORY", "GROW_MEMORY", "FUNC", "START", "TYPE", "PARAM",
+ "RESULT", "LOCAL", "MODULE", "MEMORY", "SEGMENT", "IMPORT", "EXPORT",
+ "TABLE", "ASSERT_INVALID", "ASSERT_RETURN", "ASSERT_RETURN_NAN",
+ "ASSERT_TRAP", "INVOKE", "LOW", "$accept", "text_list",
+ "value_type_list", "func_type", "nat", "literal", "var", "var_list",
+ "bind_var", "quoted_text", "segment_contents", "labeling", "labeling1",
+ "offset", "align", "expr", "op", "expr1", "expr_list", "func_fields",
+ "func_body", "type_use", "func_info", "func", "export_opt", "start",
+ "segment_address", "segment", "segment_list", "initial_pages",
+ "max_pages", "memory", "type_def", "table", "import", "export",
+ "export_memory", "module_fields", "raw_module", "module", "cmd",
+ "cmd_list", "const", "const_opt", "const_list", "script", "script_start", YY_NULLPTR
};
#endif
@@ -654,16 +668,16 @@ static const yytype_uint16 yytoknum[] =
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 307, 308, 309, 310, 311, 312
+ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314
};
# endif
-#define YYPACT_NINF -210
+#define YYPACT_NINF -257
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-210)))
+ (!!((Yystate) == (-257)))
-#define YYTABLE_NINF -1
+#define YYTABLE_NINF -94
#define yytable_value_is_error(Yytable_value) \
0
@@ -672,34 +686,41 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- -210, 7, -210, 18, 53, -210, -210, -210, -210, 38,
- 33, 48, 67, 87, 68, -210, 75, 91, 13, 68,
- 36, 45, 47, -210, -210, -210, -210, 76, -210, -210,
- -210, -210, -210, -210, -210, -210, -210, 106, 68, 68,
- 68, 94, 68, 82, 23, 107, 108, 68, -210, -210,
- -210, -210, -210, 88, -210, -210, -210, 28, -210, -210,
- 130, 117, -210, 152, -210, 151, 68, 68, 19, 73,
- 138, 141, 143, 120, 158, 154, -210, 155, -210, -210,
- -210, 156, 157, -210, 159, 123, -210, 145, -210, 68,
- 160, 161, 162, -210, -210, 169, 174, 68, -210, -210,
- -210, 183, -210, 164, 155, 164, 82, 82, -210, 82,
- 82, 82, 155, 82, 82, 166, 166, 120, 155, 155,
- 155, 155, 155, 82, 164, 178, 164, -210, -210, 155,
- 192, 156, 197, 322, -210, 199, 198, -210, 110, 200,
- 159, 168, -210, -210, 149, 160, 90, 201, 202, -210,
- -210, -210, 210, -210, 215, -210, -210, 155, 225, 164,
- 155, 155, 155, 82, 155, 155, 155, -210, -210, -210,
- 155, -210, 173, 173, -210, -210, 155, 155, -210, 155,
- 232, 29, 219, 233, 30, 228, -210, -210, 238, -210,
- -210, -210, 234, 239, 241, 242, -210, 251, 256, -210,
- -210, -210, -210, -210, 240, 155, 155, -210, -210, 155,
- 155, -210, -210, 155, -210, -210, 155, 155, -210, -210,
- 155, -210, 156, -210, 265, 243, 243, 266, -210, 64,
- 273, -210, 274, -210, 38, -210, -210, 164, -210, -210,
- -210, 155, -210, -210, 155, -210, -210, 156, 281, -210,
- -210, 243, 276, -210, -210, 272, 277, 155, -210, -210,
- -210, -210, 244, -210, 278, 285, 280, 282, 269, -210,
- 164, 155, 283, -210
+ -257, 30, -257, 40, 64, -257, -257, -257, -257, 68,
+ 45, 92, 94, 101, 80, -257, 49, 15, 77, 80,
+ 58, 71, 97, -257, -257, -257, -257, -7, -257, -257,
+ -257, -257, -257, -257, -257, -257, -257, 148, 80, 80,
+ 80, 52, 80, 85, 29, 133, 125, 80, -257, -257,
+ -257, -257, -257, 132, -257, -257, -257, 245, -257, -257,
+ 158, 128, -257, 184, -257, 183, 80, 80, 21, 131,
+ 155, 157, 170, 76, 510, -257, -257, 180, 180, 180,
+ 185, 185, 185, 85, 85, 85, -257, 85, 85, 85,
+ 160, 160, 76, -257, -257, -257, -257, -257, -257, -257,
+ -257, 323, 362, -257, -257, -257, -257, 401, 188, -257,
+ 190, 152, -257, 174, -257, 80, 194, 195, 196, -257,
+ -257, 198, 200, 80, -257, -257, -257, 201, -257, 362,
+ 180, 362, 180, 85, 85, -257, 85, 85, 85, 362,
+ 85, 85, 85, 160, 160, 76, 362, 362, 362, 362,
+ 362, -257, -257, 362, 85, 180, 197, 180, 202, -257,
+ 362, -257, 362, 362, 180, -257, 85, 85, -257, -257,
+ -257, -257, -257, -257, -257, -257, 166, 166, -257, 401,
+ 204, 648, -257, 547, 205, -257, 134, 206, 190, 162,
+ -257, -257, 179, 194, 65, 209, 210, -257, -257, -257,
+ 211, -257, 212, -257, -257, 362, 440, 203, 362, 180,
+ 362, 362, 85, 362, 362, 362, -257, -257, 362, 362,
+ 166, 166, -257, -257, 362, 362, -257, 362, -257, 213,
+ 37, 216, 215, 39, 217, -257, 207, 137, 208, 362,
+ -257, -257, 85, -257, -257, -257, 219, -257, -257, -257,
+ 218, 225, 226, 228, -257, 227, 230, -257, -257, -257,
+ -257, -257, 617, 284, 362, -257, 362, -257, 362, 362,
+ -257, -257, 362, -257, -257, 362, 362, -257, -257, 362,
+ -257, 401, -257, 231, 479, 479, 232, -257, -257, 180,
+ -257, 223, 98, -257, 62, 234, -257, 235, -257, 68,
+ -257, -257, 180, 284, -257, -257, -257, 362, -257, -257,
+ 362, -257, -257, 401, 584, -257, -257, 479, 362, -257,
+ 237, -257, -257, 238, 239, 362, -257, -257, -257, -257,
+ 233, 199, -257, 246, -257, 241, 250, 251, 242, -257,
+ 180, 362, 257, -257
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -707,211 +728,293 @@ static const yytype_int16 yypact[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 114, 121, 122, 0, 0, 107, 108, 115, 1, 96,
+ 146, 153, 154, 0, 0, 139, 140, 147, 1, 128,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
- 0, 0, 0, 18, 119, 106, 3, 0, 105, 97,
- 104, 103, 102, 101, 98, 99, 100, 0, 0, 0,
- 0, 0, 76, 0, 0, 0, 0, 0, 15, 110,
- 119, 119, 119, 0, 109, 120, 77, 61, 13, 14,
- 0, 0, 17, 0, 83, 81, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 61, 59, 62, 67, 71,
- 63, 61, 0, 78, 6, 0, 84, 0, 81, 0,
- 6, 0, 0, 89, 16, 117, 0, 0, 11, 10,
- 12, 0, 27, 20, 0, 20, 0, 0, 15, 0,
- 0, 0, 57, 0, 0, 22, 22, 0, 0, 0,
- 0, 0, 0, 0, 4, 0, 4, 54, 55, 0,
- 0, 61, 0, 0, 60, 0, 0, 74, 0, 0,
- 6, 0, 86, 82, 0, 6, 0, 0, 0, 95,
- 94, 118, 0, 112, 0, 116, 21, 61, 0, 21,
- 61, 57, 0, 0, 61, 61, 0, 58, 38, 44,
- 0, 23, 24, 24, 48, 49, 0, 0, 53, 0,
- 0, 0, 0, 0, 0, 0, 56, 26, 0, 75,
- 72, 4, 0, 0, 0, 0, 85, 0, 0, 92,
- 90, 111, 113, 28, 0, 29, 61, 35, 37, 33,
- 16, 41, 42, 61, 45, 25, 0, 0, 50, 52,
- 0, 70, 61, 5, 0, 61, 61, 0, 73, 0,
- 0, 87, 0, 79, 0, 93, 91, 20, 31, 36,
- 34, 39, 43, 46, 0, 51, 65, 61, 0, 64,
- 68, 61, 7, 9, 88, 19, 0, 61, 40, 47,
- 66, 69, 0, 80, 0, 0, 30, 0, 0, 8,
- 20, 61, 0, 32
+ 0, 0, 0, 19, 151, 138, 3, 0, 137, 129,
+ 136, 135, 134, 133, 130, 131, 132, 0, 0, 0,
+ 0, 0, 108, 0, 0, 0, 0, 0, 16, 142,
+ 151, 151, 151, 0, 141, 152, 109, 93, 14, 15,
+ 0, 0, 18, 0, 115, 113, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 31, 32, 21, 21, 21,
+ 0, 0, 0, 0, 0, 0, 39, 0, 0, 0,
+ 24, 24, 0, 52, 53, 54, 55, 42, 30, 56,
+ 57, 93, 93, 28, 99, 103, 95, 93, 0, 110,
+ 6, 0, 116, 0, 113, 0, 6, 0, 0, 121,
+ 17, 149, 0, 0, 11, 12, 13, 0, 59, 0,
+ 21, 93, 21, 0, 0, 16, 0, 0, 0, 70,
+ 0, 0, 0, 24, 24, 0, 0, 0, 0, 0,
+ 0, 58, 91, 0, 0, 4, 0, 4, 0, 23,
+ 93, 22, 93, 93, 22, 10, 0, 0, 16, 43,
+ 44, 45, 46, 47, 48, 25, 26, 26, 51, 93,
+ 0, 0, 94, 0, 0, 106, 0, 0, 6, 0,
+ 118, 114, 0, 6, 0, 0, 0, 127, 126, 150,
+ 0, 144, 0, 148, 60, 93, 93, 0, 93, 22,
+ 64, 0, 0, 93, 93, 0, 71, 81, 0, 0,
+ 26, 26, 86, 87, 0, 0, 90, 0, 92, 0,
+ 0, 0, 0, 0, 0, 29, 0, 0, 0, 93,
+ 36, 37, 0, 27, 49, 50, 0, 107, 104, 4,
+ 0, 0, 0, 0, 117, 0, 0, 124, 122, 143,
+ 145, 61, 0, 72, 93, 62, 93, 65, 66, 17,
+ 78, 79, 93, 82, 83, 0, 0, 88, 89, 0,
+ 102, 93, 5, 0, 93, 93, 0, 33, 40, 21,
+ 34, 0, 38, 105, 0, 0, 119, 0, 111, 0,
+ 125, 123, 21, 73, 76, 63, 67, 68, 80, 84,
+ 0, 77, 97, 93, 0, 96, 100, 93, 93, 35,
+ 7, 9, 120, 20, 0, 93, 69, 85, 98, 101,
+ 0, 0, 112, 0, 41, 0, 74, 0, 0, 8,
+ 21, 93, 0, 75
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -210, 54, -125, -76, 179, -52, 193, -38, -17, -210,
- -102, 194, 146, -77, -210, 150, -210, -153, -209, -178,
- -70, -66, -210, -210, -210, -210, -210, 230, -210, -210,
- -210, -210, -210, -210, -210, -210, -210, 310, -210, -210,
- -210, 226, -210, 86, -210, -210
+ -257, -57, -149, -102, 104, -80, -10, -101, -40, 129,
+ -257, -78, -68, -75, -170, -126, -257, -257, -100, -242,
+ -256, -91, -92, -257, -257, -257, -257, -257, 135, -257,
+ -257, -257, -257, -257, -257, -257, -257, -257, 266, -257,
+ -257, -257, 156, -257, 95, -257, -257
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 16, 181, 139, 101, 60, 69, 156, 24, 256,
- 157, 172, 216, 76, 130, 168, 77, 78, 79, 80,
- 81, 82, 29, 57, 30, 234, 143, 87, 65, 88,
- 31, 32, 33, 34, 35, 36, 17, 5, 6, 7,
- 1, 55, 152, 41, 2, 3
+ -1, 16, 230, 187, 166, 127, 60, 69, 159, 24,
+ 324, 160, 161, 176, 244, 102, 103, 158, 104, 105,
+ 106, 107, 108, 29, 57, 30, 299, 191, 113, 65,
+ 114, 31, 32, 33, 34, 35, 36, 17, 5, 6,
+ 7, 1, 55, 200, 41, 2, 3
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */
-static const yytype_uint16 yytable[] =
+static const yytype_int16 yytable[] =
{
- 134, 184, 37, 160, 203, 131, 63, 207, 66, 132,
- 4, 211, 212, 246, 147, 136, 92, 94, 8, 75,
- 148, 50, 51, 52, 58, 56, 61, 158, 59, 67,
- 68, 74, 62, 222, 226, 167, 18, 62, 260, 223,
- 223, 175, 176, 177, 178, 179, 15, 249, 250, 89,
- 90, 20, 186, 239, 161, 162, 9, 164, 165, 166,
- 242, 169, 170, 91, 194, 188, 229, 159, 252, 197,
- 21, 180, 145, 261, 223, 198, 23, 93, 58, 25,
- 154, 205, 59, 26, 167, 209, 182, 58, 185, 213,
- 22, 59, 38, 214, 27, 28, 9, 53, 54, 218,
- 219, 39, 220, 40, 264, 10, 11, 12, 13, 14,
- 49, 210, 64, 42, 43, 44, 23, 62, 272, 73,
- 45, 206, 46, 47, 48, 98, 99, 100, 238, 123,
- 191, 192, 240, 241, 83, 257, 70, 71, 72, 243,
- 244, 53, 95, 245, 53, 96, 53, 97, 141, 142,
- 191, 192, 141, 196, 84, 85, 86, 74, 133, 135,
- 140, 137, 138, 146, 258, 149, 150, 259, 271, 102,
- 103, 104, 53, 62, 105, 106, 107, 108, 153, 109,
- 110, 111, 112, 113, 114, 115, 116, 155, 183, 117,
- 118, 119, 120, 121, 122, 171, 187, 123, 124, 125,
- 126, 189, 190, 215, 193, 199, 200, 127, 128, 129,
- 102, 103, 104, 195, 201, 105, 106, 107, 108, 202,
- 109, 110, 111, 112, 113, 114, 115, 116, 204, 224,
- 117, 118, 119, 120, 121, 122, 221, 225, 227, 124,
- 125, 126, 228, 231, 230, 232, 248, 233, 127, 128,
- 129, 102, 103, 104, 237, 235, 105, 106, 107, 108,
- 236, 109, 110, 111, 112, 113, 114, 115, 116, 247,
- 251, 117, 118, 119, 120, 121, 122, 253, 254, 262,
- 26, 263, 266, 268, 270, 265, 269, 273, 255, 127,
- 128, 129, 102, 103, 104, 267, 174, 105, 106, 107,
- 108, 163, 109, 110, 111, 112, 113, 114, 115, 116,
- 173, 208, 117, 118, 119, 120, 121, 122, 144, 217,
- 19, 151, 0, 126, 0, 0, 0, 0, 0, 0,
- 127, 128, 129, 102, 103, 104, 0, 0, 105, 106,
- 107, 108, 0, 109, 110, 111, 112, 113, 114, 115,
- 116, 0, 0, 117, 118, 119, 120, 121, 122, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 127, 128, 129
+ 162, 163, 182, 204, 63, 206, 66, 245, 233, 180,
+ 179, 164, 178, 216, 195, 184, 177, 101, 27, 28,
+ 223, 224, 225, 226, 227, 196, 58, 228, 315, 316,
+ 59, 207, 61, 4, 212, 42, 43, 44, 62, 312,
+ 8, 281, 45, 285, 46, 47, 48, 282, 18, 282,
+ 275, 276, 205, 25, 208, 53, 54, 26, 118, 120,
+ 236, 329, 237, 238, 209, 222, 320, 242, 220, 221,
+ 117, 328, 282, 169, 170, 171, 15, 172, 173, 174,
+ 263, 124, 125, 126, 267, 268, 252, 246, 23, 272,
+ 58, 255, 273, 274, 59, 20, 239, 21, 277, 278,
+ 294, 279, 256, -17, 22, 261, 182, -17, 265, 154,
+ 249, 250, 9, 270, 271, 231, 38, 234, 10, 11,
+ 12, 13, 14, 210, 211, 9, 213, 214, 215, 39,
+ 217, 218, 219, 23, 62, 119, 58, 303, 64, 291,
+ 59, 266, 306, 307, 229, 70, 71, 72, 37, 309,
+ 310, 288, 49, 311, 289, 40, 240, 241, 53, 121,
+ 53, 122, 109, 182, 304, 73, 305, 50, 51, 52,
+ 110, 56, 308, 53, 123, 67, 68, 189, 190, 249,
+ 250, 326, 189, 254, 327, 167, 168, 111, 112, 62,
+ 165, 175, 185, 186, 188, 115, 116, 194, 243, 197,
+ 198, 53, 269, 182, 201, 203, 235, 232, 247, 248,
+ 251, 318, 253, 257, 258, 259, 260, 280, 330, 284,
+ 264, 287, 290, 293, 325, 333, 283, 286, 295, 296,
+ 297, 300, 292, 298, 301, 313, 317, 319, 321, 322,
+ 331, 342, 323, 332, 193, 335, 26, 334, 74, 192,
+ 336, 337, 202, 338, 62, 339, 75, 76, 77, 340,
+ 78, 343, 341, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 91, 19, 199, 92, 93,
+ 94, 95, 96, 97, 98, 99, 100, 181, 0, 0,
+ 0, 0, 0, 0, 0, 75, 76, 77, 0, 78,
+ 0, -93, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 0, 0, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 74, 0, 0, 0,
+ 0, 0, 0, 0, 75, 76, 77, 0, 78, 0,
+ 0, 79, 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 0, 0, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 181, 0, 0, 0, 0,
+ 0, 0, 0, 75, 76, 77, 0, 78, 0, 0,
+ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 0, 0, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 183, 0, 0, 0, 0, 0,
+ 0, 0, 75, 76, 77, 0, 78, 0, 0, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 0, 0, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 262, 0, 0, 0, 0, 0, 0,
+ 0, 75, 76, 77, 0, 78, 0, 0, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 0, 0, 92, 93, 94, 95, 96, 97, 98,
+ 99, 100, 314, 0, 0, 0, 0, 0, 0, 0,
+ 75, 76, 77, 0, 78, 0, 0, 79, 80, 81,
+ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 0, 0, 92, 93, 94, 95, 96, 97, 98, 99,
+ 100, 128, 129, 130, 0, 131, 0, 0, 132, 133,
+ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+ 144, 0, 0, 145, 146, 147, 148, 149, 150, 151,
+ 152, 153, 0, 0, 154, 155, 156, 157, 128, 129,
+ 130, 0, 131, 0, 0, 132, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 0, 0,
+ 145, 146, 147, 148, 149, 150, 151, 152, 153, 0,
+ 0, 0, 155, 156, 157, 128, 129, 130, 0, 131,
+ 0, 0, 132, 133, 134, 135, 136, 137, 138, 139,
+ 140, 141, 142, 143, 144, 0, 0, 145, 146, 147,
+ 148, 149, 150, 151, 152, 153, 0, 0, 128, 129,
+ 130, 157, 131, 302, 0, 132, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 0, 0,
+ 145, 146, 147, 148, 149, 150, 151, 152, 153, 128,
+ 129, 130, 0, 131, 0, 0, 132, 133, 134, 135,
+ 136, 137, 138, 139, 140, 141, 142, 143, 144, 0,
+ 0, 145, 146, 147, 148, 149, 150, 151, 152, 153
};
static const yytype_int16 yycheck[] =
{
- 77, 126, 19, 105, 157, 75, 44, 160, 46, 75,
- 3, 164, 165, 222, 90, 81, 68, 69, 0, 57,
- 90, 38, 39, 40, 5, 42, 3, 104, 9, 46,
- 47, 3, 9, 4, 4, 112, 3, 9, 247, 10,
- 10, 118, 119, 120, 121, 122, 8, 225, 226, 66,
- 67, 3, 129, 206, 106, 107, 43, 109, 110, 111,
- 213, 113, 114, 44, 140, 131, 191, 105, 4, 145,
- 3, 123, 89, 251, 10, 145, 8, 4, 5, 4,
- 97, 158, 9, 8, 161, 162, 124, 5, 126, 166,
- 3, 9, 56, 170, 3, 4, 43, 3, 4, 176,
- 177, 56, 179, 56, 257, 52, 53, 54, 55, 56,
- 4, 163, 5, 37, 38, 39, 8, 9, 271, 31,
- 44, 159, 46, 47, 48, 5, 6, 7, 205, 39,
- 40, 41, 209, 210, 4, 237, 50, 51, 52, 216,
- 217, 3, 4, 220, 3, 4, 3, 4, 3, 4,
- 40, 41, 3, 4, 37, 3, 5, 3, 3, 3,
- 37, 4, 3, 3, 241, 4, 4, 244, 270, 11,
- 12, 13, 3, 9, 16, 17, 18, 19, 4, 21,
- 22, 23, 24, 25, 26, 27, 28, 4, 10, 31,
- 32, 33, 34, 35, 36, 29, 4, 39, 40, 41,
- 42, 4, 4, 30, 4, 4, 4, 49, 50, 51,
- 11, 12, 13, 45, 4, 16, 17, 18, 19, 4,
- 21, 22, 23, 24, 25, 26, 27, 28, 3, 10,
- 31, 32, 33, 34, 35, 36, 4, 4, 10, 40,
- 41, 42, 4, 4, 10, 4, 3, 5, 49, 50,
- 51, 11, 12, 13, 14, 4, 16, 17, 18, 19,
- 4, 21, 22, 23, 24, 25, 26, 27, 28, 4,
- 4, 31, 32, 33, 34, 35, 36, 4, 4, 3,
- 8, 4, 4, 3, 15, 41, 4, 4, 234, 49,
- 50, 51, 11, 12, 13, 10, 117, 16, 17, 18,
- 19, 108, 21, 22, 23, 24, 25, 26, 27, 28,
- 116, 161, 31, 32, 33, 34, 35, 36, 88, 173,
- 10, 95, -1, 42, -1, -1, -1, -1, -1, -1,
- 49, 50, 51, 11, 12, 13, -1, -1, 16, 17,
- 18, 19, -1, 21, 22, 23, 24, 25, 26, 27,
- 28, -1, -1, 31, 32, 33, 34, 35, 36, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 49, 50, 51
+ 78, 79, 102, 129, 44, 131, 46, 177, 157, 101,
+ 101, 79, 92, 139, 116, 107, 91, 57, 3, 4,
+ 146, 147, 148, 149, 150, 116, 5, 153, 284, 285,
+ 9, 131, 3, 3, 135, 42, 43, 44, 9, 281,
+ 0, 4, 49, 4, 51, 52, 53, 10, 3, 10,
+ 220, 221, 130, 4, 132, 3, 4, 8, 68, 69,
+ 160, 317, 162, 163, 132, 145, 4, 168, 143, 144,
+ 49, 313, 10, 83, 84, 85, 8, 87, 88, 89,
+ 206, 5, 6, 7, 210, 211, 188, 179, 8, 215,
+ 5, 193, 218, 219, 9, 3, 164, 3, 224, 225,
+ 249, 227, 193, 5, 3, 205, 206, 9, 208, 44,
+ 45, 46, 48, 213, 214, 155, 58, 157, 54, 55,
+ 56, 57, 58, 133, 134, 48, 136, 137, 138, 58,
+ 140, 141, 142, 8, 9, 4, 5, 263, 5, 239,
+ 9, 209, 268, 269, 154, 50, 51, 52, 19, 275,
+ 276, 14, 4, 279, 17, 58, 166, 167, 3, 4,
+ 3, 4, 4, 263, 264, 33, 266, 38, 39, 40,
+ 42, 42, 272, 3, 4, 46, 47, 3, 4, 45,
+ 46, 307, 3, 4, 310, 81, 82, 3, 5, 9,
+ 5, 31, 4, 3, 42, 66, 67, 3, 32, 4,
+ 4, 3, 212, 303, 4, 4, 4, 10, 4, 4,
+ 4, 289, 50, 4, 4, 4, 4, 4, 318, 4,
+ 17, 14, 14, 4, 302, 325, 10, 10, 10, 4,
+ 4, 4, 242, 5, 4, 4, 4, 14, 4, 4,
+ 3, 341, 299, 4, 115, 46, 8, 14, 3, 114,
+ 4, 10, 123, 3, 9, 4, 11, 12, 13, 17,
+ 15, 4, 340, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 10, 121, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 3, -1, -1,
+ -1, -1, -1, -1, -1, 11, 12, 13, -1, 15,
+ -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, -1, -1, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 3, -1, -1, -1,
+ -1, -1, -1, -1, 11, 12, 13, -1, 15, -1,
+ -1, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, -1, -1, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 3, -1, -1, -1, -1,
+ -1, -1, -1, 11, 12, 13, -1, 15, -1, -1,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, -1, -1, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 3, -1, -1, -1, -1, -1,
+ -1, -1, 11, 12, 13, -1, 15, -1, -1, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, -1, -1, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 3, -1, -1, -1, -1, -1, -1,
+ -1, 11, 12, 13, -1, 15, -1, -1, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, -1, -1, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 3, -1, -1, -1, -1, -1, -1, -1,
+ 11, 12, 13, -1, 15, -1, -1, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ -1, -1, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 11, 12, 13, -1, 15, -1, -1, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, -1, -1, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, -1, -1, 44, 45, 46, 47, 11, 12,
+ 13, -1, 15, -1, -1, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, -1, -1,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
+ -1, -1, 45, 46, 47, 11, 12, 13, -1, 15,
+ -1, -1, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, -1, -1, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, -1, -1, 11, 12,
+ 13, 47, 15, 16, -1, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, -1, -1,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 11,
+ 12, 13, -1, 15, -1, -1, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, -1,
+ -1, 33, 34, 35, 36, 37, 38, 39, 40, 41
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 98, 102, 103, 3, 95, 96, 97, 0, 43,
- 52, 53, 54, 55, 56, 8, 59, 94, 3, 95,
- 3, 3, 3, 8, 66, 4, 8, 3, 4, 80,
- 82, 88, 89, 90, 91, 92, 93, 66, 56, 56,
- 56, 101, 37, 38, 39, 44, 46, 47, 48, 4,
- 66, 66, 66, 3, 4, 99, 66, 81, 5, 9,
- 63, 3, 9, 65, 5, 86, 65, 66, 66, 64,
- 101, 101, 101, 31, 3, 65, 71, 74, 75, 76,
- 77, 78, 79, 4, 37, 3, 5, 85, 87, 66,
- 66, 44, 63, 4, 63, 4, 4, 4, 5, 6,
- 7, 62, 11, 12, 13, 16, 17, 18, 19, 21,
- 22, 23, 24, 25, 26, 27, 28, 31, 32, 33,
- 34, 35, 36, 39, 40, 41, 42, 49, 50, 51,
- 72, 78, 79, 3, 71, 3, 79, 4, 3, 61,
- 37, 3, 4, 84, 85, 66, 3, 61, 78, 4,
- 4, 99, 100, 4, 66, 4, 65, 68, 71, 65,
- 68, 63, 63, 64, 63, 63, 63, 71, 73, 63,
- 63, 29, 69, 69, 62, 71, 71, 71, 71, 71,
- 63, 60, 65, 10, 60, 65, 71, 4, 79, 4,
- 4, 40, 41, 4, 61, 45, 4, 61, 78, 4,
- 4, 4, 4, 75, 3, 71, 65, 75, 73, 71,
- 63, 75, 75, 71, 71, 30, 70, 70, 71, 71,
- 71, 4, 4, 10, 10, 4, 4, 10, 4, 60,
- 10, 4, 4, 5, 83, 4, 4, 14, 71, 75,
- 71, 71, 75, 71, 71, 71, 76, 4, 3, 77,
- 77, 4, 4, 4, 4, 59, 67, 68, 71, 71,
- 76, 77, 3, 4, 75, 41, 4, 10, 3, 4,
- 15, 68, 75, 4
+ 0, 101, 105, 106, 3, 98, 99, 100, 0, 48,
+ 54, 55, 56, 57, 58, 8, 61, 97, 3, 98,
+ 3, 3, 3, 8, 69, 4, 8, 3, 4, 83,
+ 85, 91, 92, 93, 94, 95, 96, 69, 58, 58,
+ 58, 104, 42, 43, 44, 49, 51, 52, 53, 4,
+ 69, 69, 69, 3, 4, 102, 69, 84, 5, 9,
+ 66, 3, 9, 68, 5, 89, 68, 69, 69, 67,
+ 104, 104, 104, 33, 3, 11, 12, 13, 15, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 68, 75, 76, 78, 79, 80, 81, 82, 4,
+ 42, 3, 5, 88, 90, 69, 69, 49, 66, 4,
+ 66, 4, 4, 4, 5, 6, 7, 65, 11, 12,
+ 13, 15, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 44, 45, 46, 47, 77, 68,
+ 71, 72, 71, 71, 72, 5, 64, 64, 64, 66,
+ 66, 66, 66, 66, 66, 31, 73, 73, 65, 81,
+ 82, 3, 78, 3, 82, 4, 3, 63, 42, 3,
+ 4, 87, 88, 69, 3, 63, 81, 4, 4, 102,
+ 103, 4, 69, 4, 75, 71, 75, 78, 71, 72,
+ 66, 66, 67, 66, 66, 66, 75, 66, 66, 66,
+ 73, 73, 65, 75, 75, 75, 75, 75, 75, 66,
+ 62, 68, 10, 62, 68, 4, 78, 78, 78, 72,
+ 66, 66, 67, 32, 74, 74, 82, 4, 4, 45,
+ 46, 4, 63, 50, 4, 63, 81, 4, 4, 4,
+ 4, 78, 3, 75, 17, 78, 72, 75, 75, 66,
+ 78, 78, 75, 75, 75, 74, 74, 75, 75, 75,
+ 4, 4, 10, 10, 4, 4, 10, 14, 14, 17,
+ 14, 78, 66, 4, 62, 10, 4, 4, 5, 86,
+ 4, 4, 16, 75, 78, 78, 75, 75, 78, 75,
+ 75, 75, 79, 4, 3, 80, 80, 4, 71, 14,
+ 4, 4, 4, 61, 70, 71, 75, 75, 79, 80,
+ 78, 3, 4, 78, 14, 46, 4, 10, 3, 4,
+ 17, 71, 78, 4
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 58, 59, 59, 60, 60, 61, 61, 61, 61,
- 62, 62, 62, 63, 63, 64, 64, 65, 66, 67,
- 68, 68, 69, 69, 70, 70, 71, 72, 72, 72,
- 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
- 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
- 72, 72, 72, 72, 72, 72, 72, 73, 73, 74,
- 74, 75, 75, 76, 76, 76, 76, 77, 77, 77,
- 78, 79, 80, 80, 80, 80, 81, 81, 82, 83,
- 84, 85, 85, 86, 87, 88, 88, 89, 89, 90,
- 91, 91, 91, 91, 92, 93, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 95, 95, 96, 97, 97,
- 97, 97, 97, 97, 98, 98, 99, 100, 100, 101,
- 101, 102, 103
+ 0, 60, 61, 61, 62, 62, 63, 63, 63, 63,
+ 64, 65, 65, 65, 66, 66, 67, 67, 68, 69,
+ 70, 71, 71, 72, 73, 73, 74, 74, 75, 75,
+ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
+ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
+ 76, 76, 76, 76, 76, 76, 76, 76, 77, 77,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 78, 78, 79, 79, 79, 79, 80,
+ 80, 80, 81, 82, 83, 83, 83, 83, 84, 84,
+ 85, 86, 87, 88, 88, 89, 90, 91, 91, 92,
+ 92, 93, 94, 94, 94, 94, 95, 96, 97, 97,
+ 97, 97, 97, 97, 97, 97, 97, 98, 98, 99,
+ 100, 100, 100, 100, 100, 100, 101, 101, 102, 103,
+ 103, 104, 104, 105, 106
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 2, 0, 2, 0, 4, 8, 4,
- 1, 1, 1, 1, 1, 0, 2, 1, 1, 1,
- 0, 1, 0, 1, 0, 1, 3, 1, 3, 3,
- 7, 4, 12, 3, 4, 3, 4, 3, 2, 4,
- 5, 3, 3, 4, 2, 3, 4, 5, 2, 2,
- 3, 4, 3, 2, 1, 1, 2, 0, 1, 1,
- 2, 0, 1, 1, 5, 5, 6, 1, 5, 6,
- 4, 1, 6, 7, 5, 6, 0, 1, 4, 1,
- 5, 0, 2, 1, 1, 6, 5, 7, 8, 4,
- 6, 7, 6, 7, 5, 5, 0, 2, 2, 2,
- 2, 2, 2, 2, 2, 4, 4, 1, 1, 5,
- 5, 9, 8, 9, 0, 2, 4, 0, 1, 0,
- 2, 1, 1
+ 1, 1, 1, 1, 1, 1, 0, 2, 1, 1,
+ 1, 0, 1, 1, 0, 1, 0, 1, 1, 3,
+ 1, 1, 1, 4, 4, 5, 3, 3, 4, 1,
+ 4, 7, 1, 2, 2, 2, 2, 2, 2, 3,
+ 3, 2, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 3, 3, 4, 2, 3, 3, 4, 4, 5,
+ 1, 2, 3, 4, 7, 12, 4, 4, 3, 3,
+ 4, 2, 3, 3, 4, 5, 2, 2, 3, 3,
+ 2, 1, 2, 0, 2, 1, 5, 5, 6, 1,
+ 5, 6, 4, 1, 6, 7, 5, 6, 0, 1,
+ 4, 1, 5, 0, 2, 1, 1, 6, 5, 7,
+ 8, 4, 6, 7, 6, 7, 5, 5, 0, 2,
+ 2, 2, 2, 2, 2, 2, 2, 4, 4, 1,
+ 1, 5, 5, 9, 8, 9, 0, 2, 4, 0,
+ 1, 0, 2, 1, 1
};
@@ -1407,202 +1510,202 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
switch (yytype)
{
- case 59: /* text_list */
-#line 170 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 61: /* text_list */
+#line 179 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_text_list(parser->allocator, &((*yyvaluep).text_list)); }
-#line 1414 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1517 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 60: /* value_type_list */
-#line 173 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 62: /* value_type_list */
+#line 182 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_type_vector(parser->allocator, &((*yyvaluep).types)); }
-#line 1420 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1523 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 61: /* func_type */
-#line 183 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 63: /* func_type */
+#line 192 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_func_signature(parser->allocator, &((*yyvaluep).func_sig)); }
-#line 1426 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1529 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 62: /* literal */
-#line 172 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 65: /* literal */
+#line 181 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).literal).text); }
-#line 1432 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1535 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 63: /* var */
-#line 174 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 66: /* var */
+#line 183 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_var(parser->allocator, &((*yyvaluep).var)); }
-#line 1438 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1541 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 64: /* var_list */
-#line 175 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 67: /* var_list */
+#line 184 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_var_vector_and_elements(parser->allocator, &((*yyvaluep).vars)); }
-#line 1444 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1547 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 65: /* bind_var */
-#line 171 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 68: /* bind_var */
+#line 180 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); }
-#line 1450 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1553 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 66: /* quoted_text */
-#line 171 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 69: /* quoted_text */
+#line 180 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); }
-#line 1456 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1559 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 67: /* segment_contents */
-#line 180 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 70: /* segment_contents */
+#line 189 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_segment(parser->allocator, &((*yyvaluep).segment)); }
-#line 1462 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1565 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 68: /* labeling */
-#line 171 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 71: /* labeling */
+#line 180 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); }
-#line 1468 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1571 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 71: /* expr */
-#line 176 "src/wasm-ast-parser.y" /* yacc.c:1257 */
- { wasm_destroy_expr(parser->allocator, ((*yyvaluep).expr)); }
-#line 1474 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+ case 72: /* labeling1 */
+#line 180 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ { wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); }
+#line 1577 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 72: /* expr1 */
-#line 176 "src/wasm-ast-parser.y" /* yacc.c:1257 */
- { wasm_destroy_expr(parser->allocator, ((*yyvaluep).expr)); }
-#line 1480 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+ case 75: /* expr */
+#line 186 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); }
+#line 1583 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 73: /* expr_opt */
-#line 176 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 76: /* op */
+#line 185 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_expr(parser->allocator, ((*yyvaluep).expr)); }
-#line 1486 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1589 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 74: /* non_empty_expr_list */
-#line 177 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 77: /* expr1 */
+#line 186 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); }
-#line 1492 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1595 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 75: /* expr_list */
-#line 177 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 78: /* expr_list */
+#line 186 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); }
-#line 1498 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1601 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 76: /* func_fields */
-#line 178 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 79: /* func_fields */
+#line 187 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_func_fields(parser->allocator, ((*yyvaluep).func_fields)); }
-#line 1504 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1607 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 77: /* func_body */
-#line 178 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 80: /* func_body */
+#line 187 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_func_fields(parser->allocator, ((*yyvaluep).func_fields)); }
-#line 1510 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1613 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 79: /* func_info */
-#line 179 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 82: /* func_info */
+#line 188 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_func(parser->allocator, ((*yyvaluep).func)); wasm_free(parser->allocator, ((*yyvaluep).func)); }
-#line 1516 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1619 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 80: /* func */
-#line 187 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 83: /* func */
+#line 196 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_exported_func(parser->allocator, &((*yyvaluep).exported_func)); }
-#line 1522 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1625 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 84: /* segment */
-#line 180 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 87: /* segment */
+#line 189 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_segment(parser->allocator, &((*yyvaluep).segment)); }
-#line 1528 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1631 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 85: /* segment_list */
-#line 181 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 88: /* segment_list */
+#line 190 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_segment_vector_and_elements(parser->allocator, &((*yyvaluep).segments)); }
-#line 1534 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1637 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 88: /* memory */
-#line 182 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 91: /* memory */
+#line 191 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_memory(parser->allocator, &((*yyvaluep).memory)); }
-#line 1540 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1643 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 89: /* type_def */
-#line 184 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 92: /* type_def */
+#line 193 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_func_type(parser->allocator, &((*yyvaluep).func_type)); }
-#line 1546 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1649 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 90: /* table */
-#line 175 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 93: /* table */
+#line 184 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_var_vector_and_elements(parser->allocator, &((*yyvaluep).vars)); }
-#line 1552 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1655 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 91: /* import */
-#line 185 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 94: /* import */
+#line 194 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_import(parser->allocator, ((*yyvaluep).import)); wasm_free(parser->allocator, ((*yyvaluep).import)); }
-#line 1558 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1661 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 92: /* export */
-#line 186 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 95: /* export */
+#line 195 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_export(parser->allocator, &((*yyvaluep).export_)); }
-#line 1564 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1667 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 94: /* module_fields */
-#line 188 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 97: /* module_fields */
+#line 197 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_module(parser->allocator, ((*yyvaluep).module)); wasm_free(parser->allocator, ((*yyvaluep).module)); }
-#line 1570 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1673 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 95: /* raw_module */
-#line 189 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 98: /* raw_module */
+#line 198 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_raw_module(parser->allocator, &((*yyvaluep).raw_module)); }
-#line 1576 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1679 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 96: /* module */
-#line 188 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 99: /* module */
+#line 197 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_module(parser->allocator, ((*yyvaluep).module)); wasm_free(parser->allocator, ((*yyvaluep).module)); }
-#line 1582 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1685 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 97: /* cmd */
-#line 191 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 100: /* cmd */
+#line 200 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_command(parser->allocator, ((*yyvaluep).command)); wasm_free(parser->allocator, ((*yyvaluep).command)); }
-#line 1588 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1691 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 98: /* cmd_list */
-#line 192 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 101: /* cmd_list */
+#line 201 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_command_vector_and_elements(parser->allocator, &((*yyvaluep).commands)); }
-#line 1594 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1697 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 101: /* const_list */
-#line 190 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 104: /* const_list */
+#line 199 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_const_vector(parser->allocator, &((*yyvaluep).consts)); }
-#line 1600 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1703 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
- case 102: /* script */
-#line 193 "src/wasm-ast-parser.y" /* yacc.c:1257 */
+ case 105: /* script */
+#line 202 "src/wasm-ast-parser.y" /* yacc.c:1257 */
{ wasm_destroy_script(&((*yyvaluep).script)); }
-#line 1606 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
+#line 1709 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1257 */
break;
@@ -1894,18 +1997,18 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 203 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 212 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
WasmTextListNode* node = new_text_list_node(parser->allocator);
DUPTEXT(node->text, (yyvsp[0].text));
node->next = NULL;
(yyval.text_list).first = (yyval.text_list).last = node;
}
-#line 1905 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2008 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 3:
-#line 209 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 218 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.text_list) = (yyvsp[-1].text_list);
WasmTextListNode* node = new_text_list_node(parser->allocator);
@@ -1914,83 +2017,96 @@ yyreduce:
(yyval.text_list).last->next = node;
(yyval.text_list).last = node;
}
-#line 1918 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2021 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 4:
-#line 222 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 231 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.types)); }
-#line 1924 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2027 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 5:
-#line 223 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 232 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.types) = (yyvsp[-1].types);
wasm_append_type_value(parser->allocator, &(yyval.types), &(yyvsp[0].type));
}
-#line 1933 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2036 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 6:
-#line 229 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 238 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.func_sig)); }
-#line 1939 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2042 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 7:
-#line 230 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 239 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_sig).result_type = WASM_TYPE_VOID;
(yyval.func_sig).param_types = (yyvsp[-1].types);
}
-#line 1948 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2051 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 8:
-#line 234 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 243 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_sig).result_type = (yyvsp[-1].type);
(yyval.func_sig).param_types = (yyvsp[-5].types);
}
-#line 1957 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2060 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 9:
-#line 238 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 247 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.func_sig)); (yyval.func_sig).result_type = (yyvsp[-1].type); }
-#line 1963 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2066 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 10:
-#line 245 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 254 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.literal).type = (yyvsp[0].literal).type;
- DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
+ if (WASM_FAILED(wasm_parse_int32((yyvsp[0].literal).text.start,
+ (yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &(yyval.u32),
+ WASM_PARSE_UNSIGNED_ONLY))) {
+ wasm_ast_parser_error(&(yylsp[0]), lexer, parser, "invalid int " PRIstringslice,
+ WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
+ }
}
-#line 1972 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2079 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 11:
-#line 249 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 265 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.literal).type = (yyvsp[0].literal).type;
DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
}
-#line 1981 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2088 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 12:
-#line 253 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 269 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.literal).type = (yyvsp[0].literal).type;
DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
}
-#line 1990 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2097 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 13:
-#line 260 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 273 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.literal).type = (yyvsp[0].literal).type;
+ DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
+ }
+#line 2106 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 14:
+#line 280 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.var).loc = (yylsp[0]);
(yyval.var).type = WASM_VAR_TYPE_INDEX;
@@ -2003,42 +2119,42 @@ yyreduce:
}
(yyval.var).index = index;
}
-#line 2007 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2123 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 14:
-#line 272 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 15:
+#line 292 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.var).loc = (yylsp[0]);
(yyval.var).type = WASM_VAR_TYPE_NAME;
DUPTEXT((yyval.var).name, (yyvsp[0].text));
}
-#line 2017 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2133 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 15:
-#line 279 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 16:
+#line 299 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.vars)); }
-#line 2023 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2139 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 16:
-#line 280 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 17:
+#line 300 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.vars) = (yyvsp[-1].vars);
wasm_append_var_value(parser->allocator, &(yyval.vars), &(yyvsp[0].var));
}
-#line 2032 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2148 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 17:
-#line 286 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 18:
+#line 306 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ DUPTEXT((yyval.text), (yyvsp[0].text)); }
-#line 2038 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2154 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 18:
-#line 290 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 19:
+#line 310 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
WasmTextListNode node;
node.text = (yyvsp[0].text);
@@ -2052,38 +2168,32 @@ yyreduce:
(yyval.text).start = data;
(yyval.text).length = size;
}
-#line 2056 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2172 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 19:
-#line 306 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 20:
+#line 326 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
dup_text_list(parser->allocator, &(yyvsp[0].text_list), &(yyval.segment).data, &(yyval.segment).size);
wasm_destroy_text_list(parser->allocator, &(yyvsp[0].text_list));
}
-#line 2065 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
- break;
-
- case 20:
-#line 313 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- { WASM_ZERO_MEMORY((yyval.text)); }
-#line 2071 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2181 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 21:
-#line 314 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- { (yyval.text) = (yyvsp[0].text); }
-#line 2077 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 333 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ { WASM_ZERO_MEMORY((yyval.text)); }
+#line 2187 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 22:
-#line 318 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 24:
+#line 339 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ (yyval.u64) = 0; }
-#line 2083 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2193 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 23:
-#line 319 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 25:
+#line 340 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
if (WASM_FAILED(wasm_parse_int64((yyvsp[0].text).start, (yyvsp[0].text).start + (yyvsp[0].text).length, &(yyval.u64),
WASM_PARSE_SIGNED_AND_UNSIGNED))) {
@@ -2092,17 +2202,17 @@ yyreduce:
WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].text)));
}
}
-#line 2096 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2206 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 24:
-#line 329 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 26:
+#line 350 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ (yyval.u32) = USE_NATURAL_ALIGNMENT; }
-#line 2102 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2212 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 25:
-#line 330 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 27:
+#line 351 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
if (WASM_FAILED(wasm_parse_int32((yyvsp[0].text).start, (yyvsp[0].text).start + (yyvsp[0].text).length, &(yyval.u32),
WASM_PARSE_UNSIGNED_ONLY))) {
@@ -2111,244 +2221,226 @@ yyreduce:
WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].text)));
}
}
-#line 2115 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
- break;
-
- case 26:
-#line 341 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- { (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->loc = (yylsp[-2]); }
-#line 2121 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
- break;
-
- case 27:
-#line 344 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- {
- (yyval.expr) = wasm_new_empty_expr(parser->allocator, WASM_EXPR_TYPE_NOP);
- }
-#line 2129 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2225 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 28:
-#line 347 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- {
- (yyval.expr) = wasm_new_block_expr(parser->allocator);
- (yyval.expr)->block.label = (yyvsp[-1].text);
- (yyval.expr)->block.first = (yyvsp[0].expr_list).first;
- }
-#line 2139 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 362 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ { (yyval.expr_list) = join_exprs1(&(yylsp[0]), (yyvsp[0].expr)); }
+#line 2231 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 29:
-#line 352 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- {
- (yyval.expr) = wasm_new_if_expr(parser->allocator);
- (yyval.expr)->if_.cond = (yyvsp[-1].expr);
- (yyval.expr)->if_.true_.first = (yyvsp[0].expr);
- }
-#line 2149 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 363 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ { (yyval.expr_list) = (yyvsp[-1].expr_list); }
+#line 2237 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 30:
-#line 357 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 366 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_if_expr(parser->allocator);
- (yyval.expr)->if_.cond = (yyvsp[-5].expr);
- (yyval.expr)->if_.true_.label = (yyvsp[-2].text);
- (yyval.expr)->if_.true_.first = (yyvsp[-1].expr_list).first;
+ (yyval.expr) = wasm_new_unreachable_expr(parser->allocator);
}
-#line 2160 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2245 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 31:
-#line 363 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 369 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_if_else_expr(parser->allocator);
- (yyval.expr)->if_else.cond = (yyvsp[-2].expr);
- (yyval.expr)->if_else.true_.first = (yyvsp[-1].expr);
- (yyval.expr)->if_else.false_.first = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_nop_expr(parser->allocator);
}
-#line 2171 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2253 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 32:
-#line 369 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 372 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_if_else_expr(parser->allocator);
- (yyval.expr)->if_else.cond = (yyvsp[-10].expr);
- (yyval.expr)->if_else.true_.label = (yyvsp[-7].text);
- (yyval.expr)->if_else.true_.first = (yyvsp[-6].expr_list).first;
- (yyval.expr)->if_else.false_.label = (yyvsp[-2].text);
- (yyval.expr)->if_else.false_.first = (yyvsp[-1].expr_list).first;
+ (yyval.expr) = wasm_new_drop_expr(parser->allocator);
}
-#line 2184 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2261 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 33:
-#line 377 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 375 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_br_if_expr(parser->allocator);
- (yyval.expr)->br_if.var = (yyvsp[-1].var);
- (yyval.expr)->br_if.cond = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_block_expr(parser->allocator);
+ (yyval.expr)->block.label = (yyvsp[-2].text);
+ (yyval.expr)->block.first = (yyvsp[-1].expr_list).first;
}
-#line 2194 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2271 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 34:
-#line 382 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 380 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_br_if_expr(parser->allocator);
- (yyval.expr)->br_if.var = (yyvsp[-2].var);
- (yyval.expr)->br_if.expr = (yyvsp[-1].expr);
- (yyval.expr)->br_if.cond = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_loop_expr(parser->allocator);
+ (yyval.expr)->loop.label = (yyvsp[-2].text);
+ (yyval.expr)->loop.first = (yyvsp[-1].expr_list).first;
}
-#line 2205 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2281 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 35:
-#line 388 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 385 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_loop_expr(parser->allocator);
- WASM_ZERO_MEMORY((yyval.expr)->loop.outer);
- (yyval.expr)->loop.inner = (yyvsp[-1].text);
- (yyval.expr)->loop.first = (yyvsp[0].expr_list).first;
+ (yyval.expr) = wasm_new_block_expr(parser->allocator);
+ (yyval.expr)->block.label = (yyvsp[-3].text);
+ WasmExpr* loop = wasm_new_loop_expr(parser->allocator);
+ loop->loc = (yylsp[-4]);
+ loop->loop.label = (yyvsp[-2].text);
+ loop->loop.first = (yyvsp[-1].expr_list).first;
+ (yyval.expr)->block.first = loop;
}
-#line 2216 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2295 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 36:
#line 394 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_loop_expr(parser->allocator);
- (yyval.expr)->loop.outer = (yyvsp[-2].text);
- (yyval.expr)->loop.inner = (yyvsp[-1].text);
- (yyval.expr)->loop.first = (yyvsp[0].expr_list).first;
+ (yyval.expr) = wasm_new_br_expr(parser->allocator);
+ (yyval.expr)->br.arity = (yyvsp[-1].u32);
+ (yyval.expr)->br.var = (yyvsp[0].var);
}
-#line 2227 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2305 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 37:
-#line 400 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 399 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_br_expr(parser->allocator);
- (yyval.expr)->br.var = (yyvsp[-1].var);
- (yyval.expr)->br.expr = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_br_if_expr(parser->allocator);
+ (yyval.expr)->br_if.arity = (yyvsp[-1].u32);
+ (yyval.expr)->br_if.var = (yyvsp[0].var);
}
-#line 2237 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2315 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 38:
-#line 405 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 404 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_return_expr(parser->allocator);
- (yyval.expr)->return_.expr = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_br_table_expr(parser->allocator);
+ (yyval.expr)->br_table.arity = (yyvsp[-2].u32);
+ (yyval.expr)->br_table.targets = (yyvsp[-1].vars);
+ (yyval.expr)->br_table.default_target = (yyvsp[0].var);
}
-#line 2246 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2326 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 39:
-#line 409 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 410 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_br_table_expr(parser->allocator);
- (yyval.expr)->br_table.key = (yyvsp[0].expr);
- (yyval.expr)->br_table.expr = NULL;
- (yyval.expr)->br_table.targets = (yyvsp[-2].vars);
- (yyval.expr)->br_table.default_target = (yyvsp[-1].var);
+ (yyval.expr) = wasm_new_return_expr(parser->allocator);
}
-#line 2258 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2334 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 40:
-#line 416 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 413 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_br_table_expr(parser->allocator);
- (yyval.expr)->br_table.key = (yyvsp[0].expr);
- (yyval.expr)->br_table.expr = (yyvsp[-1].expr);
- (yyval.expr)->br_table.targets = (yyvsp[-3].vars);
- (yyval.expr)->br_table.default_target = (yyvsp[-2].var);
+ (yyval.expr) = wasm_new_if_expr(parser->allocator);
+ (yyval.expr)->if_.true_.label = (yyvsp[-2].text);
+ (yyval.expr)->if_.true_.first = (yyvsp[-1].expr_list).first;
}
-#line 2270 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2344 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 41:
-#line 423 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 418 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_call_expr(parser->allocator);
- (yyval.expr)->call.var = (yyvsp[-1].var);
- (yyval.expr)->call.first_arg = (yyvsp[0].expr_list).first;
- (yyval.expr)->call.num_args = (yyvsp[0].expr_list).size;
+ (yyval.expr) = wasm_new_if_else_expr(parser->allocator);
+ (yyval.expr)->if_else.true_.label = (yyvsp[-5].text);
+ (yyval.expr)->if_else.true_.first = (yyvsp[-4].expr_list).first;
+ (yyval.expr)->if_else.false_.label = (yyvsp[-2].text);
+ (yyval.expr)->if_else.false_.first = (yyvsp[-1].expr_list).first;
}
-#line 2281 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2356 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 42:
-#line 429 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 425 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_call_import_expr(parser->allocator);
- (yyval.expr)->call.var = (yyvsp[-1].var);
- (yyval.expr)->call.first_arg = (yyvsp[0].expr_list).first;
- (yyval.expr)->call.num_args = (yyvsp[0].expr_list).size;
+ (yyval.expr) = wasm_new_select_expr(parser->allocator);
}
-#line 2292 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2364 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 43:
-#line 435 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 428 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_call_indirect_expr(parser->allocator);
- (yyval.expr)->call_indirect.var = (yyvsp[-2].var);
- (yyval.expr)->call_indirect.expr = (yyvsp[-1].expr);
- (yyval.expr)->call_indirect.first_arg = (yyvsp[0].expr_list).first;
- (yyval.expr)->call_indirect.num_args = (yyvsp[0].expr_list).size;
+ (yyval.expr) = wasm_new_call_expr(parser->allocator);
+ (yyval.expr)->call.var = (yyvsp[0].var);
}
-#line 2304 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2373 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
case 44:
-#line 442 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+#line 432 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr) = wasm_new_call_expr(parser->allocator);
+ (yyval.expr)->call_import.var = (yyvsp[0].var);
+ }
+#line 2382 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 45:
+#line 436 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr) = wasm_new_call_indirect_expr(parser->allocator);
+ (yyval.expr)->call_indirect.var = (yyvsp[0].var);
+ }
+#line 2391 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 46:
+#line 440 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = wasm_new_get_local_expr(parser->allocator);
(yyval.expr)->get_local.var = (yyvsp[0].var);
}
-#line 2313 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2400 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 45:
-#line 446 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 47:
+#line 444 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = wasm_new_set_local_expr(parser->allocator);
- (yyval.expr)->set_local.var = (yyvsp[-1].var);
- (yyval.expr)->set_local.expr = (yyvsp[0].expr);
+ (yyval.expr)->set_local.var = (yyvsp[0].var);
}
-#line 2323 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2409 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 46:
-#line 451 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 48:
+#line 448 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr) = wasm_new_tee_local_expr(parser->allocator);
+ (yyval.expr)->tee_local.var = (yyvsp[0].var);
+ }
+#line 2418 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 49:
+#line 452 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = wasm_new_load_expr(parser->allocator);
- (yyval.expr)->load.opcode = (yyvsp[-3].opcode);
- (yyval.expr)->load.offset = (yyvsp[-2].u64);
- (yyval.expr)->load.align = (yyvsp[-1].u32);
- (yyval.expr)->load.addr = (yyvsp[0].expr);
+ (yyval.expr)->load.opcode = (yyvsp[-2].opcode);
+ (yyval.expr)->load.offset = (yyvsp[-1].u64);
+ (yyval.expr)->load.align = (yyvsp[0].u32);
}
-#line 2335 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2429 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 47:
+ case 50:
#line 458 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_store_expr(parser->allocator);
- (yyval.expr)->store.opcode = (yyvsp[-4].opcode);
- (yyval.expr)->store.offset = (yyvsp[-3].u64);
- (yyval.expr)->store.align = (yyvsp[-2].u32);
- (yyval.expr)->store.addr = (yyvsp[-1].expr);
- (yyval.expr)->store.value = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_load_expr(parser->allocator);
+ (yyval.expr)->store.opcode = (yyvsp[-2].opcode);
+ (yyval.expr)->store.offset = (yyvsp[-1].u64);
+ (yyval.expr)->store.align = (yyvsp[0].u32);
}
-#line 2348 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2440 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 48:
-#line 466 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 51:
+#line 464 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = wasm_new_const_expr(parser->allocator);
(yyval.expr)->const_.loc = (yylsp[-1]);
@@ -2361,144 +2453,474 @@ yyreduce:
}
wasm_free(parser->allocator, (char*)(yyvsp[0].literal).text.start);
}
-#line 2365 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2457 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 49:
-#line 478 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 52:
+#line 476 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = wasm_new_unary_expr(parser->allocator);
- (yyval.expr)->unary.opcode = (yyvsp[-1].opcode);
- (yyval.expr)->unary.expr = (yyvsp[0].expr);
+ (yyval.expr)->unary.opcode = (yyvsp[0].opcode);
}
-#line 2375 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2466 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 50:
-#line 483 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 53:
+#line 480 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = wasm_new_binary_expr(parser->allocator);
- (yyval.expr)->binary.opcode = (yyvsp[-2].opcode);
- (yyval.expr)->binary.left = (yyvsp[-1].expr);
- (yyval.expr)->binary.right = (yyvsp[0].expr);
+ (yyval.expr)->binary.opcode = (yyvsp[0].opcode);
}
-#line 2386 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2475 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 51:
-#line 489 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 54:
+#line 484 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_select_expr(parser->allocator);
- (yyval.expr)->select.true_ = (yyvsp[-2].expr);
- (yyval.expr)->select.false_ = (yyvsp[-1].expr);
- (yyval.expr)->select.cond = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_compare_expr(parser->allocator);
+ (yyval.expr)->compare.opcode = (yyvsp[0].opcode);
}
-#line 2397 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2484 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 52:
+ case 55:
+#line 488 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr) = wasm_new_convert_expr(parser->allocator);
+ (yyval.expr)->convert.opcode = (yyvsp[0].opcode);
+ }
+#line 2493 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 56:
+#line 492 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr) = wasm_new_current_memory_expr(parser->allocator);
+ }
+#line 2501 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 57:
#line 495 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_compare_expr(parser->allocator);
- (yyval.expr)->compare.opcode = (yyvsp[-2].opcode);
- (yyval.expr)->compare.left = (yyvsp[-1].expr);
- (yyval.expr)->compare.right = (yyvsp[0].expr);
+ (yyval.expr) = wasm_new_grow_memory_expr(parser->allocator);
}
-#line 2408 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2509 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 53:
-#line 501 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 58:
+#line 500 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_convert_expr(parser->allocator);
- (yyval.expr)->convert.opcode = (yyvsp[-1].opcode);
- (yyval.expr)->convert.expr = (yyvsp[0].expr);
+ (yyval.expr_list) = join_exprs1(&(yylsp[0]), wasm_new_unreachable_expr(parser->allocator));
}
-#line 2418 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2517 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 54:
+ case 59:
+#line 503 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr_list) = join_exprs1(&(yylsp[0]), wasm_new_nop_expr(parser->allocator));
+ }
+#line 2525 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 60:
#line 506 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_empty_expr(parser->allocator, WASM_EXPR_TYPE_UNREACHABLE);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), wasm_new_drop_expr(parser->allocator));
}
-#line 2426 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2533 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 55:
+ case 61:
#line 509 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_empty_expr(parser->allocator,
- WASM_EXPR_TYPE_CURRENT_MEMORY);
+ WasmExpr* expr = wasm_new_block_expr(parser->allocator);
+ expr->block.label = (yyvsp[-1].text);
+ expr->block.first = (yyvsp[0].expr_list).first;
+ (yyval.expr_list) = join_exprs1(&(yylsp[-2]), expr);
}
-#line 2435 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2544 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 56:
-#line 513 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 62:
+#line 515 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr) = wasm_new_grow_memory_expr(parser->allocator);
- (yyval.expr)->grow_memory.expr = (yyvsp[0].expr);
+ WasmExpr* expr = wasm_new_loop_expr(parser->allocator);
+ expr->loop.label = (yyvsp[-1].text);
+ expr->loop.first = (yyvsp[0].expr_list).first;
+ (yyval.expr_list) = join_exprs1(&(yylsp[-2]), expr);
}
-#line 2444 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2555 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 57:
-#line 519 "src/wasm-ast-parser.y" /* yacc.c:1646 */
- { (yyval.expr) = NULL; }
-#line 2450 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ case 63:
+#line 521 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* block = wasm_new_block_expr(parser->allocator);
+ block->block.label = (yyvsp[-2].text);
+ WasmExpr* loop = wasm_new_loop_expr(parser->allocator);
+ loop->loc = (yylsp[-3]);
+ loop->loop.label = (yyvsp[-1].text);
+ loop->loop.first = (yyvsp[0].expr_list).first;
+ block->block.first = loop;
+ (yyval.expr_list) = join_exprs1(&(yylsp[-3]), block);
+ }
+#line 2570 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 59:
-#line 523 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 64:
+#line 531 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr_list).first = (yyval.expr_list).last = (yyvsp[0].expr);
- (yyval.expr_list).size = 1;
+ WasmExpr* expr = wasm_new_br_expr(parser->allocator);
+ expr->br.arity = 0;
+ expr->br.var = (yyvsp[0].var);
+ (yyval.expr_list) = join_exprs1(&(yylsp[-1]), expr);
}
-#line 2459 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2581 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 60:
-#line 527 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 65:
+#line 537 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
- (yyval.expr_list) = (yyvsp[-1].expr_list);
- (yyval.expr_list).last->next = (yyvsp[0].expr);
- (yyval.expr_list).last = (yyvsp[0].expr);
- (yyval.expr_list).size++;
+ WasmExpr* expr = wasm_new_br_expr(parser->allocator);
+ expr->br.arity = 1;
+ expr->br.var = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[0].expr_list), expr);
}
-#line 2470 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2592 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 61:
-#line 535 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 66:
+#line 543 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_br_if_expr(parser->allocator);
+ expr->br_if.arity = 0;
+ expr->br_if.var = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2603 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 67:
+#line 549 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_br_if_expr(parser->allocator);
+ expr->br_if.arity = 1;
+ expr->br_if.var = (yyvsp[-2].var);
+ (yyval.expr_list) = join_exprs3(&(yylsp[-3]), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list), expr);
+ }
+#line 2614 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 68:
+#line 555 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_br_table_expr(parser->allocator);
+ expr->br_table.arity = 0;
+ expr->br_table.targets = (yyvsp[-2].vars);
+ expr->br_table.default_target = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-3]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2626 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 69:
+#line 562 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_br_table_expr(parser->allocator);
+ expr->br_table.arity = 1;
+ expr->br_table.targets = (yyvsp[-3].vars);
+ expr->br_table.default_target = (yyvsp[-2].var);
+ (yyval.expr_list) = join_exprs3(&(yylsp[-4]), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list), expr);
+ }
+#line 2638 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 70:
+#line 569 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_return_expr(parser->allocator);
+ (yyval.expr_list) = join_exprs1(&(yylsp[0]), expr);
+ }
+#line 2647 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 71:
+#line 573 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_return_expr(parser->allocator);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2656 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 72:
+#line 577 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_if_expr(parser->allocator);
+ expr->if_.true_.first = (yyvsp[0].expr_list).first;
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[-1].expr_list), expr);
+ }
+#line 2666 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 73:
+#line 582 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_if_else_expr(parser->allocator);
+ expr->if_else.true_.first = (yyvsp[-1].expr_list).first;
+ expr->if_else.false_.first = (yyvsp[0].expr_list).first;
+ (yyval.expr_list) = join_exprs2(&(yylsp[-3]), &(yyvsp[-2].expr_list), expr);
+ }
+#line 2677 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 74:
+#line 588 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_if_expr(parser->allocator);
+ expr->if_.true_.label = (yyvsp[-2].text);
+ expr->if_.true_.first = (yyvsp[-1].expr_list).first;
+ (yyval.expr_list) = join_exprs2(&(yylsp[-6]), &(yyvsp[-5].expr_list), expr);
+ }
+#line 2688 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 75:
+#line 594 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_if_else_expr(parser->allocator);
+ expr->if_else.true_.label = (yyvsp[-7].text);
+ expr->if_else.true_.first = (yyvsp[-6].expr_list).first;
+ expr->if_else.false_.label = (yyvsp[-2].text);
+ expr->if_else.false_.first = (yyvsp[-1].expr_list).first;
+ (yyval.expr_list) = join_exprs2(&(yylsp[-11]), &(yyvsp[-10].expr_list), expr);
+ }
+#line 2701 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 76:
+#line 602 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_if_else_expr(parser->allocator);
+ expr->if_else.true_.first = (yyvsp[-2].expr_list).first;
+ expr->if_else.false_.first = (yyvsp[0].expr_list).first;
+ (yyval.expr_list) = join_exprs1(&(yylsp[-3]), expr);
+ }
+#line 2712 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 77:
+#line 608 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr_list) = join_exprs4(&(yylsp[-3]), &(yyvsp[-2].expr_list), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list),
+ wasm_new_select_expr(parser->allocator));
+ }
+#line 2721 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 78:
+#line 612 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_call_expr(parser->allocator);
+ expr->call.var = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2731 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 79:
+#line 617 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_call_import_expr(parser->allocator);
+ expr->call_import.var = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2741 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 80:
+#line 622 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_call_indirect_expr(parser->allocator);
+ expr->call_indirect.var = (yyvsp[-2].var);
+ (yyval.expr_list) = join_exprs3(&(yylsp[-3]), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list), expr);
+ }
+#line 2751 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 81:
+#line 627 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_get_local_expr(parser->allocator);
+ expr->get_local.var = (yyvsp[0].var);
+ (yyval.expr_list) = join_exprs1(&(yylsp[-1]), expr);
+ }
+#line 2761 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 82:
+#line 632 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_set_local_expr(parser->allocator);
+ expr->set_local.var = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2771 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 83:
+#line 637 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_tee_local_expr(parser->allocator);
+ expr->tee_local.var = (yyvsp[-1].var);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2781 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 84:
+#line 642 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_load_expr(parser->allocator);
+ expr->load.opcode = (yyvsp[-3].opcode);
+ expr->load.offset = (yyvsp[-2].u64);
+ expr->load.align = (yyvsp[-1].u32);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-3]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2793 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 85:
+#line 649 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_store_expr(parser->allocator);
+ expr->store.opcode = (yyvsp[-4].opcode);
+ expr->store.offset = (yyvsp[-3].u64);
+ expr->store.align = (yyvsp[-2].u32);
+ (yyval.expr_list) = join_exprs3(&(yylsp[-4]), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list), expr);
+ }
+#line 2805 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 86:
+#line 656 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_const_expr(parser->allocator);
+ expr->const_.loc = (yylsp[-1]);
+ if (WASM_FAILED(parse_const((yyvsp[-1].type), (yyvsp[0].literal).type, (yyvsp[0].literal).text.start,
+ (yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length,
+ &expr->const_))) {
+ wasm_ast_parser_error(&(yylsp[0]), lexer, parser,
+ "invalid literal \"" PRIstringslice "\"",
+ WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
+ }
+ wasm_free(parser->allocator, (char*)(yyvsp[0].literal).text.start);
+ (yyval.expr_list) = join_exprs1(&(yylsp[-1]), expr);
+ }
+#line 2823 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 87:
+#line 669 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_unary_expr(parser->allocator);
+ expr->unary.opcode = (yyvsp[-1].opcode);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2833 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 88:
+#line 674 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_binary_expr(parser->allocator);
+ expr->binary.opcode = (yyvsp[-2].opcode);
+ (yyval.expr_list) = join_exprs3(&(yylsp[-2]), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list), expr);
+ }
+#line 2843 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 89:
+#line 679 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_compare_expr(parser->allocator);
+ expr->compare.opcode = (yyvsp[-2].opcode);
+ (yyval.expr_list) = join_exprs3(&(yylsp[-2]), &(yyvsp[-1].expr_list), &(yyvsp[0].expr_list), expr);
+ }
+#line 2853 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 90:
+#line 684 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_convert_expr(parser->allocator);
+ expr->convert.opcode = (yyvsp[-1].opcode);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2863 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 91:
+#line 689 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_current_memory_expr(parser->allocator);
+ (yyval.expr_list) = join_exprs1(&(yylsp[0]), expr);
+ }
+#line 2872 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 92:
+#line 693 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ WasmExpr* expr = wasm_new_grow_memory_expr(parser->allocator);
+ (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), expr);
+ }
+#line 2881 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 93:
+#line 699 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.expr_list)); }
-#line 2476 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2887 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 64:
-#line 542 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 94:
+#line 700 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ {
+ (yyval.expr_list).first = (yyvsp[-1].expr_list).first;
+ (yyvsp[-1].expr_list).last->next = (yyvsp[0].expr_list).first;
+ (yyval.expr_list).last = (yyvsp[0].expr_list).last ? (yyvsp[0].expr_list).last : (yyvsp[-1].expr_list).first;
+ (yyval.expr_list).size = (yyvsp[-1].expr_list).size + (yyvsp[0].expr_list).size;
+ }
+#line 2898 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+ break;
+
+ case 96:
+#line 711 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new_func_field(parser->allocator);
(yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_RESULT_TYPE;
(yyval.func_fields)->result_type = (yyvsp[-2].type);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 2487 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2909 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 65:
-#line 548 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 97:
+#line 717 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new_func_field(parser->allocator);
(yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_PARAM_TYPES;
(yyval.func_fields)->types = (yyvsp[-2].types);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 2498 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2920 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 66:
-#line 554 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 98:
+#line 723 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new_func_field(parser->allocator);
(yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_BOUND_PARAM;
@@ -2507,33 +2929,33 @@ yyreduce:
(yyval.func_fields)->bound_type.type = (yyvsp[-2].type);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 2511 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2933 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 67:
-#line 564 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 99:
+#line 733 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new_func_field(parser->allocator);
(yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_EXPRS;
(yyval.func_fields)->first_expr = (yyvsp[0].expr_list).first;
(yyval.func_fields)->next = NULL;
}
-#line 2522 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2944 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 68:
-#line 570 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 100:
+#line 739 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new_func_field(parser->allocator);
(yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_LOCAL_TYPES;
(yyval.func_fields)->types = (yyvsp[-2].types);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 2533 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2955 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 69:
-#line 576 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 101:
+#line 745 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new_func_field(parser->allocator);
(yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_BOUND_LOCAL;
@@ -2542,17 +2964,17 @@ yyreduce:
(yyval.func_fields)->bound_type.type = (yyvsp[-2].type);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 2546 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2968 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 70:
-#line 586 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 102:
+#line 755 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ (yyval.var) = (yyvsp[-1].var); }
-#line 2552 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 2974 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 71:
-#line 589 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 103:
+#line 758 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func) = new_func(parser->allocator);
WasmFuncField* field = (yyvsp[0].func_fields);
@@ -2606,11 +3028,11 @@ yyreduce:
field = next;
}
}
-#line 2610 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3032 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 72:
-#line 644 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 104:
+#line 813 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func).func = (yyvsp[-1].func);
(yyval.exported_func).func->loc = (yylsp[-4]);
@@ -2620,11 +3042,11 @@ yyreduce:
(yyval.exported_func).export_.var.type = WASM_VAR_TYPE_INDEX;
(yyval.exported_func).export_.var.index = -1;
}
-#line 2624 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3046 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 73:
-#line 653 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 105:
+#line 822 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func).func = (yyvsp[-1].func);
(yyval.exported_func).func->loc = (yylsp[-5]);
@@ -2635,11 +3057,11 @@ yyreduce:
(yyval.exported_func).export_.var.type = WASM_VAR_TYPE_INDEX;
(yyval.exported_func).export_.var.index = -1;
}
-#line 2639 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3061 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 74:
-#line 663 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 106:
+#line 832 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func).func = (yyvsp[-1].func);
(yyval.exported_func).func->loc = (yylsp[-3]);
@@ -2647,11 +3069,11 @@ yyreduce:
(yyval.exported_func).export_.var.type = WASM_VAR_TYPE_INDEX;
(yyval.exported_func).export_.var.index = -1;
}
-#line 2651 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3073 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 75:
-#line 670 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 107:
+#line 839 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func).func = (yyvsp[-1].func);
(yyval.exported_func).func->loc = (yylsp[-4]);
@@ -2660,23 +3082,23 @@ yyreduce:
(yyval.exported_func).export_.var.type = WASM_VAR_TYPE_INDEX;
(yyval.exported_func).export_.var.index = -1;
}
-#line 2664 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3086 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 76:
-#line 681 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 108:
+#line 850 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.text)); }
-#line 2670 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3092 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 78:
-#line 689 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 110:
+#line 858 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ (yyval.var) = (yyvsp[-1].var); }
-#line 2676 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3098 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 79:
-#line 693 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 111:
+#line 862 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
if (WASM_FAILED(wasm_parse_int32((yyvsp[0].literal).text.start,
(yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &(yyval.u32),
@@ -2687,37 +3109,37 @@ yyreduce:
WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
}
}
-#line 2691 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3113 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 80:
-#line 706 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 112:
+#line 875 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.segment).loc = (yylsp[-3]);
(yyval.segment).data = (yyvsp[-1].segment).data;
(yyval.segment).size = (yyvsp[-1].segment).size;
(yyval.segment).addr = (yyvsp[-2].u32);
}
-#line 2702 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3124 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 81:
-#line 714 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 113:
+#line 883 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.segments)); }
-#line 2708 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3130 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 82:
-#line 715 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 114:
+#line 884 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.segments) = (yyvsp[-1].segments);
wasm_append_segment_value(parser->allocator, &(yyval.segments), &(yyvsp[0].segment));
}
-#line 2717 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3139 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 83:
-#line 722 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 115:
+#line 891 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
if (WASM_FAILED(wasm_parse_uint64((yyvsp[0].literal).text.start,
(yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &(yyval.u64)))) {
@@ -2727,11 +3149,11 @@ yyreduce:
WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
}
}
-#line 2731 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3153 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 84:
-#line 734 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 116:
+#line 903 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
if (WASM_FAILED(wasm_parse_uint64((yyvsp[0].literal).text.start,
(yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &(yyval.u64)))) {
@@ -2740,57 +3162,57 @@ yyreduce:
WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
}
}
-#line 2744 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3166 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 85:
-#line 745 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 117:
+#line 914 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.memory).loc = (yylsp[-4]);
(yyval.memory).initial_pages = (yyvsp[-3].u64);
(yyval.memory).max_pages = (yyvsp[-2].u64);
(yyval.memory).segments = (yyvsp[-1].segments);
}
-#line 2755 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3177 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 86:
-#line 751 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 118:
+#line 920 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.memory).loc = (yylsp[-3]);
(yyval.memory).initial_pages = (yyvsp[-2].u64);
(yyval.memory).max_pages = (yyval.memory).initial_pages;
(yyval.memory).segments = (yyvsp[-1].segments);
}
-#line 2766 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3188 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 87:
-#line 760 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 119:
+#line 929 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
WASM_ZERO_MEMORY((yyval.func_type));
(yyval.func_type).sig = (yyvsp[-2].func_sig);
}
-#line 2775 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3197 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 88:
-#line 764 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 120:
+#line 933 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.func_type).name = (yyvsp[-5].text);
(yyval.func_type).sig = (yyvsp[-2].func_sig);
}
-#line 2784 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3206 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 89:
-#line 771 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 121:
+#line 940 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ (yyval.vars) = (yyvsp[-1].vars); }
-#line 2790 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3212 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 90:
-#line 775 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 122:
+#line 944 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new_import(parser->allocator);
(yyval.import)->module_name = (yyvsp[-3].text);
@@ -2798,11 +3220,11 @@ yyreduce:
(yyval.import)->decl.flags = WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE;
(yyval.import)->decl.type_var = (yyvsp[-1].var);
}
-#line 2802 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3224 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 91:
-#line 782 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 123:
+#line 951 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new_import(parser->allocator);
(yyval.import)->name = (yyvsp[-4].text);
@@ -2811,22 +3233,22 @@ yyreduce:
(yyval.import)->decl.flags = WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE;
(yyval.import)->decl.type_var = (yyvsp[-1].var);
}
-#line 2815 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3237 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 92:
-#line 790 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 124:
+#line 959 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new_import(parser->allocator);
(yyval.import)->module_name = (yyvsp[-3].text);
(yyval.import)->func_name = (yyvsp[-2].text);
(yyval.import)->decl.sig = (yyvsp[-1].func_sig);
}
-#line 2826 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3248 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 93:
-#line 796 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 125:
+#line 965 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new_import(parser->allocator);
(yyval.import)->name = (yyvsp[-4].text);
@@ -2834,36 +3256,36 @@ yyreduce:
(yyval.import)->func_name = (yyvsp[-2].text);
(yyval.import)->decl.sig = (yyvsp[-1].func_sig);
}
-#line 2838 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3260 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 94:
-#line 806 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 126:
+#line 975 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.export_).name = (yyvsp[-2].text);
(yyval.export_).var = (yyvsp[-1].var);
}
-#line 2847 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3269 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 95:
-#line 813 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 127:
+#line 982 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.export_memory).name = (yyvsp[-2].text);
}
-#line 2855 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3277 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 96:
-#line 819 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 128:
+#line 988 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = new_module(parser->allocator);
}
-#line 2863 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3285 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 97:
-#line 822 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 129:
+#line 991 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -2903,11 +3325,11 @@ yyreduce:
binding->index = (yyval.module)->exports.size - 1;
}
}
-#line 2907 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3329 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 98:
-#line 861 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 130:
+#line 1030 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -2929,11 +3351,11 @@ yyreduce:
binding->index = (yyval.module)->imports.size - 1;
}
}
-#line 2933 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3355 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 99:
-#line 882 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 131:
+#line 1051 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -2951,11 +3373,11 @@ yyreduce:
binding->index = (yyval.module)->exports.size - 1;
}
}
-#line 2955 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3377 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 100:
-#line 899 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 132:
+#line 1068 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -2964,11 +3386,11 @@ yyreduce:
field->export_memory = (yyvsp[0].export_memory);
(yyval.module)->export_memory = &field->export_memory;
}
-#line 2968 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3390 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 101:
-#line 907 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 133:
+#line 1076 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -2977,11 +3399,11 @@ yyreduce:
field->table = (yyvsp[0].vars);
(yyval.module)->table = &field->table;
}
-#line 2981 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3403 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 102:
-#line 915 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 134:
+#line 1084 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -3000,11 +3422,11 @@ yyreduce:
binding->index = (yyval.module)->func_types.size - 1;
}
}
-#line 3004 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3426 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 103:
-#line 933 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 135:
+#line 1102 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -3013,11 +3435,11 @@ yyreduce:
field->memory = (yyvsp[0].memory);
(yyval.module)->memory = &field->memory;
}
-#line 3017 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3439 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 104:
-#line 941 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 136:
+#line 1110 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module));
@@ -3026,11 +3448,11 @@ yyreduce:
field->start = (yyvsp[0].var);
(yyval.module)->start = &field->start;
}
-#line 3030 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3452 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 105:
-#line 952 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 137:
+#line 1121 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.raw_module).type = WASM_RAW_MODULE_TYPE_TEXT;
(yyval.raw_module).text = (yyvsp[-1].module);
@@ -3065,22 +3487,22 @@ yyreduce:
}
}
}
-#line 3069 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3491 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 106:
-#line 986 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 138:
+#line 1155 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.raw_module).type = WASM_RAW_MODULE_TYPE_BINARY;
(yyval.raw_module).loc = (yylsp[-2]);
dup_text_list(parser->allocator, &(yyvsp[-1].text_list), &(yyval.raw_module).binary.data, &(yyval.raw_module).binary.size);
wasm_destroy_text_list(parser->allocator, &(yyvsp[-1].text_list));
}
-#line 3080 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3502 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 107:
-#line 995 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 139:
+#line 1164 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
if ((yyvsp[0].raw_module).type == WASM_RAW_MODULE_TYPE_TEXT) {
(yyval.module) = (yyvsp[0].raw_module).text;
@@ -3100,22 +3522,22 @@ yyreduce:
wasm_free(parser->allocator, (yyvsp[0].raw_module).binary.data);
}
}
-#line 3104 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3526 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 108:
-#line 1019 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 140:
+#line 1188 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new_command(parser->allocator);
(yyval.command)->type = WASM_COMMAND_TYPE_MODULE;
(yyval.command)->module = *(yyvsp[0].module);
wasm_free(parser->allocator, (yyvsp[0].module));
}
-#line 3115 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3537 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 109:
-#line 1025 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 141:
+#line 1194 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new_command(parser->allocator);
(yyval.command)->type = WASM_COMMAND_TYPE_INVOKE;
@@ -3123,22 +3545,22 @@ yyreduce:
(yyval.command)->invoke.name = (yyvsp[-2].text);
(yyval.command)->invoke.args = (yyvsp[-1].consts);
}
-#line 3127 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3549 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 110:
-#line 1032 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 142:
+#line 1201 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new_command(parser->allocator);
(yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_INVALID;
(yyval.command)->assert_invalid.module = (yyvsp[-2].raw_module);
(yyval.command)->assert_invalid.text = (yyvsp[-1].text);
}
-#line 3138 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3560 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 111:
-#line 1038 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 143:
+#line 1207 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new_command(parser->allocator);
(yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_RETURN;
@@ -3147,11 +3569,11 @@ yyreduce:
(yyval.command)->assert_return.invoke.args = (yyvsp[-3].consts);
(yyval.command)->assert_return.expected = (yyvsp[-1].const_);
}
-#line 3151 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3573 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 112:
-#line 1046 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 144:
+#line 1215 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new_command(parser->allocator);
(yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_RETURN_NAN;
@@ -3159,11 +3581,11 @@ yyreduce:
(yyval.command)->assert_return_nan.invoke.name = (yyvsp[-3].text);
(yyval.command)->assert_return_nan.invoke.args = (yyvsp[-2].consts);
}
-#line 3163 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3585 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 113:
-#line 1053 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 145:
+#line 1222 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new_command(parser->allocator);
(yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_TRAP;
@@ -3172,27 +3594,27 @@ yyreduce:
(yyval.command)->assert_trap.invoke.args = (yyvsp[-3].consts);
(yyval.command)->assert_trap.text = (yyvsp[-1].text);
}
-#line 3176 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3598 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 114:
-#line 1063 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 146:
+#line 1232 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.commands)); }
-#line 3182 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3604 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 115:
-#line 1064 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 147:
+#line 1233 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.commands) = (yyvsp[-1].commands);
wasm_append_command_value(parser->allocator, &(yyval.commands), (yyvsp[0].command));
wasm_free(parser->allocator, (yyvsp[0].command));
}
-#line 3192 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3614 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 116:
-#line 1072 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 148:
+#line 1241 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.const_).loc = (yylsp[-2]);
if (WASM_FAILED(parse_const((yyvsp[-2].type), (yyvsp[-1].literal).type, (yyvsp[-1].literal).text.start,
@@ -3203,41 +3625,41 @@ yyreduce:
}
wasm_free(parser->allocator, (char*)(yyvsp[-1].literal).text.start);
}
-#line 3207 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3629 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 117:
-#line 1084 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 149:
+#line 1253 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ (yyval.const_).type = WASM_TYPE_VOID; }
-#line 3213 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3635 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 119:
-#line 1088 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 151:
+#line 1257 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{ WASM_ZERO_MEMORY((yyval.consts)); }
-#line 3219 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3641 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 120:
-#line 1089 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 152:
+#line 1258 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.consts) = (yyvsp[-1].consts);
wasm_append_const_value(parser->allocator, &(yyval.consts), &(yyvsp[0].const_));
}
-#line 3228 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3650 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
- case 121:
-#line 1096 "src/wasm-ast-parser.y" /* yacc.c:1646 */
+ case 153:
+#line 1265 "src/wasm-ast-parser.y" /* yacc.c:1646 */
{
(yyval.script).commands = (yyvsp[0].commands);
parser->script = (yyval.script);
}
-#line 3237 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3659 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
break;
-#line 3241 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
+#line 3663 "src/prebuilt/wasm-ast-parser-gen.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3472,9 +3894,71 @@ yyreturn:
#endif
return yyresult;
}
-#line 1108 "src/wasm-ast-parser.y" /* yacc.c:1906 */
+#line 1277 "src/wasm-ast-parser.y" /* yacc.c:1906 */
+static void append_expr_list(WasmExprList* expr_list, WasmExprList* expr) {
+ if (!expr->first)
+ return;
+ if (expr_list->last)
+ expr_list->last->next = expr->first;
+ else
+ expr_list->first = expr->first;
+ expr_list->last = expr->last;
+ expr_list->size += expr->size;
+}
+
+static void append_expr(WasmExprList* expr_list, WasmExpr* expr) {
+ if (expr_list->last)
+ expr_list->last->next = expr;
+ else
+ expr_list->first = expr;
+ expr_list->last = expr;
+ expr_list->size++;
+}
+
+static WasmExprList join_exprs1(WasmLocation* loc, WasmExpr* expr1) {
+ WasmExprList result;
+ WASM_ZERO_MEMORY(result);
+ append_expr(&result, expr1);
+ expr1->loc = *loc;
+ return result;
+}
+
+static WasmExprList join_exprs2(WasmLocation* loc, WasmExprList* expr1,
+ WasmExpr* expr2) {
+ WasmExprList result;
+ WASM_ZERO_MEMORY(result);
+ append_expr_list(&result, expr1);
+ append_expr(&result, expr2);
+ expr2->loc = *loc;
+ return result;
+}
+
+static WasmExprList join_exprs3(WasmLocation* loc, WasmExprList* expr1,
+ WasmExprList* expr2, WasmExpr* expr3) {
+ WasmExprList result;
+ WASM_ZERO_MEMORY(result);
+ append_expr_list(&result, expr1);
+ append_expr_list(&result, expr2);
+ append_expr(&result, expr3);
+ expr3->loc = *loc;
+ return result;
+}
+
+static WasmExprList join_exprs4(WasmLocation* loc, WasmExprList* expr1,
+ WasmExprList* expr2, WasmExprList* expr3,
+ WasmExpr* expr4) {
+ WasmExprList result;
+ WASM_ZERO_MEMORY(result);
+ append_expr_list(&result, expr1);
+ append_expr_list(&result, expr2);
+ append_expr_list(&result, expr3);
+ append_expr(&result, expr4);
+ expr4->loc = *loc;
+ return result;
+}
+
static WasmResult parse_const(WasmType type,
WasmLiteralType literal_type,
const char* s,