Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / libgo / go / go / printer / testdata / comments.x
blob4d7a928ae096ebf5a2ab96d6d48007a117964959
1 // This is a package for testing comment placement by go/printer.
2 //
3 package main
6 // The SZ struct; it is empty.
7 type SZ struct{}
9 // The S0 struct; no field is exported.
10 type S0 struct {
11         // contains unexported fields
14 // The S1 struct; some fields are not exported.
15 type S1 struct {
16         S0
17         A, B, C float   // 3 exported fields
18         D       int     // 2 unexported fields
19         // contains unexported fields
22 // The S2 struct; all fields are exported.
23 type S2 struct {
24         S1
25         A, B, C float   // 3 exported fields
28 // The IZ interface; it is empty.
29 type SZ interface{}
31 // The I0 interface; no method is exported.
32 type I0 interface {
33         // contains unexported methods
36 // The I1 interface; some methods are not exported.
37 type I1 interface {
38         I0
39         F(x float) float        // exported methods
40         // contains unexported methods
43 // The I2 interface; all methods are exported.
44 type I2 interface {
45         I0
46         F(x float) float        // exported method
47         G(x float) float        // exported method
50 // The S3 struct; all comments except for the last one must appear in the export.
51 type S3 struct {
52         // lead comment for F1
53         F1      int     // line comment for F1
54         // lead comment for F2
55         F2      int     // line comment for F2
56         // contains unexported fields