diff options
author | Robert Griesemer <gri@golang.org> | 2009-12-15 15:27:16 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-12-15 15:27:16 -0800 |
commit | 881d6064d23d9da5c7ff368bc7d41d271290deff (patch) | |
tree | 44d5d948e3f27cc7eff15ec8cd7ee5165d9a7e90 /src/pkg/exp/eval/func.go | |
parent | d9dfea3ebd51cea89fef8afc6b2377c2958b24f1 (diff) | |
download | golang-881d6064d23d9da5c7ff368bc7d41d271290deff.tar.gz |
1) Change default gofmt default settings for
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
2nd set of files.
R=rsc
CC=golang-dev
http://codereview.appspot.com/179067
Diffstat (limited to 'src/pkg/exp/eval/func.go')
-rw-r--r-- | src/pkg/exp/eval/func.go | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/pkg/exp/eval/func.go b/src/pkg/exp/eval/func.go index 992706641..e672d0783 100644 --- a/src/pkg/exp/eval/func.go +++ b/src/pkg/exp/eval/func.go @@ -11,25 +11,25 @@ import "os" */ type Thread struct { - abort chan os.Error; - pc uint; + abort chan os.Error + pc uint // The execution frame of this function. This remains the // same throughout a function invocation. - f *Frame; + f *Frame } type code []func(*Thread) func (i code) exec(t *Thread) { - opc := t.pc; - t.pc = 0; - l := uint(len(i)); + opc := t.pc + t.pc = 0 + l := uint(len(i)) for t.pc < l { - pc := t.pc; - t.pc++; - i[pc](t); + pc := t.pc + t.pc++ + i[pc](t) } - t.pc = opc; + t.pc = opc } /* @@ -37,33 +37,33 @@ func (i code) exec(t *Thread) { */ type codeBuf struct { - instrs code; + instrs code } -func newCodeBuf() *codeBuf { return &codeBuf{make(code, 0, 16)} } +func newCodeBuf() *codeBuf { return &codeBuf{make(code, 0, 16)} } func (b *codeBuf) push(instr func(*Thread)) { - n := len(b.instrs); + n := len(b.instrs) if n >= cap(b.instrs) { - a := make(code, n, n*2); + a := make(code, n, n*2) for i := range b.instrs { a[i] = b.instrs[i] } - b.instrs = a; + b.instrs = a } - b.instrs = b.instrs[0 : n+1]; - b.instrs[n] = instr; + b.instrs = b.instrs[0 : n+1] + b.instrs[n] = instr } -func (b *codeBuf) nextPC() uint { return uint(len(b.instrs)) } +func (b *codeBuf) nextPC() uint { return uint(len(b.instrs)) } func (b *codeBuf) get() code { // Freeze this buffer into an array of exactly the right size - a := make(code, len(b.instrs)); + a := make(code, len(b.instrs)) for i := range b.instrs { a[i] = b.instrs[i] } - return code(a); + return code(a) } /* @@ -71,11 +71,11 @@ func (b *codeBuf) get() code { */ type evalFunc struct { - outer *Frame; - frameSize int; - code code; + outer *Frame + frameSize int + code code } -func (f *evalFunc) NewFrame() *Frame { return f.outer.child(f.frameSize) } +func (f *evalFunc) NewFrame() *Frame { return f.outer.child(f.frameSize) } -func (f *evalFunc) Call(t *Thread) { f.code.exec(t) } +func (f *evalFunc) Call(t *Thread) { f.code.exec(t) } |