Prechádzať zdrojové kódy

luaL_loadbuffer replaced by luaL_loadstring (to test luaL_loadstring)
+ 'rawgetp'/'rawsetp' added to C interpreter

Roberto Ierusalimschy 10 rokov pred
rodič
commit
b6911c177d
1 zmenil súbory, kde vykonal 11 pridanie a 4 odobranie
  1. 11 4
      ltests.c

+ 11 - 4
ltests.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltests.c,v 2.192 2014/11/02 19:19:04 roberto Exp roberto $
+** $Id: ltests.c,v 2.193 2014/11/07 18:07:17 roberto Exp roberto $
 ** Internal Module for Debugging of the Lua Implementation
 ** Internal Module for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -1118,9 +1118,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
       luaL_loadfile(L1, luaL_checkstring(L1, getnum));
       luaL_loadfile(L1, luaL_checkstring(L1, getnum));
     }
     }
     else if EQ("loadstring") {
     else if EQ("loadstring") {
-      size_t sl;
-      const char *s = luaL_checklstring(L1, getnum, &sl);
-      luaL_loadbuffer(L1, s, sl, s);
+      const char *s = luaL_checkstring(L1, getnum);
+      luaL_loadstring(L1, s);
     }
     }
     else if EQ("newmetatable") {
     else if EQ("newmetatable") {
       lua_pushboolean(L1, luaL_newmetatable(L1, getstring));
       lua_pushboolean(L1, luaL_newmetatable(L1, getstring));
@@ -1201,6 +1200,14 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
       int t = getindex;
       int t = getindex;
       lua_rawgeti(L1, t, getnum);
       lua_rawgeti(L1, t, getnum);
     }
     }
+    else if EQ("rawgetp") {
+      int t = getindex;
+      lua_rawgetp(L1, t, cast(void *, cast(size_t, getnum)));
+    }
+    else if EQ("rawsetp") {
+      int t = getindex;
+      lua_rawsetp(L1, t, cast(void *, cast(size_t, getnum)));
+    }
     else if EQ("remove") {
     else if EQ("remove") {
       lua_remove(L1, getnum);
       lua_remove(L1, getnum);
     }
     }