(value LValue)
| 520 | } |
| 521 | |
| 522 | func (fc *funcContext) ConstIndex(value LValue) int { |
| 523 | ctype := value.Type() |
| 524 | for i, lv := range fc.Proto.Constants { |
| 525 | if lv.Type() == ctype && lv == value { |
| 526 | return i |
| 527 | } |
| 528 | } |
| 529 | fc.Proto.Constants = append(fc.Proto.Constants, value) |
| 530 | v := len(fc.Proto.Constants) - 1 |
| 531 | if v > opMaxArgBx { |
| 532 | raiseCompileError(fc, fc.Proto.LineDefined, "too many constants") |
| 533 | } |
| 534 | return v |
| 535 | } |
| 536 | func (fc *funcContext) BlockLocalVarsCount() int { |
| 537 | count := 0 |
| 538 | for block := fc.Block; block != nil; block = block.Parent { |
no test coverage detected