From: Robert Griesemer Date: Fri, 19 Sep 2008 06:30:32 +0000 (-0700) Subject: - fixed another parser bug, now correctly parse more tests X-Git-Tag: weekly.2009-11-06~3172 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6e08991eba61a026a7dde20aa9f74c4dd784169e;p=gostls13.git - fixed another parser bug, now correctly parse more tests R=r OCL=15518 CL=15518 --- diff --git a/usr/gri/pretty/parser.go b/usr/gri/pretty/parser.go index d1a0b62305..01f1609ed3 100644 --- a/usr/gri/pretty/parser.go +++ b/usr/gri/pretty/parser.go @@ -680,7 +680,9 @@ func (P *Parser) ParseCall(x AST.Expr) AST.Expr { P.Expect(Scanner.LPAREN); if P.tok != Scanner.RPAREN { // first arguments could be a type if the call is to "new" - if P.tok != Scanner.IDENT && P.TryType() { + // - exclude type names because they could be expression starts + // - exclude "("'s because function types are not allowed and they indicate an expression + if P.tok != Scanner.IDENT && P.tok != Scanner.LPAREN && P.TryType() { if P.tok == Scanner.COMMA { P.Next(); if P.tok != Scanner.RPAREN {