Commit 80dbe743 authored by Russ Cox's avatar Russ Cox

cmd/gc, cmd/ld: use go.weak instead of weak as the weak symbol prefix

Also defend our symbol prefixes (now just "go" and "type")
from use as import paths.

Fixes #4257.

R=ken2
CC=golang-dev
https://golang.org/cl/6744072
parent 7c44edf4
...@@ -393,6 +393,8 @@ importimport(Sym *s, Strlit *z) ...@@ -393,6 +393,8 @@ importimport(Sym *s, Strlit *z)
// human-readable messages. // human-readable messages.
Pkg *p; Pkg *p;
if(isbadimport(z))
errorexit();
p = mkpkg(z); p = mkpkg(z);
if(p->name == nil) { if(p->name == nil) {
p->name = s->name; p->name = s->name;
......
...@@ -1030,10 +1030,16 @@ sym: ...@@ -1030,10 +1030,16 @@ sym:
hidden_importsym: hidden_importsym:
'@' LLITERAL '.' LNAME '@' LLITERAL '.' LNAME
{ {
Pkg *p;
if($2.u.sval->len == 0) if($2.u.sval->len == 0)
$$ = pkglookup($4->name, importpkg); p = importpkg;
else else {
$$ = pkglookup($4->name, mkpkg($2.u.sval)); if(isbadimport($2.u.sval))
errorexit();
p = mkpkg($2.u.sval);
}
$$ = pkglookup($4->name, p);
} }
name: name:
......
...@@ -216,9 +216,9 @@ main(int argc, char *argv[]) ...@@ -216,9 +216,9 @@ main(int argc, char *argv[])
typepkg = mkpkg(strlit("type")); typepkg = mkpkg(strlit("type"));
typepkg->name = "type"; typepkg->name = "type";
weaktypepkg = mkpkg(strlit("weak.type")); weaktypepkg = mkpkg(strlit("go.weak.type"));
weaktypepkg->name = "weak.type"; weaktypepkg->name = "go.weak.type";
weaktypepkg->prefix = "weak.type"; // not weak%2etype weaktypepkg->prefix = "go.weak.type"; // not go%2eweak%2etype
unsafepkg = mkpkg(strlit("unsafe")); unsafepkg = mkpkg(strlit("unsafe"));
unsafepkg->name = "unsafe"; unsafepkg->name = "unsafe";
...@@ -664,6 +664,11 @@ importfile(Val *f, int line) ...@@ -664,6 +664,11 @@ importfile(Val *f, int line)
strcat(cleanbuf, path->s); strcat(cleanbuf, path->s);
cleanname(cleanbuf); cleanname(cleanbuf);
path = strlit(cleanbuf); path = strlit(cleanbuf);
if(isbadimport(path)) {
fakeimport();
return;
}
} }
if(!findpkg(path)) { if(!findpkg(path)) {
......
...@@ -3572,9 +3572,6 @@ mkpkg(Strlit *path) ...@@ -3572,9 +3572,6 @@ mkpkg(Strlit *path)
Pkg *p; Pkg *p;
int h; int h;
if(isbadimport(path))
errorexit();
h = stringhash(path->s) & (nelem(phash)-1); h = stringhash(path->s) & (nelem(phash)-1);
for(p=phash[h]; p; p=p->link) for(p=phash[h]; p; p=p->link)
if(p->path->len == path->len && memcmp(path->s, p->path->s, path->len) == 0) if(p->path->len == path->len && memcmp(path->s, p->path->s, path->len) == 0)
...@@ -3623,9 +3620,15 @@ addinit(Node **np, NodeList *init) ...@@ -3623,9 +3620,15 @@ addinit(Node **np, NodeList *init)
n->ullman = UINF; n->ullman = UINF;
} }
static char* reservedimports[] = {
"go",
"type",
};
int int
isbadimport(Strlit *path) isbadimport(Strlit *path)
{ {
int i;
char *s; char *s;
Rune r; Rune r;
...@@ -3634,6 +3637,13 @@ isbadimport(Strlit *path) ...@@ -3634,6 +3637,13 @@ isbadimport(Strlit *path)
return 1; return 1;
} }
for(i=0; i<nelem(reservedimports); i++) {
if(strcmp(path->s, reservedimports[i]) == 0) {
yyerror("import path \"%s\" is reserved and cannot be used", path->s);
return 1;
}
}
s = path->s; s = path->s;
while(*s) { while(*s) {
s += chartorune(&r, s); s += chartorune(&r, s);
......
/* A Bison parser, made by GNU Bison 2.6.2. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison implementation for Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 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 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -15,7 +16,9 @@ ...@@ -15,7 +16,9 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License 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 /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -44,7 +47,7 @@ ...@@ -44,7 +47,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.6.2" #define YYBISON_VERSION "2.3"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
...@@ -52,57 +55,11 @@ ...@@ -52,57 +55,11 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 0 #define YYPURE 0
/* Push parsers. */ /* Using locations. */
#define YYPUSH 0 #define YYLSP_NEEDED 0
/* Pull parsers. */
#define YYPULL 1
/* Copy the first part of user declarations. */
/* Line 336 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 336 of yacc.c */
#line 77 "y.tab.c"
# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULL nullptr
# else
# define YY_NULL 0
# endif
# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 1
#endif
/* In a future release of Bison, this section will be replaced
by #include "y.tab.h". */
#ifndef YY_Y_TAB_H
# define YY_Y_TAB_H
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -213,50 +170,62 @@ extern int yydebug; ...@@ -213,50 +170,62 @@ extern int yydebug;
/* 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 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{
/* Line 350 of yacc.c */
#line 28 "go.y" #line 28 "go.y"
{
Node* node; Node* node;
NodeList* list; NodeList* list;
Type* type; Type* type;
Sym* sym; Sym* sym;
struct Val val; struct Val val;
int i; int i;
}
/* Line 193 of yacc.c. */
/* Line 350 of yacc.c */ #line 216 "y.tab.c"
#line 232 "y.tab.c" YYSTYPE;
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE yylval;
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_Y_TAB_H */
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 353 of yacc.c */
#line 260 "y.tab.c" /* Line 216 of yacc.c. */
#line 229 "y.tab.c"
#ifdef short #ifdef short
# undef short # undef short
...@@ -331,14 +300,14 @@ typedef short int yytype_int16; ...@@ -331,14 +300,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int yyi) YYID (int i)
#else #else
static int static int
YYID (yyi) YYID (i)
int yyi; int i;
#endif #endif
{ {
return yyi; return i;
} }
#endif #endif
...@@ -359,12 +328,11 @@ YYID (yyi) ...@@ -359,12 +328,11 @@ YYID (yyi)
# define alloca _alloca # define alloca _alloca
# else # else
# define YYSTACK_ALLOC alloca # 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) || defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef _STDLIB_H
# ifndef EXIT_SUCCESS # define _STDLIB_H 1
# define EXIT_SUCCESS 0
# endif # endif
# endif # endif
# endif # endif
...@@ -387,24 +355,24 @@ YYID (yyi) ...@@ -387,24 +355,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM # ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif # endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \ # if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \ && ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free))) && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS # ifndef _STDLIB_H
# define EXIT_SUCCESS 0 # define _STDLIB_H 1
# endif # endif
# endif # endif
# ifndef YYMALLOC # ifndef YYMALLOC
# define YYMALLOC malloc # 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) || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif # endif
# endif # endif
# ifndef YYFREE # ifndef YYFREE
# define YYFREE free # 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) || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif # endif
...@@ -420,9 +388,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ ...@@ -420,9 +388,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss_alloc; yytype_int16 yyss;
YYSTYPE yyvs_alloc; YYSTYPE yyvs;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
...@@ -433,19 +401,35 @@ union yyalloc ...@@ -433,19 +401,35 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM) + YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1 /* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (YYID (0))
# endif
# endif
/* Relocate STACK from its old location to the new one. The /* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ # define YYSTACK_RELOCATE(Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \ Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
...@@ -453,26 +437,6 @@ union yyalloc ...@@ -453,26 +437,6 @@ union yyalloc
#endif #endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (YYID (0))
# endif
# endif
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 4 #define YYFINAL 4
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
...@@ -705,30 +669,30 @@ static const yytype_uint16 yyrline[] = ...@@ -705,30 +669,30 @@ static const yytype_uint16 yyrline[] =
855, 859, 864, 872, 876, 877, 888, 892, 896, 900, 855, 859, 864, 872, 876, 877, 888, 892, 896, 900,
904, 905, 911, 918, 924, 931, 934, 941, 947, 948, 904, 905, 911, 918, 924, 931, 934, 941, 947, 948,
955, 956, 974, 975, 978, 981, 985, 996, 1005, 1011, 955, 956, 974, 975, 978, 981, 985, 996, 1005, 1011,
1014, 1017, 1024, 1025, 1031, 1040, 1048, 1060, 1065, 1071, 1014, 1017, 1024, 1025, 1031, 1046, 1054, 1066, 1071, 1077,
1072, 1073, 1074, 1075, 1076, 1082, 1083, 1084, 1085, 1091, 1078, 1079, 1080, 1081, 1082, 1088, 1089, 1090, 1091, 1097,
1092, 1093, 1094, 1095, 1101, 1102, 1105, 1108, 1109, 1110, 1098, 1099, 1100, 1101, 1107, 1108, 1111, 1114, 1115, 1116,
1111, 1112, 1115, 1116, 1129, 1133, 1138, 1143, 1148, 1152, 1117, 1118, 1121, 1122, 1135, 1139, 1144, 1149, 1154, 1158,
1153, 1156, 1162, 1169, 1175, 1182, 1188, 1199, 1210, 1239, 1159, 1162, 1168, 1175, 1181, 1188, 1194, 1205, 1216, 1245,
1278, 1301, 1318, 1327, 1330, 1338, 1342, 1346, 1353, 1359, 1284, 1307, 1324, 1333, 1336, 1344, 1348, 1352, 1359, 1365,
1364, 1376, 1379, 1387, 1388, 1394, 1395, 1401, 1405, 1411, 1370, 1382, 1385, 1393, 1394, 1400, 1401, 1407, 1411, 1417,
1412, 1418, 1422, 1428, 1451, 1456, 1462, 1468, 1475, 1484, 1418, 1424, 1428, 1434, 1457, 1462, 1468, 1474, 1481, 1490,
1493, 1508, 1514, 1519, 1523, 1530, 1543, 1544, 1550, 1556, 1499, 1514, 1520, 1525, 1529, 1536, 1549, 1550, 1556, 1562,
1559, 1563, 1569, 1572, 1581, 1584, 1585, 1589, 1590, 1596, 1565, 1569, 1575, 1578, 1587, 1590, 1591, 1595, 1596, 1602,
1597, 1598, 1599, 1600, 1602, 1601, 1616, 1621, 1625, 1629, 1603, 1604, 1605, 1606, 1608, 1607, 1622, 1627, 1631, 1635,
1633, 1637, 1642, 1661, 1667, 1675, 1679, 1685, 1689, 1695, 1639, 1643, 1648, 1667, 1673, 1681, 1685, 1691, 1695, 1701,
1699, 1705, 1709, 1718, 1722, 1726, 1730, 1736, 1739, 1747, 1705, 1711, 1715, 1724, 1728, 1732, 1736, 1742, 1745, 1753,
1748, 1750, 1751, 1754, 1757, 1760, 1763, 1766, 1769, 1772, 1754, 1756, 1757, 1760, 1763, 1766, 1769, 1772, 1775, 1778,
1775, 1778, 1781, 1784, 1787, 1790, 1793, 1799, 1803, 1807, 1781, 1784, 1787, 1790, 1793, 1796, 1799, 1805, 1809, 1813,
1811, 1815, 1819, 1837, 1844, 1855, 1856, 1857, 1860, 1861, 1817, 1821, 1825, 1843, 1850, 1861, 1862, 1863, 1866, 1867,
1864, 1868, 1878, 1882, 1886, 1890, 1894, 1898, 1902, 1908, 1870, 1874, 1884, 1888, 1892, 1896, 1900, 1904, 1908, 1914,
1914, 1922, 1930, 1936, 1943, 1959, 1977, 1981, 1987, 1990, 1920, 1928, 1936, 1942, 1949, 1965, 1983, 1987, 1993, 1996,
1993, 1997, 2007, 2011, 2026, 2034, 2035, 2047, 2048, 2051, 1999, 2003, 2013, 2017, 2032, 2040, 2041, 2053, 2054, 2057,
2055, 2061, 2065, 2071, 2075 2061, 2067, 2071, 2077, 2081
}; };
#endif #endif
#if YYDEBUG || YYERROR_VERBOSE || 1 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
const char *yytname[] = const char *yytname[] =
...@@ -743,36 +707,36 @@ const char *yytname[] = ...@@ -743,36 +707,36 @@ const char *yytname[] =
"'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'", "'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'",
"PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'", "PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'",
"'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$accept", "file", "'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$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_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", "constdcl", "constdcl1", "typedclname", "typedcl", "simple_stmt", "case",
"compound_stmt", "$@3", "caseblock", "$@4", "caseblock_list", "compound_stmt", "@3", "caseblock", "@4", "caseblock_list", "loop_body",
"loop_body", "$@5", "range_stmt", "for_header", "for_body", "for_stmt", "@5", "range_stmt", "for_header", "for_body", "for_stmt", "@6",
"$@6", "if_header", "if_stmt", "$@7", "$@8", "$@9", "else", "if_header", "if_stmt", "@7", "@8", "@9", "else", "switch_stmt", "@10",
"switch_stmt", "$@10", "$@11", "select_stmt", "$@12", "expr", "uexpr", "@11", "select_stmt", "@12", "expr", "uexpr", "pseudocall",
"pseudocall", "pexpr_no_paren", "start_complit", "keyval", "complitexpr", "pexpr_no_paren", "start_complit", "keyval", "complitexpr", "pexpr",
"pexpr", "expr_or_type", "name_or_type", "lbrace", "new_name", "expr_or_type", "name_or_type", "lbrace", "new_name", "dcl_name",
"dcl_name", "onew_name", "sym", "hidden_importsym", "name", "labelname", "onew_name", "sym", "hidden_importsym", "name", "labelname", "dotdotdot",
"dotdotdot", "ntype", "non_expr_type", "non_recvchantype", "convtype", "ntype", "non_expr_type", "non_recvchantype", "convtype", "comptype",
"comptype", "fnret_type", "dotname", "othertype", "ptrtype", "fnret_type", "dotname", "othertype", "ptrtype", "recvchantype",
"recvchantype", "structtype", "interfacetype", "xfndcl", "fndcl", "structtype", "interfacetype", "xfndcl", "fndcl", "hidden_fndcl",
"hidden_fndcl", "fntype", "fnbody", "fnres", "fnlitdcl", "fnliteral", "fntype", "fnbody", "fnres", "fnlitdcl", "fnliteral", "xdcl_list",
"xdcl_list", "vardcl_list", "constdcl_list", "typedcl_list", "vardcl_list", "constdcl_list", "typedcl_list", "structdcl_list",
"structdcl_list", "interfacedcl_list", "structdcl", "packname", "embed", "interfacedcl_list", "structdcl", "packname", "embed", "interfacedcl",
"interfacedcl", "indcl", "arg_type", "arg_type_list", "indcl", "arg_type", "arg_type_list", "oarg_type_list_ocomma", "stmt",
"oarg_type_list_ocomma", "stmt", "non_dcl_stmt", "$@13", "stmt_list", "non_dcl_stmt", "@13", "stmt_list", "new_name_list", "dcl_name_list",
"new_name_list", "dcl_name_list", "expr_list", "expr_or_type_list", "expr_list", "expr_or_type_list", "keyval_list", "braced_keyval_list",
"keyval_list", "braced_keyval_list", "osemi", "ocomma", "oexpr", "osemi", "ocomma", "oexpr", "oexpr_list", "osimple_stmt",
"oexpr_list", "osimple_stmt", "ohidden_funarg_list", "ohidden_funarg_list", "ohidden_structdcl_list",
"ohidden_structdcl_list", "ohidden_interfacedcl_list", "oliteral", "ohidden_interfacedcl_list", "oliteral", "hidden_import",
"hidden_import", "hidden_pkg_importsym", "hidden_pkgtype", "hidden_type", "hidden_pkg_importsym", "hidden_pkgtype", "hidden_type",
"hidden_type_non_recv_chan", "hidden_type_misc", "hidden_type_recv_chan", "hidden_type_non_recv_chan", "hidden_type_misc", "hidden_type_recv_chan",
"hidden_type_func", "hidden_funarg", "hidden_structdcl", "hidden_type_func", "hidden_funarg", "hidden_structdcl",
"hidden_interfacedcl", "ohidden_funres", "hidden_funres", "hidden_interfacedcl", "ohidden_funres", "hidden_funres",
"hidden_literal", "hidden_constant", "hidden_import_list", "hidden_literal", "hidden_constant", "hidden_import_list",
"hidden_funarg_list", "hidden_structdcl_list", "hidden_funarg_list", "hidden_structdcl_list",
"hidden_interfacedcl_list", YY_NULL "hidden_interfacedcl_list", 0
}; };
#endif #endif
...@@ -872,8 +836,8 @@ static const yytype_uint8 yyr2[] = ...@@ -872,8 +836,8 @@ static const yytype_uint8 yyr2[] =
3, 1, 3, 1, 3 3, 1, 3, 1, 3
}; };
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
Performed when YYTABLE doesn't specify something else to do. Zero STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */ means the default is an error. */
static const yytype_uint16 yydefact[] = static const yytype_uint16 yydefact[] =
{ {
...@@ -1058,7 +1022,8 @@ static const yytype_int16 yypgoto[] = ...@@ -1058,7 +1022,8 @@ static const yytype_int16 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which 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 -270 #define YYTABLE_NINF -270
static const yytype_int16 yytable[] = static const yytype_int16 yytable[] =
{ {
...@@ -1274,12 +1239,6 @@ static const yytype_int16 yytable[] = ...@@ -1274,12 +1239,6 @@ static const yytype_int16 yytable[] =
190, 191, 192, 193, 194, 195, 196, 197 190, 191, 192, 193, 194, 195, 196, 197
}; };
#define yypact_value_is_default(yystate) \
((yystate) == (-549))
#define yytable_value_is_error(yytable_value) \
YYID (0)
static const yytype_int16 yycheck[] = static const yytype_int16 yycheck[] =
{ {
5, 67, 250, 223, 37, 126, 37, 126, 143, 135, 5, 67, 250, 223, 37, 126, 37, 126, 143, 135,
...@@ -1578,29 +1537,20 @@ static const yytype_uint8 yystos[] = ...@@ -1578,29 +1537,20 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily /* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC. to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. However, Once GCC version 2 has supplanted version 1, this can go. */
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. */
#define YYFAIL goto yyerrlab #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) #define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \ #define YYBACKUP(Token, Value) \
do \ do \
if (yychar == YYEMPTY) \ if (yychar == YYEMPTY && yylen == 1) \
{ \ { \
yychar = (Token); \ yychar = (Token); \
yylval = (Value); \ yylval = (Value); \
YYPOPSTACK (yylen); \ yytoken = YYTRANSLATE (yychar); \
yystate = *yyssp; \ YYPOPSTACK (1); \
goto yybackup; \ goto yybackup; \
} \ } \
else \ else \
...@@ -1614,10 +1564,12 @@ while (YYID (0)) ...@@ -1614,10 +1564,12 @@ while (YYID (0))
#define YYTERROR 1 #define YYTERROR 1
#define YYERRCODE 256 #define YYERRCODE 256
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */ the previous symbol: RHS[0] (always defined). */
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT #ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \ # define YYLLOC_DEFAULT(Current, Rhs, N) \
do \ do \
...@@ -1638,14 +1590,20 @@ while (YYID (0)) ...@@ -1638,14 +1590,20 @@ while (YYID (0))
while (YYID (0)) while (YYID (0))
#endif #endif
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
/* 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 #ifndef YY_LOCATION_PRINT
# 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) # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif #endif
...@@ -1700,8 +1658,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) ...@@ -1700,8 +1658,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
YYSTYPE const * const yyvaluep; YYSTYPE const * const yyvaluep;
#endif #endif
{ {
FILE *yyo = yyoutput;
YYUSE (yyo);
if (!yyvaluep) if (!yyvaluep)
return; return;
# ifdef YYPRINT # ifdef YYPRINT
...@@ -1751,20 +1707,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) ...@@ -1751,20 +1707,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else #else
static void static void
yy_stack_print (yybottom, yytop) yy_stack_print (bottom, top)
yytype_int16 *yybottom; yytype_int16 *bottom;
yytype_int16 *yytop; yytype_int16 *top;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++) for (; bottom <= top; ++bottom)
{ YYFPRINTF (stderr, " %d", *bottom);
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
...@@ -1798,11 +1751,11 @@ yy_reduce_print (yyvsp, yyrule) ...@@ -1798,11 +1751,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
YYFPRINTF (stderr, " $%d = ", yyi + 1); fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
); );
YYFPRINTF (stderr, "\n"); fprintf (stderr, "\n");
} }
} }
...@@ -1839,6 +1792,7 @@ int yydebug; ...@@ -1839,6 +1792,7 @@ int yydebug;
# define YYMAXDEPTH 10000 # define YYMAXDEPTH 10000
#endif #endif
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
...@@ -1941,142 +1895,115 @@ yytnamerr (char *yyres, const char *yystr) ...@@ -1941,142 +1895,115 @@ yytnamerr (char *yyres, const char *yystr)
} }
# endif # endif
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message /* Copy into YYRESULT an error message about the unexpected token
about the unexpected token YYTOKEN for the state stack whose top is YYCHAR while in state YYSTATE. Return the number of bytes copied,
YYSSP. including the terminating null byte. If YYRESULT is null, do not
copy anything; just return the number of bytes that would be
Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is copied. As a special case, return 0 if an ordinary "syntax error"
not large enough to hold the message. In that case, also set message will do. Return YYSIZE_MAXIMUM if overflow occurs during
*YYMSG_ALLOC to the required number of bytes. Return 2 if the size calculation. */
required number of bytes is too large to store. */ static YYSIZE_T
static int yysyntax_error (char *yyresult, int yystate, int yychar)
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{ {
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); int yyn = yypact[yystate];
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 yysize = yysize0;
YYSIZE_T yysize1; YYSIZE_T yysize1;
int yysize_overflow = 0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per int yyx;
"expected"). */
int yycount = 0; # if 0
/* This is so xgettext sees the translatable formats that are
/* There are many possibilities here to consider: constructed on the fly. */
- Assume YYFAIL is not used. It's too flawed to consider. See YY_("syntax error, unexpected %s");
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> YY_("syntax error, unexpected %s, expecting %s");
for details. YYERROR is fine as it does not invoke this YY_("syntax error, unexpected %s, expecting %s or %s");
function. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- If this state is a consistent state with a default action, then YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
the only way this function was invoked is if the default action # endif
is an error action. In that case, don't check for expected char *yyfmt;
tokens because there are none. char const *yyf;
- The only way there can be no lookahead present (in yychar) is if static char const yyunexpected[] = "syntax error, unexpected %s";
this state is a consistent state with a default action. Thus, static char const yyexpecting[] = ", expecting %s";
detecting the absence of a lookahead is sufficient to determine static char const yyor[] = " or %s";
that there is no unexpected or expected token to report. In that char yyformat[sizeof yyunexpected
case, just report a simple "syntax error". + sizeof yyexpecting - 1
- Don't assume there isn't a lookahead just because this state is a + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
consistent state with a default action. There might have been a * (sizeof yyor - 1))];
previous inconsistent state, consistent state with a non-default char const *yyprefix = yyexpecting;
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 /* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for YYCHECK. */
this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0; int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */ /* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1; int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yyx; int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx) for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
&& !yytable_value_is_error (yytable[yyx + yyn]))
{ {
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{ {
yycount = 1; yycount = 1;
yysize = yysize0; yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break; break;
} }
yyarg[yycount++] = yytname[yyx]; yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); yysize1 = yysize + yytnamerr (0, yytname[yyx]);
if (! (yysize <= yysize1 yysize_overflow |= (yysize1 < yysize);
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1; yysize = yysize1;
} yyfmt = yystpcpy (yyfmt, yyprefix);
} yyprefix = yyor;
} }
switch (yycount) yyf = YY_(yyformat);
{ yysize1 = yysize + yystrlen (yyf);
# define YYCASE_(N, S) \ yysize_overflow |= (yysize1 < yysize);
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_
}
yysize1 = yysize + yystrlen (yyformat);
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1; yysize = yysize1;
if (*yymsg_alloc < yysize) if (yysize_overflow)
{ return YYSIZE_MAXIMUM;
*yymsg_alloc = 2 * yysize;
if (! (yysize <= *yymsg_alloc
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
return 1;
}
if (yyresult)
{
/* Avoid sprintf, as that infringes on the user's name space. /* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */ produced a string with the wrong number of "%s"s. */
{ char *yyp = yyresult;
char *yyp = *yymsg;
int yyi = 0; int yyi = 0;
while ((*yyp = *yyformat) != '\0') while ((*yyp = *yyf) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) {
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{ {
yyp += yytnamerr (yyp, yyarg[yyi++]); yyp += yytnamerr (yyp, yyarg[yyi++]);
yyformat += 2; yyf += 2;
} }
else else
{ {
yyp++; yyp++;
yyformat++; yyf++;
} }
} }
return 0; }
return yysize;
}
} }
#endif /* YYERROR_VERBOSE */ #endif /* YYERROR_VERBOSE */
/*-----------------------------------------------. /*-----------------------------------------------.
| Release the memory associated to this symbol. | | Release the memory associated to this symbol. |
...@@ -2108,20 +2035,37 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -2108,20 +2035,37 @@ yydestruct (yymsg, yytype, yyvaluep)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
/* The look-ahead symbol. */
int yychar, yystate; int yychar, yystate;
/* The semantic value of the lookahead symbol. */ /* The semantic value of the look-ahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs; int yynerrs;
/*----------. /*----------.
| yyparse. | | yyparse. |
`----------*/ `----------*/
...@@ -2148,54 +2092,53 @@ yyparse () ...@@ -2148,54 +2092,53 @@ yyparse ()
#endif #endif
#endif #endif
{ {
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Number of tokens to shift before error messages enabled. */
int yyerrstatus; 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];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
/* The stacks and their tools: /* Three stacks and their tools:
`yyss': related to states. `yyss': related to states,
`yyvs': related to semantic values. `yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks through separate pointers, to allow yyoverflow Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss; yytype_int16 *yyss = yyssa;
yytype_int16 *yyssp; yytype_int16 *yyssp;
/* The semantic value stack. */ /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs; YYSTYPE *yyvs = yyvsa;
YYSTYPE *yyvsp; YYSTYPE *yyvsp;
YYSIZE_T yystacksize;
int yyn;
int yyresult; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* Lookahead token as an internal (translated) token number. */
int yytoken; YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
...@@ -2207,8 +2150,10 @@ yyparse () ...@@ -2207,8 +2150,10 @@ yyparse ()
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
goto yysetstate; goto yysetstate;
/*------------------------------------------------------------. /*------------------------------------------------------------.
...@@ -2235,6 +2180,7 @@ yyparse () ...@@ -2235,6 +2180,7 @@ yyparse ()
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss; yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might conditional around just the two extra args, but that might
...@@ -2242,6 +2188,7 @@ yyparse () ...@@ -2242,6 +2188,7 @@ yyparse ()
yyoverflow (YY_("memory exhausted"), yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp), &yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yystacksize); &yystacksize);
yyss = yyss1; yyss = yyss1;
...@@ -2264,8 +2211,9 @@ yyparse () ...@@ -2264,8 +2211,9 @@ yyparse ()
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
...@@ -2276,6 +2224,7 @@ yyparse () ...@@ -2276,6 +2224,7 @@ yyparse ()
yyssp = yyss + yysize - 1; yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1; yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize)); (unsigned long int) yystacksize));
...@@ -2285,9 +2234,6 @@ yyparse () ...@@ -2285,9 +2234,6 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
...@@ -2296,16 +2242,16 @@ yyparse () ...@@ -2296,16 +2242,16 @@ yyparse ()
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* 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]; yyn = yypact[yystate];
if (yypact_value_is_default (yyn)) if (yyn == YYPACT_NINF)
goto yydefault; 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) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
...@@ -2331,21 +2277,25 @@ yybackup: ...@@ -2331,21 +2277,25 @@ yybackup:
yyn = yytable[yyn]; yyn = yytable[yyn];
if (yyn <= 0) if (yyn <= 0)
{ {
if (yytable_value_is_error (yyn)) if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab; goto yyerrlab;
yyn = -yyn; yyn = -yyn;
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the lookahead token. */ /* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token. */ /* Discard the shifted token unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY; yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
...@@ -2386,7 +2336,6 @@ yyreduce: ...@@ -2386,7 +2336,6 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 2: case 2:
/* Line 1787 of yacc.c */
#line 128 "go.y" #line 128 "go.y"
{ {
xtop = concat(xtop, (yyvsp[(4) - (4)].list)); xtop = concat(xtop, (yyvsp[(4) - (4)].list));
...@@ -2394,7 +2343,6 @@ yyreduce: ...@@ -2394,7 +2343,6 @@ yyreduce:
break; break;
case 3: case 3:
/* Line 1787 of yacc.c */
#line 134 "go.y" #line 134 "go.y"
{ {
prevlineno = lineno; prevlineno = lineno;
...@@ -2405,7 +2353,6 @@ yyreduce: ...@@ -2405,7 +2353,6 @@ yyreduce:
break; break;
case 4: case 4:
/* Line 1787 of yacc.c */
#line 141 "go.y" #line 141 "go.y"
{ {
mkpackage((yyvsp[(2) - (3)].sym)->name); mkpackage((yyvsp[(2) - (3)].sym)->name);
...@@ -2413,7 +2360,6 @@ yyreduce: ...@@ -2413,7 +2360,6 @@ yyreduce:
break; break;
case 5: case 5:
/* Line 1787 of yacc.c */
#line 151 "go.y" #line 151 "go.y"
{ {
importpkg = runtimepkg; importpkg = runtimepkg;
...@@ -2427,7 +2373,6 @@ yyreduce: ...@@ -2427,7 +2373,6 @@ yyreduce:
break; break;
case 6: case 6:
/* Line 1787 of yacc.c */
#line 162 "go.y" #line 162 "go.y"
{ {
importpkg = nil; importpkg = nil;
...@@ -2435,7 +2380,6 @@ yyreduce: ...@@ -2435,7 +2380,6 @@ yyreduce:
break; break;
case 12: case 12:
/* Line 1787 of yacc.c */
#line 176 "go.y" #line 176 "go.y"
{ {
Pkg *ipkg; Pkg *ipkg;
...@@ -2472,7 +2416,6 @@ yyreduce: ...@@ -2472,7 +2416,6 @@ yyreduce:
break; break;
case 13: case 13:
/* Line 1787 of yacc.c */
#line 209 "go.y" #line 209 "go.y"
{ {
// When an invalid import path is passed to importfile, // When an invalid import path is passed to importfile,
...@@ -2485,7 +2428,6 @@ yyreduce: ...@@ -2485,7 +2428,6 @@ yyreduce:
break; break;
case 16: case 16:
/* Line 1787 of yacc.c */
#line 224 "go.y" #line 224 "go.y"
{ {
// import with original name // import with original name
...@@ -2496,7 +2438,6 @@ yyreduce: ...@@ -2496,7 +2438,6 @@ yyreduce:
break; break;
case 17: case 17:
/* Line 1787 of yacc.c */
#line 231 "go.y" #line 231 "go.y"
{ {
// import with given name // import with given name
...@@ -2507,7 +2448,6 @@ yyreduce: ...@@ -2507,7 +2448,6 @@ yyreduce:
break; break;
case 18: case 18:
/* Line 1787 of yacc.c */
#line 238 "go.y" #line 238 "go.y"
{ {
// import into my name space // import into my name space
...@@ -2518,7 +2458,6 @@ yyreduce: ...@@ -2518,7 +2458,6 @@ yyreduce:
break; break;
case 19: case 19:
/* Line 1787 of yacc.c */
#line 247 "go.y" #line 247 "go.y"
{ {
if(importpkg->name == nil) { if(importpkg->name == nil) {
...@@ -2534,7 +2473,6 @@ yyreduce: ...@@ -2534,7 +2473,6 @@ yyreduce:
break; break;
case 21: case 21:
/* Line 1787 of yacc.c */
#line 261 "go.y" #line 261 "go.y"
{ {
if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0) if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0)
...@@ -2543,7 +2481,6 @@ yyreduce: ...@@ -2543,7 +2481,6 @@ yyreduce:
break; break;
case 22: case 22:
/* Line 1787 of yacc.c */
#line 267 "go.y" #line 267 "go.y"
{ {
defercheckwidth(); defercheckwidth();
...@@ -2551,7 +2488,6 @@ yyreduce: ...@@ -2551,7 +2488,6 @@ yyreduce:
break; break;
case 23: case 23:
/* Line 1787 of yacc.c */
#line 271 "go.y" #line 271 "go.y"
{ {
resumecheckwidth(); resumecheckwidth();
...@@ -2560,7 +2496,6 @@ yyreduce: ...@@ -2560,7 +2496,6 @@ yyreduce:
break; break;
case 24: case 24:
/* Line 1787 of yacc.c */
#line 280 "go.y" #line 280 "go.y"
{ {
yyerror("empty top-level declaration"); yyerror("empty top-level declaration");
...@@ -2569,7 +2504,6 @@ yyreduce: ...@@ -2569,7 +2504,6 @@ yyreduce:
break; break;
case 26: case 26:
/* Line 1787 of yacc.c */
#line 286 "go.y" #line 286 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
...@@ -2577,7 +2511,6 @@ yyreduce: ...@@ -2577,7 +2511,6 @@ yyreduce:
break; break;
case 27: case 27:
/* Line 1787 of yacc.c */
#line 290 "go.y" #line 290 "go.y"
{ {
yyerror("non-declaration statement outside function body"); yyerror("non-declaration statement outside function body");
...@@ -2586,7 +2519,6 @@ yyreduce: ...@@ -2586,7 +2519,6 @@ yyreduce:
break; break;
case 28: case 28:
/* Line 1787 of yacc.c */
#line 295 "go.y" #line 295 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2594,7 +2526,6 @@ yyreduce: ...@@ -2594,7 +2526,6 @@ yyreduce:
break; break;
case 29: case 29:
/* Line 1787 of yacc.c */
#line 301 "go.y" #line 301 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (2)].list); (yyval.list) = (yyvsp[(2) - (2)].list);
...@@ -2602,7 +2533,6 @@ yyreduce: ...@@ -2602,7 +2533,6 @@ yyreduce:
break; break;
case 30: case 30:
/* Line 1787 of yacc.c */
#line 305 "go.y" #line 305 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (5)].list); (yyval.list) = (yyvsp[(3) - (5)].list);
...@@ -2610,7 +2540,6 @@ yyreduce: ...@@ -2610,7 +2540,6 @@ yyreduce:
break; break;
case 31: case 31:
/* Line 1787 of yacc.c */
#line 309 "go.y" #line 309 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2618,7 +2547,6 @@ yyreduce: ...@@ -2618,7 +2547,6 @@ yyreduce:
break; break;
case 32: case 32:
/* Line 1787 of yacc.c */
#line 313 "go.y" #line 313 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (2)].list); (yyval.list) = (yyvsp[(2) - (2)].list);
...@@ -2628,7 +2556,6 @@ yyreduce: ...@@ -2628,7 +2556,6 @@ yyreduce:
break; break;
case 33: case 33:
/* Line 1787 of yacc.c */
#line 319 "go.y" #line 319 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (5)].list); (yyval.list) = (yyvsp[(3) - (5)].list);
...@@ -2638,7 +2565,6 @@ yyreduce: ...@@ -2638,7 +2565,6 @@ yyreduce:
break; break;
case 34: case 34:
/* Line 1787 of yacc.c */
#line 325 "go.y" #line 325 "go.y"
{ {
(yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list)); (yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list));
...@@ -2648,7 +2574,6 @@ yyreduce: ...@@ -2648,7 +2574,6 @@ yyreduce:
break; break;
case 35: case 35:
/* Line 1787 of yacc.c */
#line 331 "go.y" #line 331 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2657,7 +2582,6 @@ yyreduce: ...@@ -2657,7 +2582,6 @@ yyreduce:
break; break;
case 36: case 36:
/* Line 1787 of yacc.c */
#line 336 "go.y" #line 336 "go.y"
{ {
(yyval.list) = list1((yyvsp[(2) - (2)].node)); (yyval.list) = list1((yyvsp[(2) - (2)].node));
...@@ -2665,7 +2589,6 @@ yyreduce: ...@@ -2665,7 +2589,6 @@ yyreduce:
break; break;
case 37: case 37:
/* Line 1787 of yacc.c */
#line 340 "go.y" #line 340 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (5)].list); (yyval.list) = (yyvsp[(3) - (5)].list);
...@@ -2673,7 +2596,6 @@ yyreduce: ...@@ -2673,7 +2596,6 @@ yyreduce:
break; break;
case 38: case 38:
/* Line 1787 of yacc.c */
#line 344 "go.y" #line 344 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2681,7 +2603,6 @@ yyreduce: ...@@ -2681,7 +2603,6 @@ yyreduce:
break; break;
case 39: case 39:
/* Line 1787 of yacc.c */
#line 350 "go.y" #line 350 "go.y"
{ {
iota = 0; iota = 0;
...@@ -2689,7 +2610,6 @@ yyreduce: ...@@ -2689,7 +2610,6 @@ yyreduce:
break; break;
case 40: case 40:
/* Line 1787 of yacc.c */
#line 356 "go.y" #line 356 "go.y"
{ {
(yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); (yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil);
...@@ -2697,7 +2617,6 @@ yyreduce: ...@@ -2697,7 +2617,6 @@ yyreduce:
break; break;
case 41: case 41:
/* Line 1787 of yacc.c */
#line 360 "go.y" #line 360 "go.y"
{ {
(yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); (yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list));
...@@ -2705,7 +2624,6 @@ yyreduce: ...@@ -2705,7 +2624,6 @@ yyreduce:
break; break;
case 42: case 42:
/* Line 1787 of yacc.c */
#line 364 "go.y" #line 364 "go.y"
{ {
(yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list)); (yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list));
...@@ -2713,7 +2631,6 @@ yyreduce: ...@@ -2713,7 +2631,6 @@ yyreduce:
break; break;
case 43: case 43:
/* Line 1787 of yacc.c */
#line 370 "go.y" #line 370 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); (yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list));
...@@ -2721,7 +2638,6 @@ yyreduce: ...@@ -2721,7 +2638,6 @@ yyreduce:
break; break;
case 44: case 44:
/* Line 1787 of yacc.c */
#line 374 "go.y" #line 374 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list)); (yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list));
...@@ -2729,7 +2645,6 @@ yyreduce: ...@@ -2729,7 +2645,6 @@ yyreduce:
break; break;
case 46: case 46:
/* Line 1787 of yacc.c */
#line 381 "go.y" #line 381 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); (yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil);
...@@ -2737,7 +2652,6 @@ yyreduce: ...@@ -2737,7 +2652,6 @@ yyreduce:
break; break;
case 47: case 47:
/* Line 1787 of yacc.c */
#line 385 "go.y" #line 385 "go.y"
{ {
(yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil); (yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil);
...@@ -2745,7 +2659,6 @@ yyreduce: ...@@ -2745,7 +2659,6 @@ yyreduce:
break; break;
case 48: case 48:
/* Line 1787 of yacc.c */
#line 391 "go.y" #line 391 "go.y"
{ {
// different from dclname because the name // different from dclname because the name
...@@ -2756,7 +2669,6 @@ yyreduce: ...@@ -2756,7 +2669,6 @@ yyreduce:
break; break;
case 49: case 49:
/* Line 1787 of yacc.c */
#line 400 "go.y" #line 400 "go.y"
{ {
(yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1); (yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1);
...@@ -2764,7 +2676,6 @@ yyreduce: ...@@ -2764,7 +2676,6 @@ yyreduce:
break; break;
case 50: case 50:
/* Line 1787 of yacc.c */
#line 406 "go.y" #line 406 "go.y"
{ {
(yyval.node) = (yyvsp[(1) - (1)].node); (yyval.node) = (yyvsp[(1) - (1)].node);
...@@ -2772,7 +2683,6 @@ yyreduce: ...@@ -2772,7 +2683,6 @@ yyreduce:
break; break;
case 51: case 51:
/* Line 1787 of yacc.c */
#line 410 "go.y" #line 410 "go.y"
{ {
(yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -2781,7 +2691,6 @@ yyreduce: ...@@ -2781,7 +2691,6 @@ yyreduce:
break; break;
case 52: case 52:
/* Line 1787 of yacc.c */
#line 415 "go.y" #line 415 "go.y"
{ {
if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) { if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) {
...@@ -2797,7 +2706,6 @@ yyreduce: ...@@ -2797,7 +2706,6 @@ yyreduce:
break; break;
case 53: case 53:
/* Line 1787 of yacc.c */
#line 427 "go.y" #line 427 "go.y"
{ {
if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) { if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) {
...@@ -2817,7 +2725,6 @@ yyreduce: ...@@ -2817,7 +2725,6 @@ yyreduce:
break; break;
case 54: case 54:
/* Line 1787 of yacc.c */
#line 443 "go.y" #line 443 "go.y"
{ {
(yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1));
...@@ -2826,7 +2733,6 @@ yyreduce: ...@@ -2826,7 +2733,6 @@ yyreduce:
break; break;
case 55: case 55:
/* Line 1787 of yacc.c */
#line 448 "go.y" #line 448 "go.y"
{ {
(yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1));
...@@ -2835,7 +2741,6 @@ yyreduce: ...@@ -2835,7 +2741,6 @@ yyreduce:
break; break;
case 56: case 56:
/* Line 1787 of yacc.c */
#line 455 "go.y" #line 455 "go.y"
{ {
Node *n, *nn; Node *n, *nn;
...@@ -2859,7 +2764,6 @@ yyreduce: ...@@ -2859,7 +2764,6 @@ yyreduce:
break; break;
case 57: case 57:
/* Line 1787 of yacc.c */
#line 475 "go.y" #line 475 "go.y"
{ {
Node *n; Node *n;
...@@ -2881,7 +2785,6 @@ yyreduce: ...@@ -2881,7 +2785,6 @@ yyreduce:
break; break;
case 58: case 58:
/* Line 1787 of yacc.c */
#line 493 "go.y" #line 493 "go.y"
{ {
// will be converted to OCASE // will be converted to OCASE
...@@ -2894,7 +2797,6 @@ yyreduce: ...@@ -2894,7 +2797,6 @@ yyreduce:
break; break;
case 59: case 59:
/* Line 1787 of yacc.c */
#line 502 "go.y" #line 502 "go.y"
{ {
Node *n, *nn; Node *n, *nn;
...@@ -2914,7 +2816,6 @@ yyreduce: ...@@ -2914,7 +2816,6 @@ yyreduce:
break; break;
case 60: case 60:
/* Line 1787 of yacc.c */
#line 520 "go.y" #line 520 "go.y"
{ {
markdcl(); markdcl();
...@@ -2922,7 +2823,6 @@ yyreduce: ...@@ -2922,7 +2823,6 @@ yyreduce:
break; break;
case 61: case 61:
/* Line 1787 of yacc.c */
#line 524 "go.y" #line 524 "go.y"
{ {
(yyval.node) = liststmt((yyvsp[(3) - (4)].list)); (yyval.node) = liststmt((yyvsp[(3) - (4)].list));
...@@ -2931,7 +2831,6 @@ yyreduce: ...@@ -2931,7 +2831,6 @@ yyreduce:
break; break;
case 62: case 62:
/* Line 1787 of yacc.c */
#line 531 "go.y" #line 531 "go.y"
{ {
// If the last token read by the lexer was consumed // If the last token read by the lexer was consumed
...@@ -2945,7 +2844,6 @@ yyreduce: ...@@ -2945,7 +2844,6 @@ yyreduce:
break; break;
case 63: case 63:
/* Line 1787 of yacc.c */
#line 541 "go.y" #line 541 "go.y"
{ {
int last; int last;
...@@ -2968,7 +2866,6 @@ yyreduce: ...@@ -2968,7 +2866,6 @@ yyreduce:
break; break;
case 64: case 64:
/* Line 1787 of yacc.c */
#line 561 "go.y" #line 561 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
...@@ -2976,7 +2873,6 @@ yyreduce: ...@@ -2976,7 +2873,6 @@ yyreduce:
break; break;
case 65: case 65:
/* Line 1787 of yacc.c */
#line 565 "go.y" #line 565 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); (yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node));
...@@ -2984,7 +2880,6 @@ yyreduce: ...@@ -2984,7 +2880,6 @@ yyreduce:
break; break;
case 66: case 66:
/* Line 1787 of yacc.c */
#line 571 "go.y" #line 571 "go.y"
{ {
markdcl(); markdcl();
...@@ -2992,7 +2887,6 @@ yyreduce: ...@@ -2992,7 +2887,6 @@ yyreduce:
break; break;
case 67: case 67:
/* Line 1787 of yacc.c */
#line 575 "go.y" #line 575 "go.y"
{ {
(yyval.list) = (yyvsp[(3) - (4)].list); (yyval.list) = (yyvsp[(3) - (4)].list);
...@@ -3001,7 +2895,6 @@ yyreduce: ...@@ -3001,7 +2895,6 @@ yyreduce:
break; break;
case 68: case 68:
/* Line 1787 of yacc.c */
#line 582 "go.y" #line 582 "go.y"
{ {
(yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node));
...@@ -3011,7 +2904,6 @@ yyreduce: ...@@ -3011,7 +2904,6 @@ yyreduce:
break; break;
case 69: case 69:
/* Line 1787 of yacc.c */
#line 588 "go.y" #line 588 "go.y"
{ {
(yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node));
...@@ -3022,7 +2914,6 @@ yyreduce: ...@@ -3022,7 +2914,6 @@ yyreduce:
break; break;
case 70: case 70:
/* Line 1787 of yacc.c */
#line 597 "go.y" #line 597 "go.y"
{ {
// init ; test ; incr // init ; test ; incr
...@@ -3037,7 +2928,6 @@ yyreduce: ...@@ -3037,7 +2928,6 @@ yyreduce:
break; break;
case 71: case 71:
/* Line 1787 of yacc.c */
#line 608 "go.y" #line 608 "go.y"
{ {
// normal test // normal test
...@@ -3047,7 +2937,6 @@ yyreduce: ...@@ -3047,7 +2937,6 @@ yyreduce:
break; break;
case 73: case 73:
/* Line 1787 of yacc.c */
#line 617 "go.y" #line 617 "go.y"
{ {
(yyval.node) = (yyvsp[(1) - (2)].node); (yyval.node) = (yyvsp[(1) - (2)].node);
...@@ -3056,7 +2945,6 @@ yyreduce: ...@@ -3056,7 +2945,6 @@ yyreduce:
break; break;
case 74: case 74:
/* Line 1787 of yacc.c */
#line 624 "go.y" #line 624 "go.y"
{ {
markdcl(); markdcl();
...@@ -3064,7 +2952,6 @@ yyreduce: ...@@ -3064,7 +2952,6 @@ yyreduce:
break; break;
case 75: case 75:
/* Line 1787 of yacc.c */
#line 628 "go.y" #line 628 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (3)].node); (yyval.node) = (yyvsp[(3) - (3)].node);
...@@ -3073,7 +2960,6 @@ yyreduce: ...@@ -3073,7 +2960,6 @@ yyreduce:
break; break;
case 76: case 76:
/* Line 1787 of yacc.c */
#line 635 "go.y" #line 635 "go.y"
{ {
// test // test
...@@ -3083,7 +2969,6 @@ yyreduce: ...@@ -3083,7 +2969,6 @@ yyreduce:
break; break;
case 77: case 77:
/* Line 1787 of yacc.c */
#line 641 "go.y" #line 641 "go.y"
{ {
// init ; test // init ; test
...@@ -3095,7 +2980,6 @@ yyreduce: ...@@ -3095,7 +2980,6 @@ yyreduce:
break; break;
case 78: case 78:
/* Line 1787 of yacc.c */
#line 652 "go.y" #line 652 "go.y"
{ {
markdcl(); markdcl();
...@@ -3103,7 +2987,6 @@ yyreduce: ...@@ -3103,7 +2987,6 @@ yyreduce:
break; break;
case 79: case 79:
/* Line 1787 of yacc.c */
#line 656 "go.y" #line 656 "go.y"
{ {
if((yyvsp[(3) - (3)].node)->ntest == N) if((yyvsp[(3) - (3)].node)->ntest == N)
...@@ -3112,7 +2995,6 @@ yyreduce: ...@@ -3112,7 +2995,6 @@ yyreduce:
break; break;
case 80: case 80:
/* Line 1787 of yacc.c */
#line 661 "go.y" #line 661 "go.y"
{ {
(yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list); (yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list);
...@@ -3120,7 +3002,6 @@ yyreduce: ...@@ -3120,7 +3002,6 @@ yyreduce:
break; break;
case 81: case 81:
/* Line 1787 of yacc.c */
#line 665 "go.y" #line 665 "go.y"
{ {
popdcl(); popdcl();
...@@ -3131,7 +3012,6 @@ yyreduce: ...@@ -3131,7 +3012,6 @@ yyreduce:
break; break;
case 82: case 82:
/* Line 1787 of yacc.c */
#line 673 "go.y" #line 673 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
...@@ -3139,7 +3019,6 @@ yyreduce: ...@@ -3139,7 +3019,6 @@ yyreduce:
break; break;
case 83: case 83:
/* Line 1787 of yacc.c */
#line 677 "go.y" #line 677 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (2)].node); (yyval.node) = (yyvsp[(2) - (2)].node);
...@@ -3147,7 +3026,6 @@ yyreduce: ...@@ -3147,7 +3026,6 @@ yyreduce:
break; break;
case 84: case 84:
/* Line 1787 of yacc.c */
#line 681 "go.y" #line 681 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (2)].node); (yyval.node) = (yyvsp[(2) - (2)].node);
...@@ -3155,7 +3033,6 @@ yyreduce: ...@@ -3155,7 +3033,6 @@ yyreduce:
break; break;
case 85: case 85:
/* Line 1787 of yacc.c */
#line 687 "go.y" #line 687 "go.y"
{ {
markdcl(); markdcl();
...@@ -3163,7 +3040,6 @@ yyreduce: ...@@ -3163,7 +3040,6 @@ yyreduce:
break; break;
case 86: case 86:
/* Line 1787 of yacc.c */
#line 691 "go.y" #line 691 "go.y"
{ {
Node *n; Node *n;
...@@ -3175,7 +3051,6 @@ yyreduce: ...@@ -3175,7 +3051,6 @@ yyreduce:
break; break;
case 87: case 87:
/* Line 1787 of yacc.c */
#line 699 "go.y" #line 699 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (7)].node); (yyval.node) = (yyvsp[(3) - (7)].node);
...@@ -3187,7 +3062,6 @@ yyreduce: ...@@ -3187,7 +3062,6 @@ yyreduce:
break; break;
case 88: case 88:
/* Line 1787 of yacc.c */
#line 709 "go.y" #line 709 "go.y"
{ {
typesw = nod(OXXX, typesw, N); typesw = nod(OXXX, typesw, N);
...@@ -3195,7 +3069,6 @@ yyreduce: ...@@ -3195,7 +3069,6 @@ yyreduce:
break; break;
case 89: case 89:
/* Line 1787 of yacc.c */
#line 713 "go.y" #line 713 "go.y"
{ {
(yyval.node) = nod(OSELECT, N, N); (yyval.node) = nod(OSELECT, N, N);
...@@ -3206,7 +3079,6 @@ yyreduce: ...@@ -3206,7 +3079,6 @@ yyreduce:
break; break;
case 91: case 91:
/* Line 1787 of yacc.c */
#line 726 "go.y" #line 726 "go.y"
{ {
(yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3214,7 +3086,6 @@ yyreduce: ...@@ -3214,7 +3086,6 @@ yyreduce:
break; break;
case 92: case 92:
/* Line 1787 of yacc.c */
#line 730 "go.y" #line 730 "go.y"
{ {
(yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3222,7 +3093,6 @@ yyreduce: ...@@ -3222,7 +3093,6 @@ yyreduce:
break; break;
case 93: case 93:
/* Line 1787 of yacc.c */
#line 734 "go.y" #line 734 "go.y"
{ {
(yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3230,7 +3100,6 @@ yyreduce: ...@@ -3230,7 +3100,6 @@ yyreduce:
break; break;
case 94: case 94:
/* Line 1787 of yacc.c */
#line 738 "go.y" #line 738 "go.y"
{ {
(yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3238,7 +3107,6 @@ yyreduce: ...@@ -3238,7 +3107,6 @@ yyreduce:
break; break;
case 95: case 95:
/* Line 1787 of yacc.c */
#line 742 "go.y" #line 742 "go.y"
{ {
(yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3246,7 +3114,6 @@ yyreduce: ...@@ -3246,7 +3114,6 @@ yyreduce:
break; break;
case 96: case 96:
/* Line 1787 of yacc.c */
#line 746 "go.y" #line 746 "go.y"
{ {
(yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3254,7 +3121,6 @@ yyreduce: ...@@ -3254,7 +3121,6 @@ yyreduce:
break; break;
case 97: case 97:
/* Line 1787 of yacc.c */
#line 750 "go.y" #line 750 "go.y"
{ {
(yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3262,7 +3128,6 @@ yyreduce: ...@@ -3262,7 +3128,6 @@ yyreduce:
break; break;
case 98: case 98:
/* Line 1787 of yacc.c */
#line 754 "go.y" #line 754 "go.y"
{ {
(yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3270,7 +3135,6 @@ yyreduce: ...@@ -3270,7 +3135,6 @@ yyreduce:
break; break;
case 99: case 99:
/* Line 1787 of yacc.c */
#line 758 "go.y" #line 758 "go.y"
{ {
(yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3278,7 +3142,6 @@ yyreduce: ...@@ -3278,7 +3142,6 @@ yyreduce:
break; break;
case 100: case 100:
/* Line 1787 of yacc.c */
#line 762 "go.y" #line 762 "go.y"
{ {
(yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3286,7 +3149,6 @@ yyreduce: ...@@ -3286,7 +3149,6 @@ yyreduce:
break; break;
case 101: case 101:
/* Line 1787 of yacc.c */
#line 766 "go.y" #line 766 "go.y"
{ {
(yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3294,7 +3156,6 @@ yyreduce: ...@@ -3294,7 +3156,6 @@ yyreduce:
break; break;
case 102: case 102:
/* Line 1787 of yacc.c */
#line 770 "go.y" #line 770 "go.y"
{ {
(yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3302,7 +3163,6 @@ yyreduce: ...@@ -3302,7 +3163,6 @@ yyreduce:
break; break;
case 103: case 103:
/* Line 1787 of yacc.c */
#line 774 "go.y" #line 774 "go.y"
{ {
(yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3310,7 +3170,6 @@ yyreduce: ...@@ -3310,7 +3170,6 @@ yyreduce:
break; break;
case 104: case 104:
/* Line 1787 of yacc.c */
#line 778 "go.y" #line 778 "go.y"
{ {
(yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3318,7 +3177,6 @@ yyreduce: ...@@ -3318,7 +3177,6 @@ yyreduce:
break; break;
case 105: case 105:
/* Line 1787 of yacc.c */
#line 782 "go.y" #line 782 "go.y"
{ {
(yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3326,7 +3184,6 @@ yyreduce: ...@@ -3326,7 +3184,6 @@ yyreduce:
break; break;
case 106: case 106:
/* Line 1787 of yacc.c */
#line 786 "go.y" #line 786 "go.y"
{ {
(yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3334,7 +3191,6 @@ yyreduce: ...@@ -3334,7 +3191,6 @@ yyreduce:
break; break;
case 107: case 107:
/* Line 1787 of yacc.c */
#line 790 "go.y" #line 790 "go.y"
{ {
(yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3342,7 +3198,6 @@ yyreduce: ...@@ -3342,7 +3198,6 @@ yyreduce:
break; break;
case 108: case 108:
/* Line 1787 of yacc.c */
#line 794 "go.y" #line 794 "go.y"
{ {
(yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3350,7 +3205,6 @@ yyreduce: ...@@ -3350,7 +3205,6 @@ yyreduce:
break; break;
case 109: case 109:
/* Line 1787 of yacc.c */
#line 798 "go.y" #line 798 "go.y"
{ {
(yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3358,7 +3212,6 @@ yyreduce: ...@@ -3358,7 +3212,6 @@ yyreduce:
break; break;
case 110: case 110:
/* Line 1787 of yacc.c */
#line 803 "go.y" #line 803 "go.y"
{ {
(yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3366,7 +3219,6 @@ yyreduce: ...@@ -3366,7 +3219,6 @@ yyreduce:
break; break;
case 112: case 112:
/* Line 1787 of yacc.c */
#line 810 "go.y" #line 810 "go.y"
{ {
(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
...@@ -3374,7 +3226,6 @@ yyreduce: ...@@ -3374,7 +3226,6 @@ yyreduce:
break; break;
case 113: case 113:
/* Line 1787 of yacc.c */
#line 814 "go.y" #line 814 "go.y"
{ {
if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) { if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) {
...@@ -3389,7 +3240,6 @@ yyreduce: ...@@ -3389,7 +3240,6 @@ yyreduce:
break; break;
case 114: case 114:
/* Line 1787 of yacc.c */
#line 825 "go.y" #line 825 "go.y"
{ {
(yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N);
...@@ -3397,7 +3247,6 @@ yyreduce: ...@@ -3397,7 +3247,6 @@ yyreduce:
break; break;
case 115: case 115:
/* Line 1787 of yacc.c */
#line 829 "go.y" #line 829 "go.y"
{ {
(yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N);
...@@ -3405,7 +3254,6 @@ yyreduce: ...@@ -3405,7 +3254,6 @@ yyreduce:
break; break;
case 116: case 116:
/* Line 1787 of yacc.c */
#line 833 "go.y" #line 833 "go.y"
{ {
(yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N);
...@@ -3413,7 +3261,6 @@ yyreduce: ...@@ -3413,7 +3261,6 @@ yyreduce:
break; break;
case 117: case 117:
/* Line 1787 of yacc.c */
#line 837 "go.y" #line 837 "go.y"
{ {
yyerror("the bitwise complement operator is ^"); yyerror("the bitwise complement operator is ^");
...@@ -3422,7 +3269,6 @@ yyreduce: ...@@ -3422,7 +3269,6 @@ yyreduce:
break; break;
case 118: case 118:
/* Line 1787 of yacc.c */
#line 842 "go.y" #line 842 "go.y"
{ {
(yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N);
...@@ -3430,7 +3276,6 @@ yyreduce: ...@@ -3430,7 +3276,6 @@ yyreduce:
break; break;
case 119: case 119:
/* Line 1787 of yacc.c */
#line 846 "go.y" #line 846 "go.y"
{ {
(yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N);
...@@ -3438,7 +3283,6 @@ yyreduce: ...@@ -3438,7 +3283,6 @@ yyreduce:
break; break;
case 120: case 120:
/* Line 1787 of yacc.c */
#line 856 "go.y" #line 856 "go.y"
{ {
(yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N);
...@@ -3446,7 +3290,6 @@ yyreduce: ...@@ -3446,7 +3290,6 @@ yyreduce:
break; break;
case 121: case 121:
/* Line 1787 of yacc.c */
#line 860 "go.y" #line 860 "go.y"
{ {
(yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N);
...@@ -3455,7 +3298,6 @@ yyreduce: ...@@ -3455,7 +3298,6 @@ yyreduce:
break; break;
case 122: case 122:
/* Line 1787 of yacc.c */
#line 865 "go.y" #line 865 "go.y"
{ {
(yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N); (yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N);
...@@ -3465,7 +3307,6 @@ yyreduce: ...@@ -3465,7 +3307,6 @@ yyreduce:
break; break;
case 123: case 123:
/* Line 1787 of yacc.c */
#line 873 "go.y" #line 873 "go.y"
{ {
(yyval.node) = nodlit((yyvsp[(1) - (1)].val)); (yyval.node) = nodlit((yyvsp[(1) - (1)].val));
...@@ -3473,7 +3314,6 @@ yyreduce: ...@@ -3473,7 +3314,6 @@ yyreduce:
break; break;
case 125: case 125:
/* Line 1787 of yacc.c */
#line 878 "go.y" #line 878 "go.y"
{ {
if((yyvsp[(1) - (3)].node)->op == OPACK) { if((yyvsp[(1) - (3)].node)->op == OPACK) {
...@@ -3488,7 +3328,6 @@ yyreduce: ...@@ -3488,7 +3328,6 @@ yyreduce:
break; break;
case 126: case 126:
/* Line 1787 of yacc.c */
#line 889 "go.y" #line 889 "go.y"
{ {
(yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); (yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node));
...@@ -3496,7 +3335,6 @@ yyreduce: ...@@ -3496,7 +3335,6 @@ yyreduce:
break; break;
case 127: case 127:
/* Line 1787 of yacc.c */
#line 893 "go.y" #line 893 "go.y"
{ {
(yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node)); (yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node));
...@@ -3504,7 +3342,6 @@ yyreduce: ...@@ -3504,7 +3342,6 @@ yyreduce:
break; break;
case 128: case 128:
/* Line 1787 of yacc.c */
#line 897 "go.y" #line 897 "go.y"
{ {
(yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); (yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
...@@ -3512,7 +3349,6 @@ yyreduce: ...@@ -3512,7 +3349,6 @@ yyreduce:
break; break;
case 129: case 129:
/* Line 1787 of yacc.c */
#line 901 "go.y" #line 901 "go.y"
{ {
(yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node))); (yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node)));
...@@ -3520,7 +3356,6 @@ yyreduce: ...@@ -3520,7 +3356,6 @@ yyreduce:
break; break;
case 131: case 131:
/* Line 1787 of yacc.c */
#line 906 "go.y" #line 906 "go.y"
{ {
// conversion // conversion
...@@ -3530,7 +3365,6 @@ yyreduce: ...@@ -3530,7 +3365,6 @@ yyreduce:
break; break;
case 132: case 132:
/* Line 1787 of yacc.c */
#line 912 "go.y" #line 912 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node) = (yyvsp[(3) - (5)].node);
...@@ -3541,7 +3375,6 @@ yyreduce: ...@@ -3541,7 +3375,6 @@ yyreduce:
break; break;
case 133: case 133:
/* Line 1787 of yacc.c */
#line 919 "go.y" #line 919 "go.y"
{ {
(yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node) = (yyvsp[(3) - (5)].node);
...@@ -3551,7 +3384,6 @@ yyreduce: ...@@ -3551,7 +3384,6 @@ yyreduce:
break; break;
case 134: case 134:
/* Line 1787 of yacc.c */
#line 925 "go.y" #line 925 "go.y"
{ {
yyerror("cannot parenthesize type in composite literal"); yyerror("cannot parenthesize type in composite literal");
...@@ -3562,7 +3394,6 @@ yyreduce: ...@@ -3562,7 +3394,6 @@ yyreduce:
break; break;
case 136: case 136:
/* Line 1787 of yacc.c */
#line 934 "go.y" #line 934 "go.y"
{ {
// composite expression. // composite expression.
...@@ -3572,7 +3403,6 @@ yyreduce: ...@@ -3572,7 +3403,6 @@ yyreduce:
break; break;
case 137: case 137:
/* Line 1787 of yacc.c */
#line 942 "go.y" #line 942 "go.y"
{ {
(yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); (yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
...@@ -3580,7 +3410,6 @@ yyreduce: ...@@ -3580,7 +3410,6 @@ yyreduce:
break; break;
case 139: case 139:
/* Line 1787 of yacc.c */
#line 949 "go.y" #line 949 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node) = (yyvsp[(2) - (4)].node);
...@@ -3589,7 +3418,6 @@ yyreduce: ...@@ -3589,7 +3418,6 @@ yyreduce:
break; break;
case 141: case 141:
/* Line 1787 of yacc.c */
#line 957 "go.y" #line 957 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (3)].node); (yyval.node) = (yyvsp[(2) - (3)].node);
...@@ -3609,7 +3437,6 @@ yyreduce: ...@@ -3609,7 +3437,6 @@ yyreduce:
break; break;
case 145: case 145:
/* Line 1787 of yacc.c */
#line 982 "go.y" #line 982 "go.y"
{ {
(yyval.i) = LBODY; (yyval.i) = LBODY;
...@@ -3617,7 +3444,6 @@ yyreduce: ...@@ -3617,7 +3444,6 @@ yyreduce:
break; break;
case 146: case 146:
/* Line 1787 of yacc.c */
#line 986 "go.y" #line 986 "go.y"
{ {
(yyval.i) = '{'; (yyval.i) = '{';
...@@ -3625,7 +3451,6 @@ yyreduce: ...@@ -3625,7 +3451,6 @@ yyreduce:
break; break;
case 147: case 147:
/* Line 1787 of yacc.c */
#line 997 "go.y" #line 997 "go.y"
{ {
if((yyvsp[(1) - (1)].sym) == S) if((yyvsp[(1) - (1)].sym) == S)
...@@ -3636,7 +3461,6 @@ yyreduce: ...@@ -3636,7 +3461,6 @@ yyreduce:
break; break;
case 148: case 148:
/* Line 1787 of yacc.c */
#line 1006 "go.y" #line 1006 "go.y"
{ {
(yyval.node) = dclname((yyvsp[(1) - (1)].sym)); (yyval.node) = dclname((yyvsp[(1) - (1)].sym));
...@@ -3644,7 +3468,6 @@ yyreduce: ...@@ -3644,7 +3468,6 @@ yyreduce:
break; break;
case 149: case 149:
/* Line 1787 of yacc.c */
#line 1011 "go.y" #line 1011 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
...@@ -3652,7 +3475,6 @@ yyreduce: ...@@ -3652,7 +3475,6 @@ yyreduce:
break; break;
case 151: case 151:
/* Line 1787 of yacc.c */
#line 1018 "go.y" #line 1018 "go.y"
{ {
(yyval.sym) = (yyvsp[(1) - (1)].sym); (yyval.sym) = (yyvsp[(1) - (1)].sym);
...@@ -3663,7 +3485,6 @@ yyreduce: ...@@ -3663,7 +3485,6 @@ yyreduce:
break; break;
case 153: case 153:
/* Line 1787 of yacc.c */
#line 1026 "go.y" #line 1026 "go.y"
{ {
(yyval.sym) = S; (yyval.sym) = S;
...@@ -3671,19 +3492,23 @@ yyreduce: ...@@ -3671,19 +3492,23 @@ yyreduce:
break; break;
case 154: case 154:
/* Line 1787 of yacc.c */
#line 1032 "go.y" #line 1032 "go.y"
{ {
Pkg *p;
if((yyvsp[(2) - (4)].val).u.sval->len == 0) if((yyvsp[(2) - (4)].val).u.sval->len == 0)
(yyval.sym) = pkglookup((yyvsp[(4) - (4)].sym)->name, importpkg); p = importpkg;
else else {
(yyval.sym) = pkglookup((yyvsp[(4) - (4)].sym)->name, mkpkg((yyvsp[(2) - (4)].val).u.sval)); if(isbadimport((yyvsp[(2) - (4)].val).u.sval))
errorexit();
p = mkpkg((yyvsp[(2) - (4)].val).u.sval);
}
(yyval.sym) = pkglookup((yyvsp[(4) - (4)].sym)->name, p);
} }
break; break;
case 155: case 155:
/* Line 1787 of yacc.c */ #line 1047 "go.y"
#line 1041 "go.y"
{ {
(yyval.node) = oldname((yyvsp[(1) - (1)].sym)); (yyval.node) = oldname((yyvsp[(1) - (1)].sym));
if((yyval.node)->pack != N) if((yyval.node)->pack != N)
...@@ -3692,8 +3517,7 @@ yyreduce: ...@@ -3692,8 +3517,7 @@ yyreduce:
break; break;
case 157: case 157:
/* Line 1787 of yacc.c */ #line 1067 "go.y"
#line 1061 "go.y"
{ {
yyerror("final argument in variadic function missing type"); yyerror("final argument in variadic function missing type");
(yyval.node) = nod(ODDD, typenod(typ(TINTER)), N); (yyval.node) = nod(ODDD, typenod(typ(TINTER)), N);
...@@ -3701,40 +3525,35 @@ yyreduce: ...@@ -3701,40 +3525,35 @@ yyreduce:
break; break;
case 158: case 158:
/* Line 1787 of yacc.c */ #line 1072 "go.y"
#line 1066 "go.y"
{ {
(yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 164: case 164:
/* Line 1787 of yacc.c */ #line 1083 "go.y"
#line 1077 "go.y"
{ {
(yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N);
} }
break; break;
case 168: case 168:
/* Line 1787 of yacc.c */ #line 1092 "go.y"
#line 1086 "go.y"
{ {
(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 173: case 173:
/* Line 1787 of yacc.c */ #line 1102 "go.y"
#line 1096 "go.y"
{ {
(yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N);
} }
break; break;
case 183: case 183:
/* Line 1787 of yacc.c */ #line 1123 "go.y"
#line 1117 "go.y"
{ {
if((yyvsp[(1) - (3)].node)->op == OPACK) { if((yyvsp[(1) - (3)].node)->op == OPACK) {
Sym *s; Sym *s;
...@@ -3748,16 +3567,14 @@ yyreduce: ...@@ -3748,16 +3567,14 @@ yyreduce:
break; break;
case 184: case 184:
/* Line 1787 of yacc.c */ #line 1136 "go.y"
#line 1130 "go.y"
{ {
(yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node)); (yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node));
} }
break; break;
case 185: case 185:
/* Line 1787 of yacc.c */ #line 1140 "go.y"
#line 1134 "go.y"
{ {
// array literal of nelem // array literal of nelem
(yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node)); (yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node));
...@@ -3765,8 +3582,7 @@ yyreduce: ...@@ -3765,8 +3582,7 @@ yyreduce:
break; break;
case 186: case 186:
/* Line 1787 of yacc.c */ #line 1145 "go.y"
#line 1139 "go.y"
{ {
(yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N);
(yyval.node)->etype = Cboth; (yyval.node)->etype = Cboth;
...@@ -3774,8 +3590,7 @@ yyreduce: ...@@ -3774,8 +3590,7 @@ yyreduce:
break; break;
case 187: case 187:
/* Line 1787 of yacc.c */ #line 1150 "go.y"
#line 1144 "go.y"
{ {
(yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N);
(yyval.node)->etype = Csend; (yyval.node)->etype = Csend;
...@@ -3783,24 +3598,21 @@ yyreduce: ...@@ -3783,24 +3598,21 @@ yyreduce:
break; break;
case 188: case 188:
/* Line 1787 of yacc.c */ #line 1155 "go.y"
#line 1149 "go.y"
{ {
(yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)); (yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));
} }
break; break;
case 191: case 191:
/* Line 1787 of yacc.c */ #line 1163 "go.y"
#line 1157 "go.y"
{ {
(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 192: case 192:
/* Line 1787 of yacc.c */ #line 1169 "go.y"
#line 1163 "go.y"
{ {
(yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N);
(yyval.node)->etype = Crecv; (yyval.node)->etype = Crecv;
...@@ -3808,8 +3620,7 @@ yyreduce: ...@@ -3808,8 +3620,7 @@ yyreduce:
break; break;
case 193: case 193:
/* Line 1787 of yacc.c */ #line 1176 "go.y"
#line 1170 "go.y"
{ {
(yyval.node) = nod(OTSTRUCT, N, N); (yyval.node) = nod(OTSTRUCT, N, N);
(yyval.node)->list = (yyvsp[(3) - (5)].list); (yyval.node)->list = (yyvsp[(3) - (5)].list);
...@@ -3818,8 +3629,7 @@ yyreduce: ...@@ -3818,8 +3629,7 @@ yyreduce:
break; break;
case 194: case 194:
/* Line 1787 of yacc.c */ #line 1182 "go.y"
#line 1176 "go.y"
{ {
(yyval.node) = nod(OTSTRUCT, N, N); (yyval.node) = nod(OTSTRUCT, N, N);
fixlbrace((yyvsp[(2) - (3)].i)); fixlbrace((yyvsp[(2) - (3)].i));
...@@ -3827,8 +3637,7 @@ yyreduce: ...@@ -3827,8 +3637,7 @@ yyreduce:
break; break;
case 195: case 195:
/* Line 1787 of yacc.c */ #line 1189 "go.y"
#line 1183 "go.y"
{ {
(yyval.node) = nod(OTINTER, N, N); (yyval.node) = nod(OTINTER, N, N);
(yyval.node)->list = (yyvsp[(3) - (5)].list); (yyval.node)->list = (yyvsp[(3) - (5)].list);
...@@ -3837,8 +3646,7 @@ yyreduce: ...@@ -3837,8 +3646,7 @@ yyreduce:
break; break;
case 196: case 196:
/* Line 1787 of yacc.c */ #line 1195 "go.y"
#line 1189 "go.y"
{ {
(yyval.node) = nod(OTINTER, N, N); (yyval.node) = nod(OTINTER, N, N);
fixlbrace((yyvsp[(2) - (3)].i)); fixlbrace((yyvsp[(2) - (3)].i));
...@@ -3846,8 +3654,7 @@ yyreduce: ...@@ -3846,8 +3654,7 @@ yyreduce:
break; break;
case 197: case 197:
/* Line 1787 of yacc.c */ #line 1206 "go.y"
#line 1200 "go.y"
{ {
(yyval.node) = (yyvsp[(2) - (3)].node); (yyval.node) = (yyvsp[(2) - (3)].node);
if((yyval.node) == N) if((yyval.node) == N)
...@@ -3859,8 +3666,7 @@ yyreduce: ...@@ -3859,8 +3666,7 @@ yyreduce:
break; break;
case 198: case 198:
/* Line 1787 of yacc.c */ #line 1217 "go.y"
#line 1211 "go.y"
{ {
Node *t; Node *t;
...@@ -3892,8 +3698,7 @@ yyreduce: ...@@ -3892,8 +3698,7 @@ yyreduce:
break; break;
case 199: case 199:
/* Line 1787 of yacc.c */ #line 1246 "go.y"
#line 1240 "go.y"
{ {
Node *rcvr, *t; Node *rcvr, *t;
...@@ -3933,8 +3738,7 @@ yyreduce: ...@@ -3933,8 +3738,7 @@ yyreduce:
break; break;
case 200: case 200:
/* Line 1787 of yacc.c */ #line 1285 "go.y"
#line 1279 "go.y"
{ {
Sym *s; Sym *s;
Type *t; Type *t;
...@@ -3960,8 +3764,7 @@ yyreduce: ...@@ -3960,8 +3764,7 @@ yyreduce:
break; break;
case 201: case 201:
/* Line 1787 of yacc.c */ #line 1308 "go.y"
#line 1302 "go.y"
{ {
(yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right); (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)); (yyval.node)->type = functype((yyvsp[(2) - (8)].list)->n, (yyvsp[(6) - (8)].list), (yyvsp[(8) - (8)].list));
...@@ -3979,8 +3782,7 @@ yyreduce: ...@@ -3979,8 +3782,7 @@ yyreduce:
break; break;
case 202: case 202:
/* Line 1787 of yacc.c */ #line 1325 "go.y"
#line 1319 "go.y"
{ {
(yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1); (yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1);
(yyval.node) = nod(OTFUNC, N, N); (yyval.node) = nod(OTFUNC, N, N);
...@@ -3990,16 +3792,14 @@ yyreduce: ...@@ -3990,16 +3792,14 @@ yyreduce:
break; break;
case 203: case 203:
/* Line 1787 of yacc.c */ #line 1333 "go.y"
#line 1327 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 204: case 204:
/* Line 1787 of yacc.c */ #line 1337 "go.y"
#line 1331 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (3)].list); (yyval.list) = (yyvsp[(2) - (3)].list);
if((yyval.list) == nil) if((yyval.list) == nil)
...@@ -4008,24 +3808,21 @@ yyreduce: ...@@ -4008,24 +3808,21 @@ yyreduce:
break; break;
case 205: case 205:
/* Line 1787 of yacc.c */ #line 1345 "go.y"
#line 1339 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 206: case 206:
/* Line 1787 of yacc.c */ #line 1349 "go.y"
#line 1343 "go.y"
{ {
(yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node))); (yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node)));
} }
break; break;
case 207: case 207:
/* Line 1787 of yacc.c */ #line 1353 "go.y"
#line 1347 "go.y"
{ {
(yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0); (yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0);
(yyval.list) = (yyvsp[(2) - (3)].list); (yyval.list) = (yyvsp[(2) - (3)].list);
...@@ -4033,16 +3830,14 @@ yyreduce: ...@@ -4033,16 +3830,14 @@ yyreduce:
break; break;
case 208: case 208:
/* Line 1787 of yacc.c */ #line 1360 "go.y"
#line 1354 "go.y"
{ {
closurehdr((yyvsp[(1) - (1)].node)); closurehdr((yyvsp[(1) - (1)].node));
} }
break; break;
case 209: case 209:
/* Line 1787 of yacc.c */ #line 1366 "go.y"
#line 1360 "go.y"
{ {
(yyval.node) = closurebody((yyvsp[(3) - (4)].list)); (yyval.node) = closurebody((yyvsp[(3) - (4)].list));
fixlbrace((yyvsp[(2) - (4)].i)); fixlbrace((yyvsp[(2) - (4)].i));
...@@ -4050,24 +3845,21 @@ yyreduce: ...@@ -4050,24 +3845,21 @@ yyreduce:
break; break;
case 210: case 210:
/* Line 1787 of yacc.c */ #line 1371 "go.y"
#line 1365 "go.y"
{ {
(yyval.node) = closurebody(nil); (yyval.node) = closurebody(nil);
} }
break; break;
case 211: case 211:
/* Line 1787 of yacc.c */ #line 1382 "go.y"
#line 1376 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 212: case 212:
/* Line 1787 of yacc.c */ #line 1386 "go.y"
#line 1380 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list));
if(nsyntaxerrors == 0) if(nsyntaxerrors == 0)
...@@ -4076,64 +3868,56 @@ yyreduce: ...@@ -4076,64 +3868,56 @@ yyreduce:
break; break;
case 214: case 214:
/* Line 1787 of yacc.c */ #line 1395 "go.y"
#line 1389 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
} }
break; break;
case 216: case 216:
/* Line 1787 of yacc.c */ #line 1402 "go.y"
#line 1396 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
} }
break; break;
case 217: case 217:
/* Line 1787 of yacc.c */ #line 1408 "go.y"
#line 1402 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 218: case 218:
/* Line 1787 of yacc.c */ #line 1412 "go.y"
#line 1406 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 220: case 220:
/* Line 1787 of yacc.c */ #line 1419 "go.y"
#line 1413 "go.y"
{ {
(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
} }
break; break;
case 221: case 221:
/* Line 1787 of yacc.c */ #line 1425 "go.y"
#line 1419 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 222: case 222:
/* Line 1787 of yacc.c */ #line 1429 "go.y"
#line 1423 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 223: case 223:
/* Line 1787 of yacc.c */ #line 1435 "go.y"
#line 1429 "go.y"
{ {
NodeList *l; NodeList *l;
...@@ -4159,8 +3943,7 @@ yyreduce: ...@@ -4159,8 +3943,7 @@ yyreduce:
break; break;
case 224: case 224:
/* Line 1787 of yacc.c */ #line 1458 "go.y"
#line 1452 "go.y"
{ {
(yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val); (yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val);
(yyval.list) = list1((yyvsp[(1) - (2)].node)); (yyval.list) = list1((yyvsp[(1) - (2)].node));
...@@ -4168,8 +3951,7 @@ yyreduce: ...@@ -4168,8 +3951,7 @@ yyreduce:
break; break;
case 225: case 225:
/* Line 1787 of yacc.c */ #line 1463 "go.y"
#line 1457 "go.y"
{ {
(yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val); (yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val);
(yyval.list) = list1((yyvsp[(2) - (4)].node)); (yyval.list) = list1((yyvsp[(2) - (4)].node));
...@@ -4178,8 +3960,7 @@ yyreduce: ...@@ -4178,8 +3960,7 @@ yyreduce:
break; break;
case 226: case 226:
/* Line 1787 of yacc.c */ #line 1469 "go.y"
#line 1463 "go.y"
{ {
(yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N); (yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N);
(yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val); (yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val);
...@@ -4188,8 +3969,7 @@ yyreduce: ...@@ -4188,8 +3969,7 @@ yyreduce:
break; break;
case 227: case 227:
/* Line 1787 of yacc.c */ #line 1475 "go.y"
#line 1469 "go.y"
{ {
(yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N);
(yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val);
...@@ -4199,8 +3979,7 @@ yyreduce: ...@@ -4199,8 +3979,7 @@ yyreduce:
break; break;
case 228: case 228:
/* Line 1787 of yacc.c */ #line 1482 "go.y"
#line 1476 "go.y"
{ {
(yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N);
(yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val);
...@@ -4210,8 +3989,7 @@ yyreduce: ...@@ -4210,8 +3989,7 @@ yyreduce:
break; break;
case 229: case 229:
/* Line 1787 of yacc.c */ #line 1491 "go.y"
#line 1485 "go.y"
{ {
Node *n; Node *n;
...@@ -4223,8 +4001,7 @@ yyreduce: ...@@ -4223,8 +4001,7 @@ yyreduce:
break; break;
case 230: case 230:
/* Line 1787 of yacc.c */ #line 1500 "go.y"
#line 1494 "go.y"
{ {
Pkg *pkg; Pkg *pkg;
...@@ -4240,16 +4017,14 @@ yyreduce: ...@@ -4240,16 +4017,14 @@ yyreduce:
break; break;
case 231: case 231:
/* Line 1787 of yacc.c */ #line 1515 "go.y"
#line 1509 "go.y"
{ {
(yyval.node) = embedded((yyvsp[(1) - (1)].sym)); (yyval.node) = embedded((yyvsp[(1) - (1)].sym));
} }
break; break;
case 232: case 232:
/* Line 1787 of yacc.c */ #line 1521 "go.y"
#line 1515 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); (yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
ifacedcl((yyval.node)); ifacedcl((yyval.node));
...@@ -4257,16 +4032,14 @@ yyreduce: ...@@ -4257,16 +4032,14 @@ yyreduce:
break; break;
case 233: case 233:
/* Line 1787 of yacc.c */ #line 1526 "go.y"
#line 1520 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym))); (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym)));
} }
break; break;
case 234: case 234:
/* Line 1787 of yacc.c */ #line 1530 "go.y"
#line 1524 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym))); (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym)));
yyerror("cannot parenthesize embedded type"); yyerror("cannot parenthesize embedded type");
...@@ -4274,8 +4047,7 @@ yyreduce: ...@@ -4274,8 +4047,7 @@ yyreduce:
break; break;
case 235: case 235:
/* Line 1787 of yacc.c */ #line 1537 "go.y"
#line 1531 "go.y"
{ {
// without func keyword // without func keyword
(yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1); (yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1);
...@@ -4286,8 +4058,7 @@ yyreduce: ...@@ -4286,8 +4058,7 @@ yyreduce:
break; break;
case 237: case 237:
/* Line 1787 of yacc.c */ #line 1551 "go.y"
#line 1545 "go.y"
{ {
(yyval.node) = nod(ONONAME, N, N); (yyval.node) = nod(ONONAME, N, N);
(yyval.node)->sym = (yyvsp[(1) - (2)].sym); (yyval.node)->sym = (yyvsp[(1) - (2)].sym);
...@@ -4296,8 +4067,7 @@ yyreduce: ...@@ -4296,8 +4067,7 @@ yyreduce:
break; break;
case 238: case 238:
/* Line 1787 of yacc.c */ #line 1557 "go.y"
#line 1551 "go.y"
{ {
(yyval.node) = nod(ONONAME, N, N); (yyval.node) = nod(ONONAME, N, N);
(yyval.node)->sym = (yyvsp[(1) - (2)].sym); (yyval.node)->sym = (yyvsp[(1) - (2)].sym);
...@@ -4306,64 +4076,56 @@ yyreduce: ...@@ -4306,64 +4076,56 @@ yyreduce:
break; break;
case 240: case 240:
/* Line 1787 of yacc.c */ #line 1566 "go.y"
#line 1560 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 241: case 241:
/* Line 1787 of yacc.c */ #line 1570 "go.y"
#line 1564 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 242: case 242:
/* Line 1787 of yacc.c */ #line 1575 "go.y"
#line 1569 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 243: case 243:
/* Line 1787 of yacc.c */ #line 1579 "go.y"
#line 1573 "go.y"
{ {
(yyval.list) = (yyvsp[(1) - (2)].list); (yyval.list) = (yyvsp[(1) - (2)].list);
} }
break; break;
case 244: case 244:
/* Line 1787 of yacc.c */ #line 1587 "go.y"
#line 1581 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 246: case 246:
/* Line 1787 of yacc.c */ #line 1592 "go.y"
#line 1586 "go.y"
{ {
(yyval.node) = liststmt((yyvsp[(1) - (1)].list)); (yyval.node) = liststmt((yyvsp[(1) - (1)].list));
} }
break; break;
case 248: case 248:
/* Line 1787 of yacc.c */ #line 1597 "go.y"
#line 1591 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 254: case 254:
/* Line 1787 of yacc.c */ #line 1608 "go.y"
#line 1602 "go.y"
{ {
(yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N); (yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N);
(yyvsp[(1) - (2)].node)->sym = dclstack; // context, for goto restrictions (yyvsp[(1) - (2)].node)->sym = dclstack; // context, for goto restrictions
...@@ -4371,8 +4133,7 @@ yyreduce: ...@@ -4371,8 +4133,7 @@ yyreduce:
break; break;
case 255: case 255:
/* Line 1787 of yacc.c */ #line 1613 "go.y"
#line 1607 "go.y"
{ {
NodeList *l; NodeList *l;
...@@ -4385,8 +4146,7 @@ yyreduce: ...@@ -4385,8 +4146,7 @@ yyreduce:
break; break;
case 256: case 256:
/* Line 1787 of yacc.c */ #line 1623 "go.y"
#line 1617 "go.y"
{ {
// will be converted to OFALL // will be converted to OFALL
(yyval.node) = nod(OXFALL, N, N); (yyval.node) = nod(OXFALL, N, N);
...@@ -4394,40 +4154,35 @@ yyreduce: ...@@ -4394,40 +4154,35 @@ yyreduce:
break; break;
case 257: case 257:
/* Line 1787 of yacc.c */ #line 1628 "go.y"
#line 1622 "go.y"
{ {
(yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 258: case 258:
/* Line 1787 of yacc.c */ #line 1632 "go.y"
#line 1626 "go.y"
{ {
(yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 259: case 259:
/* Line 1787 of yacc.c */ #line 1636 "go.y"
#line 1630 "go.y"
{ {
(yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 260: case 260:
/* Line 1787 of yacc.c */ #line 1640 "go.y"
#line 1634 "go.y"
{ {
(yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N);
} }
break; break;
case 261: case 261:
/* Line 1787 of yacc.c */ #line 1644 "go.y"
#line 1638 "go.y"
{ {
(yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N); (yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N);
(yyval.node)->sym = dclstack; // context, for goto restrictions (yyval.node)->sym = dclstack; // context, for goto restrictions
...@@ -4435,8 +4190,7 @@ yyreduce: ...@@ -4435,8 +4190,7 @@ yyreduce:
break; break;
case 262: case 262:
/* Line 1787 of yacc.c */ #line 1649 "go.y"
#line 1643 "go.y"
{ {
(yyval.node) = nod(ORETURN, N, N); (yyval.node) = nod(ORETURN, N, N);
(yyval.node)->list = (yyvsp[(2) - (2)].list); (yyval.node)->list = (yyvsp[(2) - (2)].list);
...@@ -4456,8 +4210,7 @@ yyreduce: ...@@ -4456,8 +4210,7 @@ yyreduce:
break; break;
case 263: case 263:
/* Line 1787 of yacc.c */ #line 1668 "go.y"
#line 1662 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
if((yyvsp[(1) - (1)].node) != N) if((yyvsp[(1) - (1)].node) != N)
...@@ -4466,8 +4219,7 @@ yyreduce: ...@@ -4466,8 +4219,7 @@ yyreduce:
break; break;
case 264: case 264:
/* Line 1787 of yacc.c */ #line 1674 "go.y"
#line 1668 "go.y"
{ {
(yyval.list) = (yyvsp[(1) - (3)].list); (yyval.list) = (yyvsp[(1) - (3)].list);
if((yyvsp[(3) - (3)].node) != N) if((yyvsp[(3) - (3)].node) != N)
...@@ -4476,216 +4228,189 @@ yyreduce: ...@@ -4476,216 +4228,189 @@ yyreduce:
break; break;
case 265: case 265:
/* Line 1787 of yacc.c */ #line 1682 "go.y"
#line 1676 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 266: case 266:
/* Line 1787 of yacc.c */ #line 1686 "go.y"
#line 1680 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 267: case 267:
/* Line 1787 of yacc.c */ #line 1692 "go.y"
#line 1686 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 268: case 268:
/* Line 1787 of yacc.c */ #line 1696 "go.y"
#line 1690 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 269: case 269:
/* Line 1787 of yacc.c */ #line 1702 "go.y"
#line 1696 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 270: case 270:
/* Line 1787 of yacc.c */ #line 1706 "go.y"
#line 1700 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 271: case 271:
/* Line 1787 of yacc.c */ #line 1712 "go.y"
#line 1706 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 272: case 272:
/* Line 1787 of yacc.c */ #line 1716 "go.y"
#line 1710 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 273: case 273:
/* Line 1787 of yacc.c */ #line 1725 "go.y"
#line 1719 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 274: case 274:
/* Line 1787 of yacc.c */ #line 1729 "go.y"
#line 1723 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 275: case 275:
/* Line 1787 of yacc.c */ #line 1733 "go.y"
#line 1727 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 276: case 276:
/* Line 1787 of yacc.c */ #line 1737 "go.y"
#line 1731 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 277: case 277:
/* Line 1787 of yacc.c */ #line 1742 "go.y"
#line 1736 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 278: case 278:
/* Line 1787 of yacc.c */ #line 1746 "go.y"
#line 1740 "go.y"
{ {
(yyval.list) = (yyvsp[(1) - (2)].list); (yyval.list) = (yyvsp[(1) - (2)].list);
} }
break; break;
case 283: case 283:
/* Line 1787 of yacc.c */ #line 1760 "go.y"
#line 1754 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 285: case 285:
/* Line 1787 of yacc.c */ #line 1766 "go.y"
#line 1760 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 287: case 287:
/* Line 1787 of yacc.c */ #line 1772 "go.y"
#line 1766 "go.y"
{ {
(yyval.node) = N; (yyval.node) = N;
} }
break; break;
case 289: case 289:
/* Line 1787 of yacc.c */ #line 1778 "go.y"
#line 1772 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 291: case 291:
/* Line 1787 of yacc.c */ #line 1784 "go.y"
#line 1778 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 293: case 293:
/* Line 1787 of yacc.c */ #line 1790 "go.y"
#line 1784 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 295: case 295:
/* Line 1787 of yacc.c */ #line 1796 "go.y"
#line 1790 "go.y"
{ {
(yyval.val).ctype = CTxxx; (yyval.val).ctype = CTxxx;
} }
break; break;
case 297: case 297:
/* Line 1787 of yacc.c */ #line 1806 "go.y"
#line 1800 "go.y"
{ {
importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval); importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval);
} }
break; break;
case 298: case 298:
/* Line 1787 of yacc.c */ #line 1810 "go.y"
#line 1804 "go.y"
{ {
importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type)); importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type));
} }
break; break;
case 299: case 299:
/* Line 1787 of yacc.c */ #line 1814 "go.y"
#line 1808 "go.y"
{ {
importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node)); importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node));
} }
break; break;
case 300: case 300:
/* Line 1787 of yacc.c */ #line 1818 "go.y"
#line 1812 "go.y"
{ {
importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node)); importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node));
} }
break; break;
case 301: case 301:
/* Line 1787 of yacc.c */ #line 1822 "go.y"
#line 1816 "go.y"
{ {
importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type)); importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type));
} }
break; break;
case 302: case 302:
/* Line 1787 of yacc.c */ #line 1826 "go.y"
#line 1820 "go.y"
{ {
if((yyvsp[(2) - (4)].node) == N) if((yyvsp[(2) - (4)].node) == N)
break; break;
...@@ -4704,8 +4429,7 @@ yyreduce: ...@@ -4704,8 +4429,7 @@ yyreduce:
break; break;
case 303: case 303:
/* Line 1787 of yacc.c */ #line 1844 "go.y"
#line 1838 "go.y"
{ {
(yyval.sym) = (yyvsp[(1) - (1)].sym); (yyval.sym) = (yyvsp[(1) - (1)].sym);
structpkg = (yyval.sym)->pkg; structpkg = (yyval.sym)->pkg;
...@@ -4713,8 +4437,7 @@ yyreduce: ...@@ -4713,8 +4437,7 @@ yyreduce:
break; break;
case 304: case 304:
/* Line 1787 of yacc.c */ #line 1851 "go.y"
#line 1845 "go.y"
{ {
(yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym));
importsym((yyvsp[(1) - (1)].sym), OTYPE); importsym((yyvsp[(1) - (1)].sym), OTYPE);
...@@ -4722,16 +4445,14 @@ yyreduce: ...@@ -4722,16 +4445,14 @@ yyreduce:
break; break;
case 310: case 310:
/* Line 1787 of yacc.c */ #line 1871 "go.y"
#line 1865 "go.y"
{ {
(yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym));
} }
break; break;
case 311: case 311:
/* Line 1787 of yacc.c */ #line 1875 "go.y"
#line 1869 "go.y"
{ {
// predefined name like uint8 // predefined name like uint8
(yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg); (yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg);
...@@ -4744,56 +4465,49 @@ yyreduce: ...@@ -4744,56 +4465,49 @@ yyreduce:
break; break;
case 312: case 312:
/* Line 1787 of yacc.c */ #line 1885 "go.y"
#line 1879 "go.y"
{ {
(yyval.type) = aindex(N, (yyvsp[(3) - (3)].type)); (yyval.type) = aindex(N, (yyvsp[(3) - (3)].type));
} }
break; break;
case 313: case 313:
/* Line 1787 of yacc.c */ #line 1889 "go.y"
#line 1883 "go.y"
{ {
(yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type)); (yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type));
} }
break; break;
case 314: case 314:
/* Line 1787 of yacc.c */ #line 1893 "go.y"
#line 1887 "go.y"
{ {
(yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type)); (yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type));
} }
break; break;
case 315: case 315:
/* Line 1787 of yacc.c */ #line 1897 "go.y"
#line 1891 "go.y"
{ {
(yyval.type) = tostruct((yyvsp[(3) - (4)].list)); (yyval.type) = tostruct((yyvsp[(3) - (4)].list));
} }
break; break;
case 316: case 316:
/* Line 1787 of yacc.c */ #line 1901 "go.y"
#line 1895 "go.y"
{ {
(yyval.type) = tointerface((yyvsp[(3) - (4)].list)); (yyval.type) = tointerface((yyvsp[(3) - (4)].list));
} }
break; break;
case 317: case 317:
/* Line 1787 of yacc.c */ #line 1905 "go.y"
#line 1899 "go.y"
{ {
(yyval.type) = ptrto((yyvsp[(2) - (2)].type)); (yyval.type) = ptrto((yyvsp[(2) - (2)].type));
} }
break; break;
case 318: case 318:
/* Line 1787 of yacc.c */ #line 1909 "go.y"
#line 1903 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(2) - (2)].type); (yyval.type)->type = (yyvsp[(2) - (2)].type);
...@@ -4802,8 +4516,7 @@ yyreduce: ...@@ -4802,8 +4516,7 @@ yyreduce:
break; break;
case 319: case 319:
/* Line 1787 of yacc.c */ #line 1915 "go.y"
#line 1909 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(3) - (4)].type); (yyval.type)->type = (yyvsp[(3) - (4)].type);
...@@ -4812,8 +4525,7 @@ yyreduce: ...@@ -4812,8 +4525,7 @@ yyreduce:
break; break;
case 320: case 320:
/* Line 1787 of yacc.c */ #line 1921 "go.y"
#line 1915 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(3) - (3)].type); (yyval.type)->type = (yyvsp[(3) - (3)].type);
...@@ -4822,8 +4534,7 @@ yyreduce: ...@@ -4822,8 +4534,7 @@ yyreduce:
break; break;
case 321: case 321:
/* Line 1787 of yacc.c */ #line 1929 "go.y"
#line 1923 "go.y"
{ {
(yyval.type) = typ(TCHAN); (yyval.type) = typ(TCHAN);
(yyval.type)->type = (yyvsp[(3) - (3)].type); (yyval.type)->type = (yyvsp[(3) - (3)].type);
...@@ -4832,16 +4543,14 @@ yyreduce: ...@@ -4832,16 +4543,14 @@ yyreduce:
break; break;
case 322: case 322:
/* Line 1787 of yacc.c */ #line 1937 "go.y"
#line 1931 "go.y"
{ {
(yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)); (yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list));
} }
break; break;
case 323: case 323:
/* Line 1787 of yacc.c */ #line 1943 "go.y"
#line 1937 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type))); (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type)));
if((yyvsp[(1) - (3)].sym)) if((yyvsp[(1) - (3)].sym))
...@@ -4851,8 +4560,7 @@ yyreduce: ...@@ -4851,8 +4560,7 @@ yyreduce:
break; break;
case 324: case 324:
/* Line 1787 of yacc.c */ #line 1950 "go.y"
#line 1944 "go.y"
{ {
Type *t; Type *t;
...@@ -4869,8 +4577,7 @@ yyreduce: ...@@ -4869,8 +4577,7 @@ yyreduce:
break; break;
case 325: case 325:
/* Line 1787 of yacc.c */ #line 1966 "go.y"
#line 1960 "go.y"
{ {
Sym *s; Sym *s;
...@@ -4889,56 +4596,49 @@ yyreduce: ...@@ -4889,56 +4596,49 @@ yyreduce:
break; break;
case 326: case 326:
/* Line 1787 of yacc.c */ #line 1984 "go.y"
#line 1978 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)))); (yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list))));
} }
break; break;
case 327: case 327:
/* Line 1787 of yacc.c */ #line 1988 "go.y"
#line 1982 "go.y"
{ {
(yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))); (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)));
} }
break; break;
case 328: case 328:
/* Line 1787 of yacc.c */ #line 1993 "go.y"
#line 1987 "go.y"
{ {
(yyval.list) = nil; (yyval.list) = nil;
} }
break; break;
case 330: case 330:
/* Line 1787 of yacc.c */ #line 2000 "go.y"
#line 1994 "go.y"
{ {
(yyval.list) = (yyvsp[(2) - (3)].list); (yyval.list) = (yyvsp[(2) - (3)].list);
} }
break; break;
case 331: case 331:
/* Line 1787 of yacc.c */ #line 2004 "go.y"
#line 1998 "go.y"
{ {
(yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)))); (yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))));
} }
break; break;
case 332: case 332:
/* Line 1787 of yacc.c */ #line 2014 "go.y"
#line 2008 "go.y"
{ {
(yyval.node) = nodlit((yyvsp[(1) - (1)].val)); (yyval.node) = nodlit((yyvsp[(1) - (1)].val));
} }
break; break;
case 333: case 333:
/* Line 1787 of yacc.c */ #line 2018 "go.y"
#line 2012 "go.y"
{ {
(yyval.node) = nodlit((yyvsp[(2) - (2)].val)); (yyval.node) = nodlit((yyvsp[(2) - (2)].val));
switch((yyval.node)->val.ctype){ switch((yyval.node)->val.ctype){
...@@ -4956,8 +4656,7 @@ yyreduce: ...@@ -4956,8 +4656,7 @@ yyreduce:
break; break;
case 334: case 334:
/* Line 1787 of yacc.c */ #line 2033 "go.y"
#line 2027 "go.y"
{ {
(yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg)); (yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg));
if((yyval.node)->op != OLITERAL) if((yyval.node)->op != OLITERAL)
...@@ -4966,8 +4665,7 @@ yyreduce: ...@@ -4966,8 +4665,7 @@ yyreduce:
break; break;
case 336: case 336:
/* Line 1787 of yacc.c */ #line 2042 "go.y"
#line 2036 "go.y"
{ {
if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) { if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) {
(yyval.node) = (yyvsp[(2) - (5)].node); (yyval.node) = (yyvsp[(2) - (5)].node);
...@@ -4981,69 +4679,52 @@ yyreduce: ...@@ -4981,69 +4679,52 @@ yyreduce:
break; break;
case 339: case 339:
/* Line 1787 of yacc.c */ #line 2058 "go.y"
#line 2052 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 340: case 340:
/* Line 1787 of yacc.c */ #line 2062 "go.y"
#line 2056 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 341: case 341:
/* Line 1787 of yacc.c */ #line 2068 "go.y"
#line 2062 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 342: case 342:
/* Line 1787 of yacc.c */ #line 2072 "go.y"
#line 2066 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
case 343: case 343:
/* Line 1787 of yacc.c */ #line 2078 "go.y"
#line 2072 "go.y"
{ {
(yyval.list) = list1((yyvsp[(1) - (1)].node)); (yyval.list) = list1((yyvsp[(1) - (1)].node));
} }
break; break;
case 344: case 344:
/* Line 1787 of yacc.c */ #line 2082 "go.y"
#line 2076 "go.y"
{ {
(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
} }
break; break;
/* Line 1787 of yacc.c */ /* Line 1267 of yacc.c. */
#line 5035 "y.tab.c" #line 4727 "y.tab.c"
default: break; 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); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -5052,6 +4733,7 @@ yyreduce: ...@@ -5052,6 +4733,7 @@ yyreduce:
*++yyvsp = yyval; *++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state /* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule that goes to, based on the state we popped back to and the rule
number reduced by. */ number reduced by. */
...@@ -5071,10 +4753,6 @@ yyreduce: ...@@ -5071,10 +4753,6 @@ yyreduce:
| yyerrlab -- here on detecting error | | yyerrlab -- here on detecting error |
`------------------------------------*/ `------------------------------------*/
yyerrlab: 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 not already recovering from an error, report this error. */
if (!yyerrstatus) if (!yyerrstatus)
{ {
...@@ -5082,36 +4760,37 @@ yyerrlab: ...@@ -5082,36 +4760,37 @@ yyerrlab:
#if ! YYERROR_VERBOSE #if ! YYERROR_VERBOSE
yyerror (YY_("syntax error")); yyerror (YY_("syntax error"));
#else #else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
{ {
char *yymsgp = YY_("syntax error"); YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
int yysyntax_error_status; if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
yysyntax_error_status = YYSYNTAX_ERROR;
if (yysyntax_error_status == 0)
yymsgp = yymsg;
else if (yysyntax_error_status == 1)
{ {
YYSIZE_T yyalloc = 2 * yysize;
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yyalloc = YYSTACK_ALLOC_MAXIMUM;
if (yymsg != yymsgbuf) if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg); YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); yymsg = (char *) YYSTACK_ALLOC (yyalloc);
if (!yymsg) if (yymsg)
yymsg_alloc = yyalloc;
else
{ {
yymsg = yymsgbuf; yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf; yymsg_alloc = sizeof yymsgbuf;
yysyntax_error_status = 2;
} }
else
{
yysyntax_error_status = YYSYNTAX_ERROR;
yymsgp = yymsg;
} }
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
yyerror (yymsg);
} }
yyerror (yymsgp); else
if (yysyntax_error_status == 2) {
yyerror (YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab; goto yyexhaustedlab;
} }
# undef YYSYNTAX_ERROR }
#endif #endif
} }
...@@ -5119,7 +4798,7 @@ yyerrlab: ...@@ -5119,7 +4798,7 @@ yyerrlab:
if (yyerrstatus == 3) 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. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
...@@ -5136,7 +4815,7 @@ yyerrlab: ...@@ -5136,7 +4815,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. */ token. */
goto yyerrlab1; goto yyerrlab1;
...@@ -5170,7 +4849,7 @@ yyerrlab1: ...@@ -5170,7 +4849,7 @@ yyerrlab1:
for (;;) for (;;)
{ {
yyn = yypact[yystate]; yyn = yypact[yystate];
if (!yypact_value_is_default (yyn)) if (yyn != YYPACT_NINF)
{ {
yyn += YYTERROR; yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
...@@ -5193,6 +4872,9 @@ yyerrlab1: ...@@ -5193,6 +4872,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
...@@ -5217,7 +4899,7 @@ yyabortlab: ...@@ -5217,7 +4899,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#if !defined yyoverflow || YYERROR_VERBOSE #ifndef yyoverflow
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
...@@ -5228,14 +4910,9 @@ yyexhaustedlab: ...@@ -5228,14 +4910,9 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEMPTY) if (yychar != YYEOF && 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", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval); yytoken, &yylval);
}
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */ this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -5259,8 +4936,7 @@ yyreturn: ...@@ -5259,8 +4936,7 @@ yyreturn:
} }
/* Line 2048 of yacc.c */ #line 2086 "go.y"
#line 2080 "go.y"
static void static void
...@@ -5273,3 +4949,4 @@ fixlbrace(int lbr) ...@@ -5273,3 +4949,4 @@ fixlbrace(int lbr)
loophack = 1; loophack = 1;
} }
/* A Bison parser, made by GNU Bison 2.6.2. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison interface for Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 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 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -15,7 +16,9 @@ ...@@ -15,7 +16,9 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License 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 /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -30,16 +33,6 @@ ...@@ -30,16 +33,6 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_Y_TAB_H
# define YY_Y_TAB_H
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -150,42 +143,25 @@ extern int yydebug; ...@@ -150,42 +143,25 @@ extern int yydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{
/* Line 2049 of yacc.c */
#line 28 "go.y" #line 28 "go.y"
{
Node* node; Node* node;
NodeList* list; NodeList* list;
Type* type; Type* type;
Sym* sym; Sym* sym;
struct Val val; struct Val val;
int i; int i;
}
/* Line 1529 of yacc.c. */
/* Line 2049 of yacc.c */ #line 160 "y.tab.h"
#line 169 "y.tab.h" YYSTYPE;
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE yylval; extern YYSTYPE yylval;
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_Y_TAB_H */
...@@ -643,7 +643,7 @@ mark(Sym *s) ...@@ -643,7 +643,7 @@ mark(Sym *s)
if(s == S || s->reachable) if(s == S || s->reachable)
return; return;
if(strncmp(s->name, "weak.", 5) == 0) if(strncmp(s->name, "go.weak.", 8) == 0)
return; return;
s->reachable = 1; s->reachable = 1;
if(s->text) if(s->text)
...@@ -751,7 +751,7 @@ deadcode(void) ...@@ -751,7 +751,7 @@ deadcode(void)
last->next = nil; last->next = nil;
for(s = allsym; s != S; s = s->allsym) for(s = allsym; s != S; s = s->allsym)
if(strncmp(s->name, "weak.", 5) == 0) { if(strncmp(s->name, "go.weak.", 8) == 0) {
s->special = 1; // do not lay out in data segment s->special = 1; // do not lay out in data segment
s->reachable = 1; s->reachable = 1;
s->hide = 1; s->hide = 1;
...@@ -766,8 +766,8 @@ doweak(void) ...@@ -766,8 +766,8 @@ doweak(void)
// resolve weak references only if // resolve weak references only if
// target symbol will be in binary anyway. // target symbol will be in binary anyway.
for(s = allsym; s != S; s = s->allsym) { for(s = allsym; s != S; s = s->allsym) {
if(strncmp(s->name, "weak.", 5) == 0) { if(strncmp(s->name, "go.weak.", 8) == 0) {
t = rlookup(s->name+5, s->version); t = rlookup(s->name+8, s->version);
if(t && t->type != 0 && t->reachable) { if(t && t->type != 0 && t->reachable) {
s->value = t->value; s->value = t->value;
s->type = t->type; s->type = t->type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment