diff options
author | Robert Griesemer <gri@golang.org> | 2009-04-02 22:24:52 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-04-02 22:24:52 -0700 |
commit | 94bd7a8aaa822c5863769184f17ba4e5dc1bad01 (patch) | |
tree | 963cd2768632c96674f207f6d03c2cf0711e218c | |
parent | 880fae004c841dc407e9dfdfa9745ef97745bd0a (diff) | |
download | golang-94bd7a8aaa822c5863769184f17ba4e5dc1bad01.tar.gz |
- renamed hasPostfix -> hasSuffix
- fixed printing of function literals (require separating ";")
R=rsc
OCL=27055
CL=27055
-rw-r--r-- | usr/gri/pretty/astprinter.go | 1 | ||||
-rw-r--r-- | usr/gri/pretty/godoc.go | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/usr/gri/pretty/astprinter.go b/usr/gri/pretty/astprinter.go index 5164495fe..66fc3616f 100644 --- a/usr/gri/pretty/astprinter.go +++ b/usr/gri/pretty/astprinter.go @@ -658,6 +658,7 @@ func (P *Printer) DoFuncLit(x *ast.FuncLit) { P.DoFuncType(x.Type); P.separator = blank; P.Stmt(x.Body); + P.opt_semi = false; // BUG 6g or spec P.newlines = 0; } diff --git a/usr/gri/pretty/godoc.go b/usr/gri/pretty/godoc.go index 947b42cda..8b428d38f 100644 --- a/usr/gri/pretty/godoc.go +++ b/usr/gri/pretty/godoc.go @@ -100,14 +100,14 @@ func hasPrefix(s, prefix string) bool { } -func hasPostfix(s, postfix string) bool { +func hasSuffix(s, postfix string) bool { pos := len(s) - len(postfix); return pos >= 0 && s[pos : len(s)] == postfix; } func isGoFile(dir *os.Dir) bool { - return dir.IsRegular() && hasPostfix(dir.Name, ".go"); + return dir.IsRegular() && hasSuffix(dir.Name, ".go"); } @@ -414,7 +414,7 @@ var ( func addFile(dirname string, filename string) { - if hasPostfix(filename, "_test.go") { + if hasSuffix(filename, "_test.go") { // ignore package tests return; } |