diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-07-12 15:11:58 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-07-12 15:11:58 -0300 |
| commit | ae1cf64348ca7bcb6d3abb19a0b97918e343914c (patch) | |
| tree | 23bd25ec0cc4d29ad62a64fad039495fbbee8bb5 /ltm.c | |
| parent | a264fd089e1814bc13d6de924b928959af2e38d9 (diff) | |
| download | lua-ae1cf64348ca7bcb6d3abb19a0b97918e343914c.tar.gz lua-ae1cf64348ca7bcb6d3abb19a0b97918e343914c.tar.bz2 lua-ae1cf64348ca7bcb6d3abb19a0b97918e343914c.zip | |
better names for type-related functions
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 1.72 2001/06/06 18:00:19 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.73 2001/06/15 20:36:57 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -70,7 +70,8 @@ int luaT_validevent (int t, int e) { /* ORDER LUA_T */ | |||
| 70 | 70 | ||
| 71 | void luaT_init (lua_State *L) { | 71 | void luaT_init (lua_State *L) { |
| 72 | static const l_char *const typenames[NUM_TAGS] = { | 72 | static const l_char *const typenames[NUM_TAGS] = { |
| 73 | l_s("userdata"), l_s("nil"), l_s("number"), l_s("string"), l_s("table"), l_s("function") | 73 | l_s("userdata"), l_s("nil"), l_s("number"), l_s("string"), |
| 74 | l_s("table"), l_s("function") | ||
| 74 | }; | 75 | }; |
| 75 | int i; | 76 | int i; |
| 76 | for (i=0; i<NUM_TAGS; i++) | 77 | for (i=0; i<NUM_TAGS; i++) |
| @@ -177,7 +178,7 @@ LUA_API void lua_settagmethod (lua_State *L, int t, const l_char *event) { | |||
| 177 | checktag(L, t); | 178 | checktag(L, t); |
| 178 | if (!luaT_validevent(t, e)) | 179 | if (!luaT_validevent(t, e)) |
| 179 | luaO_verror(L, l_s("cannot change `%.20s' tag method for type `%.20s'%.20s"), | 180 | luaO_verror(L, l_s("cannot change `%.20s' tag method for type `%.20s'%.20s"), |
| 180 | luaT_eventname[e], basictypename(G(L), t), | 181 | luaT_eventname[e], typenamebytag(G(L), t), |
| 181 | (t == LUA_TTABLE || t == LUA_TUSERDATA) ? | 182 | (t == LUA_TTABLE || t == LUA_TUSERDATA) ? |
| 182 | l_s(" with default tag") : l_s("")); | 183 | l_s(" with default tag") : l_s("")); |
| 183 | switch (ttype(L->top - 1)) { | 184 | switch (ttype(L->top - 1)) { |
