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:
parent
1727758746
commit
0d2bde8553
|
@ -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)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"end": 176
|
||||
},
|
||||
{
|
||||
"desc": "function call (or conversion)",
|
||||
"desc": "function call",
|
||||
"start": 175,
|
||||
"end": 178
|
||||
},
|
||||
|
|
|
@ -7,7 +7,7 @@ import path: what
|
|||
|
||||
-------- @what call --------
|
||||
identifier
|
||||
function call (or conversion)
|
||||
function call
|
||||
expression statement
|
||||
block
|
||||
function declaration
|
||||
|
|
|
@ -509,7 +509,10 @@ func NodeDescription(n ast.Node) string {
|
|||
return "fall-through statement"
|
||||
}
|
||||
case *ast.CallExpr:
|
||||
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:
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"end": 180
|
||||
},
|
||||
{
|
||||
"desc": "function call (or conversion)",
|
||||
"desc": "function call",
|
||||
"start": 179,
|
||||
"end": 182
|
||||
},
|
||||
|
|
|
@ -7,7 +7,7 @@ import path: what
|
|||
|
||||
-------- @what call --------
|
||||
identifier
|
||||
function call (or conversion)
|
||||
function call
|
||||
expression statement
|
||||
block
|
||||
function declaration
|
||||
|
|
Loading…
Reference in New Issue