diff options
author | Robert Griesemer <gri@golang.org> | 2008-08-04 13:27:05 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2008-08-04 13:27:05 -0700 |
commit | ff7425eed38ca596743dc6b9960c46c1e72b4ffa (patch) | |
tree | 4e796010a466ec03408108134502248561c3806d /usr/gri/gosrc/parser.go | |
parent | 68a8dc3c21ffd2d47d5796ba26d910f34713bba9 (diff) | |
download | golang-ff7425eed38ca596743dc6b9960c46c1e72b4ffa.tar.gz |
- import/export cleanup: added comments, removed dead code, re-org structure
R=r
OCL=13816
CL=13816
Diffstat (limited to 'usr/gri/gosrc/parser.go')
-rw-r--r-- | usr/gri/gosrc/parser.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr/gri/gosrc/parser.go b/usr/gri/gosrc/parser.go index 000856204..a19bd1473 100644 --- a/usr/gri/gosrc/parser.go +++ b/usr/gri/gosrc/parser.go @@ -1917,18 +1917,18 @@ func (P *Parser) ParseProgram() { P.OpenScope(); P.Expect(Scanner.PACKAGE); obj := P.ParseIdentDecl(Object.PACKAGE); - pkg := Globals.NewPackage(P.S.filename, obj); - P.comp.Insert(pkg); - if P.comp.pkg_ref != 1 { - panic "should have exactly one package now"; - } P.Optional(Scanner.SEMICOLON); { if P.level != 0 { panic "incorrect scope level"; } P.OpenScope(); - pkg.scope = P.top_scope; + + P.comp.Insert(Globals.NewPackage(P.S.filename, obj, P.top_scope)); + if P.comp.pkg_ref != 1 { + panic "should have exactly one package now"; + } + for P.tok == Scanner.IMPORT { P.ParseDecl(false, Scanner.IMPORT); P.Optional(Scanner.SEMICOLON); |