(expr ast.Expr)
| 210 | } |
| 211 | |
| 212 | func (un *unparser) visitCallFunc(expr ast.Expr) error { |
| 213 | c := expr.AsCall() |
| 214 | fun := c.FunctionName() |
| 215 | args := c.Args() |
| 216 | if c.IsMemberFunction() { |
| 217 | nested := isBinaryOrTernaryOperator(c.Target()) |
| 218 | err := un.visitMaybeNested(c.Target(), nested) |
| 219 | if err != nil { |
| 220 | return err |
| 221 | } |
| 222 | un.str.WriteString(".") |
| 223 | } |
| 224 | un.str.WriteString(fun) |
| 225 | un.str.WriteString("(") |
| 226 | for i, arg := range args { |
| 227 | err := un.visit(arg) |
| 228 | if err != nil { |
| 229 | return err |
| 230 | } |
| 231 | if i < len(args)-1 { |
| 232 | un.str.WriteString(", ") |
| 233 | } |
| 234 | } |
| 235 | un.str.WriteString(")") |
| 236 | return nil |
| 237 | } |
| 238 | |
| 239 | func (un *unparser) visitCallIndex(expr ast.Expr) error { |
| 240 | return un.visitCallIndexInternal(expr, "[") |
no test coverage detected