tools: minor comment fixes.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/173170043
diff --git a/cmd/eg/eg.go b/cmd/eg/eg.go
index 01dd5a9..8d2342a 100644
--- a/cmd/eg/eg.go
+++ b/cmd/eg/eg.go
@@ -1,4 +1,6 @@
// The eg command performs example-based refactoring.
+// For documentation, run the command, or see Help in
+// code.google.com/p/go.tools/refactor/eg.
package main
import (
diff --git a/container/intsets/sparse.go b/container/intsets/sparse.go
index 4866aaa..0ba7cb2 100644
--- a/container/intsets/sparse.go
+++ b/container/intsets/sparse.go
@@ -15,6 +15,7 @@
// TODO(adonovan):
// - Add SymmetricDifference(x, y *Sparse), i.e. x ∆ y.
+// - Add SubsetOf (x∖y=∅) and Intersects (x∩y≠∅) predicates.
// - Add InsertAll(...int), RemoveAll(...int)
// - Add 'bool changed' results for {Intersection,Difference}With too.
//
@@ -25,6 +26,9 @@
// TODO(adonovan): experiment with making the root block indirect (nil
// iff IsEmpty). This would reduce the memory usage when empty and
// might simplify the aliasing invariants.
+//
+// TODO(adonovan): opt: make UnionWith and Difference faster.
+// These are the hot-spots for go/pointer.
import (
"bytes"
@@ -641,7 +645,7 @@
if sum != 0 {
sb = sb.next
} else {
- // sb will be overrwritten or removed
+ // sb will be overwritten or removed
}
yb = yb.next
@@ -707,7 +711,7 @@
//
// Examples:
// {}.BitString() = "0"
-// {4,5}.BitString() = "110000"
+// {4,5}.BitString() = "110000"
// {-3}.BitString() = "0.001"
// {-3,0,4,5}.BitString() = "110001.001"
//
diff --git a/container/intsets/sparse_test.go b/container/intsets/sparse_test.go
index a00cbb3..2338201 100644
--- a/container/intsets/sparse_test.go
+++ b/container/intsets/sparse_test.go
@@ -458,6 +458,7 @@
// -- Benchmarks -------------------------------------------------------
// TODO(adonovan):
+// - Add benchmarks of each method.
// - Gather set distributions from pointer analysis.
// - Measure memory usage.
diff --git a/go/loader/loader.go b/go/loader/loader.go
index 566108f..82165a9 100644
--- a/go/loader/loader.go
+++ b/go/loader/loader.go
@@ -297,6 +297,7 @@
// the Config's FileSet, which is initialized if nil.
//
func (conf *Config) ParseFile(filename string, src interface{}) (*ast.File, error) {
+ // TODO(adonovan): use conf.build() etc like parseFiles does.
return parser.ParseFile(conf.fset(), filename, src, conf.ParserMode)
}
diff --git a/oracle/describe.go b/oracle/describe.go
index 0f2ea4b..01b245c 100644
--- a/oracle/describe.go
+++ b/oracle/describe.go
@@ -465,6 +465,9 @@
if len(r.methods) > 0 {
printf(r.node, "Method set:")
for _, meth := range r.methods {
+ // TODO(adonovan): print these relative
+ // to the owning package, not the
+ // query package.
printf(meth.Obj(), "\t%s", r.qpos.SelectionString(meth))
}
} else {
diff --git a/oracle/serial/serial.go b/oracle/serial/serial.go
index 631d9bc..6776872 100644
--- a/oracle/serial/serial.go
+++ b/oracle/serial/serial.go
@@ -124,8 +124,8 @@
// a "what" query.
type SyntaxNode struct {
Description string `json:"desc"` // description of syntax tree
- Start int `json:"start"` // start offset (0-based)
- End int `json:"end"` // end offset
+ Start int `json:"start"` // start byte offset, 0-based
+ End int `json:"end"` // end byte offset
}
// A What is the result of the "what" query, which quickly identifies