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

Function get_prompt

third-party/lua-5.5.0/src/lua.c:533–541  ·  view source on GitHub ↗

** Return the string to be used as a prompt by the interpreter. Leave ** the string (or nil, if using the default value) on the stack, to keep ** it anchored. */

Source from the content-addressed store, hash-verified

531** it anchored.
532*/
533static const char *get_prompt (lua_State *L, int firstline) {
534 if (lua_getglobal(L, firstline ? "_PROMPT" : "_PROMPT2") == LUA_TNIL)
535 return (firstline ? LUA_PROMPT : LUA_PROMPT2); /* use the default */
536 else { /* apply 'tostring' over the value */
537 const char *p = luaL_tolstring(L, -1, NULL);
538 lua_remove(L, -2); /* remove original value */
539 return p;
540 }
541}
542
543/* mark in error messages for incomplete statements */
544#define EOFMARK "<eof>"

Callers 1

pushlineFunction · 0.70

Calls 3

lua_getglobalFunction · 0.70
luaL_tolstringFunction · 0.70
lua_removeFunction · 0.50

Tested by

no test coverage detected