From: Robert Griesemer Date: Tue, 6 Jan 2009 23:30:26 +0000 (-0800) Subject: - fix parse heuristic: make(x) must accept a type for x X-Git-Tag: weekly.2009-11-06~2432 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e2862606866b5618f6726579db2b1dd923c3469a;p=gostls13.git - fix parse heuristic: make(x) must accept a type for x R=r OCL=22171 CL=22171 --- diff --git a/usr/gri/pretty/parser.go b/usr/gri/pretty/parser.go index b773d8e233..1e78215058 100644 --- a/usr/gri/pretty/parser.go +++ b/usr/gri/pretty/parser.go @@ -785,8 +785,8 @@ func (P *Parser) ParseCall(x0 *AST.Expr) *AST.Expr { if P.tok != Scanner.RPAREN { P.expr_lev++; var t *AST.Type; - if x0.tok == Scanner.IDENT && x0.s == "new" { - // heuristic: assume it's a new(*T, ...) call, try to parse a type + if x0.tok == Scanner.IDENT && (x0.s == "new" || x0.s == "make") { + // heuristic: assume it's a new(T) or make(T, ...) call, try to parse a type t = P.TryType(); } if t != nil {