go.tools: fix various typos

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/97920045
This commit is contained in:
Robert Griesemer 2014-05-02 14:38:08 -07:00
parent f84e8b3f03
commit 30b1abe2f7
18 changed files with 22 additions and 22 deletions

View File

@ -102,7 +102,7 @@ func (b *Bench) String() string {
} }
// BenchSet is a collection of benchmarks from one // BenchSet is a collection of benchmarks from one
// testing.B run, keyed by name to faciliate comparison. // testing.B run, keyed by name to facilitate comparison.
type BenchSet map[string][]*Bench type BenchSet map[string][]*Bench
// Parse extracts a BenchSet from testing.B output. Parse // Parse extracts a BenchSet from testing.B output. Parse

View File

@ -292,7 +292,7 @@ func (f *File) addImport(path string) string {
var slashslash = []byte("//") var slashslash = []byte("//")
// initialComments returns the prefix of content containing only // initialComments returns the prefix of content containing only
// whitepace and line comments. Any +build directives must appear // whitespace and line comments. Any +build directives must appear
// within this region. This approach is more reliable than using // within this region. This approach is more reliable than using
// go/printer to print a modified AST containing comments. // go/printer to print a modified AST containing comments.
// //
@ -432,7 +432,7 @@ func (f *File) newCounter(start, end token.Pos, numStmt int) ast.Stmt {
// //
// counters will be added before S1 and before S3. The block containing S2 // counters will be added before S1 and before S3. The block containing S2
// will be visited in a separate call. // will be visited in a separate call.
// TODO: Nested simple blocks get unecessary (but correct) counters // TODO: Nested simple blocks get unnecessary (but correct) counters
func (f *File) addCounters(pos, blockEnd token.Pos, list []ast.Stmt, extendToClosingBrace bool) []ast.Stmt { func (f *File) addCounters(pos, blockEnd token.Pos, list []ast.Stmt, extendToClosingBrace bool) []ast.Stmt {
// Special case: make sure we add a counter to an empty block. Can't do this below // Special case: make sure we add a counter to an empty block. Can't do this below
// or we will add a counter to an empty statement list after, say, a return statement. // or we will add a counter to an empty statement list after, say, a return statement.

View File

@ -88,7 +88,7 @@ func main() {
Master: rr, Master: rr,
} }
// set up work environment, use existing enviroment if possible // set up work environment, use existing environment if possible
if goroot.Exists() || *failAll { if goroot.Exists() || *failAll {
log.Print("Found old workspace, will use it") log.Print("Found old workspace, will use it")
} else { } else {

View File

@ -20,7 +20,7 @@ is limited since all variants must be created a priori.
We intend to add various presolving optimisations such as Pointer and We intend to add various presolving optimisations such as Pointer and
Location Equivalence from (Hardekopf & Lin, SAS '07) and solver Location Equivalence from (Hardekopf & Lin, SAS '07) and solver
optimisatisions such as Hybrid- and Lazy- Cycle Detection from optimisations such as Hybrid- and Lazy- Cycle Detection from
(Hardekopf & Lin, PLDI'07), (Hardekopf & Lin, PLDI'07),

View File

@ -755,7 +755,7 @@ func (a *analysis) genInvokeReflectType(caller *cgnode, site *callsite, call *ss
} }
} }
// genCall generates contraints for call instruction instr. // genCall generates constraints for call instruction instr.
func (a *analysis) genCall(caller *cgnode, instr ssa.CallInstruction) { func (a *analysis) genCall(caller *cgnode, instr ssa.CallInstruction) {
call := instr.Common() call := instr.Common()
@ -926,7 +926,7 @@ func (a *analysis) genStore(cgn *cgnode, ptr ssa.Value, val nodeid, offset, size
} }
} }
// genInstr generates contraints for instruction instr in context cgn. // genInstr generates constraints for instruction instr in context cgn.
func (a *analysis) genInstr(cgn *cgnode, instr ssa.Instruction) { func (a *analysis) genInstr(cgn *cgnode, instr ssa.Instruction) {
if a.log != nil { if a.log != nil {
var prefix string var prefix string

View File

@ -23,8 +23,8 @@ import (
// - arrays created by conversions (e.g. []byte("foo"), []byte(s)) // - arrays created by conversions (e.g. []byte("foo"), []byte(s))
// - stack- and heap-allocated variables (including composite literals) // - stack- and heap-allocated variables (including composite literals)
// - channels, maps and arrays created by make() // - channels, maps and arrays created by make()
// - instrinsic or reflective operations that allocate (e.g. append, reflect.New) // - intrinsic or reflective operations that allocate (e.g. append, reflect.New)
// - instrinsic objects, e.g. the initial array behind os.Args. // - intrinsic objects, e.g. the initial array behind os.Args.
// - and their subelements, e.g. "alloc.y[*].z" // - and their subelements, e.g. "alloc.y[*].z"
// //
// Labels are so varied that they defy good generalizations; // Labels are so varied that they defy good generalizations;
@ -87,7 +87,7 @@ func (l Label) Pos() token.Pos {
// makeinterface (tagged object allocated by makeinterface) // makeinterface (tagged object allocated by makeinterface)
// <alloc in reflect.Zero> (allocation in instrinsic) // <alloc in reflect.Zero> (allocation in instrinsic)
// sync.Mutex (a reflect.rtype instance) // sync.Mutex (a reflect.rtype instance)
// <command-line arguments> (an instrinsic object) // <command-line arguments> (an intrinsic object)
// //
// Labels within compound objects have subelement paths: // Labels within compound objects have subelement paths:
// x.y[*].z (a struct variable, x) // x.y[*].z (a struct variable, x)

View File

@ -7,7 +7,7 @@ package pointer
// For consistency, the names of all parameters match those of the // For consistency, the names of all parameters match those of the
// actual functions in the "reflect" package. // actual functions in the "reflect" package.
// //
// To avoid proliferation of equivalent labels, instrinsics should // To avoid proliferation of equivalent labels, intrinsics should
// memoize as much as possible, like TypeOf and Zero do for their // memoize as much as possible, like TypeOf and Zero do for their
// tagged objects. // tagged objects.
// //

View File

@ -19,7 +19,7 @@ func reflectValueSlice() {
print(rvsl.Interface().([]*int)) // @pointsto makeslice@slice:15 print(rvsl.Interface().([]*int)) // @pointsto makeslice@slice:15
print(rvsl.Interface().([]*int)[42]) // @pointsto main.a print(rvsl.Interface().([]*int)[42]) // @pointsto main.a
// reflect.Value contains an arrayay (non-addressable). // reflect.Value contains an array (non-addressable).
array := [10]*int{&a} // @line array array := [10]*int{&a} // @line array
rvarray := reflect.ValueOf(array).Slice(0, 0) rvarray := reflect.ValueOf(array).Slice(0, 0)
print(rvarray.Interface()) // @types print(rvarray.Interface()) // @types

View File

@ -17,7 +17,7 @@ func (s *S) String() string {
} }
func main() { func main() {
// os.Args is considered instrincally allocated, // os.Args is considered intrinsically allocated,
// but may also be set explicitly (e.g. on Windows), hence '...'. // but may also be set explicitly (e.g. on Windows), hence '...'.
print(os.Args) // @pointsto <command-line args> | ... print(os.Args) // @pointsto <command-line args> | ...
fmt.Println("Hello, World!", &theS) fmt.Println("Hello, World!", &theS)

View File

@ -240,7 +240,7 @@ func emitConv(f *Function, val Value, typ types.Type) Value {
} }
// emitStore emits to f an instruction to store value val at location // emitStore emits to f an instruction to store value val at location
// addr, applying implicit conversions as required by assignabilty rules. // addr, applying implicit conversions as required by assignability rules.
// //
func emitStore(f *Function, addr, val Value) *Store { func emitStore(f *Function, addr, val Value) *Store {
s := &Store{ s := &Store{

View File

@ -404,7 +404,7 @@ func init() {
// defer func() { // defer func() {
// r := fmt.Sprint(recover()) // r := fmt.Sprint(recover())
// if r != "interface conversion: interface is nil, not main.I" { // if r != "interface conversion: interface is nil, not main.I" {
// panic("I->I type assertion succeeed for nil value") // panic("I->I type assertion succeeded for nil value")
// } // }
// }() // }()
// var x I // var x I

View File

@ -34,7 +34,7 @@ func (check *checker) resolveOrder() []Object {
for _, f := range ityp.Methods.List { for _, f := range ityp.Methods.List {
if len(f.Names) == 0 { if len(f.Names) == 0 {
// Embedded interface: The type must be a (possibly // Embedded interface: The type must be a (possibly
// qualified) identifer denoting another interface. // qualified) identifier denoting another interface.
// Imported interfaces are already fully resolved, // Imported interfaces are already fully resolved,
// so we can ignore qualified identifiers. // so we can ignore qualified identifiers.
if ident, _ := f.Type.(*ast.Ident); ident != nil { if ident, _ := f.Type.(*ast.Ident); ident != nil {

View File

@ -259,7 +259,7 @@ func (check *checker) collectObjects() {
// rhs initializer (n:1 var declaration). // rhs initializer (n:1 var declaration).
var d1 *declInfo var d1 *declInfo
if len(s.Values) == 1 { if len(s.Values) == 1 {
// The lhs elements are only set up after the foor loop below, // The lhs elements are only set up after the for loop below,
// but that's ok because declareVar only collects the declInfo // but that's ok because declareVar only collects the declInfo
// for a later phase. // for a later phase.
d1 = &declInfo{file: fileScope, lhs: lhs, typ: s.Type, init: s.Values[0]} d1 = &declInfo{file: fileScope, lhs: lhs, typ: s.Type, init: s.Values[0]}

View File

@ -46,7 +46,7 @@ func importGroup(importPath string) int {
} }
func fixImports(fset *token.FileSet, f *ast.File) (added []string, err error) { func fixImports(fset *token.FileSet, f *ast.File) (added []string, err error) {
// refs are a set of possible package references currently unsatisified by imports. // refs are a set of possible package references currently unsatisfied by imports.
// first key: either base package (e.g. "fmt") or renamed package // first key: either base package (e.g. "fmt") or renamed package
// second key: referenced package symbol (e.g. "Println") // second key: referenced package symbol (e.g. "Println")
refs := make(map[string]map[string]bool) refs := make(map[string]map[string]bool)

View File

@ -24,7 +24,7 @@ import (
// Options specifies options for processing files. // Options specifies options for processing files.
type Options struct { type Options struct {
Fragment bool // Accept fragement of a source file (no package statement) Fragment bool // Accept fragment of a source file (no package statement)
AllErrors bool // Report all errors (not just the first 10 on different lines) AllErrors bool // Report all errors (not just the first 10 on different lines)
Comments bool // Print comments (true if nil *Options provided) Comments bool // Print comments (true if nil *Options provided)

View File

@ -153,7 +153,7 @@ func chanOps(instr ssa.Instruction) []chanOp {
type peersResult struct { type peersResult struct {
queryPos token.Pos // of queried '<-' token queryPos token.Pos // of queried '<-' token
queryType types.Type // type of queried channel queryType types.Type // type of queried channel
makes, sends, receives []token.Pos // positions of alisaed makechan/send/receive instrs makes, sends, receives []token.Pos // positions of aliased makechan/send/receive instrs
} }
func (r *peersResult) display(printf printfFunc) { func (r *peersResult) display(printf printfFunc) {

View File

@ -71,7 +71,7 @@ func (p byNamePos) Less(i, j int) bool { return p[i].NamePos < p[j].NamePos }
func (p byNamePos) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (p byNamePos) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
type referrersResult struct { type referrersResult struct {
query *ast.Ident // identifer of query query *ast.Ident // identifier of query
obj types.Object // object it denotes obj types.Object // object it denotes
refs []*ast.Ident // set of all other references to it refs []*ast.Ident // set of all other references to it
} }

View File

@ -303,7 +303,7 @@ func (tr *Transformer) subst(env map[string]ast.Expr, pattern, pos reflect.Value
return pattern return pattern
} }
// -- utilitiies ------------------------------------------------------- // -- utilities -------------------------------------------------------
func rvToExpr(rv reflect.Value) ast.Expr { func rvToExpr(rv reflect.Value) ast.Expr {
if rv.CanInterface() { if rv.CanInterface() {