mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/go/internal/syntax: reintroduce reverted comments
These comments were originally introduced together with the changes for alias declarations, and then reverted when we backed out alias support. Reintroduce them. Change-Id: I3ef2c4f4672d6af8a900f5d73df273edf28d1a14 Reviewed-on: https://go-review.googlesource.com/32826 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
429edcff10
commit
65269e7066
1 changed files with 16 additions and 0 deletions
|
|
@ -33,6 +33,7 @@ func (n *node) init(p *parser) {
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Files
|
// Files
|
||||||
|
|
||||||
|
// package PkgName; DeclList[0], DeclList[1], ...
|
||||||
type File struct {
|
type File struct {
|
||||||
PkgName *Name
|
PkgName *Name
|
||||||
DeclList []Decl
|
DeclList []Decl
|
||||||
|
|
@ -49,6 +50,8 @@ type (
|
||||||
aDecl()
|
aDecl()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Path
|
||||||
|
// LocalPkgName Path
|
||||||
ImportDecl struct {
|
ImportDecl struct {
|
||||||
LocalPkgName *Name // including "."; nil means no rename present
|
LocalPkgName *Name // including "."; nil means no rename present
|
||||||
Path *BasicLit
|
Path *BasicLit
|
||||||
|
|
@ -56,6 +59,9 @@ type (
|
||||||
decl
|
decl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NameList
|
||||||
|
// NameList = Values
|
||||||
|
// NameList Type = Values
|
||||||
ConstDecl struct {
|
ConstDecl struct {
|
||||||
NameList []*Name
|
NameList []*Name
|
||||||
Type Expr // nil means no type
|
Type Expr // nil means no type
|
||||||
|
|
@ -64,6 +70,7 @@ type (
|
||||||
decl
|
decl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name Type
|
||||||
TypeDecl struct {
|
TypeDecl struct {
|
||||||
Name *Name
|
Name *Name
|
||||||
Type Expr
|
Type Expr
|
||||||
|
|
@ -72,6 +79,9 @@ type (
|
||||||
decl
|
decl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NameList Type
|
||||||
|
// NameList Type = Values
|
||||||
|
// NameList = Values
|
||||||
VarDecl struct {
|
VarDecl struct {
|
||||||
NameList []*Name
|
NameList []*Name
|
||||||
Type Expr // nil means no type
|
Type Expr // nil means no type
|
||||||
|
|
@ -80,6 +90,10 @@ type (
|
||||||
decl
|
decl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// func Name Type { Body }
|
||||||
|
// func Name Type
|
||||||
|
// func Receiver Name Type { Body }
|
||||||
|
// func Receiver Name Type
|
||||||
FuncDecl struct {
|
FuncDecl struct {
|
||||||
Attr map[string]bool // go:attr map
|
Attr map[string]bool // go:attr map
|
||||||
Recv *Field // nil means regular function
|
Recv *Field // nil means regular function
|
||||||
|
|
@ -419,6 +433,8 @@ func (simpleStmt) aSimpleStmt() {}
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Comments
|
// Comments
|
||||||
|
|
||||||
|
// TODO(gri) Consider renaming to CommentPos, CommentPlacement, etc.
|
||||||
|
// Kind = Above doesn't make much sense.
|
||||||
type CommentKind uint
|
type CommentKind uint
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue