(body func())
| 1193 | } |
| 1194 | |
| 1195 | func (c *compiler) emitLoop(body func()) { |
| 1196 | begin := len(c.bytecode) |
| 1197 | end := c.emit(OpJumpIfEnd, placeholder) |
| 1198 | |
| 1199 | body() |
| 1200 | |
| 1201 | c.emit(OpIncrementIndex) |
| 1202 | c.emit(OpJumpBackward, c.calcBackwardJump(begin)) |
| 1203 | c.patchJump(end) |
| 1204 | } |
| 1205 | |
| 1206 | func (c *compiler) emitLoopBackwards(body func()) { |
| 1207 | c.emit(OpGetLen) |
no test coverage detected