From: Robert Findley Date: Wed, 12 Jan 2022 14:54:19 +0000 (-0500) Subject: go/ast: mention that FieldLists can now be enclosed by brackets X-Git-Tag: go1.18beta2~110 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=83bfdb6561c06bd890446af01b0f0c735360a8df;p=gostls13.git go/ast: mention that FieldLists can now be enclosed by brackets Type parameter lists are stored using ast.FieldLists. Update the documentation to reflect that the enclosing delimiter may be a bracket. Change-Id: Id103e7b38975e94a1b521f75695edc10408ad3dd Reviewed-on: https://go-review.googlesource.com/c/go/+/378014 Trust: Robert Findley Run-TryBot: Robert Findley Reviewed-by: Robert Griesemer TryBot-Result: Gopher Robot --- diff --git a/src/go/ast/ast.go b/src/go/ast/ast.go index bc140473d5..a74a827c8f 100644 --- a/src/go/ast/ast.go +++ b/src/go/ast/ast.go @@ -224,11 +224,12 @@ func (f *Field) End() token.Pos { return token.NoPos } -// A FieldList represents a list of Fields, enclosed by parentheses or braces. +// A FieldList represents a list of Fields, enclosed by parentheses, +// curly braces, or square brackets. type FieldList struct { - Opening token.Pos // position of opening parenthesis/brace, if any + Opening token.Pos // position of opening parenthesis/brace/bracket, if any List []*Field // field list; or nil - Closing token.Pos // position of closing parenthesis/brace, if any + Closing token.Pos // position of closing parenthesis/brace/bracket, if any } func (f *FieldList) Pos() token.Pos {