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

5th and last set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180050
This commit is contained in:
Robert Griesemer 2009-12-15 15:41:46 -08:00
parent d65a5cce89
commit 45ca9f7a9e
59 changed files with 5907 additions and 5907 deletions

View file

@ -5,11 +5,11 @@
package xml
import (
"io";
"os";
"reflect";
"strings";
"testing";
"io"
"os"
"reflect"
"strings"
"testing"
)
const testInput = `
@ -146,8 +146,8 @@ var xmlInput = []string{
}
type stringReader struct {
s string;
off int;
s string
off int
}
func (r *stringReader) Read(b []byte) (n int, err os.Error) {
@ -155,29 +155,29 @@ func (r *stringReader) Read(b []byte) (n int, err os.Error) {
return 0, os.EOF
}
for r.off < len(r.s) && n < len(b) {
b[n] = r.s[r.off];
n++;
r.off++;
b[n] = r.s[r.off]
n++
r.off++
}
return;
return
}
func (r *stringReader) ReadByte() (b byte, err os.Error) {
if r.off >= len(r.s) {
return 0, os.EOF
}
b = r.s[r.off];
r.off++;
return;
b = r.s[r.off]
r.off++
return
}
func StringReader(s string) io.Reader { return &stringReader{s, 0} }
func StringReader(s string) io.Reader { return &stringReader{s, 0} }
func TestRawToken(t *testing.T) {
p := NewParser(StringReader(testInput));
p := NewParser(StringReader(testInput))
for i, want := range rawTokens {
have, err := p.RawToken();
have, err := p.RawToken()
if err != nil {
t.Fatalf("token %d: unexpected error: %s", i, err)
}
@ -188,10 +188,10 @@ func TestRawToken(t *testing.T) {
}
func TestToken(t *testing.T) {
p := NewParser(StringReader(testInput));
p := NewParser(StringReader(testInput))
for i, want := range cookedTokens {
have, err := p.Token();
have, err := p.Token()
if err != nil {
t.Fatalf("token %d: unexpected error: %s", i, err)
}
@ -203,8 +203,8 @@ func TestToken(t *testing.T) {
func TestSyntax(t *testing.T) {
for i := range xmlInput {
p := NewParser(StringReader(xmlInput[i]));
var err os.Error;
p := NewParser(StringReader(xmlInput[i]))
var err os.Error
for _, err = p.Token(); err == nil; _, err = p.Token() {
}
if _, ok := err.(SyntaxError); !ok {