Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
21617250
Commit
21617250
authored
Oct 22, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import/export of embedded types
R=ken OCL=17643 CL=17643
parent
40fa690d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
src/cmd/gc/go.y
src/cmd/gc/go.y
+14
-3
src/cmd/gc/subr.c
src/cmd/gc/subr.c
+1
-1
No files found.
src/cmd/gc/go.y
View file @
21617250
...
...
@@ -73,7 +73,7 @@
%
type
<
type
>
indcl
fnlitdcl
%
type
<
val
>
hidden_constant
%
type
<
node
>
hidden_dcl
%
type
<
node
>
hidden_dcl
hidden_structdcl
%
type
<
type
>
hidden_type
hidden_type1
hidden_type2
%
type
<
node
>
hidden_structdcl_list
ohidden_structdcl_list
hidden_structdcl_list_r
%
type
<
node
>
hidden_interfacedcl_list
ohidden_interfacedcl_list
hidden_interfacedcl_list_r
...
...
@@ -1580,8 +1580,8 @@ hidden_funarg_list:
}
hidden_structdcl_list_r
:
hidden_dcl
|
hidden_structdcl_list_r
';'
hidden_dcl
hidden_
struct
dcl
|
hidden_structdcl_list_r
';'
hidden_
struct
dcl
{
$$
=
nod
(
OLIST
,
$
1
,
$
3
);
}
...
...
@@ -1847,6 +1847,17 @@ hidden_dcl:
$$->type = $2;
}
hidden_structdcl:
sym1 hidden_type
{
$$ = nod(ODCLFIELD, newname($1), N);
$$->type = $2;
}
| '
?
' hidden_type
{
$$ = embedded($2->sym);
}
hidden_interfacedcl:
sym1 '
(
' ohidden_funarg_list '
)
' ohidden_funres
{
...
...
src/cmd/gc/subr.c
View file @
21617250
...
...
@@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t)
return
fmtprint
(
fp
,
" }"
);
case
TFIELD
:
if
(
t
->
sym
==
S
||
t
->
sym
->
name
[
0
]
==
'_'
)
{
if
(
t
->
sym
==
S
||
t
->
sym
->
name
[
0
]
==
'_'
||
t
->
embedded
)
{
if
(
exporting
)
fmtprint
(
fp
,
"? "
);
return
fmtprint
(
fp
,
"%T"
,
t
->
type
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment