MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / getfunctionattribute

Function getfunctionattribute

src/lparser.cpp:2611–2625  ·  view source on GitHub ↗

Returns true if the function is declared ' '. */

Source from the content-addressed store, hash-verified

2609
2610/* Returns true if the function is declared '<nodiscard>'. */
2611static 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
2628static void defaultarguments (LexState *ls, int ismethod, const std::vector<size_t>& fallbacks, int flags = 0) {

Callers 2

bodyFunction · 0.85
lambdabodyFunction · 0.85

Calls 5

testnextFunction · 0.85
str_checknameFunction · 0.85
checknextFunction · 0.85
luaX_prevFunction · 0.85
luaK_semerrorFunction · 0.85

Tested by

no test coverage detected