** Create a new label with the given 'name' at the given 'line'. ** 'last' tells whether label is the last non-op statement in its ** block. Solves all pending gotos to this new label and adds ** a close instruction if necessary. ** Returns true iff it added a close instruction. */
| 676 | ** Returns true iff it added a close instruction. |
| 677 | */ |
| 678 | static void createlabel (LexState *ls, TString *name, int line, int last) { |
| 679 | FuncState *fs = ls->fs; |
| 680 | Labellist *ll = &ls->dyd->label; |
| 681 | int l = newlabelentry(ls, ll, name, line, luaK_getlabel(fs)); |
| 682 | if (last) { /* label is last no-op statement in the block? */ |
| 683 | /* assume that locals are already out of scope */ |
| 684 | ll->arr[l].nactvar = fs->bl->nactvar; |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | |
| 689 | /* |
no test coverage detected