aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-12-23 16:19:57 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-12-23 16:19:57 -0200
commitb1b0c219f5255a0cd0921ebc0a77a81f99b72532 (patch)
tree7cb4d9cbbdb1309b94794eb75694b02f2b08f75a /ltests.c
parentbe3212de781786c0a68365dee1d3510407b5c325 (diff)
downloadlua-b1b0c219f5255a0cd0921ebc0a77a81f99b72532.tar.gz
lua-b1b0c219f5255a0cd0921ebc0a77a81f99b72532.tar.bz2
lua-b1b0c219f5255a0cd0921ebc0a77a81f99b72532.zip
new ttypes to distinguish between C closures and Lua closures.
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ltests.c b/ltests.c
index 547d5c8b..bb7791f4 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.83 1999/12/07 12:05:34 roberto Exp $ 2** $Id: ltests.c,v 1.1 1999/12/14 18:31:20 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -17,6 +17,7 @@
17#include "lstring.h" 17#include "lstring.h"
18#include "ltable.h" 18#include "ltable.h"
19#include "lua.h" 19#include "lua.h"
20#include "luadebug.h"
20 21
21 22
22void luaB_opentests (lua_State *L); 23void luaB_opentests (lua_State *L);
@@ -195,6 +196,12 @@ static void testC (lua_State *L) {
195 else if EQ("rawsettable") { 196 else if EQ("rawsettable") {
196 lua_rawsettable(L); 197 lua_rawsettable(L);
197 } 198 }
199 else if EQ("tag") {
200 lua_pushnumber(L, lua_tag(L, reg[getreg(L, &pc)]));
201 }
202 else if EQ("type") {
203 lua_pushstring(L, lua_type(L, reg[getreg(L, &pc)]));
204 }
198 else if EQ("nextvar") { 205 else if EQ("nextvar") {
199 lua_pushstring(L, lua_nextvar(L, lua_getstring(L, reg[getreg(L, &pc)]))); 206 lua_pushstring(L, lua_nextvar(L, lua_getstring(L, reg[getreg(L, &pc)])));
200 } 207 }
@@ -223,6 +230,10 @@ static void testC (lua_State *L) {
223 int n = getreg(L, &pc); 230 int n = getreg(L, &pc);
224 lua_settagmethod(L, (int)lua_getnumber(L, reg[n]), getname(&pc)); 231 lua_settagmethod(L, (int)lua_getnumber(L, reg[n]), getname(&pc));
225 } 232 }
233 else if EQ("getfunc") {
234 int n = getreg(L, &pc);
235 reg[n] = lua_stackedfunction(L, getnum(&pc));
236 }
226 else if EQ("beginblock") { 237 else if EQ("beginblock") {
227 lua_beginblock(L); 238 lua_beginblock(L);
228 } 239 }