Returns true if the function is declared ' '. */
| 2609 | |
| 2610 | /* Returns true if the function is declared '<nodiscard>'. */ |
| 2611 | static bool getfunctionattribute (LexState *ls) { |
| 2612 | if (testnext(ls, '<')) { |
| 2613 | TString *ts = str_checkname(ls); |
| 2614 | const char *attr = getstr(ts); |
| 2615 | checknext(ls, '>'); |
| 2616 | if (strcmp(attr, "nodiscard") == 0) |
| 2617 | return true; |
| 2618 | else { |
| 2619 | luaX_prev(ls); // back to '>' |
| 2620 | luaX_prev(ls); // back to attribute |
| 2621 | luaK_semerror(ls, "unknown attribute '%s'", attr); |
| 2622 | } |
| 2623 | } |
| 2624 | return false; |
| 2625 | } |
| 2626 | |
| 2627 | |
| 2628 | static void defaultarguments (LexState *ls, int ismethod, const std::vector<size_t>& fallbacks, int flags = 0) { |
no test coverage detected