aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-04-02 17:43:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-04-02 17:43:08 -0300
commit13ab5a6bb1258d640bda2e6d776d5a38f3fa867b (patch)
tree22e8c2e5c1d10001d0abdeced6046e4489962f27
parentcd99bbcd0d88e7b5864ea9c9634ce8abd9bdedda (diff)
downloadlua-13ab5a6bb1258d640bda2e6d776d5a38f3fa867b.tar.gz
lua-13ab5a6bb1258d640bda2e6d776d5a38f3fa867b.tar.bz2
lua-13ab5a6bb1258d640bda2e6d776d5a38f3fa867b.zip
details
-rw-r--r--lcode.c4
-rw-r--r--lcode.h5
-rw-r--r--ldblib.c4
-rw-r--r--lmathlib.c4
-rw-r--r--lstrlib.c4
-rw-r--r--ltests.c13
6 files changed, 19 insertions, 15 deletions
diff --git a/lcode.c b/lcode.c
index 5caa6515..51fe877d 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 1.92 2002/03/21 20:31:43 roberto Exp roberto $ 2** $Id: lcode.c,v 1.93 2002/03/25 17:47:14 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -704,7 +704,7 @@ void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
704 luaK_exp2nextreg(fs, e2); 704 luaK_exp2nextreg(fs, e2);
705 freeexp(fs, e2); 705 freeexp(fs, e2);
706 freeexp(fs, e1); 706 freeexp(fs, e1);
707 e1->info = luaK_codeABC(fs, codes[op], 0, e1->info, e2->info); 707 e1->info = luaK_codeABC(fs, OP_CONCAT, 0, e1->info, e2->info);
708 e1->k = VRELOCABLE; 708 e1->k = VRELOCABLE;
709 } 709 }
710 break; 710 break;
diff --git a/lcode.h b/lcode.h
index ae4dd34f..4bc50c51 100644
--- a/lcode.h
+++ b/lcode.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.h,v 1.28 2002/03/08 19:10:32 roberto Exp roberto $ 2** $Id: lcode.h,v 1.29 2002/03/21 20:31:43 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -26,7 +26,8 @@
26typedef enum BinOpr { 26typedef enum BinOpr {
27 OPR_ADD, OPR_SUB, OPR_MULT, OPR_DIV, OPR_POW, 27 OPR_ADD, OPR_SUB, OPR_MULT, OPR_DIV, OPR_POW,
28 OPR_CONCAT, 28 OPR_CONCAT,
29 OPR_NE, OPR_EQ, OPR_LT, OPR_LE, OPR_GT, OPR_GE, 29 OPR_NE, OPR_EQ,
30 OPR_LT, OPR_LE, OPR_GT, OPR_GE,
30 OPR_AND, OPR_OR, 31 OPR_AND, OPR_OR,
31 OPR_NOBINOPR 32 OPR_NOBINOPR
32} BinOpr; 33} BinOpr;
diff --git a/ldblib.c b/ldblib.c
index 886dddb8..a7d63e86 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.44 2002/03/20 12:54:08 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.45 2002/03/27 15:30:41 roberto Exp roberto $
3** Interface from Lua to its debug API 3** Interface from Lua to its debug API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -264,7 +264,7 @@ static const luaL_reg dblib[] = {
264 264
265 265
266LUALIB_API int lua_dblibopen (lua_State *L) { 266LUALIB_API int lua_dblibopen (lua_State *L) {
267 luaL_opennamedlib(L, "dbg", dblib); 267 luaL_opennamedlib(L, "dbg", dblib, 0);
268 lua_register(L, LUA_ERRORMESSAGE, errorfb); 268 lua_register(L, LUA_ERRORMESSAGE, errorfb);
269 return 0; 269 return 0;
270} 270}
diff --git a/lmathlib.c b/lmathlib.c
index 8906944d..67fcbb3a 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.40 2001/12/05 20:15:18 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.41 2002/03/20 12:54:08 roberto Exp roberto $
3** Standard mathematical library 3** Standard mathematical library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -234,7 +234,7 @@ static const luaL_reg mathlib[] = {
234LUALIB_API int lua_mathlibopen (lua_State *L) { 234LUALIB_API int lua_mathlibopen (lua_State *L) {
235 lua_pushliteral(L, "math"); 235 lua_pushliteral(L, "math");
236 lua_newtable(L); 236 lua_newtable(L);
237 luaL_openlib(L, mathlib); 237 luaL_openlib(L, mathlib, 0);
238 lua_pushliteral(L, "pi"); 238 lua_pushliteral(L, "pi");
239 lua_pushnumber(L, PI); 239 lua_pushnumber(L, PI);
240 lua_settable(L, -3); 240 lua_settable(L, -3);
diff --git a/lstrlib.c b/lstrlib.c
index ff8eba33..648a081b 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.78 2002/03/11 13:29:40 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.79 2002/03/20 12:54:08 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -727,7 +727,7 @@ static const luaL_reg strlib[] = {
727** Open string library 727** Open string library
728*/ 728*/
729LUALIB_API int lua_strlibopen (lua_State *L) { 729LUALIB_API int lua_strlibopen (lua_State *L) {
730 luaL_opennamedlib(L, "str", strlib); 730 luaL_opennamedlib(L, "str", strlib, 0);
731 return 0; 731 return 0;
732} 732}
733 733
diff --git a/ltests.c b/ltests.c
index 097f7d1b..b21ffc62 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.113 2002/03/20 12:54:08 roberto Exp roberto $ 2** $Id: ltests.c,v 1.114 2002/03/25 17:47:14 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*/
@@ -349,8 +349,10 @@ static int unref (lua_State *L) {
349 349
350static int metatable (lua_State *L) { 350static int metatable (lua_State *L) {
351 luaL_check_any(L, 1); 351 luaL_check_any(L, 1);
352 if (lua_isnone(L, 2)) 352 if (lua_isnone(L, 2)) {
353 lua_getmetatable(L, 1); 353 if (lua_getmetatable(L, 1) == 0)
354 lua_pushnil(L);
355 }
354 else { 356 else {
355 lua_settop(L, 2); 357 lua_settop(L, 2);
356 luaL_check_type(L, 2, LUA_TTABLE); 358 luaL_check_type(L, 2, LUA_TTABLE);
@@ -627,7 +629,8 @@ static int testC (lua_State *L) {
627 lua_setmetatable(L, getnum); 629 lua_setmetatable(L, getnum);
628 } 630 }
629 else if EQ("getmetatable") { 631 else if EQ("getmetatable") {
630 lua_getmetatable(L, getnum); 632 if (lua_getmetatable(L, getnum) == 0)
633 lua_pushnil(L);
631 } 634 }
632 else if EQ("type") { 635 else if EQ("type") {
633 lua_pushstring(L, lua_typename(L, lua_type(L, getnum))); 636 lua_pushstring(L, lua_typename(L, lua_type(L, getnum)));
@@ -682,7 +685,7 @@ static void fim (void) {
682void luaB_opentests (lua_State *L) { 685void luaB_opentests (lua_State *L) {
683 *cast(int **, L) = &islocked; /* init lock */ 686 *cast(int **, L) = &islocked; /* init lock */
684 lua_state = L; /* keep first state to be opened */ 687 lua_state = L; /* keep first state to be opened */
685 luaL_opennamedlib(L, "T", tests_funcs); 688 luaL_opennamedlib(L, "T", tests_funcs, 0);
686 atexit(fim); 689 atexit(fim);
687} 690}
688 691