aboutsummaryrefslogtreecommitdiff
path: root/opcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-23 15:27:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-23 15:27:53 -0300
commite81f1841644405845e7de6bd70a0f074cced3d81 (patch)
treefaa59463440da831f60846d4c689289d3fbdcaf9 /opcode.c
parent3e4327530835f65d3bc089688bd46f44efcddb57 (diff)
downloadlua-e81f1841644405845e7de6bd70a0f074cced3d81.tar.gz
lua-e81f1841644405845e7de6bd70a0f074cced3d81.tar.bz2
lua-e81f1841644405845e7de6bd70a0f074cced3d81.zip
new #define LUA_COMPAT2_5 to select "compatibility mode".
Diffstat (limited to 'opcode.c')
-rw-r--r--opcode.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/opcode.c b/opcode.c
index 982b1da9..7675c159 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 4.12 1997/06/19 17:46:12 roberto Exp roberto $"; 6char *rcs_opcode="$Id: opcode.c,v 4.13 1997/06/19 18:03:04 roberto Exp roberto $";
7 7
8#include <setjmp.h> 8#include <setjmp.h>
9#include <stdio.h> 9#include <stdio.h>
@@ -325,7 +325,7 @@ static void do_call (StkId base, int nResults)
325 firstResult = lua_execute(func->value.tf->code, base); 325 firstResult = lua_execute(func->value.tf->code, base);
326 } 326 }
327 else { /* func is not a function */ 327 else { /* func is not a function */
328 /* Check the fallback for invalid functions */ 328 /* Check the tag method for invalid functions */
329 TObject *im = luaI_getimbyObj(func, IM_FUNCTION); 329 TObject *im = luaI_getimbyObj(func, IM_FUNCTION);
330 if (ttype(im) == LUA_T_NIL) 330 if (ttype(im) == LUA_T_NIL)
331 lua_error("call expression not a function"); 331 lua_error("call expression not a function");
@@ -635,17 +635,6 @@ int lua_callfunction (lua_Object function)
635} 635}
636 636
637 637
638/*
639** API: set a function as a fallback
640*/
641lua_Object lua_setfallback (char *name, lua_CFunction fallback)
642{
643 lua_pushstring(name);
644 lua_pushcfunction(fallback);
645 do_unprotectedrun(luaI_setfallback, 2, 1);
646 return put_luaObjectonTop();
647}
648
649lua_Object lua_gettagmethod (int tag, char *event) 638lua_Object lua_gettagmethod (int tag, char *event)
650{ 639{
651 lua_pushnumber(tag); 640 lua_pushnumber(tag);
@@ -1471,3 +1460,16 @@ static StkId lua_execute (Byte *pc, StkId base)
1471 } 1460 }
1472} 1461}
1473 1462
1463
1464#if COMPAT2_5
1465/*
1466** API: set a function as a fallback
1467*/
1468lua_Object lua_setfallback (char *name, lua_CFunction fallback)
1469{
1470 lua_pushstring(name);
1471 lua_pushcfunction(fallback);
1472 do_unprotectedrun(luaI_setfallback, 2, 1);
1473 return put_luaObjectonTop();
1474}
1475#endif