diff options
author | Robert Findley <rfindley@google.com> | 2022-01-12 09:54:19 -0500 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2022-01-12 16:50:38 +0000 |
commit | 83bfdb6561c06bd890446af01b0f0c735360a8df (patch) | |
tree | 7cd6d275d4b41bf03cf3a42ee1189e4060c87b71 /src | |
parent | 6e8b7e4f4213afb67a91050cb2d71347d73145aa (diff) | |
download | go-83bfdb6561c06bd890446af01b0f0c735360a8df.tar.gz go-83bfdb6561c06bd890446af01b0f0c735360a8df.zip |
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 <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/go/ast/ast.go | 7 |
1 files changed, 4 insertions, 3 deletions
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 { |