()
| 309 | } |
| 310 | |
| 311 | func (r *reader) exprN() Value { |
| 312 | b := r.b |
| 313 | typ := r.typ() |
| 314 | switch tag := r.tag().(type) { |
| 315 | case *CallExpr: |
| 316 | var c Call |
| 317 | r.setCall(&c.Call) |
| 318 | c.typ = typ |
| 319 | return b.emit(&c) |
| 320 | |
| 321 | case *IndexExpr: |
| 322 | x, pos, index := r.expr(), r.pos(), r.expr() |
| 323 | lookup := &Lookup{ |
| 324 | X: x, |
| 325 | Index: b.emitConv(index, x.Type().Underlying().(*Map).Key()), |
| 326 | CommaOk: true, |
| 327 | } |
| 328 | lookup.setType(typ) |
| 329 | lookup.setPos(pos) |
| 330 | return b.emit(lookup) |
| 331 | |
| 332 | case *AssertExpr: |
| 333 | x, pos, typ := r.expr(), r.pos(), r.typ() |
| 334 | return b.emitTypeTest(x, typ, pos) |
| 335 | |
| 336 | case *Operation: |
| 337 | pos, x := r.pos(), r.expr() |
| 338 | unop := &UnOp{ |
| 339 | Op: Recv, |
| 340 | X: x, |
| 341 | CommaOk: true, |
| 342 | } |
| 343 | unop.setType(typ) |
| 344 | unop.setPos(pos) |
| 345 | return b.emit(unop) |
| 346 | |
| 347 | default: |
| 348 | panic(fmt.Sprintf("exprN(%T) in %s", tag, b.Fn)) |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | // builtin emits to fn SSA instructions to implement a call to the |
| 353 | // built-in function obj with the specified arguments |
nothing calls this directly
no test coverage detected