1
0
mirror of https://github.com/golang/go synced 2024-11-26 13:58:48 -07:00

annotations on embedded types

R=ken
OCL=18179
CL=18179
This commit is contained in:
Russ Cox 2008-10-30 15:29:55 -07:00
parent 1850b29da6
commit f2b1536328

View 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: