| 1222 | |
| 1223 | |
| 1224 | static void labelstat (LexState *ls, TString *label, int line) { |
| 1225 | /* label -> '::' NAME '::' */ |
| 1226 | FuncState *fs = ls->fs; |
| 1227 | Labellist *ll = &ls->dyd->label; |
| 1228 | int l; /* index of new label being created */ |
| 1229 | checkrepeated(fs, ll, label); /* check for repeated labels */ |
| 1230 | checknext(ls, TK_DBCOLON); /* skip double colon */ |
| 1231 | /* create new entry for this label */ |
| 1232 | l = newlabelentry(ls, ll, label, line, luaK_getlabel(fs)); |
| 1233 | skipnoopstat(ls); /* skip other no-op statements */ |
| 1234 | if (block_follow(ls, 0)) { /* label is last no-op statement in the block? */ |
| 1235 | /* assume that locals are already out of scope */ |
| 1236 | ll->arr[l].nactvar = fs->bl->nactvar; |
| 1237 | } |
| 1238 | findgotos(ls, &ll->arr[l]); |
| 1239 | } |
| 1240 | |
| 1241 | |
| 1242 | static void whilestat (LexState *ls, int line) { |
no test coverage detected