]> Cypherpunks repositories - gostls13.git/commitdiff
annotations on embedded types
authorRuss Cox <rsc@golang.org>
Thu, 30 Oct 2008 22:29:55 +0000 (15:29 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 30 Oct 2008 22:29:55 +0000 (15:29 -0700)
R=ken
OCL=18179
CL=18179

src/cmd/gc/go.y

index cc5a101524f26045c9f59c1c62bf43ee5bef1b7e..cb802025a95f3b3671de39fc55e25c277ad6d26b 100644 (file)
@@ -1395,11 +1395,16 @@ structdcl:
                $$->type = $2;
                $$->val = $3;
        }
-|      embed
-|      '*' embed
+|      embed oliteral
+       {
+               $$ = $1;
+               $$->val = $2;
+       }
+|      '*' embed oliteral
        {
                $$ = $2;
                $$->type = ptrto($$->type);
+               $$->val = $3;
        }
 
 embed:
@@ -1898,13 +1903,14 @@ hidden_structdcl:
                $$->type = $2;
                $$->val = $3;
        }
-|      '?' hidden_type
+|      '?' hidden_type oliteral
        {
                if(isptr[$2->etype]) {
                        $$ = embedded($2->type->sym);
                        $$->type = ptrto($$->type);
                } else
                        $$ = embedded($2->sym);
+               $$->val = $3;
        }
 
 hidden_interfacedcl: