diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-01-31 11:09:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-01-31 11:09:53 -0300 |
commit | 46c3587a6feb28e1ee4a32aabe463b0ecb9e8f5e (patch) | |
tree | 7e1ae9b55536171511506532a04f4ebe6dc764b0 /ldump.c | |
parent | 69c7139ff88bf26e05d80bf19d0351e5c88d13a3 (diff) | |
download | lua-46c3587a6feb28e1ee4a32aabe463b0ecb9e8f5e.tar.gz lua-46c3587a6feb28e1ee4a32aabe463b0ecb9e8f5e.tar.bz2 lua-46c3587a6feb28e1ee4a32aabe463b0ecb9e8f5e.zip |
Clearer distinction between types and tags
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
Diffstat (limited to 'ldump.c')
-rw-r--r-- | ldump.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -111,21 +111,21 @@ static void DumpConstants (const Proto *f, DumpState *D) { | |||
111 | DumpInt(n, D); | 111 | DumpInt(n, D); |
112 | for (i = 0; i < n; i++) { | 112 | for (i = 0; i < n; i++) { |
113 | const TValue *o = &f->k[i]; | 113 | const TValue *o = &f->k[i]; |
114 | DumpByte(ttypetag(o), D); | 114 | int tt = ttypetag(o); |
115 | switch (ttypetag(o)) { | 115 | DumpByte(tt, D); |
116 | case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE: | 116 | switch (tt) { |
117 | break; | 117 | case LUA_VNUMFLT: |
118 | case LUA_TNUMFLT: | ||
119 | DumpNumber(fltvalue(o), D); | 118 | DumpNumber(fltvalue(o), D); |
120 | break; | 119 | break; |
121 | case LUA_TNUMINT: | 120 | case LUA_VNUMINT: |
122 | DumpInteger(ivalue(o), D); | 121 | DumpInteger(ivalue(o), D); |
123 | break; | 122 | break; |
124 | case LUA_TSHRSTR: | 123 | case LUA_VSHRSTR: |
125 | case LUA_TLNGSTR: | 124 | case LUA_VLNGSTR: |
126 | DumpString(tsvalue(o), D); | 125 | DumpString(tsvalue(o), D); |
127 | break; | 126 | break; |
128 | default: lua_assert(0); | 127 | default: |
128 | lua_assert(tt == LUA_VNIL || tt == LUA_VFALSE || tt == LUA_VTRUE); | ||
129 | } | 129 | } |
130 | } | 130 | } |
131 | } | 131 | } |