Pragma Pragma
PkgName *Name
DeclList []Decl
- Lines uint
+ EOF Pos
node
}
// Name Type
TypeDecl struct {
- Group *Group // nil means not part of a group
- Pragma Pragma
- Name *Name
- Alias bool
- Type Expr
+ Group *Group // nil means not part of a group
+ Pragma Pragma
+ Name *Name
+ TParamList []*Field // nil means no type parameters
+ Alias bool
+ Type Expr
decl
}
// func Receiver Name Type { Body }
// func Receiver Name Type
FuncDecl struct {
- Pragma Pragma
- Recv *Field // nil means regular function
- Name *Name
- Type *FuncType
- Body *BlockStmt // nil means no body (forward declaration)
+ Pragma Pragma
+ Recv *Field // nil means regular function
+ Name *Name
+ TParamList []*Field // nil means no type parameters
+ Type *FuncType
+ Body *BlockStmt // nil means no body (forward declaration)
decl
}
)
// Fun(ArgList[0], ArgList[1], ...)
CallExpr struct {
- Fun Expr
- ArgList []Expr // nil means no arguments
- HasDots bool // last argument is followed by ...
+ Fun Expr
+ ArgList []Expr // nil means no arguments
+ HasDots bool // last argument is followed by ...
+ Brackets bool // []'s instead of ()'s
expr
}
// interface { MethodList[0]; MethodList[1]; ... }
InterfaceType struct {
- MethodList []*Field
+ MethodList []*Field // a field named "type" means a type constraint
expr
}