diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 17:10:55 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 17:10:55 -0300 |
| commit | f6834f4393eaa1055c2bbde82ebb33cc58be8371 (patch) | |
| tree | 3583008ef181106d0fc7e130300f12adc70a5854 /ldebug.c | |
| parent | 78bc8e553d4190fc3b90be5b621fc0f3507586ef (diff) | |
| download | lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.tar.gz lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.tar.bz2 lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.zip | |
new API function `lua_type' + new type lua_Type
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 1.41 2000/09/12 18:38:02 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 1.42 2000/09/18 19:39:49 roberto Exp roberto $ |
| 3 | ** Debug Interface | 3 | ** Debug Interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -433,7 +433,7 @@ static const char *getfuncname (lua_State *L, StkId f, const char **name) { | |||
| 433 | void luaG_typeerror (lua_State *L, StkId o, const char *op) { | 433 | void luaG_typeerror (lua_State *L, StkId o, const char *op) { |
| 434 | const char *name; | 434 | const char *name; |
| 435 | const char *kind = getobjname(L, o, &name); | 435 | const char *kind = getobjname(L, o, &name); |
| 436 | const char *t = luaO_typename(o); | 436 | const char *t = luaO_typename(L, o); |
| 437 | if (kind) | 437 | if (kind) |
| 438 | luaO_verror(L, "attempt to %.30s %.20s `%.40s' (a %.10s value)", | 438 | luaO_verror(L, "attempt to %.30s %.20s `%.40s' (a %.10s value)", |
| 439 | op, kind, name, t); | 439 | op, kind, name, t); |
| @@ -442,7 +442,7 @@ void luaG_typeerror (lua_State *L, StkId o, const char *op) { | |||
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | 444 | ||
| 445 | void luaG_binerror (lua_State *L, StkId p1, lua_Type t, const char *op) { | 445 | void luaG_binerror (lua_State *L, StkId p1, lua_Tag t, const char *op) { |
| 446 | if (ttype(p1) == t) p1++; | 446 | if (ttype(p1) == t) p1++; |
| 447 | LUA_ASSERT(ttype(p1) != t, "must be an error"); | 447 | LUA_ASSERT(ttype(p1) != t, "must be an error"); |
| 448 | luaG_typeerror(L, p1, op); | 448 | luaG_typeerror(L, p1, op); |
| @@ -450,8 +450,8 @@ void luaG_binerror (lua_State *L, StkId p1, lua_Type t, const char *op) { | |||
| 450 | 450 | ||
| 451 | 451 | ||
| 452 | void luaG_ordererror (lua_State *L, StkId top) { | 452 | void luaG_ordererror (lua_State *L, StkId top) { |
| 453 | const char *t1 = luaO_typename(top-2); | 453 | const char *t1 = luaO_typename(L, top-2); |
| 454 | const char *t2 = luaO_typename(top-1); | 454 | const char *t2 = luaO_typename(L, top-1); |
| 455 | if (t1[2] == t2[2]) | 455 | if (t1[2] == t2[2]) |
| 456 | luaO_verror(L, "attempt to compare two %.10s values", t1); | 456 | luaO_verror(L, "attempt to compare two %.10s values", t1); |
| 457 | else | 457 | else |
