From c1ba1a0fec4aed430709030f98a3bdb90bfeea16 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Thu, 28 Apr 2011 10:35:15 +0200 Subject: Imported Upstream version 2011.04.27 --- src/pkg/go/ast/ast.go | 4 ++-- src/pkg/go/ast/print.go | 2 +- src/pkg/go/doc/doc.go | 2 +- src/pkg/go/parser/parser.go | 8 ++++---- src/pkg/go/printer/printer.go | 2 +- src/pkg/go/scanner/scanner.go | 6 +++--- src/pkg/go/token/token.go | 5 ++--- src/pkg/go/types/gcimporter.go | 8 +++++++- src/pkg/go/types/types.go | 2 +- 9 files changed, 22 insertions(+), 17 deletions(-) (limited to 'src/pkg/go') diff --git a/src/pkg/go/ast/ast.go b/src/pkg/go/ast/ast.go index ed3e2cdd9..2fc1a6032 100644 --- a/src/pkg/go/ast/ast.go +++ b/src/pkg/go/ast/ast.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The AST package declares the types used to represent -// syntax trees for Go packages. +// Package ast declares the types used to represent syntax trees for Go +// packages. // package ast diff --git a/src/pkg/go/ast/print.go b/src/pkg/go/ast/print.go index e6d4e838d..81e1da1d0 100644 --- a/src/pkg/go/ast/print.go +++ b/src/pkg/go/ast/print.go @@ -62,7 +62,7 @@ func Fprint(w io.Writer, fset *token.FileSet, x interface{}, f FieldFilter) (n i p.printf("nil\n") return } - p.print(reflect.NewValue(x)) + p.print(reflect.ValueOf(x)) p.printf("\n") return diff --git a/src/pkg/go/doc/doc.go b/src/pkg/go/doc/doc.go index e7a8d3f63..29d205d39 100644 --- a/src/pkg/go/doc/doc.go +++ b/src/pkg/go/doc/doc.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The doc package extracts source code documentation from a Go AST. +// Package doc extracts source code documentation from a Go AST. package doc import ( diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go index 84a0da6ae..5c57e41d1 100644 --- a/src/pkg/go/parser/parser.go +++ b/src/pkg/go/parser/parser.go @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// A parser for Go source files. Input may be provided in a variety of -// forms (see the various Parse* functions); the output is an abstract -// syntax tree (AST) representing the Go source. The parser is invoked -// through one of the Parse* functions. +// Package parser implements a parser for Go source files. Input may be +// provided in a variety of forms (see the various Parse* functions); the +// output is an abstract syntax tree (AST) representing the Go source. The +// parser is invoked through one of the Parse* functions. // package parser diff --git a/src/pkg/go/printer/printer.go b/src/pkg/go/printer/printer.go index 697a83fa8..01ebf783c 100644 --- a/src/pkg/go/printer/printer.go +++ b/src/pkg/go/printer/printer.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The printer package implements printing of AST nodes. +// Package printer implements printing of AST nodes. package printer import ( diff --git a/src/pkg/go/scanner/scanner.go b/src/pkg/go/scanner/scanner.go index 2f949ad25..07b7454c8 100644 --- a/src/pkg/go/scanner/scanner.go +++ b/src/pkg/go/scanner/scanner.go @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// A scanner for Go source text. Takes a []byte as source which can -// then be tokenized through repeated calls to the Scan function. -// Typical use: +// Package scanner implements a scanner for Go source text. Takes a []byte as +// source which can then be tokenized through repeated calls to the Scan +// function. Typical use: // // var s Scanner // fset := token.NewFileSet() // position information is relative to fset diff --git a/src/pkg/go/token/token.go b/src/pkg/go/token/token.go index a5f21df16..c2ec80ae1 100644 --- a/src/pkg/go/token/token.go +++ b/src/pkg/go/token/token.go @@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This package defines constants representing the lexical -// tokens of the Go programming language and basic operations -// on tokens (printing, predicates). +// Package token defines constants representing the lexical tokens of the Go +// programming language and basic operations on tokens (printing, predicates). // package token diff --git a/src/pkg/go/types/gcimporter.go b/src/pkg/go/types/gcimporter.go index 9e0ae6285..30adc04e7 100644 --- a/src/pkg/go/types/gcimporter.go +++ b/src/pkg/go/types/gcimporter.go @@ -461,7 +461,13 @@ func (p *gcParser) parseFuncType() Type { // MethodSpec = identifier Signature . // func (p *gcParser) parseMethodSpec(scope *ast.Scope) { - p.expect(scanner.Ident) + if p.tok == scanner.Ident { + p.expect(scanner.Ident) + } else { + p.parsePkgId() + p.expect('.') + p.parseDotIdent() + } isVariadic := false p.parseSignature(scope, &isVariadic) } diff --git a/src/pkg/go/types/types.go b/src/pkg/go/types/types.go index 72384e121..2ee645d98 100644 --- a/src/pkg/go/types/types.go +++ b/src/pkg/go/types/types.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // PACKAGE UNDER CONSTRUCTION. ANY AND ALL PARTS MAY CHANGE. -// The types package declares the types used to represent Go types. +// Package types declares the types used to represent Go types. // package types -- cgit v1.2.3