diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-12-27 15:33:22 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-12-27 15:33:22 -0200 |
commit | acdb0b741e31adebfa4f608f8bf23e65fa68d741 (patch) | |
tree | a4f3bb695c4b2ae03ef8e02d15953bc12de25a9d /lvm.c | |
parent | 5b08fcd5a1392a7440cae91e68f350a44b136806 (diff) | |
download | lua-acdb0b741e31adebfa4f608f8bf23e65fa68d741.tar.gz lua-acdb0b741e31adebfa4f608f8bf23e65fa68d741.tar.bz2 lua-acdb0b741e31adebfa4f608f8bf23e65fa68d741.zip |
comments.
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.74 1999/12/21 18:04:41 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.75 1999/12/23 18:19:57 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -135,21 +135,21 @@ void luaV_gettable (lua_State *L) { | |||
135 | */ | 135 | */ |
136 | void luaV_settable (lua_State *L, StkId t) { | 136 | void luaV_settable (lua_State *L, StkId t) { |
137 | const TObject *im; | 137 | const TObject *im; |
138 | if (ttype(t) != LUA_T_ARRAY) { /* not a table, get "settable" method */ | 138 | if (ttype(t) != LUA_T_ARRAY) { /* not a table, get `settable' method */ |
139 | im = luaT_getimbyObj(L, t, IM_SETTABLE); | 139 | im = luaT_getimbyObj(L, t, IM_SETTABLE); |
140 | if (ttype(im) == LUA_T_NIL) | 140 | if (ttype(im) == LUA_T_NIL) |
141 | lua_error(L, "indexed expression not a table"); | 141 | lua_error(L, "indexed expression not a table"); |
142 | } | 142 | } |
143 | else { /* object is a table... */ | 143 | else { /* object is a table... */ |
144 | im = luaT_getim(L, avalue(t)->htag, IM_SETTABLE); | 144 | im = luaT_getim(L, avalue(t)->htag, IM_SETTABLE); |
145 | if (ttype(im) == LUA_T_NIL) { /* and does not have a "settable" method */ | 145 | if (ttype(im) == LUA_T_NIL) { /* and does not have a `settable' method */ |
146 | luaH_set(L, avalue(t), t+1, L->top-1); | 146 | luaH_set(L, avalue(t), t+1, L->top-1); |
147 | L->top--; /* pop value */ | 147 | L->top--; /* pop value */ |
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | /* else it has a "settable" method, go through to next command */ | 150 | /* else it has a `settable' method, go through to next command */ |
151 | } | 151 | } |
152 | /* object is not a table, or it has a "settable" method */ | 152 | /* object is not a table, or it has a `settable' method */ |
153 | /* prepare arguments and call the tag method */ | 153 | /* prepare arguments and call the tag method */ |
154 | *(L->top+1) = *(L->top-1); | 154 | *(L->top+1) = *(L->top-1); |
155 | *(L->top) = *(t+1); | 155 | *(L->top) = *(t+1); |
@@ -210,7 +210,7 @@ static void call_binTM (lua_State *L, StkId top, IMS event, const char *msg) { | |||
210 | if (ttype(im) == LUA_T_NIL) { | 210 | if (ttype(im) == LUA_T_NIL) { |
211 | im = luaT_getimbyObj(L, top-1, event); /* try second operand */ | 211 | im = luaT_getimbyObj(L, top-1, event); /* try second operand */ |
212 | if (ttype(im) == LUA_T_NIL) { | 212 | if (ttype(im) == LUA_T_NIL) { |
213 | im = luaT_getim(L, 0, event); /* try a 'global' i.m. */ | 213 | im = luaT_getim(L, 0, event); /* try a `global' method */ |
214 | if (ttype(im) == LUA_T_NIL) | 214 | if (ttype(im) == LUA_T_NIL) |
215 | lua_error(L, msg); | 215 | lua_error(L, msg); |
216 | } | 216 | } |
@@ -603,7 +603,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, const TProtoFunc *tf, | |||
603 | case LONGARGW: aux += highbyte(L, *pc++); | 603 | case LONGARGW: aux += highbyte(L, *pc++); |
604 | case LONGARG: aux += *pc++; | 604 | case LONGARG: aux += *pc++; |
605 | aux = highbyte(L, highbyte(L, aux)); | 605 | aux = highbyte(L, highbyte(L, aux)); |
606 | goto switchentry; /* do not reset "aux" */ | 606 | goto switchentry; /* do not reset `aux' */ |
607 | 607 | ||
608 | } | 608 | } |
609 | } | 609 | } |