MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaX_setinput

Function luaX_setinput

third-party/lua-5.5.0/src/llex.c:176–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175
176void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source,
177 int firstchar) {
178 ls->t.token = 0;
179 ls->L = L;
180 ls->current = firstchar;
181 ls->lookahead.token = TK_EOS; /* no look-ahead token */
182 ls->z = z;
183 ls->fs = NULL;
184 ls->linenumber = 1;
185 ls->lastline = 1;
186 ls->source = source;
187 /* all three strings here ("_ENV", "break", "global") were fixed,
188 so they cannot be collected */
189 ls->envn = luaS_newliteral(L, LUA_ENV); /* get env string */
190 ls->brkn = luaS_newliteral(L, "break"); /* get "break" string */
191#if defined(LUA_COMPAT_GLOBAL)
192 /* compatibility mode: "global" is not a reserved word */
193 ls->glbn = luaS_newliteral(L, "global"); /* get "global" string */
194 ls->glbn->extra = 0; /* mark it as not reserved */
195#endif
196 luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */
197}
198
199
200

Callers 1

luaY_parserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected