summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/spec.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-09 21:09:34 -0800
committerRobert Griesemer <gri@golang.org>2009-11-09 21:09:34 -0800
commitef50a171462c00444b6bf8d205ae8e97079ab2b9 (patch)
tree19dba38f765c27e237474bcf2f29ea11733f2e0f /src/cmd/godoc/spec.go
parent14932a6e27718eb08f82f5ac4d39f6f70f6903dd (diff)
downloadgolang-ef50a171462c00444b6bf8d205ae8e97079ab2b9.tar.gz
- replaced gofmt expression formatting algorithm with
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1024040
Diffstat (limited to 'src/cmd/godoc/spec.go')
-rw-r--r--src/cmd/godoc/spec.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/godoc/spec.go b/src/cmd/godoc/spec.go
index a863a16cd..15ce2fb9e 100644
--- a/src/cmd/godoc/spec.go
+++ b/src/cmd/godoc/spec.go
@@ -32,7 +32,7 @@ type ebnfParser struct {
func (p *ebnfParser) flush() {
- p.out.Write(p.src[p.prev : p.pos.Offset]);
+ p.out.Write(p.src[p.prev:p.pos.Offset]);
p.prev = p.pos.Offset;
}
@@ -60,7 +60,7 @@ func (p *ebnfParser) errorExpected(pos token.Position, msg string) {
// make the error message more specific
msg += ", found '" + p.tok.String() + "'";
if p.tok.IsLiteral() {
- msg += " "+string(p.lit)
+ msg += " " + string(p.lit)
}
}
p.Error(pos, msg);
@@ -70,7 +70,7 @@ func (p *ebnfParser) errorExpected(pos token.Position, msg string) {
func (p *ebnfParser) expect(tok token.Token) token.Position {
pos := p.pos;
if p.tok != tok {
- p.errorExpected(pos, "'" + tok.String() + "'")
+ p.errorExpected(pos, "'"+tok.String()+"'")
}
p.next(); // make progress in any case
return pos;
@@ -178,14 +178,14 @@ func linkify(out io.Writer, src []byte) {
// i: beginning of EBNF text (or end of source)
i := bytes.Index(src, openTag);
if i < 0 {
- i = n-len(openTag)
+ i = n - len(openTag)
}
i += len(openTag);
// j: end of EBNF text (or end of source)
j := bytes.Index(src[i:n], closeTag); // close marker
if j < 0 {
- j = n-i
+ j = n - i
}
j += i;