MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaY_parser

Function luaY_parser

app/redis-6.2.6/deps/lua/src/lparser.c:383–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381
382
383Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
384 struct LexState lexstate;
385 struct FuncState funcstate;
386 lexstate.buff = buff;
387 TString *tname = luaS_new(L, name);
388 setsvalue2s(L, L->top, tname);
389 incr_top(L);
390 luaX_setinput(L, &lexstate, z, tname);
391 open_func(&lexstate, &funcstate);
392 funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */
393 luaX_next(&lexstate); /* read first token */
394 chunk(&lexstate);
395 check(&lexstate, TK_EOS);
396 close_func(&lexstate);
397 --L->top;
398 lua_assert(funcstate.prev == NULL);
399 lua_assert(funcstate.f->nups == 0);
400 lua_assert(lexstate.fs == NULL);
401 return funcstate.f;
402}
403
404
405

Callers

nothing calls this directly

Calls 7

luaS_newFunction · 0.85
chunkFunction · 0.85
luaX_setinputFunction · 0.70
open_funcFunction · 0.70
luaX_nextFunction · 0.70
checkFunction · 0.70
close_funcFunction · 0.70

Tested by

no test coverage detected