Commits

Anonymous committed 5f2608a

make test/ken safe for optional semis

R=rsc, ken2, ken3
http://codereview.appspot.com/174042

Comments (0)

Files changed (32)

test/ken/array.go

 package	main
 
 func
-setpd(a []int)
-{
+setpd(a []int) {
 //	print("setpd a=", a, " len=", len(a), " cap=", cap(a), "\n");
 	for i:=0; i<len(a); i++ {
 		a[i] = i;
 }
 
 func
-sumpd(a []int) int
-{
+sumpd(a []int) int {
 //	print("sumpd a=", a, " len=", len(a), " cap=", cap(a), "\n");
 	t := 0;
 	for i:=0; i<len(a); i++ {
 }
 
 func
-setpf(a *[20]int)
-{
+setpf(a *[20]int) {
 //	print("setpf a=", a, " len=", len(a), " cap=", cap(a), "\n");
 	for i:=0; i<len(a); i++ {
 		a[i] = i;
 }
 
 func
-sumpf(a *[20]int) int
-{
+sumpf(a *[20]int) int {
 //	print("sumpf a=", a, " len=", len(a), " cap=", cap(a), "\n");
 	t := 0;
 	for i:=0; i<len(a); i++ {
 }
 
 func
-res(t int, lb, hb int)
-{
+res(t int, lb, hb int) {
 	sb := (hb-lb)*(hb+lb-1)/2;
 	if t != sb {
 		print(	"lb=", lb,
 
 // call ptr dynamic with ptr dynamic
 func
-testpdpd()
-{
+testpdpd() {
 	a := make([]int, 10, 100);
 	if len(a) != 10 && cap(a) != 100 {
 		panic("len and cap from new: ", len(a), " ", cap(a), "\n");
 
 // call ptr fixed with ptr fixed
 func
-testpfpf()
-{
+testpfpf() {
 	var a [20]int;
 
 	setpf(&a);
 
 // call ptr dynamic with ptr fixed from new
 func
-testpdpf1()
-{
+testpdpf1() {
 	a := new([40]int);
 	setpd(a);
 	res(sumpd(a), 0, 40);
 
 // call ptr dynamic with ptr fixed from var
 func
-testpdpf2()
-{
+testpdpf2() {
 	var a [80]int;
 
 	setpd(&a);
 
 // generate bounds error with ptr dynamic
 func
-testpdfault()
-{
+testpdfault() {
 	a := make([]int, 100);
 
 	print("good\n");
 
 // generate bounds error with ptr fixed
 func
-testfdfault()
-{
+testfdfault() {
 	var a [80]int;
 
 	print("good\n");
 }
 
 func
-main()
-{
+main() {
 	testpdpd();
 	testpfpf();
 	testpdpf1();
 var	randx	int;
 
 func
-nrand(n int) int
-{
+nrand(n int) int {
 	randx += 10007;
 	if randx >= 1000000 {
 		randx -= 1000000;
 	return randx%n;
 }
 
-type	Chan
-struct
-{
+type	Chan struct {
 	sc,rc	chan int;	// send and recv chan
 	sv,rv	int;		// send and recv seq
 }
 )
 
 func
-init()
-{
+init() {
 	nc = new(Chan);
 }
 
 func
-mkchan(c,n int) []*Chan
-{
+mkchan(c,n int) []*Chan {
 	ca := make([]*Chan, n);
 	for i:=0; i<n; i++ {
 		cval = cval+100;
 }
 
 func
-expect(v, v0 int) (newv int)
-{
+expect(v, v0 int) (newv int) {
 	if v == v0 {
 		if v%100 == 75 {
 			return end;
 	panic("got ", v, " expected ", v0+1, "\n");
 }
 
-func (c *Chan)
-send() bool
-{
+func (c *Chan) send() bool {
 //	print("send ", c.sv, "\n");
 	tots++;
 	c.sv = expect(c.sv, c.sv);
 }
 
 func
-send(c *Chan)
-{
+send(c *Chan) {
 	nproc++;	// total goroutines running
 	for {
 		for r:=nrand(10); r>=0; r-- {
 	nproc--;
 }
 
-func (c *Chan)
-recv(v int) bool
-{
+func (c *Chan) recv(v int) bool {
 //	print("recv ", v, "\n");
 	totr++;
 	c.rv = expect(c.rv, v);
 }
 
 func
-recv(c *Chan)
-{
+recv(c *Chan) {
 	var v int;
 
 	nproc++;	// total goroutines running
 }
 
 func
-sel(r0,r1,r2,r3, s0,s1,s2,s3 *Chan)
-{
+sel(r0,r1,r2,r3, s0,s1,s2,s3 *Chan) {
 	var v int;
 
 	nproc++;	// total goroutines running
 
 // direct send to direct recv
 func
-test1(c *Chan)
-{
+test1(c *Chan) {
 	go send(c);
 	go recv(c);
 }
 
 // direct send to select recv
 func
-test2(c int)
-{
+test2(c int) {
 	ca := mkchan(c,4);
 
 	go send(ca[0]);
 
 // select send to direct recv
 func
-test3(c int)
-{
+test3(c int) {
 	ca := mkchan(c,4);
 
 	go recv(ca[0]);
 
 // select send to select recv
 func
-test4(c int)
-{
+test4(c int) {
 	ca := mkchan(c,4);
 
 	go sel(nc,nc,nc,nc, ca[0],ca[1],ca[2],ca[3]);
 }
 
 func
-test5(c int)
-{
+test5(c int) {
 	ca := mkchan(c,8);
 
 	go sel(ca[4],ca[5],ca[6],ca[7], ca[0],ca[1],ca[2],ca[3]);
 }
 
 func
-test6(c int)
-{
+test6(c int) {
 	ca := mkchan(c,12);
 
 	go send(ca[4]);
 
 // wait for outstanding tests to finish
 func
-wait()
-{
+wait() {
 	runtime.Gosched();
 	for nproc != 0 {
 		runtime.Gosched();
 
 // run all tests with specified buffer size
 func
-tests(c int)
-{
+tests(c int) {
 	ca := mkchan(c,4);
 	test1(ca[0]);
 	test1(ca[1]);
 
 // run all test with 4 buffser sizes
 func
-main()
-{
+main() {
 
 	tests(0);
 	tests(1);
 	tests(10);
 	tests(100);
 
-	t :=	4			// buffer sizes
-		* (	4*4		// tests 1,2,3,4 channels
-			+ 8		// test 5 channels
-			+ 12		// test 6 channels
-		) * 76;			// sends/recvs on a channel
+	t :=	4 *			// buffer sizes
+		(	4*4 +		// tests 1,2,3,4 channels
+			8 +		// test 5 channels
+			12 ) *		// test 6 channels
+		76;			// sends/recvs on a channel
 
 	if tots != t || totr != t {
 		print("tots=", tots, " totr=", totr, " sb=", t, "\n");

test/ken/chan1.go

 var	h	[N]int;		// marking of send/recv
 
 func
-r(c chan int, m int)
-{
+r(c chan int, m int) {
 	for {
 		select {
 		case r := <- c:
 				panicln("r",
 					"m=", m,
 					"r=", r,
-					"h=", h[r]
+					"h=", h[r],
 				);
 			}
 			h[r] = 2;
 }
 
 func
-s(c chan int)
-{
+s(c chan int) {
 	for n:=0; n<N; n++ {
 		r := n;
 		if h[r] != 0 {
 }
 
 func
-main()
-{
+main() {
 	c := make(chan int, W);
 	for m:=0; m<M; m++ {
 		go r(c, m);

test/ken/complit.go

 type	SM	struct{ a,b,c M };
 
 func
-main()
-{
+main() {
 	test("s.a", s.a);
 	test("s.b", s.b);
 	test("s.c", s.c);
 var	ref	= 0;
 
 func
-test(xs string, x int)
-{
+test(xs string, x int) {
 
 	if ref >= len(answers) {
 		println(xs, x);
 var	mc	= map[int][]int{0:[]int{5201,5202,5203}, 1:[]int{5204,5205,5206}, 2:[]int{5207,5208,5209}}
 var	mm	= map[int]M{0:M{0:5301,1:5302,2:5303}, 1:M{0:5304,1:5305,2:5306}, 2:M{0:5307,1:5308,2:5309}}
 
-var	answers	= [...]int
-{
+var	answers	= [...]int {
 	// s
 	1101, 1102, 1103,
 

test/ken/divconst.go

 const	Count	= 1e5
 
 func
-i64rand() int64
-{
+i64rand() int64 {
 	for {
 		a := int64(rand.Uint32());
 		a = (a<<32) | int64(rand.Uint32());
 }
 
 func
-i64test(a,b,c int64)
-{
+i64test(a,b,c int64) {
 	d := a/c;
 	if d != b {
 		panicln("i64", a, b, c, d);
 }
 
 func
-i64run()
-{
+i64run() {
 	var a, b int64;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u64rand() uint64
-{
+u64rand() uint64 {
 	a := uint64(rand.Uint32());
 	a = (a<<32) | uint64(rand.Uint32());
 	a >>= uint(rand.Intn(64));
 }
 
 func
-u64test(a,b,c uint64)
-{
+u64test(a,b,c uint64) {
 	d := a/c;
 	if d != b {
 		panicln("u64", a, b, c, d);
 }
 
 func
-u64run()
-{
+u64run() {
 	var a, b uint64;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-i32rand() int32
-{
+i32rand() int32 {
 	for {
 		a := int32(rand.Uint32());
 		a >>= uint(rand.Intn(32));
 }
 
 func
-i32test(a,b,c int32)
-{
+i32test(a,b,c int32) {
 	d := a/c;
 	if d != b {
 		panicln("i32", a, b, c, d);
 }
 
 func
-i32run()
-{
+i32run() {
 	var a, b int32;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u32rand() uint32
-{
+u32rand() uint32 {
 	a := uint32(rand.Uint32());
 	a >>= uint(rand.Intn(32));
 	return a;
 }
 
 func
-u32test(a,b,c uint32)
-{
+u32test(a,b,c uint32) {
 	d := a/c;
 	if d != b {
 		panicln("u32", a, b, c, d);
 }
 
 func
-u32run()
-{
+u32run() {
 	var a, b uint32;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-i16rand() int16
-{
+i16rand() int16 {
 	for {
 		a := int16(rand.Uint32());
 		a >>= uint(rand.Intn(16));
 }
 
 func
-i16test(a,b,c int16)
-{
+i16test(a,b,c int16) {
 	d := a/c;
 	if d != b {
 		panicln("i16", a, b, c, d);
 }
 
 func
-i16run()
-{
+i16run() {
 	var a, b int16;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u16rand() uint16
-{
+u16rand() uint16 {
 	a := uint16(rand.Uint32());
 	a >>= uint(rand.Intn(16));
 	return a;
 }
 
 func
-u16test(a,b,c uint16)
-{
+u16test(a,b,c uint16) {
 	d := a/c;
 	if d != b {
 		panicln("u16", a, b, c, d);
 }
 
 func
-u16run()
-{
+u16run() {
 	var a, b uint16;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-i8rand() int8
-{
+i8rand() int8 {
 	for {
 		a := int8(rand.Uint32());
 		a >>= uint(rand.Intn(8));
 }
 
 func
-i8test(a,b,c int8)
-{
+i8test(a,b,c int8) {
 	d := a/c;
 	if d != b {
 		panicln("i8", a, b, c, d);
 }
 
 func
-i8run()
-{
+i8run() {
 	var a, b int8;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u8rand() uint8
-{
+u8rand() uint8 {
 	a := uint8(rand.Uint32());
 	a >>= uint(rand.Intn(8));
 	return a;
 }
 
 func
-u8test(a,b,c uint8)
-{
+u8test(a,b,c uint8) {
 	d := a/c;
 	if d != b {
 		panicln("u8", a, b, c, d);
 }
 
 func
-u8run()
-{
+u8run() {
 	var a, b uint8;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-main()
-{
+main() {
 	xtest();
 	i64run();
 	u64run();
 }
 
 func
-xtest()
-{
+xtest() {
 }

test/ken/divmod.go

 )
 
 func
-main()
-{
+main() {
 	/* ideals */
 	if n1/d1 != q1 || n1%d1 != r1 {
 		panicln("ideal-1", n1, d1, n1/d1, n1%d1);

test/ken/embed.go

 
 
 type
-I	interface
-{
+I	interface {
 	test1() int;
 	test2() int;
 	test3() int;
  ******/
 
 type
-SubpSubp	struct
-{
+SubpSubp	struct {
 	a7	int;
 	a	int;
 }
-func (p *SubpSubp)
-test7() int
-{
+func (p *SubpSubp) test7() int {
 	if p.a != p.a7 { panicln("SubpSubp", p, p.a7) }
 	return p.a
 }
-func (p *SubpSubp)
-testx()
-{
+func (p *SubpSubp) testx() {
 	println("SubpSubp", p, p.a7);
 }
 
  ******/
 
 type
-SubpSub	struct
-{
+SubpSub	struct {
 	a6	int;
 		SubpSubp;
 	a	int;
 }
-func (p *SubpSub)
-test6() int
-{
+func (p *SubpSub) test6() int {
 	if p.a != p.a6 { panicln("SubpSub", p, p.a6) }
 	return p.a
 }
-func (p *SubpSub)
-testx()
-{
+func (p *SubpSub) testx() {
 	println("SubpSub", p, p.a6);
 }
 
  ******/
 
 type
-SubSubp	struct
-{
+SubSubp	struct {
 	a5	int;
 	a	int;
 }
-func (p *SubSubp)
-test5() int
-{
+func (p *SubSubp) test5() int {
 	if p.a != p.a5 { panicln("SubpSub", p, p.a5) }
 	return p.a
 }
  ******/
 
 type
-SubSub	struct
-{
+SubSub	struct {
 	a4	int;
 	a	int;
 }
-func (p *SubSub)
-test4() int
-{
+func (p *SubSub) test4() int {
 	if p.a != p.a4 { panicln("SubpSub", p, p.a4) }
 	return p.a
 }
  ******/
 
 type
-Subp	struct
-{
+Subp	struct {
 	a3	int;
 		*SubpSubp;
 		SubpSub;
 	a	int;
 }
-func (p *Subp)
-test3() int
-{
+func (p *Subp) test3() int {
 	if p.a != p.a3 { panicln("SubpSub", p, p.a3) }
 	return p.a
 }
 		SubSub;
 	a	int;
 }
-func (p *Sub)
-test2() int
-{
+func (p *Sub) test2() int {
 	if p.a != p.a2 { panicln("SubpSub", p, p.a2) }
 	return p.a
 }
  ******/
 
 type
-S	struct
-{
+S	struct {
 	a1	int;
 		Sub;
 		*Subp;
 	a	int;
 }
-func (p *S)
-test1() int
-{
+func (p *S) test1() int {
 	if p.a != p.a1 { panicln("SubpSub", p, p.a1) }
 	return p.a
 }
  ******/
 
 func
-main()
-{
+main() {
 	var i I;
 	var s *S;
 
 package main
 
 func
-main()
-{
+main() {
 	var t,i int;
 
 	for i=0; i<100; i=i+1 {

test/ken/interbasic.go

 type	I0		interface {};
 
 func
-f()
-{
+f() {
 	var ia, ib I0;
 	var i myint;
 	var s mystring;
 }
 
 func
-main()
-{
+main() {
 	var ia [20]I0;
 	var b bool;
 	var s string;

test/ken/interfun.go

 
 package main
 
-type S struct
-{
+type S struct {
 	a,b	int;
 }
 
-type I1 interface
-{
+type I1 interface {
 	f	()int;
 }
 
-type I2 interface
-{
+type I2 interface {
 	g() int;
 	f() int;
 }
 
-func
-(this *S) f()int
-{
+func (this *S) f()int {
 	return this.a;
 }
 
-func
-(this *S) g()int
-{
+func (this *S) g()int {
 	return this.b;
 }
 
 func
-main()
-{
+main() {
 	var i1 I1;
 	var i2 I2;
 	var g *S;

test/ken/intervar.go

 
 package main
 
-type	Iputs	interface
-{
+type	Iputs	interface {
 	puts	(s string);
 }
 
 // ---------
 
-type	Print	struct
-{
+type	Print	struct {
 	whoami	int;
 	put	Iputs;
 }
 
-func (p *Print)
-dop()
-{
+func (p *Print) dop() {
 	print(" print ", p.whoami);
 	p.put.puts("abc");
 }
 
 // ---------
 
-type	Bio	struct
-{
+type	Bio	struct {
 	whoami	int;
 	put	Iputs;
 }
 
-func (b *Bio)
-puts(s string)
-{
+func (b *Bio) puts(s string) {
 	print(" bio ", b.whoami);
 	b.put.puts(s);
 }
 
 // ---------
 
-type	File	struct
-{
+type	File	struct {
 	whoami	int;
 	put	Iputs;
 }
 
-func (f *File)
-puts(s string)
-{
+func (f *File) puts(s string) {
 	print(" file ", f.whoami, " -- ", s);
 }
 
 func
-main()
-{
+main() {
 	p := new(Print);
 	b := new(Bio);
 	f := new(File);

test/ken/label.go

 package main
 
 func
-main()
-{
+main() {
 	i := 0;
 	if false {
 		goto gogoloop;

test/ken/litfun.go

 package main
 
 func
-main()
-{
+main() {
 	x := func(a int)int {
 		x := func(a int)int {
 			x := func(a int)int {

test/ken/mfunc.go

 package main
 
 func
-main()
-{
+main() {
 	var x,y int;
 
 	x,y = simple(10,20,30);
 }
 
 func
-simple(ia,ib,ic int) (oa,ob int)
-{
+simple(ia,ib,ic int) (oa,ob int) {
 	return ia+5, ib+ic;
 }

test/ken/modconst.go

 const	Count	= 1e5
 
 func
-i64rand() int64
-{
+i64rand() int64 {
 	for {
 		a := int64(rand.Uint32());
 		a = (a<<32) | int64(rand.Uint32());
 }
 
 func
-i64test(a,b,c int64)
-{
+i64test(a,b,c int64) {
 	d := a%c;
 	if d != b {
 		panicln("i64", a, b, c, d);
 }
 
 func
-i64run()
-{
+i64run() {
 	var a, b int64;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u64rand() uint64
-{
+u64rand() uint64 {
 	a := uint64(rand.Uint32());
 	a = (a<<32) | uint64(rand.Uint32());
 	a >>= uint(rand.Intn(64));
 }
 
 func
-u64test(a,b,c uint64)
-{
+u64test(a,b,c uint64) {
 	d := a%c;
 	if d != b {
 		panicln("u64", a, b, c, d);
 }
 
 func
-u64run()
-{
+u64run() {
 	var a, b uint64;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-i32rand() int32
-{
+i32rand() int32 {
 	for {
 		a := int32(rand.Uint32());
 		a >>= uint(rand.Intn(32));
 }
 
 func
-i32test(a,b,c int32)
-{
+i32test(a,b,c int32) {
 	d := a%c;
 	if d != b {
 		panicln("i32", a, b, c, d);
 }
 
 func
-i32run()
-{
+i32run() {
 	var a, b int32;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u32rand() uint32
-{
+u32rand() uint32 {
 	a := uint32(rand.Uint32());
 	a >>= uint(rand.Intn(32));
 	return a;
 }
 
 func
-u32test(a,b,c uint32)
-{
+u32test(a,b,c uint32) {
 	d := a%c;
 	if d != b {
 		panicln("u32", a, b, c, d);
 }
 
 func
-u32run()
-{
+u32run() {
 	var a, b uint32;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-i16rand() int16
-{
+i16rand() int16 {
 	for {
 		a := int16(rand.Uint32());
 		a >>= uint(rand.Intn(16));
 }
 
 func
-i16test(a,b,c int16)
-{
+i16test(a,b,c int16) {
 	d := a%c;
 	if d != b {
 		panicln("i16", a, b, c, d);
 }
 
 func
-i16run()
-{
+i16run() {
 	var a, b int16;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u16rand() uint16
-{
+u16rand() uint16 {
 	a := uint16(rand.Uint32());
 	a >>= uint(rand.Intn(16));
 	return a;
 }
 
 func
-u16test(a,b,c uint16)
-{
+u16test(a,b,c uint16) {
 	d := a%c;
 	if d != b {
 		panicln("u16", a, b, c, d);
 }
 
 func
-u16run()
-{
+u16run() {
 	var a, b uint16;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-i8rand() int8
-{
+i8rand() int8 {
 	for {
 		a := int8(rand.Uint32());
 		a >>= uint(rand.Intn(8));
 }
 
 func
-i8test(a,b,c int8)
-{
+i8test(a,b,c int8) {
 	d := a%c;
 	if d != b {
 		panicln("i8", a, b, c, d);
 }
 
 func
-i8run()
-{
+i8run() {
 	var a, b int8;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-u8rand() uint8
-{
+u8rand() uint8 {
 	a := uint8(rand.Uint32());
 	a >>= uint(rand.Intn(8));
 	return a;
 }
 
 func
-u8test(a,b,c uint8)
-{
+u8test(a,b,c uint8) {
 	d := a%c;
 	if d != b {
 		panicln("u8", a, b, c, d);
 }
 
 func
-u8run()
-{
+u8run() {
 	var a, b uint8;
 
 	for i:=0; i<Count; i++ {
 }
 
 func
-main()
-{
+main() {
 	xtest();
 	i64run();
 	u64run();
 }
 
 func
-xtest()
-{
+xtest() {
 }

test/ken/ptrfun.go

 
 package main
 
-type C struct
-{
+type C struct {
 	a	int;
 	x	func(p *C)int;
 }
 
-func
-(this *C) f()int
-{
+func (this *C) f()int {
 	return this.a;
 }
 
 func
-main()
-{
+main() {
 	var v int;
 	var c *C;
 
 	if v != 6 { panic(v); }
 }
 
-func
-g(p *C)int
-{
+func g(p *C)int {
 	var v int;
 
 	v = p.a;

test/ken/ptrvar.go

 var	g2	struct { a,b,c int; d x2; };
 
 func
-main()
-{
+main() {
 	var x int;
 	var s1 *x2;
 	var s2 *struct { a,b,c int; d x2; };

test/ken/range.go

 var	m	map[int]byte;
 
 func
-f(k int) byte
-{
+f(k int) byte {
 	return byte(k*10007 % size);
 }
 
 func
-init()
-{
+init() {
 	p = make([]byte, size);
 	m = make(map[int]byte);
 	for k:=0; k<size; k++ {
 }
 
 func
-main()
-{
+main() {
 	var i int;
 
 	/*
 
 package main
 
-type Item interface
-{
+type Item interface {
 	Print();
 }
 
-type ListItem struct
-{
+type ListItem struct {
 	item    Item;
 	next    *ListItem;
 }
 
-type List struct
-{
+type List struct {
 	head    *ListItem;
 }
 
-func (list *List)
-Init()
-{
+func (list *List) Init() {
 	list.head = nil;
 }
 
-func (list *List)
-Insert(i Item)
-{
+func (list *List) Insert(i Item) {
 	item := new(ListItem);
 	item.item = i;
 	item.next = list.head;
 	list.head = item;
 }
 
-func (list *List)
-Print()
-{
+func (list *List) Print() {
 	i := list.head;
 	for i != nil {
 		i.item.Print();
 }
 
 // Something to put in a list
-type Integer struct
-{
+type Integer struct {
 	val		int;
 }
 
-func (this *Integer)
-Init(i int) *Integer
-{
+func (this *Integer) Init(i int) *Integer {
 	this.val = i;
 	return this;
 }
 
-func (this *Integer)
-Print()
-{
+func (this *Integer) Print() {
 	print(this.val);
 }
 
 func
-main()
-{
+main() {
 	list := new(List);
 	list.Init();
 	for i := 0; i < 10; i = i + 1 {
 
 const EOF int = -1;
 
-func main()
-{
+func main() {
 	var list *Slist;
 
 	OpenFile();
 	}
 }
 
-func (slist *Slist) PrintOne(doparen bool)
-{
+func (slist *Slist) PrintOne(doparen bool) {
 	if slist == nil {
 		return;
 	}
 	}
 }
 
-func (slist *Slist) Print()
-{
+func (slist *Slist) Print() {
 	slist.PrintOne(true);
 	print("\n");
 }
 
-func Get() int
-{
+func Get() int {
 	var c int;
 
 	if peekc >= 0 {
 	return c;
 }
 
-func WhiteSpace(c int) bool
-{
+func WhiteSpace(c int) bool {
 	return c == ' ' || c == '\t' || c == '\r' || c == '\n';
 }
 
-func NextToken()
-{
+func NextToken() {
 	var i, c int;
 
 	tokenbuf[0] = nilchar;	// clear previous token
 	}
 }
 
-func Expect(c int)
-{
+func Expect(c int) {
 	if token != c {
 		print("parse error: expected ", c, "\n");
 		panic("parse");
 }
 
 // Parse a non-parenthesized list up to a closing paren or EOF
-func ParseList() *Slist
-{
+func ParseList() *Slist {
 	var slist, retval *Slist;
 
 	slist = new(Slist);
 	return retval;
 }
 
-func atom(i int) *Slist	// BUG: uses tokenbuf; should take argument
-{
+func atom(i int) *Slist	{ // BUG: uses tokenbuf; should take argument)
 	var slist *Slist;
 
 	slist = new(Slist);
 	return slist;
 }
 
-func atoi() int	// BUG: uses tokenbuf; should take argument
-{
+func atoi() int	{ // BUG: uses tokenbuf; should take argument)
 	var v int = 0;
 	for i := 0; i < tokenlen && '0' <= tokenbuf[i] && tokenbuf[i] <= '9'; i = i + 1 {
 		v = 10 * v + int(tokenbuf[i] - '0');
 	return v;
 }
 
-func Parse() *Slist
-{
+func Parse() *Slist {
 	var slist *Slist;
 
 	if token == EOF || token == ')' {
 	return nil;
 }
 
-func OpenFile()
-{
+func OpenFile() {
 	input = "(defn foo (add 12 34))\n\x00";
 	inputindex = 0;
 	peekc = -1;		// BUG

test/ken/shift.go

 var	pass	string;
 
 func
-testi(i int, t1,t2,t3 int)
-{
+testi(i int, t1,t2,t3 int) {
 	n := ((t1*3) + t2)*2 + t3;
 	if i != ians[n] {
 		print("itest ", t1,t2,t3,pass,
 }
 
 func
-index(t1,t2,t3 int) int
-{
+index(t1,t2,t3 int) int {
 	return ((t1*3) + t2)*2 + t3;
 }
 
 func
-testu(u uint, t1,t2,t3 int)
-{
+testu(u uint, t1,t2,t3 int) {
 	n := index(t1,t2,t3);
 	if u != uans[n] {
 		print("utest ", t1,t2,t3,pass,
 }
 
 func
-main()
-{
+main() {
 	var i int;
 	var u,c uint;
 
 }
 
 func
-init()
-{
+init() {
 	/*
 	 * set the 'correct' answer
 	 */

test/ken/simparray.go

 var b[10] float32;
 
 func
-main()
-{
+main() {
 	var a[10] float32;
 
 	for i:=int16(5); i<10; i=i+1 {

test/ken/simpbool.go

 
 package main
 
-type s struct
-{
+type s struct {
 	a	bool;
 	b	bool;
 }
 
 func
-main()
-{
+main() {
 	var a,b bool;
 
 	a = true;

test/ken/simpconv.go

 type short int16;
 
 func
-main()
-{
+main() {
 	s1 := vlong(0);
 	for i:=short(0); i<10; i=i+1 {
 		s1 = s1 + vlong(i);

test/ken/simpfun.go

 package main
 
 func
-main()
-{
+main() {
 	var x int;
 
 	x = fun(10,20,30);
 }
 
 func
-fun(ia,ib,ic int)int
-{
+fun(ia,ib,ic int)int {
 	var o int;
 
 	o = ia+ib+ic;

test/ken/simpprint.go

 package main
 
 func
-main()
-{
+main() {
 	print("hello world\n");
 }

test/ken/simpswitch.go

 package main
 
 func
-main()
-{
+main() {
 	a := 3;
 	for i:=0; i<10; i=i+1 {
 		switch(i) {

test/ken/simpvar.go

 var	x,y	int;
 
 func
-main()
-{
+main() {
 
 	x = 15;
 	y = 20;

test/ken/slicearray.go

 var	t	int
 
 func
-main()
-{
+main() {
 	lb = 0; hb = 10;
 	by = &bx; tstb();
 
 }
 
 func
-tstb()
-{
+tstb() {
 	t++;
 	if len(by) != hb-lb {
 		panicln("t=", t, "lb=", lb, "hb=", hb,
 }
 
 func
-tstf()
-{
+tstf() {
 	t++;
 	if len(fy) != hb-lb {
 		panicln("t=", t, "lb=", lb, "hb=", hb,
 }
 
 func
-init()
-{
+init() {
 	for i:=0; i<len(bx); i++ {
 		bx[i] = byte(i+20);
 	}

test/ken/sliceslice.go

 var	t	int
 
 func
-main()
-{
+main() {
 
 	// width 1 (byte)
 	lb = 0; hb = 10;
 }
 
 func
-tstb()
-{
+tstb() {
 	t++;
 	if len(by) != hb-lb {
 		panicln("t=", t, "lb=", lb, "hb=", hb,
 }
 
 func
-tstf()
-{
+tstf() {
 	t++;
 	if len(fy) != hb-lb {
 		panicln("t=", t, "lb=", lb, "hb=", hb,
 }
 
 func
-init()
-{
+init() {
 	bx = make([]byte, 10);
 	for i:=0; i<len(bx); i++ {
 		bx[i] = byte(i+20);

test/ken/string.go

 package main
 
 func
-main()
-{
+main() {
 	var c string;
 
 	a := `abc`;

test/ken/strvar.go

 var	g2	struct { a,b,c int; d x2; };
 
 func
-main()
-{
+main() {
 	var x int;
 	var s1 *x2;
 	var s2 *struct { a,b,c int; d x2; };