(value LValue, index int)
| 1563 | } |
| 1564 | |
| 1565 | func (ls *LState) Insert(value LValue, index int) { |
| 1566 | reg := ls.indexToReg(index) |
| 1567 | top := ls.reg.Top() |
| 1568 | if reg >= top { |
| 1569 | ls.reg.Set(reg, value) |
| 1570 | return |
| 1571 | } |
| 1572 | if reg <= ls.currentLocalBase() { |
| 1573 | reg = ls.currentLocalBase() |
| 1574 | } |
| 1575 | top-- |
| 1576 | for ; top >= reg; top-- { |
| 1577 | ls.reg.Set(top+1, ls.reg.Get(top)) |
| 1578 | } |
| 1579 | ls.reg.Set(reg, value) |
| 1580 | } |
| 1581 | |
| 1582 | func (ls *LState) Remove(index int) { |
| 1583 | reg := ls.indexToReg(index) |
no test coverage detected