mirror of
https://github.com/lua/lua
synced 2025-04-15 09:22:52 +03:00
simpler code for `print'
This commit is contained in:
parent
70751dd27c
commit
2ec4fc4295
16
lbaselib.c
16
lbaselib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lbaselib.c,v 1.160 2004/11/18 19:53:49 roberto Exp roberto $
|
** $Id: lbaselib.c,v 1.161 2004/12/06 17:53:42 roberto Exp roberto $
|
||||||
** Basic library
|
** Basic library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -396,18 +396,8 @@ static int luaB_tostring (lua_State *L) {
|
|||||||
case LUA_TNIL:
|
case LUA_TNIL:
|
||||||
lua_pushliteral(L, "nil");
|
lua_pushliteral(L, "nil");
|
||||||
break;
|
break;
|
||||||
case LUA_TTABLE:
|
default:
|
||||||
lua_pushfstring(L, "table: %p", lua_topointer(L, 1));
|
lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1));
|
||||||
break;
|
|
||||||
case LUA_TFUNCTION:
|
|
||||||
lua_pushfstring(L, "function: %p", lua_topointer(L, 1));
|
|
||||||
break;
|
|
||||||
case LUA_TUSERDATA:
|
|
||||||
case LUA_TLIGHTUSERDATA:
|
|
||||||
lua_pushfstring(L, "userdata: %p", lua_topointer(L, 1));
|
|
||||||
break;
|
|
||||||
case LUA_TTHREAD:
|
|
||||||
lua_pushfstring(L, "thread: %p", lua_topointer(L, 1));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user