diff options
author | Lua Team <team@lua.org> | 2004-12-07 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2004-12-07 12:00:00 +0000 |
commit | 226f7859b5392b6680b7e703f9cc7f7f101fd365 (patch) | |
tree | 4345e84719d7f9ccf8d62fa007cbd386f235c58a /src/luac/print.c | |
parent | d8fd22e11b391cf183068049bebbee9702c8f78f (diff) | |
download | lua-github-226f7859b5392b6680b7e703f9cc7f7f101fd365.tar.gz |
Lua 5.1-work35.1-work3
Diffstat (limited to 'src/luac/print.c')
-rw-r--r-- | src/luac/print.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/luac/print.c b/src/luac/print.c index 0d3f18bf..f273ebfc 100644 --- a/src/luac/print.c +++ b/src/luac/print.c @@ -1,5 +1,5 @@ /* -** $Id: print.c,v 1.48 2004/09/01 21:22:34 lhf Exp $ +** $Id: print.c,v 1.49 2004/11/25 09:31:41 lhf Exp $ ** print bytecodes ** See Copyright Notice in lua.h */ @@ -33,7 +33,7 @@ static void PrintString(const Proto* f, int n) case '\r': printf("\\r"); break; case '\t': printf("\\t"); break; case '\v': printf("\\v"); break; - default: printf(isprint(*s) ? "%c" : "\\%03d",*s); + default: printf(isprint((unsigned char)*s) ? "%c" : "\\%03d",*s); } } putchar('"'); @@ -44,15 +44,18 @@ static void PrintConstant(const Proto* f, int i) const TValue* o=&f->k[i]; switch (ttype(o)) { + case LUA_TNIL: + printf("nil"); + break; + case LUA_TBOOLEAN: + printf(bvalue(o) ? "true" : "false"); + break; case LUA_TNUMBER: printf(LUA_NUMBER_FMT,nvalue(o)); break; case LUA_TSTRING: PrintString(f,i); break; - case LUA_TNIL: - printf("nil"); - break; default: /* cannot happen */ printf("? type=%d",ttype(o)); break; |