Skip to content

Commit 34a5830

Browse files
griesemergopherbot
authored andcommitted
cmd/compile/internal/syntax: fix/update various comments
Change-Id: I30b448c8fcdbad94afcd7ff0dfc5cfebb485bdd7 Reviewed-on: https://go-review.googlesource.com/c/go/+/538855 Auto-Submit: Robert Griesemer <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 0aa2197 commit 34a5830

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/cmd/compile/internal/syntax/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ loop:
11471147
}
11481148

11491149
// x[i:...
1150-
// For better error message, don't simply use p.want(_Colon) here (issue #47704).
1150+
// For better error message, don't simply use p.want(_Colon) here (go.dev/issue/47704).
11511151
if !p.got(_Colon) {
11521152
p.syntaxError("expected comma, : or ]")
11531153
p.advance(_Comma, _Colon, _Rbrack)
@@ -2322,7 +2322,7 @@ func (p *parser) header(keyword token) (init SimpleStmt, cond Expr, post SimpleS
23222322
// asking for a '{' rather than a ';' here leads to a better error message
23232323
p.want(_Lbrace)
23242324
if p.tok != _Lbrace {
2325-
p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., issue #22581)
2325+
p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., go.dev/issue/22581)
23262326
}
23272327
}
23282328
if keyword == _For {

src/cmd/compile/internal/syntax/testdata/issue23434.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Test case for issue 23434: Better synchronization of
5+
// Test case for go.dev/issue/23434: Better synchronization of
66
// parser after missing type. There should be exactly
77
// one error each time, with now follow errors.
88

@@ -12,7 +12,7 @@ type T /* ERROR unexpected newline */
1212

1313
type Map map[int] /* ERROR unexpected newline */
1414

15-
// Examples from #23434:
15+
// Examples from go.dev/issue/23434:
1616

1717
func g() {
1818
m := make(map[string] /* ERROR unexpected ! */ !)

src/cmd/compile/internal/syntax/testdata/issue31092.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Test cases for issue 31092: Better synchronization of
5+
// Test cases for go.dev/issue/31092: Better synchronization of
66
// parser after seeing an := rather than an = in a const,
77
// type, or variable declaration.
88

src/cmd/compile/internal/syntax/testdata/map2.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// This file is like map.go2, but instead if importing chans, it contains
5+
// This file is like map.go, but instead of importing chans, it contains
66
// the necessary functionality at the end of the file.
77

88
// Package orderedmap provides an ordered map, implemented as a binary tree.
@@ -23,7 +23,7 @@ type node[K, V any] struct {
2323

2424
// New returns a new map.
2525
func New[K, V any](compare func(K, K) int) *Map[K, V] {
26-
return &Map[K, V]{compare: compare}
26+
return &Map[K, V]{compare: compare}
2727
}
2828

2929
// 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] {
8585
// Stop sending values if sender.Send returns false,
8686
// meaning that nothing is listening at the receiver end.
8787
return f(n.left) &&
88-
sender.Send(keyValue[K, V]{n.key, n.val}) &&
88+
sender.Send(keyValue[K, V]{n.key, n.val}) &&
8989
f(n.right)
9090
}
9191
go func() {
@@ -119,7 +119,7 @@ func chans_Ranger[T any]() (*chans_Sender[T], *chans_Receiver[T])
119119
// A sender is used to send values to a Receiver.
120120
type chans_Sender[T any] struct {
121121
values chan<- T
122-
done <-chan bool
122+
done <-chan bool
123123
}
124124

125125
func (s *chans_Sender[T]) Send(v T) bool {
@@ -137,10 +137,10 @@ func (s *chans_Sender[T]) Close() {
137137

138138
type chans_Receiver[T any] struct {
139139
values <-chan T
140-
done chan<- bool
140+
done chan<- bool
141141
}
142142

143143
func (r *chans_Receiver[T]) Next() (T, bool) {
144144
v, ok := <-r.values
145145
return v, ok
146-
}
146+
}

src/cmd/compile/internal/syntax/testdata/tparams.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func f[a t, b t, c /* ERROR missing type constraint */ ]()
2323

2424
func f[a b, /* ERROR expected ] */ 0] ()
2525

26-
// issue #49482
26+
// go.dev/issue/49482
2727
type (
2828
t[a *[]int] struct{}
2929
t[a *t,] struct{}
@@ -35,7 +35,7 @@ type (
3535
t[a *struct{}|~t] struct{}
3636
)
3737

38-
// issue #51488
38+
// go.dev/issue/51488
3939
type (
4040
t[a *t|t,] struct{}
4141
t[a *t|t, b t] struct{}

src/cmd/compile/internal/syntax/testdata/typeset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ type (
4444
_[_ t|~struct{}] t
4545
_[_ ~t|~struct{}] t
4646

47-
// test cases for issue #49175
47+
// test cases for go.dev/issue/49175
4848
_[_ []t]t
4949
_[_ [1]t]t
5050
_[_ ~[]t]t
5151
_[_ ~[1]t]t
5252
t [ /* ERROR type parameters must be named */ t[0]]t
5353
)
5454

55-
// test cases for issue #49174
55+
// test cases for go.dev/issue/49174
5656
func _[_ t]() {}
5757
func _[_ []t]() {}
5858
func _[_ [1]t]() {}

0 commit comments

Comments
 (0)