diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-11-28 18:13:13 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-11-28 18:13:13 -0200 |
commit | 72659a06050632da1a9b4c492302be46ac283f6b (patch) | |
tree | bac06b4ea523ba5443564d0869e392180d4b7b77 /lcode.c | |
parent | dfaf8c5291fa8aef5bedbfa375853475364ac76e (diff) | |
download | lua-72659a06050632da1a9b4c492302be46ac283f6b.tar.gz lua-72659a06050632da1a9b4c492302be46ac283f6b.tar.bz2 lua-72659a06050632da1a9b4c492302be46ac283f6b.zip |
no more explicit support for wide-chars; too much troble...
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 1.79 2001/08/27 15:16:28 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.82 2001/09/07 17:39:10 roberto Exp $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -7,7 +7,6 @@ | |||
7 | 7 | ||
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | 9 | ||
10 | #define LUA_PRIVATE | ||
11 | #include "lua.h" | 10 | #include "lua.h" |
12 | 11 | ||
13 | #include "lcode.h" | 12 | #include "lcode.h" |
@@ -27,7 +26,7 @@ | |||
27 | 26 | ||
28 | 27 | ||
29 | 28 | ||
30 | void luaK_error (LexState *ls, const l_char *msg) { | 29 | void luaK_error (LexState *ls, const char *msg) { |
31 | luaX_error(ls, msg, ls->t.token); | 30 | luaX_error(ls, msg, ls->t.token); |
32 | } | 31 | } |
33 | 32 | ||
@@ -83,7 +82,7 @@ static void luaK_fixjump (FuncState *fs, int pc, int dest) { | |||
83 | else { /* jump is relative to position following jump instruction */ | 82 | else { /* jump is relative to position following jump instruction */ |
84 | int offset = dest-(pc+1); | 83 | int offset = dest-(pc+1); |
85 | if (abs(offset) > MAXARG_sBc) | 84 | if (abs(offset) > MAXARG_sBc) |
86 | luaK_error(fs->ls, l_s("control structure too long")); | 85 | luaK_error(fs->ls, "control structure too long"); |
87 | SETARG_sBc(*jmp, offset); | 86 | SETARG_sBc(*jmp, offset); |
88 | } | 87 | } |
89 | } | 88 | } |
@@ -202,7 +201,7 @@ void luaK_reserveregs (FuncState *fs, int n) { | |||
202 | fs->freereg += n; | 201 | fs->freereg += n; |
203 | if (fs->freereg > fs->f->maxstacksize) { | 202 | if (fs->freereg > fs->f->maxstacksize) { |
204 | if (fs->freereg >= MAXSTACK) | 203 | if (fs->freereg >= MAXSTACK) |
205 | luaK_error(fs->ls, l_s("function or expression too complex")); | 204 | luaK_error(fs->ls, "function or expression too complex"); |
206 | fs->f->maxstacksize = cast(short, fs->freereg); | 205 | fs->f->maxstacksize = cast(short, fs->freereg); |
207 | } | 206 | } |
208 | } | 207 | } |
@@ -232,7 +231,7 @@ static int addk (FuncState *fs, TObject *k) { | |||
232 | TObject o; | 231 | TObject o; |
233 | Proto *f = fs->f; | 232 | Proto *f = fs->f; |
234 | luaM_growvector(fs->L, f->k, fs->nk, f->sizek, TObject, | 233 | luaM_growvector(fs->L, f->k, fs->nk, f->sizek, TObject, |
235 | MAXARG_Bc, l_s("constant table overflow")); | 234 | MAXARG_Bc, "constant table overflow"); |
236 | setobj(&f->k[fs->nk], k); | 235 | setobj(&f->k[fs->nk], k); |
237 | setnvalue(&o, fs->nk); | 236 | setnvalue(&o, fs->nk); |
238 | luaH_set(fs->L, fs->h, k, &o); | 237 | luaH_set(fs->L, fs->h, k, &o); |
@@ -771,11 +770,11 @@ static void codelineinfo (FuncState *fs) { | |||
771 | if (ls->lastline > fs->lastline) { | 770 | if (ls->lastline > fs->lastline) { |
772 | if (ls->lastline > fs->lastline+1) { | 771 | if (ls->lastline > fs->lastline+1) { |
773 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, | 772 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, |
774 | MAX_INT, l_s("line info overflow")); | 773 | MAX_INT, "line info overflow"); |
775 | f->lineinfo[fs->nlineinfo++] = -(ls->lastline - (fs->lastline+1)); | 774 | f->lineinfo[fs->nlineinfo++] = -(ls->lastline - (fs->lastline+1)); |
776 | } | 775 | } |
777 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, | 776 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, |
778 | MAX_INT, l_s("line info overflow")); | 777 | MAX_INT, "line info overflow"); |
779 | f->lineinfo[fs->nlineinfo++] = fs->pc; | 778 | f->lineinfo[fs->nlineinfo++] = fs->pc; |
780 | fs->lastline = ls->lastline; | 779 | fs->lastline = ls->lastline; |
781 | } | 780 | } |
@@ -788,7 +787,7 @@ static int luaK_code (FuncState *fs, Instruction i) { | |||
788 | f = fs->f; | 787 | f = fs->f; |
789 | /* put new instruction in code array */ | 788 | /* put new instruction in code array */ |
790 | luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, | 789 | luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, |
791 | MAX_INT, l_s("code size overflow")); | 790 | MAX_INT, "code size overflow"); |
792 | f->code[fs->pc] = i; | 791 | f->code[fs->pc] = i; |
793 | /*printf("free: %d ", fs->freereg); printopcode(f, fs->pc);*/ | 792 | /*printf("free: %d ", fs->freereg); printopcode(f, fs->pc);*/ |
794 | return fs->pc++; | 793 | return fs->pc++; |