| 1699 | |
| 1700 | |
| 1701 | static int getlocalattribute (LexState *ls) { |
| 1702 | /* ATTRIB -> ['<' Name '>'] */ |
| 1703 | if (testnext(ls, '<')) { |
| 1704 | const char *attr = getstr(str_checkname(ls)); |
| 1705 | checknext(ls, '>'); |
| 1706 | if (strcmp(attr, "const") == 0) |
| 1707 | return RDKCONST; /* read-only variable */ |
| 1708 | else if (strcmp(attr, "close") == 0) |
| 1709 | return RDKTOCLOSE; /* to-be-closed variable */ |
| 1710 | else |
| 1711 | luaK_semerror(ls, |
| 1712 | luaO_pushfstring(ls->L, "unknown attribute '%s'", attr)); |
| 1713 | } |
| 1714 | return VDKREG; /* regular variable */ |
| 1715 | } |
| 1716 | |
| 1717 | |
| 1718 | static void checktoclose (FuncState *fs, int level) { |
no test coverage detected