| 1791 | |
| 1792 | |
| 1793 | static lu_byte getvarattribute (LexState *ls, lu_byte df) { |
| 1794 | /* attrib -> ['<' NAME '>'] */ |
| 1795 | if (testnext(ls, '<')) { |
| 1796 | TString *ts = str_checkname(ls); |
| 1797 | const char *attr = getstr(ts); |
| 1798 | checknext(ls, '>'); |
| 1799 | if (strcmp(attr, "const") == 0) |
| 1800 | return RDKCONST; /* read-only variable */ |
| 1801 | else if (strcmp(attr, "close") == 0) |
| 1802 | return RDKTOCLOSE; /* to-be-closed variable */ |
| 1803 | else |
| 1804 | luaK_semerror(ls, "unknown attribute '%s'", attr); |
| 1805 | } |
| 1806 | return df; /* return default value */ |
| 1807 | } |
| 1808 | |
| 1809 | |
| 1810 | static void checktoclose (FuncState *fs, int level) { |
no test coverage detected