tools: minor comment fixes.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/173170043
This commit is contained in:
Alan Donovan 2014-11-13 12:34:25 -05:00
parent c05aea77a9
commit b8d26f5b94
6 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,6 @@
// The eg command performs example-based refactoring. // 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 package main
import ( import (

View File

@ -15,6 +15,7 @@ package intsets
// TODO(adonovan): // TODO(adonovan):
// - Add SymmetricDifference(x, y *Sparse), i.e. x ∆ y. // - Add SymmetricDifference(x, y *Sparse), i.e. x ∆ y.
// - Add SubsetOf (xy=∅) and Intersects (x∩y≠∅) predicates.
// - Add InsertAll(...int), RemoveAll(...int) // - Add InsertAll(...int), RemoveAll(...int)
// - Add 'bool changed' results for {Intersection,Difference}With too. // - 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 // TODO(adonovan): experiment with making the root block indirect (nil
// iff IsEmpty). This would reduce the memory usage when empty and // iff IsEmpty). This would reduce the memory usage when empty and
// might simplify the aliasing invariants. // might simplify the aliasing invariants.
//
// TODO(adonovan): opt: make UnionWith and Difference faster.
// These are the hot-spots for go/pointer.
import ( import (
"bytes" "bytes"
@ -641,7 +645,7 @@ func (s *Sparse) Difference(x, y *Sparse) {
if sum != 0 { if sum != 0 {
sb = sb.next sb = sb.next
} else { } else {
// sb will be overrwritten or removed // sb will be overwritten or removed
} }
yb = yb.next yb = yb.next
@ -707,7 +711,7 @@ func (s *Sparse) String() string {
// //
// Examples: // Examples:
// {}.BitString() = "0" // {}.BitString() = "0"
// {4,5}.BitString() = "110000" // {4,5}.BitString() = "110000"
// {-3}.BitString() = "0.001" // {-3}.BitString() = "0.001"
// {-3,0,4,5}.BitString() = "110001.001" // {-3,0,4,5}.BitString() = "110001.001"
// //

View File

@ -458,6 +458,7 @@ func TestFailFastOnShallowCopy(t *testing.T) {
// -- Benchmarks ------------------------------------------------------- // -- Benchmarks -------------------------------------------------------
// TODO(adonovan): // TODO(adonovan):
// - Add benchmarks of each method.
// - Gather set distributions from pointer analysis. // - Gather set distributions from pointer analysis.
// - Measure memory usage. // - Measure memory usage.

View File

@ -297,6 +297,7 @@ func (conf *Config) fset() *token.FileSet {
// the Config's FileSet, which is initialized if nil. // the Config's FileSet, which is initialized if nil.
// //
func (conf *Config) ParseFile(filename string, src interface{}) (*ast.File, error) { 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) return parser.ParseFile(conf.fset(), filename, src, conf.ParserMode)
} }

View File

@ -465,6 +465,9 @@ func (r *describeTypeResult) display(printf printfFunc) {
if len(r.methods) > 0 { if len(r.methods) > 0 {
printf(r.node, "Method set:") printf(r.node, "Method set:")
for _, meth := range r.methods { 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)) printf(meth.Obj(), "\t%s", r.qpos.SelectionString(meth))
} }
} else { } else {

View File

@ -124,8 +124,8 @@ type ImplementsType struct {
// a "what" query. // a "what" query.
type SyntaxNode struct { type SyntaxNode struct {
Description string `json:"desc"` // description of syntax tree Description string `json:"desc"` // description of syntax tree
Start int `json:"start"` // start offset (0-based) Start int `json:"start"` // start byte offset, 0-based
End int `json:"end"` // end offset End int `json:"end"` // end byte offset
} }
// A What is the result of the "what" query, which quickly identifies // A What is the result of the "what" query, which quickly identifies