diff --git a/src/cmd/gc/fmt.c b/src/cmd/gc/fmt.c index 5437dac1dba..093b276f070 100644 --- a/src/cmd/gc/fmt.c +++ b/src/cmd/gc/fmt.c @@ -1058,7 +1058,7 @@ exprfmt(Fmt *f, Node *n, int prec) NodeList *l; Type *t; - while(n && n->implicit) + while(n && n->implicit && (n->op == OIND || n->op == OADDR)) n = n->left; if(n == N) @@ -1160,13 +1160,13 @@ exprfmt(Fmt *f, Node *n, int prec) return fmtprint(f, "%N{ %,H }", n->right, n->list); case OPTRLIT: - if (fmtmode == FExp && n->left->right->implicit == Implicit) + if(fmtmode == FExp && n->left->implicit) return fmtprint(f, "%N", n->left); return fmtprint(f, "&%N", n->left); case OSTRUCTLIT: - if (fmtmode == FExp) { // requires special handling of field names - if(n->right->implicit == Implicit) + if(fmtmode == FExp) { // requires special handling of field names + if(n->implicit) fmtstrcpy(f, "{"); else fmtprint(f, "%T{", n->type); @@ -1194,6 +1194,8 @@ exprfmt(Fmt *f, Node *n, int prec) case OMAPLIT: if(fmtmode == FErr) return fmtprint(f, "%T literal", n->type); + if(fmtmode == FExp && n->implicit) + return fmtprint(f, "{ %,H }", n->list); return fmtprint(f, "%T{ %,H }", n->type, n->list); case OKEY: diff --git a/src/cmd/gc/go.h b/src/cmd/gc/go.h index 66becb0f3f8..6b0709c16ef 100644 --- a/src/cmd/gc/go.h +++ b/src/cmd/gc/go.h @@ -215,13 +215,6 @@ enum EscNever, }; -enum -{ - Explicit, - Implicit, // don't print in output - ImplPtr, // OIND added by &T{ ... } literal -}; - struct Node { // Tree structure. @@ -257,7 +250,7 @@ struct Node uchar used; uchar isddd; uchar readonly; - uchar implicit; // Explicit, Implicit, ImplPtr. + uchar implicit; uchar addrtaken; // address taken, even if not moved to heap uchar dupok; // duplicate definitions ok (for func) diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index 31909635876..0561f2bdf58 100644 --- a/src/cmd/gc/go.y +++ b/src/cmd/gc/go.y @@ -808,7 +808,7 @@ uexpr: // Special case for &T{...}: turn into (*T){...}. $$ = $2; $$->right = nod(OIND, $$->right, N); - $$->right->implicit = ImplPtr; + $$->right->implicit = 1; } else { $$ = nod(OADDR, $2, N); } diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c index 4f2aea49928..2339efe072f 100644 --- a/src/cmd/gc/typecheck.c +++ b/src/cmd/gc/typecheck.c @@ -2008,7 +2008,8 @@ pushtype(Node *n, Type *t) if(n->right == N) { n->right = typenod(t); - n->right->implicit = 1; + n->implicit = 1; // don't print + n->right->implicit = 1; // * is okay } else if(debug['s']) { typecheck(&n->right, Etype); @@ -2048,8 +2049,8 @@ typecheckcomplit(Node **np) if(isptr[t->etype]) { // For better or worse, we don't allow pointers as the composite literal type, - // except when using the &T syntax, which sets implicit to ImplPtr. - if(n->right->implicit == Explicit) { + // except when using the &T syntax, which sets implicit on the OIND. + if(!n->right->implicit) { yyerror("invalid pointer type %T for composite literal (use &%T instead)", t, t->type); goto error; } diff --git a/src/cmd/gc/y.tab.c b/src/cmd/gc/y.tab.c index 2ad3d89b34f..b7f7fa96ddb 100644 --- a/src/cmd/gc/y.tab.c +++ b/src/cmd/gc/y.tab.c @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,11 +54,52 @@ /* Pure parsers. */ #define YYPURE 0 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 20 "go.y" + +#include +#include /* if we don't, bison will, and go.h re-#defines getc */ +#include +#include "go.h" + +static void fixlbrace(int); + + +/* Line 189 of yacc.c */ +#line 83 "y.tab.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -171,61 +211,36 @@ -/* Copy the first part of user declarations. */ -#line 20 "go.y" - -#include -#include /* if we don't, bison will, and go.h re-#defines getc */ -#include -#include "go.h" - -static void fixlbrace(int); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 28 "go.y" { + +/* Line 214 of yacc.c */ +#line 28 "go.y" + Node* node; NodeList* list; Type* type; Sym* sym; struct Val val; int i; -} -/* Line 193 of yacc.c. */ -#line 216 "y.tab.c" - YYSTYPE; + + + +/* Line 214 of yacc.c */ +#line 232 "y.tab.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 229 "y.tab.c" +/* Line 264 of yacc.c */ +#line 244 "y.tab.c" #ifdef short # undef short @@ -275,7 +290,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -300,14 +315,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -388,9 +403,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -424,12 +439,12 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -707,30 +722,30 @@ const char *yytname[] = "'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'", "PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'", "'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$accept", "file", - "package", "loadsys", "@1", "imports", "import", "import_stmt", + "package", "loadsys", "$@1", "imports", "import", "import_stmt", "import_stmt_list", "import_here", "import_package", "import_safety", - "import_there", "@2", "xdcl", "common_dcl", "lconst", "vardcl", + "import_there", "$@2", "xdcl", "common_dcl", "lconst", "vardcl", "constdcl", "constdcl1", "typedclname", "typedcl", "simple_stmt", "case", - "compound_stmt", "@3", "caseblock", "@4", "caseblock_list", "loop_body", - "@5", "range_stmt", "for_header", "for_body", "for_stmt", "@6", - "if_header", "if_stmt", "@7", "@8", "@9", "else", "switch_stmt", "@10", - "@11", "select_stmt", "@12", "expr", "uexpr", "pseudocall", - "pexpr_no_paren", "start_complit", "keyval", "complitexpr", "pexpr", - "expr_or_type", "name_or_type", "lbrace", "new_name", "dcl_name", - "onew_name", "sym", "hidden_importsym", "name", "labelname", "dotdotdot", - "ntype", "non_expr_type", "non_recvchantype", "convtype", "comptype", - "fnret_type", "dotname", "othertype", "ptrtype", "recvchantype", - "structtype", "interfacetype", "xfndcl", "fndcl", "hidden_fndcl", - "fntype", "fnbody", "fnres", "fnlitdcl", "fnliteral", "xdcl_list", - "vardcl_list", "constdcl_list", "typedcl_list", "structdcl_list", - "interfacedcl_list", "structdcl", "packname", "embed", "interfacedcl", - "indcl", "arg_type", "arg_type_list", "oarg_type_list_ocomma", "stmt", - "non_dcl_stmt", "@13", "stmt_list", "new_name_list", "dcl_name_list", - "expr_list", "expr_or_type_list", "keyval_list", "braced_keyval_list", - "osemi", "ocomma", "oexpr", "oexpr_list", "osimple_stmt", - "ohidden_funarg_list", "ohidden_structdcl_list", - "ohidden_interfacedcl_list", "oliteral", "hidden_import", - "hidden_pkg_importsym", "hidden_pkgtype", "hidden_type", + "compound_stmt", "$@3", "caseblock", "$@4", "caseblock_list", + "loop_body", "$@5", "range_stmt", "for_header", "for_body", "for_stmt", + "$@6", "if_header", "if_stmt", "$@7", "$@8", "$@9", "else", + "switch_stmt", "$@10", "$@11", "select_stmt", "$@12", "expr", "uexpr", + "pseudocall", "pexpr_no_paren", "start_complit", "keyval", "complitexpr", + "pexpr", "expr_or_type", "name_or_type", "lbrace", "new_name", + "dcl_name", "onew_name", "sym", "hidden_importsym", "name", "labelname", + "dotdotdot", "ntype", "non_expr_type", "non_recvchantype", "convtype", + "comptype", "fnret_type", "dotname", "othertype", "ptrtype", + "recvchantype", "structtype", "interfacetype", "xfndcl", "fndcl", + "hidden_fndcl", "fntype", "fnbody", "fnres", "fnlitdcl", "fnliteral", + "xdcl_list", "vardcl_list", "constdcl_list", "typedcl_list", + "structdcl_list", "interfacedcl_list", "structdcl", "packname", "embed", + "interfacedcl", "indcl", "arg_type", "arg_type_list", + "oarg_type_list_ocomma", "stmt", "non_dcl_stmt", "$@13", "stmt_list", + "new_name_list", "dcl_name_list", "expr_list", "expr_or_type_list", + "keyval_list", "braced_keyval_list", "osemi", "ocomma", "oexpr", + "oexpr_list", "osimple_stmt", "ohidden_funarg_list", + "ohidden_structdcl_list", "ohidden_interfacedcl_list", "oliteral", + "hidden_import", "hidden_pkg_importsym", "hidden_pkgtype", "hidden_type", "hidden_type_non_recv_chan", "hidden_type_misc", "hidden_type_recv_chan", "hidden_type_func", "hidden_funarg", "hidden_structdcl", "hidden_interfacedcl", "ohidden_funres", "hidden_funres", @@ -1608,7 +1623,7 @@ while (YYID (0)) we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -1719,17 +1734,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -1763,11 +1781,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } @@ -2047,10 +2065,8 @@ yydestruct (yymsg, yytype, yyvaluep) break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -2066,11 +2082,10 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar, yystate; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -2078,9 +2093,9 @@ int yynerrs; -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -2104,13 +2119,38 @@ yyparse () #endif #endif { - + + + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + int yyn; int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -2118,51 +2158,28 @@ yyparse () YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -2192,7 +2209,6 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -2200,7 +2216,6 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -2223,9 +2238,8 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -2236,7 +2250,6 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -2246,6 +2259,9 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -2254,16 +2270,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -2295,20 +2311,16 @@ yybackup: goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -2348,6 +2360,8 @@ yyreduce: switch (yyn) { case 2: + +/* Line 1455 of yacc.c */ #line 128 "go.y" { xtop = concat(xtop, (yyvsp[(4) - (4)].list)); @@ -2355,6 +2369,8 @@ yyreduce: break; case 3: + +/* Line 1455 of yacc.c */ #line 134 "go.y" { prevlineno = lineno; @@ -2365,6 +2381,8 @@ yyreduce: break; case 4: + +/* Line 1455 of yacc.c */ #line 141 "go.y" { mkpackage((yyvsp[(2) - (3)].sym)->name); @@ -2372,6 +2390,8 @@ yyreduce: break; case 5: + +/* Line 1455 of yacc.c */ #line 151 "go.y" { importpkg = runtimepkg; @@ -2385,6 +2405,8 @@ yyreduce: break; case 6: + +/* Line 1455 of yacc.c */ #line 162 "go.y" { importpkg = nil; @@ -2392,6 +2414,8 @@ yyreduce: break; case 12: + +/* Line 1455 of yacc.c */ #line 176 "go.y" { Pkg *ipkg; @@ -2428,6 +2452,8 @@ yyreduce: break; case 15: + +/* Line 1455 of yacc.c */ #line 216 "go.y" { // import with original name @@ -2438,6 +2464,8 @@ yyreduce: break; case 16: + +/* Line 1455 of yacc.c */ #line 223 "go.y" { // import with given name @@ -2448,6 +2476,8 @@ yyreduce: break; case 17: + +/* Line 1455 of yacc.c */ #line 230 "go.y" { // import into my name space @@ -2458,6 +2488,8 @@ yyreduce: break; case 18: + +/* Line 1455 of yacc.c */ #line 239 "go.y" { if(importpkg->name == nil) { @@ -2473,6 +2505,8 @@ yyreduce: break; case 20: + +/* Line 1455 of yacc.c */ #line 253 "go.y" { if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0) @@ -2481,6 +2515,8 @@ yyreduce: break; case 21: + +/* Line 1455 of yacc.c */ #line 259 "go.y" { defercheckwidth(); @@ -2488,6 +2524,8 @@ yyreduce: break; case 22: + +/* Line 1455 of yacc.c */ #line 263 "go.y" { resumecheckwidth(); @@ -2496,6 +2534,8 @@ yyreduce: break; case 23: + +/* Line 1455 of yacc.c */ #line 272 "go.y" { yyerror("empty top-level declaration"); @@ -2504,6 +2544,8 @@ yyreduce: break; case 25: + +/* Line 1455 of yacc.c */ #line 278 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -2511,6 +2553,8 @@ yyreduce: break; case 26: + +/* Line 1455 of yacc.c */ #line 282 "go.y" { yyerror("non-declaration statement outside function body"); @@ -2519,6 +2563,8 @@ yyreduce: break; case 27: + +/* Line 1455 of yacc.c */ #line 287 "go.y" { (yyval.list) = nil; @@ -2526,6 +2572,8 @@ yyreduce: break; case 28: + +/* Line 1455 of yacc.c */ #line 293 "go.y" { (yyval.list) = (yyvsp[(2) - (2)].list); @@ -2533,6 +2581,8 @@ yyreduce: break; case 29: + +/* Line 1455 of yacc.c */ #line 297 "go.y" { (yyval.list) = (yyvsp[(3) - (5)].list); @@ -2540,6 +2590,8 @@ yyreduce: break; case 30: + +/* Line 1455 of yacc.c */ #line 301 "go.y" { (yyval.list) = nil; @@ -2547,6 +2599,8 @@ yyreduce: break; case 31: + +/* Line 1455 of yacc.c */ #line 305 "go.y" { (yyval.list) = (yyvsp[(2) - (2)].list); @@ -2556,6 +2610,8 @@ yyreduce: break; case 32: + +/* Line 1455 of yacc.c */ #line 311 "go.y" { (yyval.list) = (yyvsp[(3) - (5)].list); @@ -2565,6 +2621,8 @@ yyreduce: break; case 33: + +/* Line 1455 of yacc.c */ #line 317 "go.y" { (yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list)); @@ -2574,6 +2632,8 @@ yyreduce: break; case 34: + +/* Line 1455 of yacc.c */ #line 323 "go.y" { (yyval.list) = nil; @@ -2582,6 +2642,8 @@ yyreduce: break; case 35: + +/* Line 1455 of yacc.c */ #line 328 "go.y" { (yyval.list) = list1((yyvsp[(2) - (2)].node)); @@ -2589,6 +2651,8 @@ yyreduce: break; case 36: + +/* Line 1455 of yacc.c */ #line 332 "go.y" { (yyval.list) = (yyvsp[(3) - (5)].list); @@ -2596,6 +2660,8 @@ yyreduce: break; case 37: + +/* Line 1455 of yacc.c */ #line 336 "go.y" { (yyval.list) = nil; @@ -2603,6 +2669,8 @@ yyreduce: break; case 38: + +/* Line 1455 of yacc.c */ #line 342 "go.y" { iota = 0; @@ -2610,6 +2678,8 @@ yyreduce: break; case 39: + +/* Line 1455 of yacc.c */ #line 348 "go.y" { (yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); @@ -2617,6 +2687,8 @@ yyreduce: break; case 40: + +/* Line 1455 of yacc.c */ #line 352 "go.y" { (yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); @@ -2624,6 +2696,8 @@ yyreduce: break; case 41: + +/* Line 1455 of yacc.c */ #line 356 "go.y" { (yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list)); @@ -2631,6 +2705,8 @@ yyreduce: break; case 42: + +/* Line 1455 of yacc.c */ #line 362 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list)); @@ -2638,6 +2714,8 @@ yyreduce: break; case 43: + +/* Line 1455 of yacc.c */ #line 366 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list)); @@ -2645,6 +2723,8 @@ yyreduce: break; case 45: + +/* Line 1455 of yacc.c */ #line 373 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil); @@ -2652,6 +2732,8 @@ yyreduce: break; case 46: + +/* Line 1455 of yacc.c */ #line 377 "go.y" { (yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil); @@ -2659,6 +2741,8 @@ yyreduce: break; case 47: + +/* Line 1455 of yacc.c */ #line 383 "go.y" { // different from dclname because the name @@ -2669,6 +2753,8 @@ yyreduce: break; case 48: + +/* Line 1455 of yacc.c */ #line 392 "go.y" { (yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1); @@ -2676,6 +2762,8 @@ yyreduce: break; case 49: + +/* Line 1455 of yacc.c */ #line 398 "go.y" { (yyval.node) = (yyvsp[(1) - (1)].node); @@ -2683,6 +2771,8 @@ yyreduce: break; case 50: + +/* Line 1455 of yacc.c */ #line 402 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -2691,6 +2781,8 @@ yyreduce: break; case 51: + +/* Line 1455 of yacc.c */ #line 407 "go.y" { if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) { @@ -2706,6 +2798,8 @@ yyreduce: break; case 52: + +/* Line 1455 of yacc.c */ #line 419 "go.y" { if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) { @@ -2725,6 +2819,8 @@ yyreduce: break; case 53: + +/* Line 1455 of yacc.c */ #line 435 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); @@ -2733,6 +2829,8 @@ yyreduce: break; case 54: + +/* Line 1455 of yacc.c */ #line 440 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); @@ -2741,6 +2839,8 @@ yyreduce: break; case 55: + +/* Line 1455 of yacc.c */ #line 447 "go.y" { Node *n, *nn; @@ -2764,6 +2864,8 @@ yyreduce: break; case 56: + +/* Line 1455 of yacc.c */ #line 467 "go.y" { Node *n; @@ -2785,6 +2887,8 @@ yyreduce: break; case 57: + +/* Line 1455 of yacc.c */ #line 485 "go.y" { // will be converted to OCASE @@ -2797,6 +2901,8 @@ yyreduce: break; case 58: + +/* Line 1455 of yacc.c */ #line 494 "go.y" { Node *n, *nn; @@ -2816,6 +2922,8 @@ yyreduce: break; case 59: + +/* Line 1455 of yacc.c */ #line 512 "go.y" { markdcl(); @@ -2823,6 +2931,8 @@ yyreduce: break; case 60: + +/* Line 1455 of yacc.c */ #line 516 "go.y" { (yyval.node) = liststmt((yyvsp[(3) - (4)].list)); @@ -2831,6 +2941,8 @@ yyreduce: break; case 61: + +/* Line 1455 of yacc.c */ #line 523 "go.y" { // If the last token read by the lexer was consumed @@ -2844,6 +2956,8 @@ yyreduce: break; case 62: + +/* Line 1455 of yacc.c */ #line 533 "go.y" { int last; @@ -2866,6 +2980,8 @@ yyreduce: break; case 63: + +/* Line 1455 of yacc.c */ #line 553 "go.y" { (yyval.list) = nil; @@ -2873,6 +2989,8 @@ yyreduce: break; case 64: + +/* Line 1455 of yacc.c */ #line 557 "go.y" { (yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); @@ -2880,6 +2998,8 @@ yyreduce: break; case 65: + +/* Line 1455 of yacc.c */ #line 563 "go.y" { markdcl(); @@ -2887,6 +3007,8 @@ yyreduce: break; case 66: + +/* Line 1455 of yacc.c */ #line 567 "go.y" { (yyval.list) = (yyvsp[(3) - (4)].list); @@ -2895,6 +3017,8 @@ yyreduce: break; case 67: + +/* Line 1455 of yacc.c */ #line 574 "go.y" { (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); @@ -2904,6 +3028,8 @@ yyreduce: break; case 68: + +/* Line 1455 of yacc.c */ #line 580 "go.y" { (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); @@ -2914,6 +3040,8 @@ yyreduce: break; case 69: + +/* Line 1455 of yacc.c */ #line 589 "go.y" { // init ; test ; incr @@ -2928,6 +3056,8 @@ yyreduce: break; case 70: + +/* Line 1455 of yacc.c */ #line 600 "go.y" { // normal test @@ -2937,6 +3067,8 @@ yyreduce: break; case 72: + +/* Line 1455 of yacc.c */ #line 609 "go.y" { (yyval.node) = (yyvsp[(1) - (2)].node); @@ -2945,6 +3077,8 @@ yyreduce: break; case 73: + +/* Line 1455 of yacc.c */ #line 616 "go.y" { markdcl(); @@ -2952,6 +3086,8 @@ yyreduce: break; case 74: + +/* Line 1455 of yacc.c */ #line 620 "go.y" { (yyval.node) = (yyvsp[(3) - (3)].node); @@ -2960,6 +3096,8 @@ yyreduce: break; case 75: + +/* Line 1455 of yacc.c */ #line 627 "go.y" { // test @@ -2969,6 +3107,8 @@ yyreduce: break; case 76: + +/* Line 1455 of yacc.c */ #line 633 "go.y" { // init ; test @@ -2980,6 +3120,8 @@ yyreduce: break; case 77: + +/* Line 1455 of yacc.c */ #line 644 "go.y" { markdcl(); @@ -2987,6 +3129,8 @@ yyreduce: break; case 78: + +/* Line 1455 of yacc.c */ #line 648 "go.y" { if((yyvsp[(3) - (3)].node)->ntest == N) @@ -2995,6 +3139,8 @@ yyreduce: break; case 79: + +/* Line 1455 of yacc.c */ #line 653 "go.y" { (yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list); @@ -3002,6 +3148,8 @@ yyreduce: break; case 80: + +/* Line 1455 of yacc.c */ #line 657 "go.y" { popdcl(); @@ -3012,6 +3160,8 @@ yyreduce: break; case 81: + +/* Line 1455 of yacc.c */ #line 665 "go.y" { (yyval.node) = N; @@ -3019,6 +3169,8 @@ yyreduce: break; case 82: + +/* Line 1455 of yacc.c */ #line 669 "go.y" { (yyval.node) = (yyvsp[(2) - (2)].node); @@ -3026,6 +3178,8 @@ yyreduce: break; case 83: + +/* Line 1455 of yacc.c */ #line 673 "go.y" { (yyval.node) = (yyvsp[(2) - (2)].node); @@ -3033,6 +3187,8 @@ yyreduce: break; case 84: + +/* Line 1455 of yacc.c */ #line 679 "go.y" { markdcl(); @@ -3040,6 +3196,8 @@ yyreduce: break; case 85: + +/* Line 1455 of yacc.c */ #line 683 "go.y" { Node *n; @@ -3051,6 +3209,8 @@ yyreduce: break; case 86: + +/* Line 1455 of yacc.c */ #line 691 "go.y" { (yyval.node) = (yyvsp[(3) - (7)].node); @@ -3062,6 +3222,8 @@ yyreduce: break; case 87: + +/* Line 1455 of yacc.c */ #line 701 "go.y" { typesw = nod(OXXX, typesw, N); @@ -3069,6 +3231,8 @@ yyreduce: break; case 88: + +/* Line 1455 of yacc.c */ #line 705 "go.y" { (yyval.node) = nod(OSELECT, N, N); @@ -3079,6 +3243,8 @@ yyreduce: break; case 90: + +/* Line 1455 of yacc.c */ #line 718 "go.y" { (yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3086,6 +3252,8 @@ yyreduce: break; case 91: + +/* Line 1455 of yacc.c */ #line 722 "go.y" { (yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3093,6 +3261,8 @@ yyreduce: break; case 92: + +/* Line 1455 of yacc.c */ #line 726 "go.y" { (yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3100,6 +3270,8 @@ yyreduce: break; case 93: + +/* Line 1455 of yacc.c */ #line 730 "go.y" { (yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3107,6 +3279,8 @@ yyreduce: break; case 94: + +/* Line 1455 of yacc.c */ #line 734 "go.y" { (yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3114,6 +3288,8 @@ yyreduce: break; case 95: + +/* Line 1455 of yacc.c */ #line 738 "go.y" { (yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3121,6 +3297,8 @@ yyreduce: break; case 96: + +/* Line 1455 of yacc.c */ #line 742 "go.y" { (yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3128,6 +3306,8 @@ yyreduce: break; case 97: + +/* Line 1455 of yacc.c */ #line 746 "go.y" { (yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3135,6 +3315,8 @@ yyreduce: break; case 98: + +/* Line 1455 of yacc.c */ #line 750 "go.y" { (yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3142,6 +3324,8 @@ yyreduce: break; case 99: + +/* Line 1455 of yacc.c */ #line 754 "go.y" { (yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3149,6 +3333,8 @@ yyreduce: break; case 100: + +/* Line 1455 of yacc.c */ #line 758 "go.y" { (yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3156,6 +3342,8 @@ yyreduce: break; case 101: + +/* Line 1455 of yacc.c */ #line 762 "go.y" { (yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3163,6 +3351,8 @@ yyreduce: break; case 102: + +/* Line 1455 of yacc.c */ #line 766 "go.y" { (yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3170,6 +3360,8 @@ yyreduce: break; case 103: + +/* Line 1455 of yacc.c */ #line 770 "go.y" { (yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3177,6 +3369,8 @@ yyreduce: break; case 104: + +/* Line 1455 of yacc.c */ #line 774 "go.y" { (yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3184,6 +3378,8 @@ yyreduce: break; case 105: + +/* Line 1455 of yacc.c */ #line 778 "go.y" { (yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3191,6 +3387,8 @@ yyreduce: break; case 106: + +/* Line 1455 of yacc.c */ #line 782 "go.y" { (yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3198,6 +3396,8 @@ yyreduce: break; case 107: + +/* Line 1455 of yacc.c */ #line 786 "go.y" { (yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3205,6 +3405,8 @@ yyreduce: break; case 108: + +/* Line 1455 of yacc.c */ #line 790 "go.y" { (yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3212,6 +3414,8 @@ yyreduce: break; case 109: + +/* Line 1455 of yacc.c */ #line 795 "go.y" { (yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3219,6 +3423,8 @@ yyreduce: break; case 111: + +/* Line 1455 of yacc.c */ #line 802 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); @@ -3226,13 +3432,15 @@ yyreduce: break; case 112: + +/* Line 1455 of yacc.c */ #line 806 "go.y" { if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) { // Special case for &T{...}: turn into (*T){...}. (yyval.node) = (yyvsp[(2) - (2)].node); (yyval.node)->right = nod(OIND, (yyval.node)->right, N); - (yyval.node)->right->implicit = ImplPtr; + (yyval.node)->right->implicit = 1; } else { (yyval.node) = nod(OADDR, (yyvsp[(2) - (2)].node), N); } @@ -3240,6 +3448,8 @@ yyreduce: break; case 113: + +/* Line 1455 of yacc.c */ #line 817 "go.y" { (yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N); @@ -3247,6 +3457,8 @@ yyreduce: break; case 114: + +/* Line 1455 of yacc.c */ #line 821 "go.y" { (yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N); @@ -3254,6 +3466,8 @@ yyreduce: break; case 115: + +/* Line 1455 of yacc.c */ #line 825 "go.y" { (yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N); @@ -3261,6 +3475,8 @@ yyreduce: break; case 116: + +/* Line 1455 of yacc.c */ #line 829 "go.y" { yyerror("the bitwise complement operator is ^"); @@ -3269,6 +3485,8 @@ yyreduce: break; case 117: + +/* Line 1455 of yacc.c */ #line 834 "go.y" { (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); @@ -3276,6 +3494,8 @@ yyreduce: break; case 118: + +/* Line 1455 of yacc.c */ #line 838 "go.y" { (yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N); @@ -3283,6 +3503,8 @@ yyreduce: break; case 119: + +/* Line 1455 of yacc.c */ #line 848 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N); @@ -3290,6 +3512,8 @@ yyreduce: break; case 120: + +/* Line 1455 of yacc.c */ #line 852 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); @@ -3298,6 +3522,8 @@ yyreduce: break; case 121: + +/* Line 1455 of yacc.c */ #line 857 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N); @@ -3307,6 +3533,8 @@ yyreduce: break; case 122: + +/* Line 1455 of yacc.c */ #line 865 "go.y" { (yyval.node) = nodlit((yyvsp[(1) - (1)].val)); @@ -3314,6 +3542,8 @@ yyreduce: break; case 124: + +/* Line 1455 of yacc.c */ #line 870 "go.y" { if((yyvsp[(1) - (3)].node)->op == OPACK) { @@ -3328,6 +3558,8 @@ yyreduce: break; case 125: + +/* Line 1455 of yacc.c */ #line 881 "go.y" { (yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); @@ -3335,6 +3567,8 @@ yyreduce: break; case 126: + +/* Line 1455 of yacc.c */ #line 885 "go.y" { (yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node)); @@ -3342,6 +3576,8 @@ yyreduce: break; case 127: + +/* Line 1455 of yacc.c */ #line 889 "go.y" { (yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); @@ -3349,6 +3585,8 @@ yyreduce: break; case 128: + +/* Line 1455 of yacc.c */ #line 893 "go.y" { (yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node))); @@ -3356,6 +3594,8 @@ yyreduce: break; case 130: + +/* Line 1455 of yacc.c */ #line 898 "go.y" { // conversion @@ -3365,6 +3605,8 @@ yyreduce: break; case 131: + +/* Line 1455 of yacc.c */ #line 904 "go.y" { (yyval.node) = (yyvsp[(3) - (5)].node); @@ -3375,6 +3617,8 @@ yyreduce: break; case 132: + +/* Line 1455 of yacc.c */ #line 911 "go.y" { (yyval.node) = (yyvsp[(3) - (5)].node); @@ -3384,6 +3628,8 @@ yyreduce: break; case 133: + +/* Line 1455 of yacc.c */ #line 917 "go.y" { yyerror("cannot parenthesize type in composite literal"); @@ -3394,6 +3640,8 @@ yyreduce: break; case 135: + +/* Line 1455 of yacc.c */ #line 926 "go.y" { // composite expression. @@ -3403,6 +3651,8 @@ yyreduce: break; case 136: + +/* Line 1455 of yacc.c */ #line 934 "go.y" { (yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); @@ -3410,6 +3660,8 @@ yyreduce: break; case 138: + +/* Line 1455 of yacc.c */ #line 941 "go.y" { (yyval.node) = (yyvsp[(2) - (4)].node); @@ -3418,6 +3670,8 @@ yyreduce: break; case 140: + +/* Line 1455 of yacc.c */ #line 949 "go.y" { (yyval.node) = (yyvsp[(2) - (3)].node); @@ -3437,6 +3691,8 @@ yyreduce: break; case 144: + +/* Line 1455 of yacc.c */ #line 974 "go.y" { (yyval.i) = LBODY; @@ -3444,6 +3700,8 @@ yyreduce: break; case 145: + +/* Line 1455 of yacc.c */ #line 978 "go.y" { (yyval.i) = '{'; @@ -3451,6 +3709,8 @@ yyreduce: break; case 146: + +/* Line 1455 of yacc.c */ #line 989 "go.y" { (yyval.node) = newname((yyvsp[(1) - (1)].sym)); @@ -3458,6 +3718,8 @@ yyreduce: break; case 147: + +/* Line 1455 of yacc.c */ #line 995 "go.y" { (yyval.node) = dclname((yyvsp[(1) - (1)].sym)); @@ -3465,6 +3727,8 @@ yyreduce: break; case 148: + +/* Line 1455 of yacc.c */ #line 1000 "go.y" { (yyval.node) = N; @@ -3472,6 +3736,8 @@ yyreduce: break; case 150: + +/* Line 1455 of yacc.c */ #line 1007 "go.y" { (yyval.sym) = (yyvsp[(1) - (1)].sym); @@ -3482,6 +3748,8 @@ yyreduce: break; case 152: + +/* Line 1455 of yacc.c */ #line 1015 "go.y" { (yyval.sym) = S; @@ -3489,6 +3757,8 @@ yyreduce: break; case 153: + +/* Line 1455 of yacc.c */ #line 1021 "go.y" { if((yyvsp[(2) - (4)].val).u.sval->len == 0) @@ -3499,6 +3769,8 @@ yyreduce: break; case 154: + +/* Line 1455 of yacc.c */ #line 1030 "go.y" { (yyval.node) = oldname((yyvsp[(1) - (1)].sym)); @@ -3508,6 +3780,8 @@ yyreduce: break; case 156: + +/* Line 1455 of yacc.c */ #line 1050 "go.y" { yyerror("final argument in variadic function missing type"); @@ -3516,6 +3790,8 @@ yyreduce: break; case 157: + +/* Line 1455 of yacc.c */ #line 1055 "go.y" { (yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N); @@ -3523,6 +3799,8 @@ yyreduce: break; case 163: + +/* Line 1455 of yacc.c */ #line 1066 "go.y" { (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); @@ -3530,6 +3808,8 @@ yyreduce: break; case 167: + +/* Line 1455 of yacc.c */ #line 1075 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); @@ -3537,6 +3817,8 @@ yyreduce: break; case 172: + +/* Line 1455 of yacc.c */ #line 1085 "go.y" { (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); @@ -3544,6 +3826,8 @@ yyreduce: break; case 182: + +/* Line 1455 of yacc.c */ #line 1106 "go.y" { if((yyvsp[(1) - (3)].node)->op == OPACK) { @@ -3558,6 +3842,8 @@ yyreduce: break; case 183: + +/* Line 1455 of yacc.c */ #line 1119 "go.y" { (yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node)); @@ -3565,6 +3851,8 @@ yyreduce: break; case 184: + +/* Line 1455 of yacc.c */ #line 1123 "go.y" { // array literal of nelem @@ -3573,6 +3861,8 @@ yyreduce: break; case 185: + +/* Line 1455 of yacc.c */ #line 1128 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N); @@ -3581,6 +3871,8 @@ yyreduce: break; case 186: + +/* Line 1455 of yacc.c */ #line 1133 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); @@ -3589,6 +3881,8 @@ yyreduce: break; case 187: + +/* Line 1455 of yacc.c */ #line 1138 "go.y" { (yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)); @@ -3596,6 +3890,8 @@ yyreduce: break; case 190: + +/* Line 1455 of yacc.c */ #line 1146 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); @@ -3603,6 +3899,8 @@ yyreduce: break; case 191: + +/* Line 1455 of yacc.c */ #line 1152 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); @@ -3611,6 +3909,8 @@ yyreduce: break; case 192: + +/* Line 1455 of yacc.c */ #line 1159 "go.y" { (yyval.node) = nod(OTSTRUCT, N, N); @@ -3620,6 +3920,8 @@ yyreduce: break; case 193: + +/* Line 1455 of yacc.c */ #line 1165 "go.y" { (yyval.node) = nod(OTSTRUCT, N, N); @@ -3628,6 +3930,8 @@ yyreduce: break; case 194: + +/* Line 1455 of yacc.c */ #line 1172 "go.y" { (yyval.node) = nod(OTINTER, N, N); @@ -3637,6 +3941,8 @@ yyreduce: break; case 195: + +/* Line 1455 of yacc.c */ #line 1178 "go.y" { (yyval.node) = nod(OTINTER, N, N); @@ -3645,6 +3951,8 @@ yyreduce: break; case 196: + +/* Line 1455 of yacc.c */ #line 1189 "go.y" { (yyval.node) = (yyvsp[(2) - (3)].node); @@ -3657,6 +3965,8 @@ yyreduce: break; case 197: + +/* Line 1455 of yacc.c */ #line 1200 "go.y" { Node *t; @@ -3689,6 +3999,8 @@ yyreduce: break; case 198: + +/* Line 1455 of yacc.c */ #line 1229 "go.y" { Node *rcvr, *t; @@ -3729,6 +4041,8 @@ yyreduce: break; case 199: + +/* Line 1455 of yacc.c */ #line 1268 "go.y" { Sym *s; @@ -3755,6 +4069,8 @@ yyreduce: break; case 200: + +/* Line 1455 of yacc.c */ #line 1291 "go.y" { (yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right); @@ -3773,6 +4089,8 @@ yyreduce: break; case 201: + +/* Line 1455 of yacc.c */ #line 1308 "go.y" { (yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1); @@ -3783,6 +4101,8 @@ yyreduce: break; case 202: + +/* Line 1455 of yacc.c */ #line 1316 "go.y" { (yyval.list) = nil; @@ -3790,6 +4110,8 @@ yyreduce: break; case 203: + +/* Line 1455 of yacc.c */ #line 1320 "go.y" { (yyval.list) = (yyvsp[(2) - (3)].list); @@ -3799,6 +4121,8 @@ yyreduce: break; case 204: + +/* Line 1455 of yacc.c */ #line 1328 "go.y" { (yyval.list) = nil; @@ -3806,6 +4130,8 @@ yyreduce: break; case 205: + +/* Line 1455 of yacc.c */ #line 1332 "go.y" { (yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node))); @@ -3813,6 +4139,8 @@ yyreduce: break; case 206: + +/* Line 1455 of yacc.c */ #line 1336 "go.y" { (yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0); @@ -3821,6 +4149,8 @@ yyreduce: break; case 207: + +/* Line 1455 of yacc.c */ #line 1343 "go.y" { closurehdr((yyvsp[(1) - (1)].node)); @@ -3828,6 +4158,8 @@ yyreduce: break; case 208: + +/* Line 1455 of yacc.c */ #line 1349 "go.y" { (yyval.node) = closurebody((yyvsp[(3) - (4)].list)); @@ -3836,6 +4168,8 @@ yyreduce: break; case 209: + +/* Line 1455 of yacc.c */ #line 1354 "go.y" { (yyval.node) = closurebody(nil); @@ -3843,6 +4177,8 @@ yyreduce: break; case 210: + +/* Line 1455 of yacc.c */ #line 1365 "go.y" { (yyval.list) = nil; @@ -3850,6 +4186,8 @@ yyreduce: break; case 211: + +/* Line 1455 of yacc.c */ #line 1369 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list)); @@ -3859,6 +4197,8 @@ yyreduce: break; case 213: + +/* Line 1455 of yacc.c */ #line 1378 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); @@ -3866,6 +4206,8 @@ yyreduce: break; case 215: + +/* Line 1455 of yacc.c */ #line 1385 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); @@ -3873,6 +4215,8 @@ yyreduce: break; case 216: + +/* Line 1455 of yacc.c */ #line 1391 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -3880,6 +4224,8 @@ yyreduce: break; case 217: + +/* Line 1455 of yacc.c */ #line 1395 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -3887,6 +4233,8 @@ yyreduce: break; case 219: + +/* Line 1455 of yacc.c */ #line 1402 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); @@ -3894,6 +4242,8 @@ yyreduce: break; case 220: + +/* Line 1455 of yacc.c */ #line 1408 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -3901,6 +4251,8 @@ yyreduce: break; case 221: + +/* Line 1455 of yacc.c */ #line 1412 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -3908,6 +4260,8 @@ yyreduce: break; case 222: + +/* Line 1455 of yacc.c */ #line 1418 "go.y" { NodeList *l; @@ -3920,6 +4274,8 @@ yyreduce: break; case 223: + +/* Line 1455 of yacc.c */ #line 1427 "go.y" { (yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val); @@ -3928,6 +4284,8 @@ yyreduce: break; case 224: + +/* Line 1455 of yacc.c */ #line 1432 "go.y" { (yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val); @@ -3937,6 +4295,8 @@ yyreduce: break; case 225: + +/* Line 1455 of yacc.c */ #line 1438 "go.y" { (yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N); @@ -3946,6 +4306,8 @@ yyreduce: break; case 226: + +/* Line 1455 of yacc.c */ #line 1444 "go.y" { (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); @@ -3956,6 +4318,8 @@ yyreduce: break; case 227: + +/* Line 1455 of yacc.c */ #line 1451 "go.y" { (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); @@ -3966,6 +4330,8 @@ yyreduce: break; case 228: + +/* Line 1455 of yacc.c */ #line 1460 "go.y" { Node *n; @@ -3978,6 +4344,8 @@ yyreduce: break; case 229: + +/* Line 1455 of yacc.c */ #line 1469 "go.y" { Pkg *pkg; @@ -3994,6 +4362,8 @@ yyreduce: break; case 230: + +/* Line 1455 of yacc.c */ #line 1484 "go.y" { (yyval.node) = embedded((yyvsp[(1) - (1)].sym)); @@ -4001,6 +4371,8 @@ yyreduce: break; case 231: + +/* Line 1455 of yacc.c */ #line 1490 "go.y" { (yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); @@ -4009,6 +4381,8 @@ yyreduce: break; case 232: + +/* Line 1455 of yacc.c */ #line 1495 "go.y" { (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym))); @@ -4016,6 +4390,8 @@ yyreduce: break; case 233: + +/* Line 1455 of yacc.c */ #line 1499 "go.y" { (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym))); @@ -4024,6 +4400,8 @@ yyreduce: break; case 234: + +/* Line 1455 of yacc.c */ #line 1506 "go.y" { // without func keyword @@ -4035,6 +4413,8 @@ yyreduce: break; case 236: + +/* Line 1455 of yacc.c */ #line 1520 "go.y" { (yyval.node) = nod(ONONAME, N, N); @@ -4044,6 +4424,8 @@ yyreduce: break; case 237: + +/* Line 1455 of yacc.c */ #line 1526 "go.y" { (yyval.node) = nod(ONONAME, N, N); @@ -4053,6 +4435,8 @@ yyreduce: break; case 239: + +/* Line 1455 of yacc.c */ #line 1535 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4060,6 +4444,8 @@ yyreduce: break; case 240: + +/* Line 1455 of yacc.c */ #line 1539 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4067,6 +4453,8 @@ yyreduce: break; case 241: + +/* Line 1455 of yacc.c */ #line 1544 "go.y" { (yyval.list) = nil; @@ -4074,6 +4462,8 @@ yyreduce: break; case 242: + +/* Line 1455 of yacc.c */ #line 1548 "go.y" { (yyval.list) = (yyvsp[(1) - (2)].list); @@ -4081,6 +4471,8 @@ yyreduce: break; case 243: + +/* Line 1455 of yacc.c */ #line 1556 "go.y" { (yyval.node) = N; @@ -4088,6 +4480,8 @@ yyreduce: break; case 245: + +/* Line 1455 of yacc.c */ #line 1561 "go.y" { (yyval.node) = liststmt((yyvsp[(1) - (1)].list)); @@ -4095,6 +4489,8 @@ yyreduce: break; case 247: + +/* Line 1455 of yacc.c */ #line 1566 "go.y" { (yyval.node) = N; @@ -4102,6 +4498,8 @@ yyreduce: break; case 253: + +/* Line 1455 of yacc.c */ #line 1577 "go.y" { (yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N); @@ -4110,6 +4508,8 @@ yyreduce: break; case 254: + +/* Line 1455 of yacc.c */ #line 1582 "go.y" { NodeList *l; @@ -4123,6 +4523,8 @@ yyreduce: break; case 255: + +/* Line 1455 of yacc.c */ #line 1592 "go.y" { // will be converted to OFALL @@ -4131,6 +4533,8 @@ yyreduce: break; case 256: + +/* Line 1455 of yacc.c */ #line 1597 "go.y" { (yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N); @@ -4138,6 +4542,8 @@ yyreduce: break; case 257: + +/* Line 1455 of yacc.c */ #line 1601 "go.y" { (yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N); @@ -4145,6 +4551,8 @@ yyreduce: break; case 258: + +/* Line 1455 of yacc.c */ #line 1605 "go.y" { (yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N); @@ -4152,6 +4560,8 @@ yyreduce: break; case 259: + +/* Line 1455 of yacc.c */ #line 1609 "go.y" { (yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N); @@ -4159,6 +4569,8 @@ yyreduce: break; case 260: + +/* Line 1455 of yacc.c */ #line 1613 "go.y" { (yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N); @@ -4167,6 +4579,8 @@ yyreduce: break; case 261: + +/* Line 1455 of yacc.c */ #line 1618 "go.y" { (yyval.node) = nod(ORETURN, N, N); @@ -4187,6 +4601,8 @@ yyreduce: break; case 262: + +/* Line 1455 of yacc.c */ #line 1637 "go.y" { (yyval.list) = nil; @@ -4196,6 +4612,8 @@ yyreduce: break; case 263: + +/* Line 1455 of yacc.c */ #line 1643 "go.y" { (yyval.list) = (yyvsp[(1) - (3)].list); @@ -4205,6 +4623,8 @@ yyreduce: break; case 264: + +/* Line 1455 of yacc.c */ #line 1651 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4212,6 +4632,8 @@ yyreduce: break; case 265: + +/* Line 1455 of yacc.c */ #line 1655 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4219,6 +4641,8 @@ yyreduce: break; case 266: + +/* Line 1455 of yacc.c */ #line 1661 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4226,6 +4650,8 @@ yyreduce: break; case 267: + +/* Line 1455 of yacc.c */ #line 1665 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4233,6 +4659,8 @@ yyreduce: break; case 268: + +/* Line 1455 of yacc.c */ #line 1671 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4240,6 +4668,8 @@ yyreduce: break; case 269: + +/* Line 1455 of yacc.c */ #line 1675 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4247,6 +4677,8 @@ yyreduce: break; case 270: + +/* Line 1455 of yacc.c */ #line 1681 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4254,6 +4686,8 @@ yyreduce: break; case 271: + +/* Line 1455 of yacc.c */ #line 1685 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4261,6 +4695,8 @@ yyreduce: break; case 272: + +/* Line 1455 of yacc.c */ #line 1694 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4268,6 +4704,8 @@ yyreduce: break; case 273: + +/* Line 1455 of yacc.c */ #line 1698 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4275,6 +4713,8 @@ yyreduce: break; case 274: + +/* Line 1455 of yacc.c */ #line 1702 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4282,6 +4722,8 @@ yyreduce: break; case 275: + +/* Line 1455 of yacc.c */ #line 1706 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4289,6 +4731,8 @@ yyreduce: break; case 276: + +/* Line 1455 of yacc.c */ #line 1711 "go.y" { (yyval.list) = nil; @@ -4296,6 +4740,8 @@ yyreduce: break; case 277: + +/* Line 1455 of yacc.c */ #line 1715 "go.y" { (yyval.list) = (yyvsp[(1) - (2)].list); @@ -4303,6 +4749,8 @@ yyreduce: break; case 282: + +/* Line 1455 of yacc.c */ #line 1729 "go.y" { (yyval.node) = N; @@ -4310,6 +4758,8 @@ yyreduce: break; case 284: + +/* Line 1455 of yacc.c */ #line 1735 "go.y" { (yyval.list) = nil; @@ -4317,6 +4767,8 @@ yyreduce: break; case 286: + +/* Line 1455 of yacc.c */ #line 1741 "go.y" { (yyval.node) = N; @@ -4324,6 +4776,8 @@ yyreduce: break; case 288: + +/* Line 1455 of yacc.c */ #line 1747 "go.y" { (yyval.list) = nil; @@ -4331,6 +4785,8 @@ yyreduce: break; case 290: + +/* Line 1455 of yacc.c */ #line 1753 "go.y" { (yyval.list) = nil; @@ -4338,6 +4794,8 @@ yyreduce: break; case 292: + +/* Line 1455 of yacc.c */ #line 1759 "go.y" { (yyval.list) = nil; @@ -4345,6 +4803,8 @@ yyreduce: break; case 294: + +/* Line 1455 of yacc.c */ #line 1765 "go.y" { (yyval.val).ctype = CTxxx; @@ -4352,6 +4812,8 @@ yyreduce: break; case 296: + +/* Line 1455 of yacc.c */ #line 1775 "go.y" { importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval); @@ -4359,6 +4821,8 @@ yyreduce: break; case 297: + +/* Line 1455 of yacc.c */ #line 1779 "go.y" { importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type)); @@ -4366,6 +4830,8 @@ yyreduce: break; case 298: + +/* Line 1455 of yacc.c */ #line 1783 "go.y" { importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node)); @@ -4373,6 +4839,8 @@ yyreduce: break; case 299: + +/* Line 1455 of yacc.c */ #line 1787 "go.y" { importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node)); @@ -4380,6 +4848,8 @@ yyreduce: break; case 300: + +/* Line 1455 of yacc.c */ #line 1791 "go.y" { importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type)); @@ -4387,6 +4857,8 @@ yyreduce: break; case 301: + +/* Line 1455 of yacc.c */ #line 1795 "go.y" { if((yyvsp[(2) - (4)].node) == N) @@ -4406,6 +4878,8 @@ yyreduce: break; case 302: + +/* Line 1455 of yacc.c */ #line 1813 "go.y" { (yyval.sym) = (yyvsp[(1) - (1)].sym); @@ -4414,6 +4888,8 @@ yyreduce: break; case 303: + +/* Line 1455 of yacc.c */ #line 1820 "go.y" { (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); @@ -4422,6 +4898,8 @@ yyreduce: break; case 309: + +/* Line 1455 of yacc.c */ #line 1840 "go.y" { (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); @@ -4429,6 +4907,8 @@ yyreduce: break; case 310: + +/* Line 1455 of yacc.c */ #line 1844 "go.y" { // predefined name like uint8 @@ -4442,6 +4922,8 @@ yyreduce: break; case 311: + +/* Line 1455 of yacc.c */ #line 1854 "go.y" { (yyval.type) = aindex(N, (yyvsp[(3) - (3)].type)); @@ -4449,6 +4931,8 @@ yyreduce: break; case 312: + +/* Line 1455 of yacc.c */ #line 1858 "go.y" { (yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type)); @@ -4456,6 +4940,8 @@ yyreduce: break; case 313: + +/* Line 1455 of yacc.c */ #line 1862 "go.y" { (yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type)); @@ -4463,6 +4949,8 @@ yyreduce: break; case 314: + +/* Line 1455 of yacc.c */ #line 1866 "go.y" { (yyval.type) = tostruct((yyvsp[(3) - (4)].list)); @@ -4470,6 +4958,8 @@ yyreduce: break; case 315: + +/* Line 1455 of yacc.c */ #line 1870 "go.y" { (yyval.type) = tointerface((yyvsp[(3) - (4)].list)); @@ -4477,6 +4967,8 @@ yyreduce: break; case 316: + +/* Line 1455 of yacc.c */ #line 1874 "go.y" { (yyval.type) = ptrto((yyvsp[(2) - (2)].type)); @@ -4484,6 +4976,8 @@ yyreduce: break; case 317: + +/* Line 1455 of yacc.c */ #line 1878 "go.y" { (yyval.type) = typ(TCHAN); @@ -4493,6 +4987,8 @@ yyreduce: break; case 318: + +/* Line 1455 of yacc.c */ #line 1884 "go.y" { (yyval.type) = typ(TCHAN); @@ -4502,6 +4998,8 @@ yyreduce: break; case 319: + +/* Line 1455 of yacc.c */ #line 1890 "go.y" { (yyval.type) = typ(TCHAN); @@ -4511,6 +5009,8 @@ yyreduce: break; case 320: + +/* Line 1455 of yacc.c */ #line 1898 "go.y" { (yyval.type) = typ(TCHAN); @@ -4520,6 +5020,8 @@ yyreduce: break; case 321: + +/* Line 1455 of yacc.c */ #line 1906 "go.y" { (yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)); @@ -4527,6 +5029,8 @@ yyreduce: break; case 322: + +/* Line 1455 of yacc.c */ #line 1912 "go.y" { (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type))); @@ -4537,6 +5041,8 @@ yyreduce: break; case 323: + +/* Line 1455 of yacc.c */ #line 1919 "go.y" { Type *t; @@ -4554,6 +5060,8 @@ yyreduce: break; case 324: + +/* Line 1455 of yacc.c */ #line 1935 "go.y" { Sym *s; @@ -4573,6 +5081,8 @@ yyreduce: break; case 325: + +/* Line 1455 of yacc.c */ #line 1953 "go.y" { (yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)))); @@ -4580,6 +5090,8 @@ yyreduce: break; case 326: + +/* Line 1455 of yacc.c */ #line 1957 "go.y" { (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))); @@ -4587,6 +5099,8 @@ yyreduce: break; case 327: + +/* Line 1455 of yacc.c */ #line 1962 "go.y" { (yyval.list) = nil; @@ -4594,6 +5108,8 @@ yyreduce: break; case 329: + +/* Line 1455 of yacc.c */ #line 1969 "go.y" { (yyval.list) = (yyvsp[(2) - (3)].list); @@ -4601,6 +5117,8 @@ yyreduce: break; case 330: + +/* Line 1455 of yacc.c */ #line 1973 "go.y" { (yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)))); @@ -4608,6 +5126,8 @@ yyreduce: break; case 331: + +/* Line 1455 of yacc.c */ #line 1983 "go.y" { (yyval.node) = nodlit((yyvsp[(1) - (1)].val)); @@ -4615,6 +5135,8 @@ yyreduce: break; case 332: + +/* Line 1455 of yacc.c */ #line 1987 "go.y" { (yyval.node) = nodlit((yyvsp[(2) - (2)].val)); @@ -4633,6 +5155,8 @@ yyreduce: break; case 333: + +/* Line 1455 of yacc.c */ #line 2002 "go.y" { (yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg)); @@ -4642,6 +5166,8 @@ yyreduce: break; case 335: + +/* Line 1455 of yacc.c */ #line 2011 "go.y" { if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) { @@ -4654,6 +5180,8 @@ yyreduce: break; case 338: + +/* Line 1455 of yacc.c */ #line 2025 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4661,6 +5189,8 @@ yyreduce: break; case 339: + +/* Line 1455 of yacc.c */ #line 2029 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4668,6 +5198,8 @@ yyreduce: break; case 340: + +/* Line 1455 of yacc.c */ #line 2035 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4675,6 +5207,8 @@ yyreduce: break; case 341: + +/* Line 1455 of yacc.c */ #line 2039 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4682,6 +5216,8 @@ yyreduce: break; case 342: + +/* Line 1455 of yacc.c */ #line 2045 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); @@ -4689,6 +5225,8 @@ yyreduce: break; case 343: + +/* Line 1455 of yacc.c */ #line 2049 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); @@ -4696,8 +5234,9 @@ yyreduce: break; -/* Line 1267 of yacc.c. */ -#line 4702 "y.tab.c" + +/* Line 1455 of yacc.c */ +#line 5241 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4708,7 +5247,6 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -4773,7 +5311,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -4790,7 +5328,7 @@ yyerrlab: } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -4847,9 +5385,6 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; @@ -4874,7 +5409,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -4885,7 +5420,7 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) + if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered @@ -4911,6 +5446,8 @@ yyreturn: } + +/* Line 1675 of yacc.c */ #line 2053 "go.y" diff --git a/src/cmd/gc/y.tab.h b/src/cmd/gc/y.tab.h index cb45a87fbcb..11e19b6af04 100644 --- a/src/cmd/gc/y.tab.h +++ b/src/cmd/gc/y.tab.h @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,10 +28,11 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -146,22 +146,28 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 28 "go.y" { + +/* Line 1676 of yacc.c */ +#line 28 "go.y" + Node* node; NodeList* list; Type* type; Sym* sym; struct Val val; int i; -} -/* Line 1529 of yacc.c. */ -#line 160 "y.tab.h" - YYSTYPE; + + + +/* Line 1676 of yacc.c */ +#line 165 "y.tab.h" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; + diff --git a/test/fixedbugs/bug392.dir/one.go b/test/fixedbugs/bug392.dir/one.go index 69fe0894628..8242f284620 100644 --- a/test/fixedbugs/bug392.dir/one.go +++ b/test/fixedbugs/bug392.dir/one.go @@ -36,6 +36,8 @@ func F6(S int) *U { return &U{{S,S}} } +// Bug in the fix. +type PB struct { x int } - +func (t *PB) Reset() { *t = PB{} } diff --git a/test/fixedbugs/bug392.dir/three.go b/test/fixedbugs/bug392.dir/three.go new file mode 100644 index 00000000000..a6193bf9107 --- /dev/null +++ b/test/fixedbugs/bug392.dir/three.go @@ -0,0 +1,13 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Use the functions in one.go so that the inlined +// forms get type-checked. + +package three + +import "./two" + +var x = two.F() +var v = two.V diff --git a/test/fixedbugs/bug392.dir/two.go b/test/fixedbugs/bug392.dir/two.go index 3485519f97c..a9033dbb037 100644 --- a/test/fixedbugs/bug392.dir/two.go +++ b/test/fixedbugs/bug392.dir/two.go @@ -19,3 +19,7 @@ func use() { t.M() t.MM() } + +var V = []one.PB{{}, {}} + +func F() *one.PB diff --git a/test/fixedbugs/bug392.go b/test/fixedbugs/bug392.go index 50af6006fbe..a7a4216c457 100644 --- a/test/fixedbugs/bug392.go +++ b/test/fixedbugs/bug392.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go +// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go && $G $D/$F.dir/three.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style