]> Cypherpunks repositories - gostls13.git/commitdiff
go/ast: mention that FieldLists can now be enclosed by brackets
authorRobert Findley <rfindley@google.com>
Wed, 12 Jan 2022 14:54:19 +0000 (09:54 -0500)
committerRobert Findley <rfindley@google.com>
Wed, 12 Jan 2022 16:50:38 +0000 (16:50 +0000)
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>

src/go/ast/ast.go

index bc140473d58d2fbc634a70197b34956d447a3e3a..a74a827c8fde6cb7cf6d56ec31a3ef5a298ba6b1 100644 (file)
@@ -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 {