summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-01-30 19:22:46 -0500
committerRuss Cox <rsc@golang.org>2022-04-01 18:18:05 +0000
commit89dff118ada91061350aa149b54a2ab4fdbd6810 (patch)
tree75e16709eb36fdf6433fae7bc4ba1ddc44a76c5e /src/cmd/compile/internal
parent7d87ccc860dc31c0cd60faf00720e2f30fd37efb (diff)
downloadgo-git-89dff118ada91061350aa149b54a2ab4fdbd6810.tar.gz
all: fix TODO comment hanging indents
For whatever reason (perhaps some tool does this), a handful of comments, including some doc comments, have TODOs formatted like: // TODO(name): Text here and // more text aligned // under first text. In doc comments the second line turns into a <pre> block, which is undesirable in this context. Rewrite those to unindent, like this instead: // TODO(name): Text here and // more text aligned // at left column. For #51082. Change-Id: Ibf5145659a61ebf9496f016752a709a7656d2d4b Reviewed-on: https://go-review.googlesource.com/c/go/+/384258 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal')
-rw-r--r--src/cmd/compile/internal/ssa/func_test.go2
-rw-r--r--src/cmd/compile/internal/syntax/nodes.go2
-rw-r--r--src/cmd/compile/internal/syntax/pos.go2
-rw-r--r--src/cmd/compile/internal/syntax/tokens.go4
-rw-r--r--src/cmd/compile/internal/syntax/walk.go2
-rw-r--r--src/cmd/compile/internal/types2/assignments.go4
-rw-r--r--src/cmd/compile/internal/types2/lookup.go6
-rw-r--r--src/cmd/compile/internal/types2/named.go2
-rw-r--r--src/cmd/compile/internal/types2/return.go4
-rw-r--r--src/cmd/compile/internal/types2/stmt.go2
-rw-r--r--src/cmd/compile/internal/types2/validtype.go10
11 files changed, 20 insertions, 20 deletions
diff --git a/src/cmd/compile/internal/ssa/func_test.go b/src/cmd/compile/internal/ssa/func_test.go
index 276c444b9a..bbb228d8a5 100644
--- a/src/cmd/compile/internal/ssa/func_test.go
+++ b/src/cmd/compile/internal/ssa/func_test.go
@@ -34,7 +34,7 @@ package ssa
// TODO(matloob): Choose better names for Fun, Bloc, Goto, etc.
// TODO(matloob): Write a parser for the Func disassembly. Maybe
-// the parser can be used instead of Fun.
+// the parser can be used instead of Fun.
import (
"cmd/compile/internal/types"
diff --git a/src/cmd/compile/internal/syntax/nodes.go b/src/cmd/compile/internal/syntax/nodes.go
index 2f9b43edef..b0a0918e77 100644
--- a/src/cmd/compile/internal/syntax/nodes.go
+++ b/src/cmd/compile/internal/syntax/nodes.go
@@ -462,7 +462,7 @@ func (simpleStmt) aSimpleStmt() {}
// Comments
// TODO(gri) Consider renaming to CommentPos, CommentPlacement, etc.
-// Kind = Above doesn't make much sense.
+// Kind = Above doesn't make much sense.
type CommentKind uint
const (
diff --git a/src/cmd/compile/internal/syntax/pos.go b/src/cmd/compile/internal/syntax/pos.go
index 1494c0989f..b5e53d268b 100644
--- a/src/cmd/compile/internal/syntax/pos.go
+++ b/src/cmd/compile/internal/syntax/pos.go
@@ -24,7 +24,7 @@ type Pos struct {
func MakePos(base *PosBase, line, col uint) Pos { return Pos{base, sat32(line), sat32(col)} }
// TODO(gri) IsKnown makes an assumption about linebase < 1.
-// Maybe we should check for Base() != nil instead.
+// Maybe we should check for Base() != nil instead.
func (pos Pos) Pos() Pos { return pos }
func (pos Pos) IsKnown() bool { return pos.line > 0 }
diff --git a/src/cmd/compile/internal/syntax/tokens.go b/src/cmd/compile/internal/syntax/tokens.go
index 60eae36ec9..6dece1aa5b 100644
--- a/src/cmd/compile/internal/syntax/tokens.go
+++ b/src/cmd/compile/internal/syntax/tokens.go
@@ -93,8 +93,8 @@ func contains(tokset uint64, tok token) bool {
type LitKind uint8
// TODO(gri) With the 'i' (imaginary) suffix now permitted on integer
-// and floating-point numbers, having a single ImagLit does
-// not represent the literal kind well anymore. Remove it?
+// and floating-point numbers, having a single ImagLit does
+// not represent the literal kind well anymore. Remove it?
const (
IntLit LitKind = iota
FloatLit
diff --git a/src/cmd/compile/internal/syntax/walk.go b/src/cmd/compile/internal/syntax/walk.go
index b025844204..8f1d566155 100644
--- a/src/cmd/compile/internal/syntax/walk.go
+++ b/src/cmd/compile/internal/syntax/walk.go
@@ -52,7 +52,7 @@ func Crawl(root Node, f func(Node) bool) {
// field lists such as type T in "a, b, c T"). Such shared nodes are
// walked multiple times.
// TODO(gri) Revisit this design. It may make sense to walk those nodes
-// only once. A place where this matters is types2.TestResolveIdents.
+// only once. A place where this matters is types2.TestResolveIdents.
func Walk(root Node, v Visitor) {
walker{v}.node(root)
}
diff --git a/src/cmd/compile/internal/types2/assignments.go b/src/cmd/compile/internal/types2/assignments.go
index 49f4e2d2ab..f766c0b31d 100644
--- a/src/cmd/compile/internal/types2/assignments.go
+++ b/src/cmd/compile/internal/types2/assignments.go
@@ -441,8 +441,8 @@ func (check *Checker) assignVars(lhs, orig_rhs []syntax.Expr) {
// unpack unpacks a *syntax.ListExpr into a list of syntax.Expr.
// Helper introduced for the go/types -> types2 port.
// TODO(gri) Should find a more efficient solution that doesn't
-// require introduction of a new slice for simple
-// expressions.
+// require introduction of a new slice for simple
+// expressions.
func unpackExpr(x syntax.Expr) []syntax.Expr {
if x, _ := x.(*syntax.ListExpr); x != nil {
return x.ElemList
diff --git a/src/cmd/compile/internal/types2/lookup.go b/src/cmd/compile/internal/types2/lookup.go
index 0832877226..335e4d0c23 100644
--- a/src/cmd/compile/internal/types2/lookup.go
+++ b/src/cmd/compile/internal/types2/lookup.go
@@ -83,9 +83,9 @@ func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (o
}
// TODO(gri) The named type consolidation and seen maps below must be
-// indexed by unique keys for a given type. Verify that named
-// types always have only one representation (even when imported
-// indirectly via different packages.)
+// indexed by unique keys for a given type. Verify that named
+// types always have only one representation (even when imported
+// indirectly via different packages.)
// lookupFieldOrMethod should only be called by LookupFieldOrMethod and missingMethod.
// If foldCase is true, the lookup for methods will include looking for any method
diff --git a/src/cmd/compile/internal/types2/named.go b/src/cmd/compile/internal/types2/named.go
index 584ee51a13..1d3703ffd9 100644
--- a/src/cmd/compile/internal/types2/named.go
+++ b/src/cmd/compile/internal/types2/named.go
@@ -107,7 +107,7 @@ func (t *Named) Obj() *TypeName { return t.orig.obj } // for non-instances this
func (t *Named) Origin() *Named { return t.orig }
// TODO(gri) Come up with a better representation and API to distinguish
-// between parameterized instantiated and non-instantiated types.
+// between parameterized instantiated and non-instantiated types.
// TypeParams returns the type parameters of the named type t, or nil.
// The result is non-nil for an (originally) generic type even if it is instantiated.
diff --git a/src/cmd/compile/internal/types2/return.go b/src/cmd/compile/internal/types2/return.go
index 6c3e1842ce..7cdea99e08 100644
--- a/src/cmd/compile/internal/types2/return.go
+++ b/src/cmd/compile/internal/types2/return.go
@@ -99,8 +99,8 @@ func (check *Checker) isTerminatingSwitch(body []*syntax.CaseClause, label strin
}
// TODO(gri) For nested breakable statements, the current implementation of hasBreak
-// will traverse the same subtree repeatedly, once for each label. Replace
-// with a single-pass label/break matching phase.
+// will traverse the same subtree repeatedly, once for each label. Replace
+// with a single-pass label/break matching phase.
// hasBreak reports if s is or contains a break statement
// referring to the label-ed statement or implicit-ly the
diff --git a/src/cmd/compile/internal/types2/stmt.go b/src/cmd/compile/internal/types2/stmt.go
index 2b6abbde7e..e00f73ce99 100644
--- a/src/cmd/compile/internal/types2/stmt.go
+++ b/src/cmd/compile/internal/types2/stmt.go
@@ -312,7 +312,7 @@ L:
}
// TODO(gri) Once we are certain that typeHash is correct in all situations, use this version of caseTypes instead.
-// (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
+// (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
//
// func (check *Checker) caseTypes(x *operand, xtyp *Interface, types []syntax.Expr, seen map[string]syntax.Expr) (T Type) {
// var dummy operand
diff --git a/src/cmd/compile/internal/types2/validtype.go b/src/cmd/compile/internal/types2/validtype.go
index c7d42551dd..d495c6788e 100644
--- a/src/cmd/compile/internal/types2/validtype.go
+++ b/src/cmd/compile/internal/types2/validtype.go
@@ -141,8 +141,8 @@ func (env *tparamEnv) push(typ *Named) *tparamEnv {
}
// TODO(gri) Alternative implementation:
-// We may not need to build a stack of environments to
-// look up the type arguments for type parameters. The
-// same information should be available via the path:
-// We should be able to just walk the path backwards
-// and find the type arguments in the instance objects.
+// We may not need to build a stack of environments to
+// look up the type arguments for type parameters. The
+// same information should be available via the path:
+// We should be able to just walk the path backwards
+// and find the type arguments in the instance objects.