Commit 21617250 authored by Russ Cox's avatar Russ Cox

import/export of embedded types

R=ken
OCL=17643
CL=17643
parent 40fa690d
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
%type <type> indcl fnlitdcl %type <type> indcl fnlitdcl
%type <val> hidden_constant %type <val> hidden_constant
%type <node> hidden_dcl %type <node> hidden_dcl hidden_structdcl
%type <type> hidden_type hidden_type1 hidden_type2 %type <type> hidden_type hidden_type1 hidden_type2
%type <node> hidden_structdcl_list ohidden_structdcl_list hidden_structdcl_list_r %type <node> hidden_structdcl_list ohidden_structdcl_list hidden_structdcl_list_r
%type <node> hidden_interfacedcl_list ohidden_interfacedcl_list hidden_interfacedcl_list_r %type <node> hidden_interfacedcl_list ohidden_interfacedcl_list hidden_interfacedcl_list_r
...@@ -1580,8 +1580,8 @@ hidden_funarg_list: ...@@ -1580,8 +1580,8 @@ hidden_funarg_list:
} }
hidden_structdcl_list_r: hidden_structdcl_list_r:
hidden_dcl hidden_structdcl
| hidden_structdcl_list_r ';' hidden_dcl | hidden_structdcl_list_r ';' hidden_structdcl
{ {
$$ = nod(OLIST, $1, $3); $$ = nod(OLIST, $1, $3);
} }
...@@ -1847,6 +1847,17 @@ hidden_dcl: ...@@ -1847,6 +1847,17 @@ hidden_dcl:
$$->type = $2; $$->type = $2;
} }
hidden_structdcl:
sym1 hidden_type
{
$$ = nod(ODCLFIELD, newname($1), N);
$$->type = $2;
}
| '?' hidden_type
{
$$ = embedded($2->sym);
}
hidden_interfacedcl: hidden_interfacedcl:
sym1 '(' ohidden_funarg_list ')' ohidden_funres sym1 '(' ohidden_funarg_list ')' ohidden_funres
{ {
......
...@@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t) ...@@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t)
return fmtprint(fp, " }"); return fmtprint(fp, " }");
case TFIELD: case TFIELD:
if(t->sym == S || t->sym->name[0] == '_') { if(t->sym == S || t->sym->name[0] == '_' || t->embedded) {
if(exporting) if(exporting)
fmtprint(fp, "? "); fmtprint(fp, "? ");
return fmtprint(fp, "%T", t->type); return fmtprint(fp, "%T", 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