summaryrefslogtreecommitdiff
path: root/src/pkg/exp/eval/compiler.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-05 14:41:56 -0800
committerRobert Griesemer <gri@golang.org>2009-11-05 14:41:56 -0800
commit217feb50e2fc8bac9a2b9ad2e195ec7bda364408 (patch)
tree203297f79d6f444aeb053b16aaebd0e2f35bd115 /src/pkg/exp/eval/compiler.go
parent5cd306c71e1a0dc79d64fd3ed60ad70d13059a20 (diff)
downloadgolang-217feb50e2fc8bac9a2b9ad2e195ec7bda364408.tar.gz
gofmt-ify eval
R=rsc http://go/go-review/1016054
Diffstat (limited to 'src/pkg/exp/eval/compiler.go')
-rw-r--r--src/pkg/exp/eval/compiler.go39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/pkg/exp/eval/compiler.go b/src/pkg/exp/eval/compiler.go
index f3c962c2b..9d57d7abe 100644
--- a/src/pkg/exp/eval/compiler.go
+++ b/src/pkg/exp/eval/compiler.go
@@ -22,9 +22,9 @@ type positioned interface {
// TODO(austin) This might actually represent package level, in which
// case it should be package compiler.
type compiler struct {
- errors scanner.ErrorHandler;
- numErrors int;
- silentErrors int;
+ errors scanner.ErrorHandler;
+ numErrors int;
+ silentErrors int;
}
func (a *compiler) diagAt(pos positioned, format string, args ...) {
@@ -43,55 +43,56 @@ func newUniverse() *Scope {
offset: 0,
scope: sc,
global: true,
- defs: make(map[string] Def)
+ defs: make(map[string]Def),
};
return sc;
}
-var universe *Scope = newUniverse();
+
+var universe *Scope = newUniverse()
// TODO(austin) These can all go in stmt.go now
type label struct {
- name string;
- desc string;
+ name string;
+ desc string;
// The PC goto statements should jump to, or nil if this label
// cannot be goto'd (such as an anonymous for loop label).
- gotoPC *uint;
+ gotoPC *uint;
// The PC break statements should jump to, or nil if a break
// statement is invalid.
- breakPC *uint;
+ breakPC *uint;
// The PC continue statements should jump to, or nil if a
// continue statement is invalid.
- continuePC *uint;
+ continuePC *uint;
// The position where this label was resolved. If it has not
// been resolved yet, an invalid position.
- resolved token.Position;
+ resolved token.Position;
// The position where this label was first jumped to.
- used token.Position;
+ used token.Position;
}
// A funcCompiler captures information used throughout the compilation
// of a single function body.
type funcCompiler struct {
*compiler;
- fnType *FuncType;
+ fnType *FuncType;
// Whether the out variables are named. This affects what
// kinds of return statements are legal.
- outVarsNamed bool;
+ outVarsNamed bool;
*codeBuf;
- flow *flowBuf;
- labels map[string] *label;
+ flow *flowBuf;
+ labels map[string]*label;
}
// A blockCompiler captures information used throughout the compilation
// of a single block within a function.
type blockCompiler struct {
*funcCompiler;
- block *block;
+ block *block;
// The label of this block, used for finding break and
// continue labels.
- label *label;
+ label *label;
// The blockCompiler for the block enclosing this one, or nil
// for a function-level block.
- parent *blockCompiler;
+ parent *blockCompiler;
}