summaryrefslogtreecommitdiff
path: root/src/pkg/go/parser/parser.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-06-29 15:24:23 -0700
committerRuss Cox <rsc@golang.org>2009-06-29 15:24:23 -0700
commit755e009ad2a874373454d488f9ea46648a8a9547 (patch)
treeed3d700304a76b08cdca0f356605077c58ee0f76 /src/pkg/go/parser/parser.go
parent24323437280c7f0a166b7f2fae75620470cde0f9 (diff)
downloadgolang-755e009ad2a874373454d488f9ea46648a8a9547.tar.gz
io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
Diffstat (limited to 'src/pkg/go/parser/parser.go')
-rw-r--r--src/pkg/go/parser/parser.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go
index aabd2248b..b8bb3b85a 100644
--- a/src/pkg/go/parser/parser.go
+++ b/src/pkg/go/parser/parser.go
@@ -10,6 +10,7 @@
package parser
import (
+ "bytes";
"container/vector";
"fmt";
"go/ast";
@@ -17,6 +18,7 @@ import (
"go/token";
"io";
"os";
+ "strings";
)
@@ -1964,16 +1966,16 @@ func readSource(src interface{}) ([]byte, os.Error) {
if src != nil {
switch s := src.(type) {
case string:
- return io.StringBytes(s), nil;
+ return strings.Bytes(s), nil;
case []byte:
return s, nil;
- case *io.ByteBuffer:
- // is io.Read, but src is already available in []byte form
+ case *bytes.Buffer:
+ // is io.Reader, but src is already available in []byte form
if s != nil {
return s.Data(), nil;
}
case io.Reader:
- var buf io.ByteBuffer;
+ var buf bytes.Buffer;
n, err := io.Copy(s, &buf);
if err != nil {
return nil, err;
@@ -1997,7 +1999,7 @@ func scannerMode(mode uint) uint {
// Parse parses a Go program.
//
// The program source src may be provided in a variety of formats. At the
-// moment the following types are supported: string, []byte, and io.Read.
+// moment the following types are supported: string, []byte, and io.Reader.
// The mode parameter controls the amount of source text parsed and other
// optional parser functionality.
//