]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: switch cannedimports to use a Biobuf
authorMatthew Dempsky <mdempsky@google.com>
Sat, 20 Feb 2016 02:36:02 +0000 (18:36 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Sat, 20 Feb 2016 04:37:50 +0000 (04:37 +0000)
Allows eliminating the separate lexer code paths for reading from cp
in the next CL.

Change-Id: I49098ecef32b735c4a01374443c2f847235ff964
Reviewed-on: https://go-review.googlesource.com/19750
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/lex.go

index 0bcfb3687d810778515f9ec9df19660ecfa02454..e506f7a117fd92df8ad87fe616a6f1fdb0946af5 100644 (file)
@@ -851,7 +851,7 @@ func importfile(f *Val) {
 func cannedimports(file string, cp string) {
        lexlineno++ // if sys.6 is included on line 1,
        pushedio = curio
-       curio = Io{infile: file, cp: cp}
+       curio = Io{infile: file, bin: obj.Binitr(strings.NewReader(cp))}
        typecheckok = true
        incannedimport = 1