]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile/internal/syntax: fix/update various comments
authorRobert Griesemer <gri@golang.org>
Tue, 31 Oct 2023 16:50:00 +0000 (09:50 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 1 Nov 2023 12:49:49 +0000 (12:49 +0000)
Change-Id: I30b448c8fcdbad94afcd7ff0dfc5cfebb485bdd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/538855
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/syntax/parser.go
src/cmd/compile/internal/syntax/testdata/issue23434.go
src/cmd/compile/internal/syntax/testdata/issue31092.go
src/cmd/compile/internal/syntax/testdata/map2.go
src/cmd/compile/internal/syntax/testdata/tparams.go
src/cmd/compile/internal/syntax/testdata/typeset.go

index 3895f53cf74d6d34424a7e557b1a91871f3cf197..b34a58c3c2e86d605b0ed5629d14fbda2e033d9e 100644 (file)
@@ -1147,7 +1147,7 @@ loop:
                        }
 
                        // x[i:...
-                       // For better error message, don't simply use p.want(_Colon) here (issue #47704).
+                       // For better error message, don't simply use p.want(_Colon) here (go.dev/issue/47704).
                        if !p.got(_Colon) {
                                p.syntaxError("expected comma, : or ]")
                                p.advance(_Comma, _Colon, _Rbrack)
@@ -2322,7 +2322,7 @@ func (p *parser) header(keyword token) (init SimpleStmt, cond Expr, post SimpleS
                        // asking for a '{' rather than a ';' here leads to a better error message
                        p.want(_Lbrace)
                        if p.tok != _Lbrace {
-                               p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., issue #22581)
+                               p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., go.dev/issue/22581)
                        }
                }
                if keyword == _For {
index 5a72a7f4ed1769690e8f8d4c64bae59ed9f35d1a..e436abfecbb2ad8a173638fdfc4c6e4f24279b55 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Test case for issue 23434: Better synchronization of
+// Test case for go.dev/issue/23434: Better synchronization of
 // parser after missing type. There should be exactly
 // one error each time, with now follow errors.
 
@@ -12,7 +12,7 @@ type T /* ERROR unexpected newline */
 
 type Map map[int] /* ERROR unexpected newline */
 
-// Examples from #23434:
+// Examples from go.dev/issue/23434:
 
 func g() {
        m := make(map[string] /* ERROR unexpected ! */ !)
index b1839b8f468290d97ff2cca2bec70401e402b7e7..0bd40bd7cd629ef4ef516b51f1c793778aac776a 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Test cases for issue 31092: Better synchronization of
+// Test cases for go.dev/issue/31092: Better synchronization of
 // parser after seeing an := rather than an = in a const,
 // type, or variable declaration.
 
index 2833445662de813d6d3eeed95978c8342316b29f..3d1cbfbd22d4f287e95a6b50c218c84f449ef3a6 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// This file is like map.go2, but instead if importing chans, it contains
+// This file is like map.go, but instead of importing chans, it contains
 // the necessary functionality at the end of the file.
 
 // Package orderedmap provides an ordered map, implemented as a binary tree.
@@ -23,7 +23,7 @@ type node[K, V any] struct {
 
 // New returns a new map.
 func New[K, V any](compare func(K, K) int) *Map[K, V] {
-        return &Map[K, V]{compare: compare}
+       return &Map[K, V]{compare: compare}
 }
 
 // find looks up key in the map, and returns either a pointer
@@ -85,7 +85,7 @@ func (m *Map[K, V]) InOrder() *Iterator[K, V] {
                // Stop sending values if sender.Send returns false,
                // meaning that nothing is listening at the receiver end.
                return f(n.left) &&
-                        sender.Send(keyValue[K, V]{n.key, n.val}) &&
+                       sender.Send(keyValue[K, V]{n.key, n.val}) &&
                        f(n.right)
        }
        go func() {
@@ -119,7 +119,7 @@ func chans_Ranger[T any]() (*chans_Sender[T], *chans_Receiver[T])
 // A sender is used to send values to a Receiver.
 type chans_Sender[T any] struct {
        values chan<- T
-       done <-chan bool
+       done   <-chan bool
 }
 
 func (s *chans_Sender[T]) Send(v T) bool {
@@ -137,10 +137,10 @@ func (s *chans_Sender[T]) Close() {
 
 type chans_Receiver[T any] struct {
        values <-chan T
-       done chan<- bool
+       done   chan<- bool
 }
 
 func (r *chans_Receiver[T]) Next() (T, bool) {
        v, ok := <-r.values
        return v, ok
-}
\ No newline at end of file
+}
index 646fbbebc8940886ad8c753b2d713b811aa12f88..15e92afa81d8cbf21feefd9f90f162b1f25d10ff 100644 (file)
@@ -23,7 +23,7 @@ func f[a t, b t, c /* ERROR missing type constraint */ ]()
 
 func f[a b,  /* ERROR expected ] */ 0] ()
 
-// issue #49482
+// go.dev/issue/49482
 type (
        t[a *[]int] struct{}
        t[a *t,] struct{}
@@ -35,7 +35,7 @@ type (
        t[a *struct{}|~t] struct{}
 )
 
-// issue #51488
+// go.dev/issue/51488
 type (
        t[a *t|t,] struct{}
        t[a *t|t, b t] struct{}
index fe5c3f45a815f9fd8032e3eab316b02e0db73714..63cdb079c0db744a0541a5ee637cb5fba1aec68f 100644 (file)
@@ -44,7 +44,7 @@ type (
         _[_ t|~struct{}] t
         _[_ ~t|~struct{}] t
 
-        // test cases for issue #49175
+        // test cases for go.dev/issue/49175
         _[_ []t]t
         _[_ [1]t]t
         _[_ ~[]t]t
@@ -52,7 +52,7 @@ type (
         t [ /* ERROR type parameters must be named */ t[0]]t
 )
 
-// test cases for issue #49174
+// test cases for go.dev/issue/49174
 func _[_ t]() {}
 func _[_ []t]() {}
 func _[_ [1]t]() {}