test: pretty
pretty -s *.go
pretty -s ../gosrc/*.go
+ pretty -s $(GOROOT)/test/235.go
+ pretty -s $(GOROOT)/test/args.go
+ pretty -s $(GOROOT)/test/bufiolib.go
+ pretty -s $(GOROOT)/test/char_lit.go
pretty -s $(GOROOT)/test/sieve.go
pretty -s $(GOROOT)/src/pkg/*.go
pretty -s $(GOROOT)/src/lib/flag.go
pretty -s $(GOROOT)/src/lib/rand.go
pretty -s $(GOROOT)/src/lib/math/*.go
pretty -s $(GOROOT)/src/lib/container/*.go
- pretty -s $(GOROOT)/src/syscall/*.go
+ pretty -s $(GOROOT)/src/lib/syscall/*.go
+ echo "DONE"
+
+testnoisy: pretty
+ pretty *.go
+ pretty ../gosrc/*.go
+ pretty $(GOROOT)/test/235.go
+ pretty $(GOROOT)/test/args.go
+ pretty $(GOROOT)/test/bufiolib.go
+ pretty $(GOROOT)/test/char_lit.go
+ pretty $(GOROOT)/test/sieve.go
+ pretty $(GOROOT)/src/pkg/*.go
+ pretty $(GOROOT)/src/lib/flag.go
+ pretty $(GOROOT)/src/lib/fmt.go
+ pretty $(GOROOT)/src/lib/rand.go
+ pretty $(GOROOT)/src/lib/math/*.go
+ pretty $(GOROOT)/src/lib/container/*.go
+ pretty $(GOROOT)/src/lib/syscall/*.go
echo "DONE"
install: pretty
}
-func (P *Parser) ParseQualifiedIdent(ident *AST.Ident) AST.Expr {
+func (P *Parser) ParseQualifiedIdent() AST.Expr {
P.Trace("QualifiedIdent");
- if ident == nil {
- ident = P.ParseIdent();
- }
+ ident := P.ParseIdent();
var qident AST.Expr = ident;
+
for P.tok == Scanner.PERIOD {
pos := P.pos;
P.Next();
func (P *Parser) ParseTypeName() AST.Type {
P.Trace("TypeName");
- typ := P.ParseQualifiedIdent(nil);
+ typ := P.ParseQualifiedIdent();
P.Ecart();
return typ;
func (P *Parser) ParseVarDeclList() *AST.VarDeclList {
P.Trace("VarDeclList");
-
+
vars := new(AST.VarDeclList);
- if P.tok == Scanner.IDENT {
- vars.idents = P.ParseIdentList();
- typ, ok := P.TryType();
- if ok {
- vars.typ = typ;
- } else {
- // we had an anonymous var, and the ident may be it's typename
- // or the package name of a qualified identifier representing
- // the typename
- if vars.idents.len() == 1 {
- vars.typ = P.ParseQualifiedIdent(vars.idents.at(0));
- vars.idents = nil;
- } else {
- P.Error(P.pos, "type expected");
- vars.typ = AST.NIL;
- }
- }
- } else {
- vars.typ = P.ParseVarType();
+ vars.idents = AST.NewList();
+ vars.typ = AST.NIL;
+
+ vars.idents.Add(P.ParseType());
+ for P.tok == Scanner.COMMA {
+ P.Next();
+ vars.idents.Add(P.ParseType());
+ }
+
+ var ok bool;
+ vars.typ, ok = P.TryType();
+
+ if !ok {
+ // we must have a list of types
}
P.Ecart();
}
-// Returns a list of AST.VarDeclList
+// Returns a list of *AST.VarDeclList or Type
func (P *Parser) ParseParameterList() *AST.List {
P.Trace("ParameterList");