go/ast/astutil: describe fewer CallExprs as "conversions"

Only unary CallExprs with no ellipsis, f(x), are ambiguous.

Change-Id: If4f17445ab0725dee916992db133eac5536133a7
Reviewed-on: https://go-review.googlesource.com/24552
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Alan Donovan 2016-06-28 17:23:16 -04:00
parent 1727758746
commit 0d2bde8553
6 changed files with 9 additions and 6 deletions

View File

@ -206,7 +206,7 @@ Fields:
inner.recursive.E bool
-------- @describe call-unknown --------
function call (or conversion) of type invalid type
function call of type invalid type
-------- @describe def-iface-I --------
definition of type I (size 16, align 8)

View File

@ -7,7 +7,7 @@
"end": 176
},
{
"desc": "function call (or conversion)",
"desc": "function call",
"start": 175,
"end": 178
},

View File

@ -7,7 +7,7 @@ import path: what
-------- @what call --------
identifier
function call (or conversion)
function call
expression statement
block
function declaration

View File

@ -509,7 +509,10 @@ func NodeDescription(n ast.Node) string {
return "fall-through statement"
}
case *ast.CallExpr:
return "function call (or conversion)"
if len(n.Args) == 1 && !n.Ellipsis.IsValid() {
return "function call (or conversion)"
}
return "function call"
case *ast.CaseClause:
return "case clause"
case *ast.ChanType:

View File

@ -9,7 +9,7 @@
"end": 180
},
{
"desc": "function call (or conversion)",
"desc": "function call",
"start": 179,
"end": 182
},

View File

@ -7,7 +7,7 @@ import path: what
-------- @what call --------
identifier
function call (or conversion)
function call
expression statement
block
function declaration