** generates an error for an undefined 'goto'; choose appropriate ** message when label name is a reserved word (which can only be 'break') */
| 462 | ** message when label name is a reserved word (which can only be 'break') |
| 463 | */ |
| 464 | static l_noret undefgoto (LexState *ls, Labeldesc *gt) { |
| 465 | const char *msg = isreserved(gt->name) |
| 466 | ? "<%s> at line %d not inside a loop" |
| 467 | : "no visible label '%s' for <goto> at line %d"; |
| 468 | msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line); |
| 469 | semerror(ls, msg); |
| 470 | } |
| 471 | |
| 472 | |
| 473 | static void leaveblock (FuncState *fs) { |
no test coverage detected