(value LValue, index int)
| 1350 | } |
| 1351 | |
| 1352 | func (ls *LState) Insert(value LValue, index int) { |
| 1353 | reg := ls.indexToReg(index) |
| 1354 | top := ls.reg.Top() |
| 1355 | if reg >= top { |
| 1356 | ls.reg.Set(reg, value) |
| 1357 | return |
| 1358 | } |
| 1359 | if reg <= ls.currentLocalBase() { |
| 1360 | reg = ls.currentLocalBase() |
| 1361 | } |
| 1362 | top-- |
| 1363 | for ; top >= reg; top-- { |
| 1364 | ls.reg.Set(top+1, ls.reg.Get(top)) |
| 1365 | } |
| 1366 | ls.reg.Set(reg, value) |
| 1367 | } |
| 1368 | |
| 1369 | func (ls *LState) Remove(index int) { |
| 1370 | reg := ls.indexToReg(index) |
no test coverage detected