writeBlockWithImplicitReturn writes a block body with return added. Transforms { expr } to { return expr }
()
| 160 | // writeBlockWithImplicitReturn writes a block body with return added. |
| 161 | // Transforms { expr } to { return expr } |
| 162 | func (g *LambdaCodeGen) writeBlockWithImplicitReturn() { |
| 163 | body := g.expr.Body |
| 164 | inner := strings.TrimSpace(body[1 : len(body)-1]) |
| 165 | g.Write("{ return ") |
| 166 | g.Write(inner) |
| 167 | g.Write(" }") |
| 168 | } |