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

Function arraydestructuring

src/lparser.cpp:5550–5564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5548}
5549
5550static void arraydestructuring (LexState *ls) {
5551 auto line = ls->getLineNumber();
5552 auto& pairs = *pluto_newclassinst(ls->L, DestructuringPairs);
5553 luaX_next(ls); /* skip '[' */
5554 expdesc prop;
5555 init_exp(&prop, VKINT, 0);
5556 prop.u.ival = 1;
5557 do {
5558 pairs.emplace_back(str_checkname(ls, N_OVERRIDABLE), prop);
5559 prop.u.ival++;
5560 } while (testnext(ls, ',') && gett(ls) != ']');
5561 check_match(ls, ']', '[', line);
5562 restdestructuring(ls, line, pairs);
5563 ls->L->top.p--; /* pop pairs */
5564}
5565
5566
5567static void localstat (LexState *ls, bool isexport = false) {

Callers 1

localstatFunction · 0.85

Calls 8

luaX_nextFunction · 0.85
init_expFunction · 0.85
str_checknameFunction · 0.85
testnextFunction · 0.85
gettFunction · 0.85
check_matchFunction · 0.85
restdestructuringFunction · 0.85
getLineNumberMethod · 0.80

Tested by

no test coverage detected