]> Cypherpunks repositories - gostls13.git/commit
better handling of mistaken top-level variable
authorRuss Cox <rsc@golang.org>
Wed, 7 Oct 2009 21:55:12 +0000 (14:55 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 7 Oct 2009 21:55:12 +0000 (14:55 -0700)
commitd5150635885bb08c701176b996d0e2462e6fcb8f
tree0bc92db04f9ce77a95481c15bd0f644999245d17
parent4fd7a908bb5f904181cf7aaf3bcf6155c6ba5c8c
better handling of mistaken top-level variable
references during the parsing of :=.  the base
problem is that when reading

a,b,c,d

the parser makes those refer to existing variables,
which might create a few stub top-level ones
for undefined names, but then if a := is the next
token, we need to undo those stubs.

this was causing problems in multifile packages
in which one file used a := variable named rpc
and the other imported a package named rpc.

R=ken
OCL=35446
CL=35446
src/cmd/gc/dcl.c
src/cmd/gc/go.h
src/cmd/gc/go.y
src/cmd/gc/lex.c
src/cmd/gc/subr.c