clipperhouse/gen — pull request #56 by infogulch (2014-07-03 06:43:25+00:00)
Title: Support parenthesized type multi-declarations

Like `import` and `var`, the `type` declaration in go supports multiple declarations in a single statement like so:

```go
// This comment is in GenDecl.Doc
type (
// This comment in GenDecl.Spec[0].Doc
Thing1 int

// This comment in GenDecl.Spec[1].Doc
Thing2 float
)
```
([Here it is, parsed with go/ast][1])

Should gen support such type declarations? If so, what should the semantics be?

My opinion on the semantics: Directives found in `GenDecl.Doc` applies to all `TypeSpec`s it contains. A directive found directly in a `TypeSpec.Doc` applies to that `TypeSpec` and overrides any `GenDecl.Doc` directive, if present.

[1]: http://play.golang.org/p/2IQsIpWE98