Args []Expr // function arguments; or nil
Ellipsis token.Pos // position of "..." (token.NoPos if there is no "...")
Rparen token.Pos // position of ")"
- Brackets bool // if set, "[" and "]" are used instead of "(" and ")"
+ // TODO(rFindley) use a new ListExpr type rather than overloading CallExpr
+ // via Brackets, as is done in the syntax package
+ Brackets bool // if set, "[" and "]" are used instead of "(" and ")"
}
// A StarExpr node represents an expression of the form "*" Expression.
Name *Ident // function/method name
Type *FuncType // function signature: type and value parameters, results, and position of "func" keyword
Body *BlockStmt // function body; or nil for external (non-Go) function
+ // TODO(rFindley) consider storing TParams here, rather than FuncType, as
+ // they are only valid for declared functions
}
)
} else {
// embedded, possibly generic type
// (using the enclosing parentheses to distinguish it from a named field declaration)
- // TODO(gri) confirm that this doesn't allow parenthesized embedded type
+ // TODO(rFindley) confirm that this doesn't allow parenthesized embedded type
typ = p.parseType()
}
}
func (p *parser) parseParamDecl(name *ast.Ident) (f field) {
+ // TODO(rFindley) compare with parser.paramDeclOrNil in the syntax package
if p.trace {
defer un(trace(p, "ParamDeclOrNil"))
}
}
func writeTParamList(buf *bytes.Buffer, list []*TypeName, qf Qualifier, visited []Type) {
+ // TODO(rFindley) compare this with the corresponding implementation in types2
buf.WriteString("[")
var prev Type
for i, p := range list {