1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:40:22 -07:00

ast/printer: support for printing ast.Spec nodes

R=gri
CC=golang-dev
https://golang.org/cl/682041
This commit is contained in:
Andrew Gerrand 2010-03-23 09:00:47 +11:00
parent 2e5fe5a14c
commit 51a7f1c9d6

View File

@ -1018,6 +1018,9 @@ func (cfg *Config) Fprint(output io.Writer, node interface{}) (int, os.Error) {
case ast.Decl:
p.useNodeComments = true
p.decl(n, atTop, ignoreMultiLine)
case ast.Spec:
p.useNodeComments = true
p.spec(n, 1, atTop, false, ignoreMultiLine)
case *ast.File:
p.comments = n.Comments
p.useNodeComments = n.Comments == nil