From b1b0c219f5255a0cd0921ebc0a77a81f99b72532 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 23 Dec 1999 16:19:57 -0200 Subject: new ttypes to distinguish between C closures and Lua closures. --- ltests.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 547d5c8b..bb7791f4 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.83 1999/12/07 12:05:34 roberto Exp $ +** $Id: ltests.c,v 1.1 1999/12/14 18:31:20 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -17,6 +17,7 @@ #include "lstring.h" #include "ltable.h" #include "lua.h" +#include "luadebug.h" void luaB_opentests (lua_State *L); @@ -195,6 +196,12 @@ static void testC (lua_State *L) { else if EQ("rawsettable") { lua_rawsettable(L); } + else if EQ("tag") { + lua_pushnumber(L, lua_tag(L, reg[getreg(L, &pc)])); + } + else if EQ("type") { + lua_pushstring(L, lua_type(L, reg[getreg(L, &pc)])); + } else if EQ("nextvar") { lua_pushstring(L, lua_nextvar(L, lua_getstring(L, reg[getreg(L, &pc)]))); } @@ -223,6 +230,10 @@ static void testC (lua_State *L) { int n = getreg(L, &pc); lua_settagmethod(L, (int)lua_getnumber(L, reg[n]), getname(&pc)); } + else if EQ("getfunc") { + int n = getreg(L, &pc); + reg[n] = lua_stackedfunction(L, getnum(&pc)); + } else if EQ("beginblock") { lua_beginblock(L); } -- cgit v1.2.3-55-g6feb