diff --git a/lapi.c b/lapi.c index decea1b5..7c6cb7ef 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.74 2000/03/10 18:37:44 roberto Exp roberto $ +** $Id: lapi.c,v 1.75 2000/03/20 19:14:54 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -132,7 +132,7 @@ lua_Object lua_gettable (lua_State *L) { lua_Object lua_rawgettable (lua_State *L) { lua_Object res; luaA_checkCargs(L, 2); - if (ttype(L->top-2) != TAG_ARRAY) + if (ttype(L->top-2) != TAG_TABLE) lua_error(L, "indexed expression not a table in rawgettable"); res = luaA_putluaObject(L, luaH_get(L, avalue(L->top-2), L->top-1)); L->top -= 2; @@ -159,7 +159,7 @@ lua_Object lua_createtable (lua_State *L) { TObject o; luaC_checkGC(L); avalue(&o) = luaH_new(L, 0); - ttype(&o) = TAG_ARRAY; + ttype(&o) = TAG_TABLE; return luaA_putluaObject(L, &o); } @@ -201,7 +201,7 @@ int lua_isnil (lua_State *L, lua_Object o) { int lua_istable (lua_State *L, lua_Object o) { UNUSED(L); - return (o != LUA_NOOBJECT) && (ttype(o) == TAG_ARRAY); + return (o != LUA_NOOBJECT) && (ttype(o) == TAG_TABLE); } int lua_isuserdata (lua_State *L, lua_Object o) { @@ -342,7 +342,7 @@ void lua_settag (lua_State *L, int tag) { luaA_checkCargs(L, 1); luaT_realtag(L, tag); switch (ttype(L->top-1)) { - case TAG_ARRAY: + case TAG_TABLE: (L->top-1)->value.a->htag = tag; break; case TAG_USERDATA: @@ -405,7 +405,7 @@ int luaA_next (lua_State *L, const Hash *t, int i) { int lua_next (lua_State *L, lua_Object t, int i) { - if (ttype(t) != TAG_ARRAY) + if (ttype(t) != TAG_TABLE) lua_error(L, "Lua API error - object is not a table in `lua_next'"); i = luaA_next(L, avalue(t), i); top2LC(L, (i==0) ? 0 : 2); diff --git a/lbuiltin.c b/lbuiltin.c index 33421908..eadce4ec 100644 --- a/lbuiltin.c +++ b/lbuiltin.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.97 2000/03/24 17:26:08 roberto Exp roberto $ +** $Id: lbuiltin.c,v 1.98 2000/03/27 20:08:02 roberto Exp roberto $ ** Built-in functions ** See Copyright Notice in lua.h */ @@ -380,7 +380,7 @@ void luaB_tostring (lua_State *L) { case TAG_STRING: lua_pushobject(L, o); return; - case TAG_ARRAY: + case TAG_TABLE: sprintf(buff, "table: %p", o->value.a); break; case TAG_LCLOSURE: case TAG_CCLOSURE: diff --git a/ldebug.c b/ldebug.c index d96a373b..33823257 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.11 2000/03/10 18:37:44 roberto Exp roberto $ +** $Id: ldebug.c,v 1.12 2000/03/20 19:14:54 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -23,7 +23,7 @@ static const lua_Type normtype[] = { /* ORDER LUA_T */ - TAG_USERDATA, TAG_NUMBER, TAG_STRING, TAG_ARRAY, + TAG_USERDATA, TAG_NUMBER, TAG_STRING, TAG_TABLE, TAG_LPROTO, TAG_CPROTO, TAG_NIL, TAG_LCLOSURE, TAG_CCLOSURE, TAG_LCLOSURE, TAG_CCLOSURE, /* TAG_LCLMARK, TAG_CCLMARK */ diff --git a/lgc.c b/lgc.c index b4832188..ae14c9ab 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 1.42 2000/03/10 18:37:44 roberto Exp roberto $ +** $Id: lgc.c,v 1.43 2000/03/27 20:08:02 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -99,7 +99,7 @@ static int markobject (lua_State *L, TObject *o) { case TAG_USERDATA: case TAG_STRING: strmark(L, tsvalue(o)); break; - case TAG_ARRAY: + case TAG_TABLE: hashmark(L, avalue(o)); break; case TAG_LCLOSURE: case TAG_LCLMARK: diff --git a/lobject.c b/lobject.c index 1fdb7c80..b3f0da34 100644 --- a/lobject.c +++ b/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 1.32 2000/03/03 14:58:26 roberto Exp roberto $ +** $Id: lobject.c,v 1.33 2000/03/10 18:37:44 roberto Exp roberto $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -41,7 +41,7 @@ int luaO_equalval (const TObject *t1, const TObject *t2) { return nvalue(t1) == nvalue(t2); case TAG_STRING: case TAG_USERDATA: return svalue(t1) == svalue(t2); - case TAG_ARRAY: + case TAG_TABLE: return avalue(t1) == avalue(t2); case TAG_LPROTO: return tfvalue(t1) == tfvalue(t2); diff --git a/lobject.h b/lobject.h index 0edd99f6..49b0f0d2 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.54 2000/03/24 17:26:08 roberto Exp roberto $ +** $Id: lobject.h,v 1.55 2000/03/24 19:49:23 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -35,7 +35,7 @@ typedef enum { TAG_USERDATA = 0, /* default tag for userdata */ TAG_NUMBER, /* fixed tag for numbers */ TAG_STRING, /* fixed tag for strings */ - TAG_ARRAY, /* default tag for tables (or arrays) */ + TAG_TABLE, /* default tag for tables */ TAG_LPROTO, /* fixed tag for Lua functions */ TAG_CPROTO, /* fixed tag for C functions */ TAG_NIL, /* last "pre-defined" tag */ @@ -67,7 +67,7 @@ typedef union { struct TString *ts; /* TAG_STRING, TAG_USERDATA */ struct Proto *tf; /* TAG_LPROTO, TAG_LMARK */ struct Closure *cl; /* TAG_[CL]CLOSURE, TAG_[CL]CLMARK */ - struct Hash *a; /* TAG_ARRAY */ + struct Hash *a; /* TAG_TABLE */ int i; /* TAG_LINE */ } Value; diff --git a/lref.c b/lref.c index b401a1b5..4cbe4b48 100644 --- a/lref.c +++ b/lref.c @@ -1,5 +1,5 @@ /* -** $Id: lref.c,v 1.8 2000/03/03 14:58:26 roberto Exp roberto $ +** $Id: lref.c,v 1.9 2000/03/10 18:37:44 roberto Exp roberto $ ** reference mechanism ** See Copyright Notice in lua.h */ @@ -84,7 +84,7 @@ static int ismarked (const TObject *o) { switch (o->ttype) { case TAG_STRING: case TAG_USERDATA: return o->value.ts->marked; - case TAG_ARRAY: + case TAG_TABLE: return o->value.a->marked; case TAG_LCLOSURE: case TAG_CCLOSURE: return o->value.cl->marked; diff --git a/ltable.c b/ltable.c index d13002c9..afd17b26 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.35 2000/03/03 14:58:26 roberto Exp roberto $ +** $Id: ltable.c,v 1.36 2000/03/10 18:37:44 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -32,7 +32,7 @@ -#define TagDefault TAG_ARRAY +#define TagDefault TAG_TABLE @@ -49,7 +49,7 @@ Node *luaH_mainposition (const Hash *t, const TObject *key) { case TAG_STRING: case TAG_USERDATA: h = tsvalue(key)->hash; break; - case TAG_ARRAY: + case TAG_TABLE: h = IntPoint(L, avalue(key)); break; case TAG_LPROTO: diff --git a/ltm.c b/ltm.c index d9ec4476..10c94829 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 1.35 2000/03/20 19:14:54 roberto Exp roberto $ +** $Id: ltm.c,v 1.36 2000/03/27 20:08:02 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -29,7 +29,7 @@ static int luaI_checkevent (lua_State *L, const char *name, int t) { int e = luaL_findstring(name, luaT_eventname); if (e >= IM_N) luaL_verror(L, "event `%.50s' is deprecated", name); - if (e == IM_GC && t == TAG_ARRAY) + if (e == IM_GC && t == TAG_TABLE) luaL_verror(L, "event `gc' for tables is deprecated"); if (e < 0) luaL_verror(L, "`%.50s' is not a valid event name", name); @@ -46,7 +46,7 @@ static const char luaT_validevents[NUM_TAGS][IM_N] = { {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_USERDATA */ {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, /* TAG_NUMBER */ {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, /* TAG_STRING */ - {0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_ARRAY */ + {0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_TABLE */ {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* TAG_LPROTO */ {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* TAG_CPROTO */ {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} /* TAG_NIL */ @@ -106,7 +106,7 @@ int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) { int luaT_effectivetag (lua_State *L, const TObject *o) { static const int realtag[] = { /* ORDER LUA_T */ - TAG_USERDATA, TAG_NUMBER, TAG_STRING, TAG_ARRAY, + TAG_USERDATA, TAG_NUMBER, TAG_STRING, TAG_TABLE, TAG_LPROTO, TAG_CPROTO, TAG_NIL, TAG_LPROTO, TAG_CPROTO, /* TAG_LCLOSURE, TAG_CCLOSURE */ }; @@ -116,7 +116,7 @@ int luaT_effectivetag (lua_State *L, const TObject *o) { int tag = o->value.ts->u.d.tag; return (tag > L->last_tag) ? TAG_USERDATA : tag; /* deprecated test */ } - case TAG_ARRAY: return o->value.a->htag; + case TAG_TABLE: return o->value.a->htag; default: return realtag[t]; } } @@ -141,7 +141,7 @@ void luaT_settagmethod (lua_State *L, int t, const char *event, TObject *func) { if (!luaT_validevent(t, e)) luaL_verror(L, "cannot change `%.20s' tag method for type `%.20s'%.20s", luaT_eventname[e], luaO_typenames[t], - (t == TAG_ARRAY || t == TAG_USERDATA) ? " with default tag" + (t == TAG_TABLE || t == TAG_USERDATA) ? " with default tag" : ""); temp = *func; *func = *luaT_getim(L, t,e); diff --git a/lvm.c b/lvm.c index 42baff32..9baee90e 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 1.95 2000/03/10 18:37:44 roberto Exp roberto $ +** $Id: lvm.c,v 1.96 2000/03/17 13:09:12 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -93,7 +93,7 @@ void luaV_closure (lua_State *L, int nelems) { void luaV_gettable (lua_State *L, StkId top) { TObject *table = top-2; const TObject *im; - if (ttype(table) != TAG_ARRAY) { /* not a table, get gettable TM */ + if (ttype(table) != TAG_TABLE) { /* not a table, get gettable TM */ im = luaT_getimbyObj(L, table, IM_GETTABLE); if (ttype(im) == TAG_NIL) { L->top = top; @@ -128,7 +128,7 @@ void luaV_gettable (lua_State *L, StkId top) { */ void luaV_settable (lua_State *L, StkId t, StkId top) { const TObject *im; - if (ttype(t) != TAG_ARRAY) { /* not a table, get `settable' method */ + if (ttype(t) != TAG_TABLE) { /* not a table, get `settable' method */ L->top = top; im = luaT_getimbyObj(L, t, IM_SETTABLE); if (ttype(im) == TAG_NIL) @@ -155,7 +155,7 @@ void luaV_settable (lua_State *L, StkId t, StkId top) { void luaV_rawsettable (lua_State *L, StkId t) { - if (ttype(t) != TAG_ARRAY) + if (ttype(t) != TAG_TABLE) lua_error(L, "indexed expression not a table"); else { luaH_set(L, avalue(t), t+1, L->top-1); @@ -291,7 +291,7 @@ void luaV_pack (lua_State *L, StkId firstelem, int nvararg, TObject *tab) { int i; Hash *htab; htab = avalue(tab) = luaH_new(L, nvararg+1); /* +1 for field `n' */ - ttype(tab) = TAG_ARRAY; + ttype(tab) = TAG_TABLE; for (i=0; itop = top; luaC_checkGC(L); avalue(top) = luaH_new(L, GETARG_U(i)); - ttype(top) = TAG_ARRAY; + ttype(top) = TAG_TABLE; top++; break;