diff options
author | Austin Clements <aclements@csail.mit.edu> | 2009-08-28 18:25:56 -0700 |
---|---|---|
committer | Austin Clements <aclements@csail.mit.edu> | 2009-08-28 18:25:56 -0700 |
commit | 361f52bd34a70cd930274f38ecbe1765d1f7b103 (patch) | |
tree | 4a26c09a52d385d50bb08ecc9f13a8ff592f0bd2 /usr/austin/eval/compiler.go | |
parent | 6ebaf63bacd95a6a3418fa9aacab2d63495d4b83 (diff) | |
download | golang-361f52bd34a70cd930274f38ecbe1765d1f7b103.tar.gz |
Split decls.go up, taking advantage of whole-package
compilation to put the definitions in reasonable places. No
code changes, just movement.
R=rsc
APPROVED=rsc
DELTA=479 (232 added, 247 deleted, 0 changed)
OCL=34067
CL=34069
Diffstat (limited to 'usr/austin/eval/compiler.go')
-rw-r--r-- | usr/austin/eval/compiler.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/usr/austin/eval/compiler.go b/usr/austin/eval/compiler.go index 676bff31e..f4ababf74 100644 --- a/usr/austin/eval/compiler.go +++ b/usr/austin/eval/compiler.go @@ -37,6 +37,17 @@ func (a *compiler) numError() int { return a.numErrors + a.silentErrors; } +// The universal scope +func newUniverse() *Scope { + sc := &Scope{nil, 0}; + sc.block = &block{ + scope: sc, + defs: make(map[string] Def) + }; + return sc; +} +var universe *Scope = newUniverse(); + // TODO(austin) These can all go in stmt.go now type label struct { |