// ----------------------------------------------------------------------------
// Files
+// package PkgName; DeclList[0], DeclList[1], ...
type File struct {
PkgName *Name
DeclList []Decl
aDecl()
}
+ // Path
+ // LocalPkgName Path
ImportDecl struct {
LocalPkgName *Name // including "."; nil means no rename present
Path *BasicLit
decl
}
+ // NameList
+ // NameList = Values
+ // NameList Type = Values
ConstDecl struct {
NameList []*Name
Type Expr // nil means no type
decl
}
+ // Name Type
TypeDecl struct {
Name *Name
Type Expr
decl
}
+ // NameList Type
+ // NameList Type = Values
+ // NameList = Values
VarDecl struct {
NameList []*Name
Type Expr // nil means no type
decl
}
+ // func Name Type { Body }
+ // func Name Type
+ // func Receiver Name Type { Body }
+ // func Receiver Name Type
FuncDecl struct {
Attr map[string]bool // go:attr map
Recv *Field // nil means regular function
// ----------------------------------------------------------------------------
// Comments
+// TODO(gri) Consider renaming to CommentPos, CommentPlacement, etc.
+// Kind = Above doesn't make much sense.
type CommentKind uint
const (