diff options
Diffstat (limited to 'src/cmd/gc/y.tab.c')
-rw-r--r-- | src/cmd/gc/y.tab.c | 1762 |
1 files changed, 583 insertions, 1179 deletions
diff --git a/src/cmd/gc/y.tab.c b/src/cmd/gc/y.tab.c index 390ad80b3..08d8ecff2 100644 --- a/src/cmd/gc/y.tab.c +++ b/src/cmd/gc/y.tab.c @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -52,52 +55,11 @@ /* Pure parsers. */ #define YYPURE 0 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 0 -/* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 20 "go.y" - -#include <u.h> -#include <stdio.h> /* if we don't, bison will, and go.h re-#defines getc */ -#include <libc.h> -#include "go.h" - -static void fixlbrace(int); - - -/* Line 268 of yacc.c */ -#line 81 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -209,36 +171,61 @@ static void fixlbrace(int); +/* Copy the first part of user declarations. */ +#line 20 "go.y" + +#include <u.h> +#include <stdio.h> /* if we don't, bison will, and go.h re-#defines getc */ +#include <libc.h> +#include "go.h" + +static void fixlbrace(int); + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 293 of yacc.c */ #line 28 "go.y" - +{ Node* node; NodeList* list; Type* type; Sym* sym; struct Val val; int i; - - - -/* Line 293 of yacc.c */ -#line 230 "y.tab.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 193 of yacc.c. */ +#line 216 "y.tab.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif + /* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 242 "y.tab.c" +/* Line 216 of yacc.c. */ +#line 229 "y.tab.c" #ifdef short # undef short @@ -313,14 +300,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -341,11 +328,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -368,24 +355,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -401,9 +388,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -414,27 +401,6 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY @@ -452,7 +418,24 @@ union yyalloc while (YYID (0)) # endif # endif -#endif /* !YYCOPY_NEEDED */ + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 @@ -681,36 +664,36 @@ static const yytype_uint16 yyrline[] = 308, 312, 316, 322, 328, 334, 339, 343, 347, 353, 359, 363, 367, 373, 377, 383, 384, 388, 394, 403, 409, 427, 432, 444, 460, 465, 472, 492, 510, 519, - 538, 537, 552, 551, 582, 585, 592, 591, 602, 608, - 617, 628, 634, 637, 645, 644, 655, 661, 673, 677, - 682, 672, 703, 702, 715, 718, 724, 727, 739, 743, - 738, 761, 760, 776, 777, 781, 785, 789, 793, 797, - 801, 805, 809, 813, 817, 821, 825, 829, 833, 837, - 841, 845, 849, 854, 860, 861, 865, 876, 880, 884, - 888, 893, 897, 907, 911, 916, 924, 928, 929, 940, - 944, 948, 952, 956, 964, 965, 971, 978, 984, 991, - 994, 1001, 1007, 1024, 1031, 1032, 1039, 1040, 1059, 1060, - 1063, 1066, 1070, 1081, 1090, 1096, 1099, 1102, 1109, 1110, - 1116, 1129, 1144, 1152, 1164, 1169, 1175, 1176, 1177, 1178, - 1179, 1180, 1186, 1187, 1188, 1189, 1195, 1196, 1197, 1198, - 1199, 1205, 1206, 1209, 1212, 1213, 1214, 1215, 1216, 1219, - 1220, 1233, 1237, 1242, 1247, 1252, 1256, 1257, 1260, 1266, - 1273, 1279, 1286, 1292, 1303, 1317, 1346, 1386, 1411, 1429, - 1438, 1441, 1449, 1453, 1457, 1464, 1470, 1475, 1487, 1490, - 1500, 1501, 1507, 1508, 1514, 1518, 1524, 1525, 1531, 1535, - 1541, 1564, 1569, 1575, 1581, 1588, 1597, 1606, 1621, 1627, - 1632, 1636, 1643, 1656, 1657, 1663, 1669, 1672, 1676, 1682, - 1685, 1694, 1697, 1698, 1702, 1703, 1709, 1710, 1711, 1712, - 1713, 1715, 1714, 1729, 1734, 1738, 1742, 1746, 1750, 1755, - 1774, 1780, 1788, 1792, 1798, 1802, 1808, 1812, 1818, 1822, - 1831, 1835, 1839, 1843, 1849, 1852, 1860, 1861, 1863, 1864, - 1867, 1870, 1873, 1876, 1879, 1882, 1885, 1888, 1891, 1894, - 1897, 1900, 1903, 1906, 1912, 1916, 1920, 1924, 1928, 1932, - 1952, 1959, 1970, 1971, 1972, 1975, 1976, 1979, 1983, 1993, - 1997, 2001, 2005, 2009, 2013, 2017, 2023, 2029, 2037, 2045, - 2051, 2058, 2074, 2096, 2100, 2106, 2109, 2112, 2116, 2126, - 2130, 2145, 2153, 2154, 2166, 2167, 2170, 2174, 2180, 2184, - 2190, 2194 + 538, 537, 552, 551, 583, 586, 593, 592, 603, 609, + 618, 629, 635, 638, 646, 645, 656, 662, 674, 678, + 683, 673, 704, 703, 716, 719, 725, 728, 740, 744, + 739, 762, 761, 777, 778, 782, 786, 790, 794, 798, + 802, 806, 810, 814, 818, 822, 826, 830, 834, 838, + 842, 846, 850, 855, 861, 862, 866, 877, 881, 885, + 889, 894, 898, 908, 912, 917, 925, 929, 930, 941, + 945, 949, 953, 957, 965, 966, 972, 979, 985, 992, + 995, 1002, 1008, 1025, 1032, 1033, 1040, 1041, 1060, 1061, + 1064, 1067, 1071, 1082, 1091, 1097, 1100, 1103, 1110, 1111, + 1117, 1130, 1145, 1153, 1165, 1170, 1176, 1177, 1178, 1179, + 1180, 1181, 1187, 1188, 1189, 1190, 1196, 1197, 1198, 1199, + 1200, 1206, 1207, 1210, 1213, 1214, 1215, 1216, 1217, 1220, + 1221, 1234, 1238, 1243, 1248, 1253, 1257, 1258, 1261, 1267, + 1274, 1280, 1287, 1293, 1304, 1318, 1347, 1387, 1412, 1430, + 1439, 1442, 1450, 1454, 1458, 1465, 1471, 1476, 1488, 1491, + 1501, 1502, 1508, 1509, 1515, 1519, 1525, 1526, 1532, 1536, + 1542, 1565, 1570, 1576, 1582, 1589, 1598, 1607, 1622, 1628, + 1633, 1637, 1644, 1657, 1658, 1664, 1670, 1673, 1677, 1683, + 1686, 1695, 1698, 1699, 1703, 1704, 1710, 1711, 1712, 1713, + 1714, 1716, 1715, 1730, 1736, 1740, 1744, 1748, 1752, 1757, + 1776, 1782, 1790, 1794, 1800, 1804, 1810, 1814, 1820, 1824, + 1833, 1837, 1841, 1845, 1851, 1854, 1862, 1863, 1865, 1866, + 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890, 1893, 1896, + 1899, 1902, 1905, 1908, 1914, 1918, 1922, 1926, 1930, 1934, + 1954, 1961, 1972, 1973, 1974, 1977, 1978, 1981, 1985, 1995, + 1999, 2003, 2007, 2011, 2015, 2019, 2025, 2031, 2039, 2047, + 2053, 2060, 2076, 2098, 2102, 2108, 2111, 2114, 2118, 2128, + 2132, 2151, 2159, 2160, 2172, 2173, 2176, 2180, 2186, 2190, + 2196, 2200 }; #endif @@ -729,16 +712,16 @@ const char *yytname[] = "'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'", "PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'", "'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$accept", "file", - "package", "loadsys", "$@1", "imports", "import", "import_stmt", + "package", "loadsys", "@1", "imports", "import", "import_stmt", "import_stmt_list", "import_here", "import_package", "import_safety", - "import_there", "$@2", "xdcl", "common_dcl", "lconst", "vardcl", + "import_there", "@2", "xdcl", "common_dcl", "lconst", "vardcl", "constdcl", "constdcl1", "typedclname", "typedcl", "simple_stmt", "case", - "compound_stmt", "$@3", "caseblock", "$@4", "caseblock_list", - "loop_body", "$@5", "range_stmt", "for_header", "for_body", "for_stmt", - "$@6", "if_header", "if_stmt", "$@7", "$@8", "$@9", "elseif", "$@10", - "elseif_list", "else", "switch_stmt", "$@11", "$@12", "select_stmt", - "$@13", "expr", "uexpr", "pseudocall", "pexpr_no_paren", "start_complit", - "keyval", "bare_complitexpr", "complitexpr", "pexpr", "expr_or_type", + "compound_stmt", "@3", "caseblock", "@4", "caseblock_list", "loop_body", + "@5", "range_stmt", "for_header", "for_body", "for_stmt", "@6", + "if_header", "if_stmt", "@7", "@8", "@9", "elseif", "@10", "elseif_list", + "else", "switch_stmt", "@11", "@12", "select_stmt", "@13", "expr", + "uexpr", "pseudocall", "pexpr_no_paren", "start_complit", "keyval", + "bare_complitexpr", "complitexpr", "pexpr", "expr_or_type", "name_or_type", "lbrace", "new_name", "dcl_name", "onew_name", "sym", "hidden_importsym", "name", "labelname", "dotdotdot", "ntype", "non_expr_type", "non_recvchantype", "convtype", "comptype", @@ -748,7 +731,7 @@ const char *yytname[] = "vardcl_list", "constdcl_list", "typedcl_list", "structdcl_list", "interfacedcl_list", "structdcl", "packname", "embed", "interfacedcl", "indcl", "arg_type", "arg_type_list", "oarg_type_list_ocomma", "stmt", - "non_dcl_stmt", "$@14", "stmt_list", "new_name_list", "dcl_name_list", + "non_dcl_stmt", "@14", "stmt_list", "new_name_list", "dcl_name_list", "expr_list", "expr_or_type_list", "keyval_list", "braced_keyval_list", "osemi", "ocomma", "oexpr", "oexpr_list", "osimple_stmt", "ohidden_funarg_list", "ohidden_structdcl_list", @@ -861,8 +844,8 @@ static const yytype_uint8 yyr2[] = 1, 3 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { @@ -1051,7 +1034,8 @@ static const yytype_int16 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -277 static const yytype_int16 yytable[] = { @@ -1285,12 +1269,6 @@ static const yytype_int16 yytable[] = 198 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-474)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { 37, 37, 61, 143, 67, 37, 37, 202, 324, 251, @@ -1608,18 +1586,9 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1629,6 +1598,7 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -1670,10 +1640,19 @@ while (YYID (0)) #endif -/* This macro is provided for backward compatibility. */ +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif @@ -1777,20 +1756,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1824,11 +1800,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1865,6 +1841,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1967,142 +1944,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } + int yyn = yypact[yystate]; - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } + if (yysize_overflow) + return YYSIZE_MAXIMUM; - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -2134,9 +2084,10 @@ yydestruct (yymsg, yytype, yyvaluep) break; } } - + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -2152,16 +2103,18 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ -/* The lookahead symbol. */ + +/* The look-ahead symbol. */ int yychar, yystate; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; + /*----------. | yyparse. | `----------*/ @@ -2188,36 +2141,13 @@ yyparse () #endif #endif { - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - + int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -2225,28 +2155,51 @@ yyparse () YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; @@ -2276,6 +2229,7 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -2283,6 +2237,7 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -2305,8 +2260,9 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -2317,6 +2273,7 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -2326,9 +2283,6 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -2337,16 +2291,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -2372,22 +2326,26 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -2427,8 +2385,6 @@ yyreduce: switch (yyn) { case 2: - -/* Line 1806 of yacc.c */ #line 128 "go.y" { xtop = concat(xtop, (yyvsp[(4) - (4)].list)); @@ -2436,8 +2392,6 @@ yyreduce: break; case 3: - -/* Line 1806 of yacc.c */ #line 134 "go.y" { prevlineno = lineno; @@ -2447,8 +2401,6 @@ yyreduce: break; case 4: - -/* Line 1806 of yacc.c */ #line 140 "go.y" { mkpackage((yyvsp[(2) - (3)].sym)->name); @@ -2456,8 +2408,6 @@ yyreduce: break; case 5: - -/* Line 1806 of yacc.c */ #line 150 "go.y" { importpkg = runtimepkg; @@ -2471,8 +2421,6 @@ yyreduce: break; case 6: - -/* Line 1806 of yacc.c */ #line 161 "go.y" { importpkg = nil; @@ -2480,8 +2428,6 @@ yyreduce: break; case 12: - -/* Line 1806 of yacc.c */ #line 175 "go.y" { Pkg *ipkg; @@ -2522,8 +2468,6 @@ yyreduce: break; case 13: - -/* Line 1806 of yacc.c */ #line 212 "go.y" { // When an invalid import path is passed to importfile, @@ -2536,8 +2480,6 @@ yyreduce: break; case 16: - -/* Line 1806 of yacc.c */ #line 227 "go.y" { // import with original name @@ -2548,8 +2490,6 @@ yyreduce: break; case 17: - -/* Line 1806 of yacc.c */ #line 234 "go.y" { // import with given name @@ -2560,8 +2500,6 @@ yyreduce: break; case 18: - -/* Line 1806 of yacc.c */ #line 241 "go.y" { // import into my name space @@ -2572,8 +2510,6 @@ yyreduce: break; case 19: - -/* Line 1806 of yacc.c */ #line 250 "go.y" { if(importpkg->name == nil) { @@ -2590,8 +2526,6 @@ yyreduce: break; case 21: - -/* Line 1806 of yacc.c */ #line 265 "go.y" { if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0) @@ -2600,8 +2534,6 @@ yyreduce: break; case 22: - -/* Line 1806 of yacc.c */ #line 271 "go.y" { defercheckwidth(); @@ -2609,8 +2541,6 @@ yyreduce: break; case 23: - -/* Line 1806 of yacc.c */ #line 275 "go.y" { resumecheckwidth(); @@ -2619,8 +2549,6 @@ yyreduce: break; case 24: - -/* Line 1806 of yacc.c */ #line 284 "go.y" { yyerror("empty top-level declaration"); @@ -2629,8 +2557,6 @@ yyreduce: break; case 26: - -/* Line 1806 of yacc.c */ #line 290 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -2638,8 +2564,6 @@ yyreduce: break; case 27: - -/* Line 1806 of yacc.c */ #line 294 "go.y" { yyerror("non-declaration statement outside function body"); @@ -2648,8 +2572,6 @@ yyreduce: break; case 28: - -/* Line 1806 of yacc.c */ #line 299 "go.y" { (yyval.list) = nil; @@ -2657,8 +2579,6 @@ yyreduce: break; case 29: - -/* Line 1806 of yacc.c */ #line 305 "go.y" { (yyval.list) = (yyvsp[(2) - (2)].list); @@ -2666,8 +2586,6 @@ yyreduce: break; case 30: - -/* Line 1806 of yacc.c */ #line 309 "go.y" { (yyval.list) = (yyvsp[(3) - (5)].list); @@ -2675,8 +2593,6 @@ yyreduce: break; case 31: - -/* Line 1806 of yacc.c */ #line 313 "go.y" { (yyval.list) = nil; @@ -2684,8 +2600,6 @@ yyreduce: break; case 32: - -/* Line 1806 of yacc.c */ #line 317 "go.y" { (yyval.list) = (yyvsp[(2) - (2)].list); @@ -2695,8 +2609,6 @@ yyreduce: break; case 33: - -/* Line 1806 of yacc.c */ #line 323 "go.y" { (yyval.list) = (yyvsp[(3) - (5)].list); @@ -2706,8 +2618,6 @@ yyreduce: break; case 34: - -/* Line 1806 of yacc.c */ #line 329 "go.y" { (yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list)); @@ -2717,8 +2627,6 @@ yyreduce: break; case 35: - -/* Line 1806 of yacc.c */ #line 335 "go.y" { (yyval.list) = nil; @@ -2727,8 +2635,6 @@ yyreduce: break; case 36: - -/* Line 1806 of yacc.c */ #line 340 "go.y" { (yyval.list) = list1((yyvsp[(2) - (2)].node)); @@ -2736,8 +2642,6 @@ yyreduce: break; case 37: - -/* Line 1806 of yacc.c */ #line 344 "go.y" { (yyval.list) = (yyvsp[(3) - (5)].list); @@ -2745,8 +2649,6 @@ yyreduce: break; case 38: - -/* Line 1806 of yacc.c */ #line 348 "go.y" { (yyval.list) = nil; @@ -2754,8 +2656,6 @@ yyreduce: break; case 39: - -/* Line 1806 of yacc.c */ #line 354 "go.y" { iota = 0; @@ -2763,8 +2663,6 @@ yyreduce: break; case 40: - -/* Line 1806 of yacc.c */ #line 360 "go.y" { (yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); @@ -2772,8 +2670,6 @@ yyreduce: break; case 41: - -/* Line 1806 of yacc.c */ #line 364 "go.y" { (yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); @@ -2781,8 +2677,6 @@ yyreduce: break; case 42: - -/* Line 1806 of yacc.c */ #line 368 "go.y" { (yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list)); @@ -2790,8 +2684,6 @@ yyreduce: break; case 43: - -/* Line 1806 of yacc.c */ #line 374 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); @@ -2799,8 +2691,6 @@ yyreduce: break; case 44: - -/* Line 1806 of yacc.c */ #line 378 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list)); @@ -2808,8 +2698,6 @@ yyreduce: break; case 46: - -/* Line 1806 of yacc.c */ #line 385 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); @@ -2817,8 +2705,6 @@ yyreduce: break; case 47: - -/* Line 1806 of yacc.c */ #line 389 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil); @@ -2826,8 +2712,6 @@ yyreduce: break; case 48: - -/* Line 1806 of yacc.c */ #line 395 "go.y" { // different from dclname because the name @@ -2838,8 +2722,6 @@ yyreduce: break; case 49: - -/* Line 1806 of yacc.c */ #line 404 "go.y" { (yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1); @@ -2847,8 +2729,6 @@ yyreduce: break; case 50: - -/* Line 1806 of yacc.c */ #line 410 "go.y" { (yyval.node) = (yyvsp[(1) - (1)].node); @@ -2870,8 +2750,6 @@ yyreduce: break; case 51: - -/* Line 1806 of yacc.c */ #line 428 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -2880,8 +2758,6 @@ yyreduce: break; case 52: - -/* Line 1806 of yacc.c */ #line 433 "go.y" { if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) { @@ -2897,8 +2773,6 @@ yyreduce: break; case 53: - -/* Line 1806 of yacc.c */ #line 445 "go.y" { if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) { @@ -2918,8 +2792,6 @@ yyreduce: break; case 54: - -/* Line 1806 of yacc.c */ #line 461 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); @@ -2928,8 +2800,6 @@ yyreduce: break; case 55: - -/* Line 1806 of yacc.c */ #line 466 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); @@ -2938,8 +2808,6 @@ yyreduce: break; case 56: - -/* Line 1806 of yacc.c */ #line 473 "go.y" { Node *n, *nn; @@ -2963,8 +2831,6 @@ yyreduce: break; case 57: - -/* Line 1806 of yacc.c */ #line 493 "go.y" { Node *n; @@ -2986,8 +2852,6 @@ yyreduce: break; case 58: - -/* Line 1806 of yacc.c */ #line 511 "go.y" { // will be converted to OCASE @@ -3000,8 +2864,6 @@ yyreduce: break; case 59: - -/* Line 1806 of yacc.c */ #line 520 "go.y" { Node *n, *nn; @@ -3021,8 +2883,6 @@ yyreduce: break; case 60: - -/* Line 1806 of yacc.c */ #line 538 "go.y" { markdcl(); @@ -3030,8 +2890,6 @@ yyreduce: break; case 61: - -/* Line 1806 of yacc.c */ #line 542 "go.y" { if((yyvsp[(3) - (4)].list) == nil) @@ -3043,8 +2901,6 @@ yyreduce: break; case 62: - -/* Line 1806 of yacc.c */ #line 552 "go.y" { // If the last token read by the lexer was consumed @@ -3054,13 +2910,12 @@ yyreduce: // This is so that the stmt_list action doesn't look at // the case tokens if the stmt_list is empty. yylast = yychar; + (yyvsp[(1) - (1)].node)->xoffset = block; } break; case 63: - -/* Line 1806 of yacc.c */ -#line 562 "go.y" +#line 563 "go.y" { int last; @@ -3082,36 +2937,28 @@ yyreduce: break; case 64: - -/* Line 1806 of yacc.c */ -#line 582 "go.y" +#line 583 "go.y" { (yyval.list) = nil; } break; case 65: - -/* Line 1806 of yacc.c */ -#line 586 "go.y" +#line 587 "go.y" { (yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); } break; case 66: - -/* Line 1806 of yacc.c */ -#line 592 "go.y" +#line 593 "go.y" { markdcl(); } break; case 67: - -/* Line 1806 of yacc.c */ -#line 596 "go.y" +#line 597 "go.y" { (yyval.list) = (yyvsp[(3) - (4)].list); popdcl(); @@ -3119,9 +2966,7 @@ yyreduce: break; case 68: - -/* Line 1806 of yacc.c */ -#line 603 "go.y" +#line 604 "go.y" { (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node)->list = (yyvsp[(1) - (4)].list); @@ -3130,9 +2975,7 @@ yyreduce: break; case 69: - -/* Line 1806 of yacc.c */ -#line 609 "go.y" +#line 610 "go.y" { (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node)->list = (yyvsp[(1) - (4)].list); @@ -3142,9 +2985,7 @@ yyreduce: break; case 70: - -/* Line 1806 of yacc.c */ -#line 618 "go.y" +#line 619 "go.y" { // init ; test ; incr if((yyvsp[(5) - (5)].node) != N && (yyvsp[(5) - (5)].node)->colas != 0) @@ -3158,9 +2999,7 @@ yyreduce: break; case 71: - -/* Line 1806 of yacc.c */ -#line 629 "go.y" +#line 630 "go.y" { // normal test (yyval.node) = nod(OFOR, N, N); @@ -3169,9 +3008,7 @@ yyreduce: break; case 73: - -/* Line 1806 of yacc.c */ -#line 638 "go.y" +#line 639 "go.y" { (yyval.node) = (yyvsp[(1) - (2)].node); (yyval.node)->nbody = concat((yyval.node)->nbody, (yyvsp[(2) - (2)].list)); @@ -3179,18 +3016,14 @@ yyreduce: break; case 74: - -/* Line 1806 of yacc.c */ -#line 645 "go.y" +#line 646 "go.y" { markdcl(); } break; case 75: - -/* Line 1806 of yacc.c */ -#line 649 "go.y" +#line 650 "go.y" { (yyval.node) = (yyvsp[(3) - (3)].node); popdcl(); @@ -3198,9 +3031,7 @@ yyreduce: break; case 76: - -/* Line 1806 of yacc.c */ -#line 656 "go.y" +#line 657 "go.y" { // test (yyval.node) = nod(OIF, N, N); @@ -3209,9 +3040,7 @@ yyreduce: break; case 77: - -/* Line 1806 of yacc.c */ -#line 662 "go.y" +#line 663 "go.y" { // init ; test (yyval.node) = nod(OIF, N, N); @@ -3222,18 +3051,14 @@ yyreduce: break; case 78: - -/* Line 1806 of yacc.c */ -#line 673 "go.y" +#line 674 "go.y" { markdcl(); } break; case 79: - -/* Line 1806 of yacc.c */ -#line 677 "go.y" +#line 678 "go.y" { if((yyvsp[(3) - (3)].node)->ntest == N) yyerror("missing condition in if statement"); @@ -3241,18 +3066,14 @@ yyreduce: break; case 80: - -/* Line 1806 of yacc.c */ -#line 682 "go.y" +#line 683 "go.y" { (yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list); } break; case 81: - -/* Line 1806 of yacc.c */ -#line 686 "go.y" +#line 687 "go.y" { Node *n; NodeList *nn; @@ -3270,18 +3091,14 @@ yyreduce: break; case 82: - -/* Line 1806 of yacc.c */ -#line 703 "go.y" +#line 704 "go.y" { markdcl(); } break; case 83: - -/* Line 1806 of yacc.c */ -#line 707 "go.y" +#line 708 "go.y" { if((yyvsp[(4) - (5)].node)->ntest == N) yyerror("missing condition in if statement"); @@ -3291,36 +3108,28 @@ yyreduce: break; case 84: - -/* Line 1806 of yacc.c */ -#line 715 "go.y" +#line 716 "go.y" { (yyval.list) = nil; } break; case 85: - -/* Line 1806 of yacc.c */ -#line 719 "go.y" +#line 720 "go.y" { (yyval.list) = concat((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); } break; case 86: - -/* Line 1806 of yacc.c */ -#line 724 "go.y" +#line 725 "go.y" { (yyval.list) = nil; } break; case 87: - -/* Line 1806 of yacc.c */ -#line 728 "go.y" +#line 729 "go.y" { NodeList *node; @@ -3332,18 +3141,14 @@ yyreduce: break; case 88: - -/* Line 1806 of yacc.c */ -#line 739 "go.y" +#line 740 "go.y" { markdcl(); } break; case 89: - -/* Line 1806 of yacc.c */ -#line 743 "go.y" +#line 744 "go.y" { Node *n; n = (yyvsp[(3) - (3)].node)->ntest; @@ -3354,9 +3159,7 @@ yyreduce: break; case 90: - -/* Line 1806 of yacc.c */ -#line 751 "go.y" +#line 752 "go.y" { (yyval.node) = (yyvsp[(3) - (7)].node); (yyval.node)->op = OSWITCH; @@ -3367,18 +3170,14 @@ yyreduce: break; case 91: - -/* Line 1806 of yacc.c */ -#line 761 "go.y" +#line 762 "go.y" { typesw = nod(OXXX, typesw, N); } break; case 92: - -/* Line 1806 of yacc.c */ -#line 765 "go.y" +#line 766 "go.y" { (yyval.node) = nod(OSELECT, N, N); (yyval.node)->lineno = typesw->lineno; @@ -3388,198 +3187,154 @@ yyreduce: break; case 94: - -/* Line 1806 of yacc.c */ -#line 778 "go.y" +#line 779 "go.y" { (yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 95: - -/* Line 1806 of yacc.c */ -#line 782 "go.y" +#line 783 "go.y" { (yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 96: - -/* Line 1806 of yacc.c */ -#line 786 "go.y" +#line 787 "go.y" { (yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 97: - -/* Line 1806 of yacc.c */ -#line 790 "go.y" +#line 791 "go.y" { (yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 98: - -/* Line 1806 of yacc.c */ -#line 794 "go.y" +#line 795 "go.y" { (yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 99: - -/* Line 1806 of yacc.c */ -#line 798 "go.y" +#line 799 "go.y" { (yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 100: - -/* Line 1806 of yacc.c */ -#line 802 "go.y" +#line 803 "go.y" { (yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 101: - -/* Line 1806 of yacc.c */ -#line 806 "go.y" +#line 807 "go.y" { (yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 102: - -/* Line 1806 of yacc.c */ -#line 810 "go.y" +#line 811 "go.y" { (yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 103: - -/* Line 1806 of yacc.c */ -#line 814 "go.y" +#line 815 "go.y" { (yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 104: - -/* Line 1806 of yacc.c */ -#line 818 "go.y" +#line 819 "go.y" { (yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 105: - -/* Line 1806 of yacc.c */ -#line 822 "go.y" +#line 823 "go.y" { (yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 106: - -/* Line 1806 of yacc.c */ -#line 826 "go.y" +#line 827 "go.y" { (yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 107: - -/* Line 1806 of yacc.c */ -#line 830 "go.y" +#line 831 "go.y" { (yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 108: - -/* Line 1806 of yacc.c */ -#line 834 "go.y" +#line 835 "go.y" { (yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 109: - -/* Line 1806 of yacc.c */ -#line 838 "go.y" +#line 839 "go.y" { (yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 110: - -/* Line 1806 of yacc.c */ -#line 842 "go.y" +#line 843 "go.y" { (yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 111: - -/* Line 1806 of yacc.c */ -#line 846 "go.y" +#line 847 "go.y" { (yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 112: - -/* Line 1806 of yacc.c */ -#line 850 "go.y" +#line 851 "go.y" { (yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 113: - -/* Line 1806 of yacc.c */ -#line 855 "go.y" +#line 856 "go.y" { (yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 115: - -/* Line 1806 of yacc.c */ -#line 862 "go.y" +#line 863 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); } break; case 116: - -/* Line 1806 of yacc.c */ -#line 866 "go.y" +#line 867 "go.y" { if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) { // Special case for &T{...}: turn into (*T){...}. @@ -3593,36 +3348,28 @@ yyreduce: break; case 117: - -/* Line 1806 of yacc.c */ -#line 877 "go.y" +#line 878 "go.y" { (yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N); } break; case 118: - -/* Line 1806 of yacc.c */ -#line 881 "go.y" +#line 882 "go.y" { (yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N); } break; case 119: - -/* Line 1806 of yacc.c */ -#line 885 "go.y" +#line 886 "go.y" { (yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N); } break; case 120: - -/* Line 1806 of yacc.c */ -#line 889 "go.y" +#line 890 "go.y" { yyerror("the bitwise complement operator is ^"); (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); @@ -3630,36 +3377,28 @@ yyreduce: break; case 121: - -/* Line 1806 of yacc.c */ -#line 894 "go.y" +#line 895 "go.y" { (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); } break; case 122: - -/* Line 1806 of yacc.c */ -#line 898 "go.y" +#line 899 "go.y" { (yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N); } break; case 123: - -/* Line 1806 of yacc.c */ -#line 908 "go.y" +#line 909 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N); } break; case 124: - -/* Line 1806 of yacc.c */ -#line 912 "go.y" +#line 913 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); (yyval.node)->list = (yyvsp[(3) - (5)].list); @@ -3667,9 +3406,7 @@ yyreduce: break; case 125: - -/* Line 1806 of yacc.c */ -#line 917 "go.y" +#line 918 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N); (yyval.node)->list = (yyvsp[(3) - (6)].list); @@ -3678,18 +3415,14 @@ yyreduce: break; case 126: - -/* Line 1806 of yacc.c */ -#line 925 "go.y" +#line 926 "go.y" { (yyval.node) = nodlit((yyvsp[(1) - (1)].val)); } break; case 128: - -/* Line 1806 of yacc.c */ -#line 930 "go.y" +#line 931 "go.y" { if((yyvsp[(1) - (3)].node)->op == OPACK) { Sym *s; @@ -3703,45 +3436,35 @@ yyreduce: break; case 129: - -/* Line 1806 of yacc.c */ -#line 941 "go.y" +#line 942 "go.y" { (yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); } break; case 130: - -/* Line 1806 of yacc.c */ -#line 945 "go.y" +#line 946 "go.y" { (yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node)); } break; case 131: - -/* Line 1806 of yacc.c */ -#line 949 "go.y" +#line 950 "go.y" { (yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); } break; case 132: - -/* Line 1806 of yacc.c */ -#line 953 "go.y" +#line 954 "go.y" { (yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node))); } break; case 133: - -/* Line 1806 of yacc.c */ -#line 957 "go.y" +#line 958 "go.y" { if((yyvsp[(5) - (8)].node) == N) yyerror("middle index required in 3-index slice"); @@ -3752,9 +3475,7 @@ yyreduce: break; case 135: - -/* Line 1806 of yacc.c */ -#line 966 "go.y" +#line 967 "go.y" { // conversion (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); @@ -3763,9 +3484,7 @@ yyreduce: break; case 136: - -/* Line 1806 of yacc.c */ -#line 972 "go.y" +#line 973 "go.y" { (yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node)->right = (yyvsp[(1) - (5)].node); @@ -3775,9 +3494,7 @@ yyreduce: break; case 137: - -/* Line 1806 of yacc.c */ -#line 979 "go.y" +#line 980 "go.y" { (yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node)->right = (yyvsp[(1) - (5)].node); @@ -3786,9 +3503,7 @@ yyreduce: break; case 138: - -/* Line 1806 of yacc.c */ -#line 985 "go.y" +#line 986 "go.y" { yyerror("cannot parenthesize type in composite literal"); (yyval.node) = (yyvsp[(5) - (7)].node); @@ -3798,9 +3513,7 @@ yyreduce: break; case 140: - -/* Line 1806 of yacc.c */ -#line 994 "go.y" +#line 995 "go.y" { // composite expression. // make node early so we get the right line number. @@ -3809,18 +3522,14 @@ yyreduce: break; case 141: - -/* Line 1806 of yacc.c */ -#line 1002 "go.y" +#line 1003 "go.y" { (yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; case 142: - -/* Line 1806 of yacc.c */ -#line 1008 "go.y" +#line 1009 "go.y" { // These nodes do not carry line numbers. // Since a composite literal commonly spans several lines, @@ -3840,9 +3549,7 @@ yyreduce: break; case 143: - -/* Line 1806 of yacc.c */ -#line 1025 "go.y" +#line 1026 "go.y" { (yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node)->list = (yyvsp[(3) - (4)].list); @@ -3850,9 +3557,7 @@ yyreduce: break; case 145: - -/* Line 1806 of yacc.c */ -#line 1033 "go.y" +#line 1034 "go.y" { (yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node)->list = (yyvsp[(3) - (4)].list); @@ -3860,9 +3565,7 @@ yyreduce: break; case 147: - -/* Line 1806 of yacc.c */ -#line 1041 "go.y" +#line 1042 "go.y" { (yyval.node) = (yyvsp[(2) - (3)].node); @@ -3882,27 +3585,21 @@ yyreduce: break; case 151: - -/* Line 1806 of yacc.c */ -#line 1067 "go.y" +#line 1068 "go.y" { (yyval.i) = LBODY; } break; case 152: - -/* Line 1806 of yacc.c */ -#line 1071 "go.y" +#line 1072 "go.y" { (yyval.i) = '{'; } break; case 153: - -/* Line 1806 of yacc.c */ -#line 1082 "go.y" +#line 1083 "go.y" { if((yyvsp[(1) - (1)].sym) == S) (yyval.node) = N; @@ -3912,27 +3609,21 @@ yyreduce: break; case 154: - -/* Line 1806 of yacc.c */ -#line 1091 "go.y" +#line 1092 "go.y" { (yyval.node) = dclname((yyvsp[(1) - (1)].sym)); } break; case 155: - -/* Line 1806 of yacc.c */ -#line 1096 "go.y" +#line 1097 "go.y" { (yyval.node) = N; } break; case 157: - -/* Line 1806 of yacc.c */ -#line 1103 "go.y" +#line 1104 "go.y" { (yyval.sym) = (yyvsp[(1) - (1)].sym); // during imports, unqualified non-exported identifiers are from builtinpkg @@ -3942,18 +3633,14 @@ yyreduce: break; case 159: - -/* Line 1806 of yacc.c */ -#line 1111 "go.y" +#line 1112 "go.y" { (yyval.sym) = S; } break; case 160: - -/* Line 1806 of yacc.c */ -#line 1117 "go.y" +#line 1118 "go.y" { Pkg *p; @@ -3969,9 +3656,7 @@ yyreduce: break; case 161: - -/* Line 1806 of yacc.c */ -#line 1130 "go.y" +#line 1131 "go.y" { Pkg *p; @@ -3987,9 +3672,7 @@ yyreduce: break; case 162: - -/* Line 1806 of yacc.c */ -#line 1145 "go.y" +#line 1146 "go.y" { (yyval.node) = oldname((yyvsp[(1) - (1)].sym)); if((yyval.node)->pack != N) @@ -3998,9 +3681,7 @@ yyreduce: break; case 164: - -/* Line 1806 of yacc.c */ -#line 1165 "go.y" +#line 1166 "go.y" { yyerror("final argument in variadic function missing type"); (yyval.node) = nod(ODDD, typenod(typ(TINTER)), N); @@ -4008,45 +3689,35 @@ yyreduce: break; case 165: - -/* Line 1806 of yacc.c */ -#line 1170 "go.y" +#line 1171 "go.y" { (yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N); } break; case 171: - -/* Line 1806 of yacc.c */ -#line 1181 "go.y" +#line 1182 "go.y" { (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); } break; case 175: - -/* Line 1806 of yacc.c */ -#line 1190 "go.y" +#line 1191 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); } break; case 180: - -/* Line 1806 of yacc.c */ -#line 1200 "go.y" +#line 1201 "go.y" { (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); } break; case 190: - -/* Line 1806 of yacc.c */ -#line 1221 "go.y" +#line 1222 "go.y" { if((yyvsp[(1) - (3)].node)->op == OPACK) { Sym *s; @@ -4060,18 +3731,14 @@ yyreduce: break; case 191: - -/* Line 1806 of yacc.c */ -#line 1234 "go.y" +#line 1235 "go.y" { (yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node)); } break; case 192: - -/* Line 1806 of yacc.c */ -#line 1238 "go.y" +#line 1239 "go.y" { // array literal of nelem (yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node)); @@ -4079,9 +3746,7 @@ yyreduce: break; case 193: - -/* Line 1806 of yacc.c */ -#line 1243 "go.y" +#line 1244 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N); (yyval.node)->etype = Cboth; @@ -4089,9 +3754,7 @@ yyreduce: break; case 194: - -/* Line 1806 of yacc.c */ -#line 1248 "go.y" +#line 1249 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node)->etype = Csend; @@ -4099,27 +3762,21 @@ yyreduce: break; case 195: - -/* Line 1806 of yacc.c */ -#line 1253 "go.y" +#line 1254 "go.y" { (yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)); } break; case 198: - -/* Line 1806 of yacc.c */ -#line 1261 "go.y" +#line 1262 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); } break; case 199: - -/* Line 1806 of yacc.c */ -#line 1267 "go.y" +#line 1268 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node)->etype = Crecv; @@ -4127,9 +3784,7 @@ yyreduce: break; case 200: - -/* Line 1806 of yacc.c */ -#line 1274 "go.y" +#line 1275 "go.y" { (yyval.node) = nod(OTSTRUCT, N, N); (yyval.node)->list = (yyvsp[(3) - (5)].list); @@ -4138,9 +3793,7 @@ yyreduce: break; case 201: - -/* Line 1806 of yacc.c */ -#line 1280 "go.y" +#line 1281 "go.y" { (yyval.node) = nod(OTSTRUCT, N, N); fixlbrace((yyvsp[(2) - (3)].i)); @@ -4148,9 +3801,7 @@ yyreduce: break; case 202: - -/* Line 1806 of yacc.c */ -#line 1287 "go.y" +#line 1288 "go.y" { (yyval.node) = nod(OTINTER, N, N); (yyval.node)->list = (yyvsp[(3) - (5)].list); @@ -4159,9 +3810,7 @@ yyreduce: break; case 203: - -/* Line 1806 of yacc.c */ -#line 1293 "go.y" +#line 1294 "go.y" { (yyval.node) = nod(OTINTER, N, N); fixlbrace((yyvsp[(2) - (3)].i)); @@ -4169,9 +3818,7 @@ yyreduce: break; case 204: - -/* Line 1806 of yacc.c */ -#line 1304 "go.y" +#line 1305 "go.y" { (yyval.node) = (yyvsp[(2) - (3)].node); if((yyval.node) == N) @@ -4186,9 +3833,7 @@ yyreduce: break; case 205: - -/* Line 1806 of yacc.c */ -#line 1318 "go.y" +#line 1319 "go.y" { Node *t; @@ -4220,9 +3865,7 @@ yyreduce: break; case 206: - -/* Line 1806 of yacc.c */ -#line 1347 "go.y" +#line 1348 "go.y" { Node *rcvr, *t; @@ -4263,9 +3906,7 @@ yyreduce: break; case 207: - -/* Line 1806 of yacc.c */ -#line 1387 "go.y" +#line 1388 "go.y" { Sym *s; Type *t; @@ -4293,9 +3934,7 @@ yyreduce: break; case 208: - -/* Line 1806 of yacc.c */ -#line 1412 "go.y" +#line 1413 "go.y" { (yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right); (yyval.node)->type = functype((yyvsp[(2) - (8)].list)->n, (yyvsp[(6) - (8)].list), (yyvsp[(8) - (8)].list)); @@ -4314,9 +3953,7 @@ yyreduce: break; case 209: - -/* Line 1806 of yacc.c */ -#line 1430 "go.y" +#line 1431 "go.y" { (yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1); (yyval.node) = nod(OTFUNC, N, N); @@ -4326,18 +3963,14 @@ yyreduce: break; case 210: - -/* Line 1806 of yacc.c */ -#line 1438 "go.y" +#line 1439 "go.y" { (yyval.list) = nil; } break; case 211: - -/* Line 1806 of yacc.c */ -#line 1442 "go.y" +#line 1443 "go.y" { (yyval.list) = (yyvsp[(2) - (3)].list); if((yyval.list) == nil) @@ -4346,27 +3979,21 @@ yyreduce: break; case 212: - -/* Line 1806 of yacc.c */ -#line 1450 "go.y" +#line 1451 "go.y" { (yyval.list) = nil; } break; case 213: - -/* Line 1806 of yacc.c */ -#line 1454 "go.y" +#line 1455 "go.y" { (yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node))); } break; case 214: - -/* Line 1806 of yacc.c */ -#line 1458 "go.y" +#line 1459 "go.y" { (yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0); (yyval.list) = (yyvsp[(2) - (3)].list); @@ -4374,18 +4001,14 @@ yyreduce: break; case 215: - -/* Line 1806 of yacc.c */ -#line 1465 "go.y" +#line 1466 "go.y" { closurehdr((yyvsp[(1) - (1)].node)); } break; case 216: - -/* Line 1806 of yacc.c */ -#line 1471 "go.y" +#line 1472 "go.y" { (yyval.node) = closurebody((yyvsp[(3) - (4)].list)); fixlbrace((yyvsp[(2) - (4)].i)); @@ -4393,27 +4016,21 @@ yyreduce: break; case 217: - -/* Line 1806 of yacc.c */ -#line 1476 "go.y" +#line 1477 "go.y" { (yyval.node) = closurebody(nil); } break; case 218: - -/* Line 1806 of yacc.c */ -#line 1487 "go.y" +#line 1488 "go.y" { (yyval.list) = nil; } break; case 219: - -/* Line 1806 of yacc.c */ -#line 1491 "go.y" +#line 1492 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list)); if(nsyntaxerrors == 0) @@ -4424,72 +4041,56 @@ yyreduce: break; case 221: - -/* Line 1806 of yacc.c */ -#line 1502 "go.y" +#line 1503 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); } break; case 223: - -/* Line 1806 of yacc.c */ -#line 1509 "go.y" +#line 1510 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); } break; case 224: - -/* Line 1806 of yacc.c */ -#line 1515 "go.y" +#line 1516 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 225: - -/* Line 1806 of yacc.c */ -#line 1519 "go.y" +#line 1520 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 227: - -/* Line 1806 of yacc.c */ -#line 1526 "go.y" +#line 1527 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); } break; case 228: - -/* Line 1806 of yacc.c */ -#line 1532 "go.y" +#line 1533 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 229: - -/* Line 1806 of yacc.c */ -#line 1536 "go.y" +#line 1537 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 230: - -/* Line 1806 of yacc.c */ -#line 1542 "go.y" +#line 1543 "go.y" { NodeList *l; @@ -4515,9 +4116,7 @@ yyreduce: break; case 231: - -/* Line 1806 of yacc.c */ -#line 1565 "go.y" +#line 1566 "go.y" { (yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val); (yyval.list) = list1((yyvsp[(1) - (2)].node)); @@ -4525,9 +4124,7 @@ yyreduce: break; case 232: - -/* Line 1806 of yacc.c */ -#line 1570 "go.y" +#line 1571 "go.y" { (yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val); (yyval.list) = list1((yyvsp[(2) - (4)].node)); @@ -4536,9 +4133,7 @@ yyreduce: break; case 233: - -/* Line 1806 of yacc.c */ -#line 1576 "go.y" +#line 1577 "go.y" { (yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N); (yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val); @@ -4547,9 +4142,7 @@ yyreduce: break; case 234: - -/* Line 1806 of yacc.c */ -#line 1582 "go.y" +#line 1583 "go.y" { (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); @@ -4559,9 +4152,7 @@ yyreduce: break; case 235: - -/* Line 1806 of yacc.c */ -#line 1589 "go.y" +#line 1590 "go.y" { (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); @@ -4571,9 +4162,7 @@ yyreduce: break; case 236: - -/* Line 1806 of yacc.c */ -#line 1598 "go.y" +#line 1599 "go.y" { Node *n; @@ -4585,9 +4174,7 @@ yyreduce: break; case 237: - -/* Line 1806 of yacc.c */ -#line 1607 "go.y" +#line 1608 "go.y" { Pkg *pkg; @@ -4603,18 +4190,14 @@ yyreduce: break; case 238: - -/* Line 1806 of yacc.c */ -#line 1622 "go.y" +#line 1623 "go.y" { (yyval.node) = embedded((yyvsp[(1) - (1)].sym), localpkg); } break; case 239: - -/* Line 1806 of yacc.c */ -#line 1628 "go.y" +#line 1629 "go.y" { (yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); ifacedcl((yyval.node)); @@ -4622,18 +4205,14 @@ yyreduce: break; case 240: - -/* Line 1806 of yacc.c */ -#line 1633 "go.y" +#line 1634 "go.y" { (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym))); } break; case 241: - -/* Line 1806 of yacc.c */ -#line 1637 "go.y" +#line 1638 "go.y" { (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym))); yyerror("cannot parenthesize embedded type"); @@ -4641,9 +4220,7 @@ yyreduce: break; case 242: - -/* Line 1806 of yacc.c */ -#line 1644 "go.y" +#line 1645 "go.y" { // without func keyword (yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1); @@ -4654,9 +4231,7 @@ yyreduce: break; case 244: - -/* Line 1806 of yacc.c */ -#line 1658 "go.y" +#line 1659 "go.y" { (yyval.node) = nod(ONONAME, N, N); (yyval.node)->sym = (yyvsp[(1) - (2)].sym); @@ -4665,9 +4240,7 @@ yyreduce: break; case 245: - -/* Line 1806 of yacc.c */ -#line 1664 "go.y" +#line 1665 "go.y" { (yyval.node) = nod(ONONAME, N, N); (yyval.node)->sym = (yyvsp[(1) - (2)].sym); @@ -4676,72 +4249,56 @@ yyreduce: break; case 247: - -/* Line 1806 of yacc.c */ -#line 1673 "go.y" +#line 1674 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 248: - -/* Line 1806 of yacc.c */ -#line 1677 "go.y" +#line 1678 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 249: - -/* Line 1806 of yacc.c */ -#line 1682 "go.y" +#line 1683 "go.y" { (yyval.list) = nil; } break; case 250: - -/* Line 1806 of yacc.c */ -#line 1686 "go.y" +#line 1687 "go.y" { (yyval.list) = (yyvsp[(1) - (2)].list); } break; case 251: - -/* Line 1806 of yacc.c */ -#line 1694 "go.y" +#line 1695 "go.y" { (yyval.node) = N; } break; case 253: - -/* Line 1806 of yacc.c */ -#line 1699 "go.y" +#line 1700 "go.y" { (yyval.node) = liststmt((yyvsp[(1) - (1)].list)); } break; case 255: - -/* Line 1806 of yacc.c */ -#line 1704 "go.y" +#line 1705 "go.y" { (yyval.node) = N; } break; case 261: - -/* Line 1806 of yacc.c */ -#line 1715 "go.y" +#line 1716 "go.y" { (yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N); (yyvsp[(1) - (2)].node)->sym = dclstack; // context, for goto restrictions @@ -4749,9 +4306,7 @@ yyreduce: break; case 262: - -/* Line 1806 of yacc.c */ -#line 1720 "go.y" +#line 1721 "go.y" { NodeList *l; @@ -4764,55 +4319,44 @@ yyreduce: break; case 263: - -/* Line 1806 of yacc.c */ -#line 1730 "go.y" +#line 1731 "go.y" { // will be converted to OFALL (yyval.node) = nod(OXFALL, N, N); + (yyval.node)->xoffset = block; } break; case 264: - -/* Line 1806 of yacc.c */ -#line 1735 "go.y" +#line 1737 "go.y" { (yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N); } break; case 265: - -/* Line 1806 of yacc.c */ -#line 1739 "go.y" +#line 1741 "go.y" { (yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N); } break; case 266: - -/* Line 1806 of yacc.c */ -#line 1743 "go.y" +#line 1745 "go.y" { (yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N); } break; case 267: - -/* Line 1806 of yacc.c */ -#line 1747 "go.y" +#line 1749 "go.y" { (yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N); } break; case 268: - -/* Line 1806 of yacc.c */ -#line 1751 "go.y" +#line 1753 "go.y" { (yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N); (yyval.node)->sym = dclstack; // context, for goto restrictions @@ -4820,9 +4364,7 @@ yyreduce: break; case 269: - -/* Line 1806 of yacc.c */ -#line 1756 "go.y" +#line 1758 "go.y" { (yyval.node) = nod(ORETURN, N, N); (yyval.node)->list = (yyvsp[(2) - (2)].list); @@ -4842,9 +4384,7 @@ yyreduce: break; case 270: - -/* Line 1806 of yacc.c */ -#line 1775 "go.y" +#line 1777 "go.y" { (yyval.list) = nil; if((yyvsp[(1) - (1)].node) != N) @@ -4853,9 +4393,7 @@ yyreduce: break; case 271: - -/* Line 1806 of yacc.c */ -#line 1781 "go.y" +#line 1783 "go.y" { (yyval.list) = (yyvsp[(1) - (3)].list); if((yyvsp[(3) - (3)].node) != N) @@ -4864,243 +4402,189 @@ yyreduce: break; case 272: - -/* Line 1806 of yacc.c */ -#line 1789 "go.y" +#line 1791 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 273: - -/* Line 1806 of yacc.c */ -#line 1793 "go.y" +#line 1795 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 274: - -/* Line 1806 of yacc.c */ -#line 1799 "go.y" +#line 1801 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 275: - -/* Line 1806 of yacc.c */ -#line 1803 "go.y" +#line 1805 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 276: - -/* Line 1806 of yacc.c */ -#line 1809 "go.y" +#line 1811 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 277: - -/* Line 1806 of yacc.c */ -#line 1813 "go.y" +#line 1815 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 278: - -/* Line 1806 of yacc.c */ -#line 1819 "go.y" +#line 1821 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 279: - -/* Line 1806 of yacc.c */ -#line 1823 "go.y" +#line 1825 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 280: - -/* Line 1806 of yacc.c */ -#line 1832 "go.y" +#line 1834 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 281: - -/* Line 1806 of yacc.c */ -#line 1836 "go.y" +#line 1838 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 282: - -/* Line 1806 of yacc.c */ -#line 1840 "go.y" +#line 1842 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 283: - -/* Line 1806 of yacc.c */ -#line 1844 "go.y" +#line 1846 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 284: - -/* Line 1806 of yacc.c */ -#line 1849 "go.y" +#line 1851 "go.y" { (yyval.list) = nil; } break; case 285: - -/* Line 1806 of yacc.c */ -#line 1853 "go.y" +#line 1855 "go.y" { (yyval.list) = (yyvsp[(1) - (2)].list); } break; case 290: - -/* Line 1806 of yacc.c */ -#line 1867 "go.y" +#line 1869 "go.y" { (yyval.node) = N; } break; case 292: - -/* Line 1806 of yacc.c */ -#line 1873 "go.y" +#line 1875 "go.y" { (yyval.list) = nil; } break; case 294: - -/* Line 1806 of yacc.c */ -#line 1879 "go.y" +#line 1881 "go.y" { (yyval.node) = N; } break; case 296: - -/* Line 1806 of yacc.c */ -#line 1885 "go.y" +#line 1887 "go.y" { (yyval.list) = nil; } break; case 298: - -/* Line 1806 of yacc.c */ -#line 1891 "go.y" +#line 1893 "go.y" { (yyval.list) = nil; } break; case 300: - -/* Line 1806 of yacc.c */ -#line 1897 "go.y" +#line 1899 "go.y" { (yyval.list) = nil; } break; case 302: - -/* Line 1806 of yacc.c */ -#line 1903 "go.y" +#line 1905 "go.y" { (yyval.val).ctype = CTxxx; } break; case 304: - -/* Line 1806 of yacc.c */ -#line 1913 "go.y" +#line 1915 "go.y" { importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval); } break; case 305: - -/* Line 1806 of yacc.c */ -#line 1917 "go.y" +#line 1919 "go.y" { importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type)); } break; case 306: - -/* Line 1806 of yacc.c */ -#line 1921 "go.y" +#line 1923 "go.y" { importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node)); } break; case 307: - -/* Line 1806 of yacc.c */ -#line 1925 "go.y" +#line 1927 "go.y" { importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node)); } break; case 308: - -/* Line 1806 of yacc.c */ -#line 1929 "go.y" +#line 1931 "go.y" { importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type)); } break; case 309: - -/* Line 1806 of yacc.c */ -#line 1933 "go.y" +#line 1935 "go.y" { if((yyvsp[(2) - (4)].node) == N) { dclcontext = PEXTERN; // since we skip the funcbody below @@ -5121,9 +4605,7 @@ yyreduce: break; case 310: - -/* Line 1806 of yacc.c */ -#line 1953 "go.y" +#line 1955 "go.y" { (yyval.sym) = (yyvsp[(1) - (1)].sym); structpkg = (yyval.sym)->pkg; @@ -5131,9 +4613,7 @@ yyreduce: break; case 311: - -/* Line 1806 of yacc.c */ -#line 1960 "go.y" +#line 1962 "go.y" { (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); importsym((yyvsp[(1) - (1)].sym), OTYPE); @@ -5141,18 +4621,14 @@ yyreduce: break; case 317: - -/* Line 1806 of yacc.c */ -#line 1980 "go.y" +#line 1982 "go.y" { (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); } break; case 318: - -/* Line 1806 of yacc.c */ -#line 1984 "go.y" +#line 1986 "go.y" { // predefined name like uint8 (yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg); @@ -5165,63 +4641,49 @@ yyreduce: break; case 319: - -/* Line 1806 of yacc.c */ -#line 1994 "go.y" +#line 1996 "go.y" { (yyval.type) = aindex(N, (yyvsp[(3) - (3)].type)); } break; case 320: - -/* Line 1806 of yacc.c */ -#line 1998 "go.y" +#line 2000 "go.y" { (yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type)); } break; case 321: - -/* Line 1806 of yacc.c */ -#line 2002 "go.y" +#line 2004 "go.y" { (yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type)); } break; case 322: - -/* Line 1806 of yacc.c */ -#line 2006 "go.y" +#line 2008 "go.y" { (yyval.type) = tostruct((yyvsp[(3) - (4)].list)); } break; case 323: - -/* Line 1806 of yacc.c */ -#line 2010 "go.y" +#line 2012 "go.y" { (yyval.type) = tointerface((yyvsp[(3) - (4)].list)); } break; case 324: - -/* Line 1806 of yacc.c */ -#line 2014 "go.y" +#line 2016 "go.y" { (yyval.type) = ptrto((yyvsp[(2) - (2)].type)); } break; case 325: - -/* Line 1806 of yacc.c */ -#line 2018 "go.y" +#line 2020 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(2) - (2)].type); @@ -5230,9 +4692,7 @@ yyreduce: break; case 326: - -/* Line 1806 of yacc.c */ -#line 2024 "go.y" +#line 2026 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(3) - (4)].type); @@ -5241,9 +4701,7 @@ yyreduce: break; case 327: - -/* Line 1806 of yacc.c */ -#line 2030 "go.y" +#line 2032 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(3) - (3)].type); @@ -5252,9 +4710,7 @@ yyreduce: break; case 328: - -/* Line 1806 of yacc.c */ -#line 2038 "go.y" +#line 2040 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(3) - (3)].type); @@ -5263,18 +4719,14 @@ yyreduce: break; case 329: - -/* Line 1806 of yacc.c */ -#line 2046 "go.y" +#line 2048 "go.y" { (yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)); } break; case 330: - -/* Line 1806 of yacc.c */ -#line 2052 "go.y" +#line 2054 "go.y" { (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type))); if((yyvsp[(1) - (3)].sym)) @@ -5284,9 +4736,7 @@ yyreduce: break; case 331: - -/* Line 1806 of yacc.c */ -#line 2059 "go.y" +#line 2061 "go.y" { Type *t; @@ -5303,9 +4753,7 @@ yyreduce: break; case 332: - -/* Line 1806 of yacc.c */ -#line 2075 "go.y" +#line 2077 "go.y" { Sym *s; Pkg *p; @@ -5328,63 +4776,49 @@ yyreduce: break; case 333: - -/* Line 1806 of yacc.c */ -#line 2097 "go.y" +#line 2099 "go.y" { (yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)))); } break; case 334: - -/* Line 1806 of yacc.c */ -#line 2101 "go.y" +#line 2103 "go.y" { (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))); } break; case 335: - -/* Line 1806 of yacc.c */ -#line 2106 "go.y" +#line 2108 "go.y" { (yyval.list) = nil; } break; case 337: - -/* Line 1806 of yacc.c */ -#line 2113 "go.y" +#line 2115 "go.y" { (yyval.list) = (yyvsp[(2) - (3)].list); } break; case 338: - -/* Line 1806 of yacc.c */ -#line 2117 "go.y" +#line 2119 "go.y" { (yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)))); } break; case 339: - -/* Line 1806 of yacc.c */ -#line 2127 "go.y" +#line 2129 "go.y" { (yyval.node) = nodlit((yyvsp[(1) - (1)].val)); } break; case 340: - -/* Line 1806 of yacc.c */ -#line 2131 "go.y" +#line 2133 "go.y" { (yyval.node) = nodlit((yyvsp[(2) - (2)].val)); switch((yyval.node)->val.ctype){ @@ -5395,6 +4829,10 @@ yyreduce: case CTFLT: mpnegflt((yyval.node)->val.u.fval); break; + case CTCPLX: + mpnegflt(&(yyval.node)->val.u.cval->real); + mpnegflt(&(yyval.node)->val.u.cval->imag); + break; default: yyerror("bad negated constant"); } @@ -5402,9 +4840,7 @@ yyreduce: break; case 341: - -/* Line 1806 of yacc.c */ -#line 2146 "go.y" +#line 2152 "go.y" { (yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg)); if((yyval.node)->op != OLITERAL) @@ -5413,9 +4849,7 @@ yyreduce: break; case 343: - -/* Line 1806 of yacc.c */ -#line 2155 "go.y" +#line 2161 "go.y" { if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) { (yyval.node) = (yyvsp[(2) - (5)].node); @@ -5429,76 +4863,52 @@ yyreduce: break; case 346: - -/* Line 1806 of yacc.c */ -#line 2171 "go.y" +#line 2177 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 347: - -/* Line 1806 of yacc.c */ -#line 2175 "go.y" +#line 2181 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 348: - -/* Line 1806 of yacc.c */ -#line 2181 "go.y" +#line 2187 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 349: - -/* Line 1806 of yacc.c */ -#line 2185 "go.y" +#line 2191 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; case 350: - -/* Line 1806 of yacc.c */ -#line 2191 "go.y" +#line 2197 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; case 351: - -/* Line 1806 of yacc.c */ -#line 2195 "go.y" +#line 2201 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - -/* Line 1806 of yacc.c */ -#line 5490 "y.tab.c" +/* Line 1267 of yacc.c. */ +#line 4911 "y.tab.c" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -5507,6 +4917,7 @@ yyreduce: *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -5526,10 +4937,6 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -5537,36 +4944,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -5574,7 +4982,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -5591,7 +4999,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -5625,7 +5033,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -5648,6 +5056,9 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; @@ -5672,7 +5083,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -5683,14 +5094,9 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -5714,9 +5120,7 @@ yyreturn: } - -/* Line 2067 of yacc.c */ -#line 2199 "go.y" +#line 2205 "go.y" static void |