diff --git a/cmd/eg/eg.go b/cmd/eg/eg.go index 01dd5a9182..8d2342ab1b 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 4866aaa9ce..0ba7cb2346 100644 --- a/container/intsets/sparse.go +++ b/container/intsets/sparse.go @@ -15,6 +15,7 @@ package intsets // 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 @@ package intsets // 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 @@ func (s *Sparse) Difference(x, y *Sparse) { 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 @@ func (s *Sparse) String() string { // // 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 a00cbb3290..2338201903 100644 --- a/container/intsets/sparse_test.go +++ b/container/intsets/sparse_test.go @@ -458,6 +458,7 @@ func TestFailFastOnShallowCopy(t *testing.T) { // -- 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 566108fa5e..82165a9f9e 100644 --- a/go/loader/loader.go +++ b/go/loader/loader.go @@ -297,6 +297,7 @@ func (conf *Config) fset() *token.FileSet { // 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 0f2ea4b9ac..01b245c44c 100644 --- a/oracle/describe.go +++ b/oracle/describe.go @@ -465,6 +465,9 @@ func (r *describeTypeResult) display(printf printfFunc) { 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 631d9bc554..677687228e 100644 --- a/oracle/serial/serial.go +++ b/oracle/serial/serial.go @@ -124,8 +124,8 @@ type ImplementsType struct { // 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